renalware-core 2.0.102 → 2.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/documents/renalware/smoking_status.rb +14 -0
- data/app/presenters/renalware/ukrdc/patient_presenter.rb +8 -11
- data/app/views/renalware/api/ukrdc/patients/_diagnoses.xml.builder +3 -3
- data/app/views/renalware/api/ukrdc/patients/_hd_session_observations.xml.builder +0 -8
- data/app/views/renalware/api/ukrdc/patients/diagnoses/_cause_of_death.xml.builder +1 -1
- data/app/views/renalware/api/ukrdc/patients/show.xml.builder +1 -1
- 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: b3fcf667f61a34da31971a76359ec16409ac8da3f4f118b9b42de1de51249623
|
4
|
+
data.tar.gz: '0109e1864753ae09f154ab1f3e1f764f116475a1835d627955d4ade5294bf26f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b555f9e3be2c7c52b3864c69cb346d99a1ea75465e9556bff4d2c735a9c12237492bbfdf7ecc0304447a1362f53d8f0a14941f2278eaf5cd6ec2bf016fc8851
|
7
|
+
data.tar.gz: a0ca258b95dcfcbefce04d1f3c2832592154f1e9fb2ccb56b8f9da0350f066bdbabe7b6412ebdf9342f2a5309c9b34dbd28dd4b07e8dba3cbd14ec2fe771f41f
|
@@ -4,8 +4,22 @@ require "document/enum"
|
|
4
4
|
|
5
5
|
module Renalware
|
6
6
|
class SmokingStatus < NestedAttribute
|
7
|
+
SMOKING_SNOMED_MAP = {
|
8
|
+
current: { code: 77176002, description: "Current" },
|
9
|
+
non_smoker: { code: 8392000, description: "Non" },
|
10
|
+
ex_smoker: { code: 8517006, description: "Ex" }
|
11
|
+
}.freeze
|
12
|
+
|
7
13
|
attribute :value,
|
8
14
|
Document::Enum,
|
9
15
|
enums: %i(non_smoker ex_smoker current)
|
16
|
+
|
17
|
+
def snomed_code
|
18
|
+
SMOKING_SNOMED_MAP.dig(value&.to_sym, :code)
|
19
|
+
end
|
20
|
+
|
21
|
+
def snomed_description
|
22
|
+
SMOKING_SNOMED_MAP.dig(value&.to_sym, :description)
|
23
|
+
end
|
10
24
|
end
|
11
25
|
end
|
@@ -38,13 +38,6 @@ module Renalware
|
|
38
38
|
super
|
39
39
|
end
|
40
40
|
|
41
|
-
# def modalities
|
42
|
-
# __getobj__
|
43
|
-
# .modalities
|
44
|
-
# .includes(:description)
|
45
|
-
# .order(started_on: :asc, created_at: :asc)
|
46
|
-
# end
|
47
|
-
|
48
41
|
def dead?
|
49
42
|
current_modality_death?
|
50
43
|
end
|
@@ -158,15 +151,19 @@ module Renalware
|
|
158
151
|
end
|
159
152
|
|
160
153
|
def clinical_history
|
161
|
-
@clinical_history ||= document&.history || NullObject.
|
154
|
+
@clinical_history ||= document&.history || NullObject.instance
|
162
155
|
end
|
163
156
|
|
164
157
|
def smoking_history?
|
165
158
|
clinical_history.smoking.present?
|
166
159
|
end
|
167
160
|
|
161
|
+
def smoking_cormbidity
|
162
|
+
comorbidity_attributes[:smoking]
|
163
|
+
end
|
164
|
+
|
168
165
|
def profile
|
169
|
-
renal_patient.profile ||
|
166
|
+
renal_patient.profile || Renalware::Renal::Profile.new
|
170
167
|
end
|
171
168
|
|
172
169
|
def first_seen_on
|
@@ -192,11 +189,11 @@ module Renalware
|
|
192
189
|
end
|
193
190
|
|
194
191
|
def comorbidity_attributes
|
195
|
-
profile
|
192
|
+
profile.document&.comorbidities&.attributes || {}
|
196
193
|
end
|
197
194
|
|
198
195
|
def comorbidities
|
199
|
-
@comorbidities ||= profile
|
196
|
+
@comorbidities ||= profile.document&.comorbidities
|
200
197
|
end
|
201
198
|
|
202
199
|
def clinical_patient
|
@@ -22,12 +22,12 @@ xml.Diagnoses do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
if patient.
|
25
|
+
if patient.smoking_cormbidity&.value.present?
|
26
26
|
xml.Diagnosis do
|
27
27
|
xml.Diagnosis do
|
28
28
|
xml.CodingStandard "SNOMED"
|
29
|
-
xml.Code patient.
|
30
|
-
xml.Description "Smoking history: #{patient.
|
29
|
+
xml.Code patient.smoking_cormbidity.snomed_code
|
30
|
+
xml.Description "Smoking history: #{patient.smoking_cormbidity.snomed_description}"
|
31
31
|
end
|
32
32
|
# We don't store a smoking date (it doesn't make much sense to) but UKRDC
|
33
33
|
# would like a date so send th ESRF date. See email from GS to TC 23/5/18.
|
@@ -17,14 +17,6 @@ observation_times = {
|
|
17
17
|
"weight" => observations.weight
|
18
18
|
}
|
19
19
|
|
20
|
-
if observations.temperature_measured == :yes
|
21
|
-
measurements["temperature"] = observations.temperature
|
22
|
-
end
|
23
|
-
|
24
|
-
if observations.respiratory_rate_measured == :yes
|
25
|
-
measurements["respiratory_rate"] = observations.respiratory_rate
|
26
|
-
end
|
27
|
-
|
28
20
|
measurements.each do |i18n_key, value|
|
29
21
|
xml.Observation do
|
30
22
|
xml.ObservationTime observation_times[pre_post].iso8601
|
@@ -15,7 +15,7 @@ xml.ukrdc(:PatientRecord, namespace_and_schema) do
|
|
15
15
|
render "sending_facility", builder: xml, patient: patient
|
16
16
|
render "patient", builder: xml, patient: patient
|
17
17
|
render "lab_orders", builder: xml, patient: patient
|
18
|
-
render "social_histories", builder: xml, patient: patient
|
18
|
+
# render "social_histories", builder: xml, patient: patient
|
19
19
|
render "family_histories", builder: xml, patient: patient
|
20
20
|
render "observations", builder: xml, patient: patient
|
21
21
|
# render "allergies", builder: xml, patient: patient
|
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.103
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_type
|