renalware-core 2.0.120 → 2.0.121
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/renalware/feeds/hl7_message.rb +20 -9
- data/lib/renalware/configuration.rb +18 -0
- data/lib/renalware/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b93f9d4c837438e01bbb281d1a8a81046ae012697e1f6906cb008e401162cb0
|
4
|
+
data.tar.gz: 474cf5ccd494cbcf535ca7d11dee7e96bb1675f023dda2327b8fbe8a74d80fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d2790007b3bcf1f1173c421f8b0060c0b40345bb0323e5893dc83e3d39164e4c1e5653d9acf15d0b3ac163664fcc9f8a68e4b4a4df416e05c5d8a8c73d5240
|
7
|
+
data.tar.gz: b82938bbc38a637773a7999da0f416b98050a7efa56848f18e2741fb084b167e91900b836b99a50db736b7e07b3af75f666d5d51041d2f32ded7fae957289914
|
@@ -129,6 +129,8 @@ module Renalware
|
|
129
129
|
alias_attribute :died_at, :death_date
|
130
130
|
|
131
131
|
def internal_id
|
132
|
+
return unless defined?(patient_id_list)
|
133
|
+
|
132
134
|
patient_id_list.split("^").first
|
133
135
|
end
|
134
136
|
|
@@ -156,17 +158,26 @@ module Renalware
|
|
156
158
|
super.split("^")
|
157
159
|
end
|
158
160
|
|
159
|
-
#
|
160
|
-
#
|
161
|
+
# We don't use the HL7::Message#sex_admin method (from the ruby hl7 gem) because it
|
162
|
+
# raises an error during reading if the sex value in the PID is not in (F|M|O|U|A|N|C).
|
163
|
+
# I think that behaviour is a not quite right as a hospital might not use those values in
|
164
|
+
# their HL7 PID implementation, especially in the UK. KCH does not for instance.
|
165
|
+
# So instead we read the PID array directly, and map whatever is in there to its Renalware
|
166
|
+
# equivalent, then overwrite the existing #admin_sex method so the HL7::Message version
|
167
|
+
# cannot be called. If we can't map it we just return whatever is in there and its up to
|
168
|
+
# calling code to handle any coercion issues. The hl7_pid_sex_map hash can be configured
|
169
|
+
# by the host app to support whatever sex values it uses intenrally.
|
170
|
+
# I think some work needs to be done on Renalware sex and gender (which are slightly
|
171
|
+
# conflated in Renalware). For example:
|
172
|
+
# - the LOINC names for administrative sex: Male Female Unknown (https://loinc.org/72143-1/)
|
173
|
+
# - the LOINC names for sex at birth: Male Female Unknown (https://loinc.org/LL3324-2/)
|
174
|
+
# - HL7's definitions: F Female, M Male, O Other, U Unknown, A Ambiguous, N Not applicable
|
175
|
+
# - gender: 7 options https://loinc.org/76691-5/
|
161
176
|
def sex
|
162
|
-
|
163
|
-
|
164
|
-
self[8] = "F" if self[8] == "FEMALE"
|
165
|
-
self[8] = "O" if self[8] == "OTHER"
|
166
|
-
admin_sex
|
167
|
-
rescue HL7::InvalidDataError => e
|
168
|
-
raise e, "#{e} value is '#{self[8]}'", e.backtrace
|
177
|
+
pid_sex = self[8]&.upcase
|
178
|
+
Renalware.config.hl7_pid_sex_map.fetch(pid_sex, pid_sex)
|
169
179
|
end
|
180
|
+
alias admin_sex sex
|
170
181
|
|
171
182
|
private
|
172
183
|
|
@@ -105,6 +105,24 @@ module Renalware
|
|
105
105
|
)
|
106
106
|
}
|
107
107
|
}
|
108
|
+
|
109
|
+
# This the default mapping from possible HL7 PID 'administrative sex' values that we
|
110
|
+
# might see in a message, to their Renalware equivalent. A hospital can override this
|
111
|
+
# mapping if they have different values in their HL7 messages.
|
112
|
+
# Note that the standard HL7 PID admin sex values are not adhered to here. For reference
|
113
|
+
# they are:
|
114
|
+
# F Female, M Male, O Other, U Unknown, A Ambiguous, N Not applicable
|
115
|
+
config_accessor(:hl7_pid_sex_map) do
|
116
|
+
{
|
117
|
+
"MALE" => "M",
|
118
|
+
"FEMALE" => "F",
|
119
|
+
"OTHER" => "NS",
|
120
|
+
"UNKNOWN" => "NK",
|
121
|
+
"NOTKNOWN" => "NK",
|
122
|
+
"AMBIGUOUS" => "NS",
|
123
|
+
"NOT APPLICABLE" => "NS"
|
124
|
+
}.freeze
|
125
|
+
end
|
108
126
|
end
|
109
127
|
|
110
128
|
def self.config
|
data/lib/renalware/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renalware-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.121
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview-component
|