renalware-core 2.0.94 → 2.0.95
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/pathology/observation_description.rb +3 -0
- data/app/models/renalware/ukrdc/pathology_observation_requests_query.rb +1 -1
- data/app/presenters/renalware/clinics/clinic_visit_presenter.rb +6 -0
- data/app/presenters/renalware/pathology/observation_presenter.rb +2 -1
- data/app/presenters/renalware/ukrdc/{modality_presenter.rb → modality_presenter.rb.dead} +0 -0
- data/app/presenters/renalware/ukrdc/pathology_observation_presenter.rb +26 -0
- data/app/presenters/renalware/ukrdc/patient_presenter.rb +7 -4
- data/app/views/renalware/api/ukrdc/patients/_observations.xml.builder +1 -1
- data/app/views/renalware/api/ukrdc/patients/lab_orders/_result_item.xml.builder +11 -9
- data/config/locales/loinc_codes.yml +1 -1
- data/db/migrate/20190722145936_change_type_of_patients_ukrdc_external_id.rb +17 -0
- data/db/migrate/20190723150737_add_result_type_to_pathology_observation_descriptions.rb +21 -0
- data/lib/renalware/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f743d2f776695b7e406965b0c575158b831091441c6d687dc618755f503108
|
4
|
+
data.tar.gz: 7fa35c1012943e0e1da51d6268fbc38186bfac42eec755ac9319827ad20f9993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8595949189f925bfa32f89eb30f2f2e1d6be774b776fb01670a0a8270fd945f58db710979c83b178862479582d835cac249a71136281a0566eefe5d59e847cf6
|
7
|
+
data.tar.gz: cbf56881a9bdea06a338c2e9bce80daf3fc911248e9aeb0da125655cb5c87fd388b1872d536f8204faed4bc428b0d35953fbb2fcd96703e787373c5124f5e0df
|
@@ -21,6 +21,9 @@ module Renalware
|
|
21
21
|
.order([:display_group, :display_order])
|
22
22
|
}
|
23
23
|
|
24
|
+
enum rr_type: { rr_type_simple: 0, rr_type_interpretation: 1 }
|
25
|
+
enum rr_coding_standard: { ukrr: 0, pv: 1 }
|
26
|
+
|
24
27
|
def self.for(codes)
|
25
28
|
ObservationDescriptionsByCodeQuery.new(codes: codes).call
|
26
29
|
end
|
@@ -18,7 +18,7 @@ module Renalware
|
|
18
18
|
Pathology::ObservationRequest
|
19
19
|
.where(id: Pathology::ObservationRequest.distinct_for_patient_id(patient_id))
|
20
20
|
.where("requested_at >= ?", changes_since)
|
21
|
-
.where("loinc_code
|
21
|
+
.where("coalesce(loinc_code, '') != ''") # excludes NULL and ''
|
22
22
|
.eager_load(
|
23
23
|
:description,
|
24
24
|
observations: { description: :measurement_unit }
|
@@ -5,7 +5,8 @@ require_dependency "renalware/pathology"
|
|
5
5
|
module Renalware
|
6
6
|
module Pathology
|
7
7
|
class ObservationPresenter < SimpleDelegator
|
8
|
-
delegate :name, :code, :loinc_code,
|
8
|
+
delegate :name, :code, :loinc_code, :rr_type, :rr_coding_standard,
|
9
|
+
to: :description, prefix: true, allow_nil: true
|
9
10
|
delegate :measurement_unit, to: :description, allow_nil: true
|
10
11
|
delegate :name, to: :measurement_unit, prefix: true, allow_nil: true
|
11
12
|
|
File without changes
|
@@ -2,7 +2,17 @@
|
|
2
2
|
|
3
3
|
module Renalware
|
4
4
|
module UKRDC
|
5
|
+
# Assumes the thing being passed to the ctor is of type Pathology::ObservationPresenter hence
|
6
|
+
# responds to #description_code
|
5
7
|
class PathologyObservationPresenter < SimpleDelegator
|
8
|
+
delegate :rr_type_interpretation?, to: :description
|
9
|
+
|
10
|
+
INTERPRETATION_CODE_MAP = {
|
11
|
+
"positive" => "POS",
|
12
|
+
"negative" => "NEG"
|
13
|
+
}.freeze
|
14
|
+
DEFAULT_INTERPRETATION_CODE = "UNK"
|
15
|
+
|
6
16
|
# The PrePost element in ResultItem
|
7
17
|
# For HD patients, all bloods are PRE except the post dialysis urea,
|
8
18
|
# For non-HD patients, all the tests are NA
|
@@ -19,6 +29,22 @@ module Renalware
|
|
19
29
|
def result
|
20
30
|
(super || "")[0..19]
|
21
31
|
end
|
32
|
+
|
33
|
+
def coding_standard
|
34
|
+
return if description_rr_coding_standard.blank?
|
35
|
+
|
36
|
+
description_rr_coding_standard.to_s.upcase
|
37
|
+
end
|
38
|
+
|
39
|
+
def code
|
40
|
+
description_loinc_code.presence || description_code
|
41
|
+
end
|
42
|
+
|
43
|
+
def interpretation_code
|
44
|
+
sanitized_result = result&.downcase&.strip
|
45
|
+
|
46
|
+
INTERPRETATION_CODE_MAP.fetch(sanitized_result, DEFAULT_INTERPRETATION_CODE)
|
47
|
+
end
|
22
48
|
end
|
23
49
|
end
|
24
50
|
end
|
@@ -94,10 +94,13 @@ module Renalware
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def clinic_visits
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
@clinic_visits ||= begin
|
98
|
+
visits = clinics_patient
|
99
|
+
.clinic_visits
|
100
|
+
.where("date >= ?", changes_since)
|
101
|
+
.includes(:updated_by)
|
102
|
+
CollectionPresenter.new(visits, Clinics::ClinicVisitPresenter)
|
103
|
+
end
|
101
104
|
end
|
102
105
|
|
103
106
|
def treatments
|
@@ -8,17 +8,19 @@ xml.ResultItem do
|
|
8
8
|
xml.EnteredOn observation.updated_at&.iso8601
|
9
9
|
xml.PrePost observation.pre_post(patient_is_on_hd: patient.current_modality_hd?)
|
10
10
|
xml.ServiceId do
|
11
|
-
|
12
|
-
|
13
|
-
xml.Code observation.description_loinc_code
|
14
|
-
else
|
15
|
-
xml.CodingStandard "LOCAL"
|
16
|
-
xml.Code observation.description_code
|
17
|
-
end
|
11
|
+
xml.CodingStandard observation.coding_standard
|
12
|
+
xml.Code observation.code
|
18
13
|
xml.Description observation.description_name
|
19
14
|
end
|
20
15
|
|
21
|
-
|
22
|
-
|
16
|
+
# If the rrr_type of the observation_descriptions is interpretation (ie an interpretted result
|
17
|
+
# like POS NEG)
|
18
|
+
if observation.rr_type_interpretation?
|
19
|
+
xml.InterpretationCodes observation.interpretation_code
|
20
|
+
else
|
21
|
+
xml.ResultValue observation.result
|
22
|
+
xml.ResultValueUnits observation.measurement_unit_name
|
23
|
+
end
|
24
|
+
|
23
25
|
xml.ObservationTime observation.observed_at&.iso8601
|
24
26
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class ChangeTypeOfPatientsUKRDCExternalId < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
within_renalware_schema do
|
4
|
+
reversible do |dir|
|
5
|
+
dir.up do
|
6
|
+
change_column :patients, :ukrdc_external_id, :text, null: true
|
7
|
+
end
|
8
|
+
dir.down do
|
9
|
+
change_column :patients, :ukrdc_external_id, "uuid USING UUID(ukrdc_external_id)", null: true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
remove_index :patients, :ukrdc_external_id
|
14
|
+
add_index :patients, :ukrdc_external_id, unique: true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AddResultTypeToPathologyObservationDescriptions < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
within_renalware_schema do
|
4
|
+
add_column(
|
5
|
+
:pathology_observation_descriptions,
|
6
|
+
:rr_type,
|
7
|
+
:integer,
|
8
|
+
default: 0,
|
9
|
+
null: false
|
10
|
+
)
|
11
|
+
|
12
|
+
add_column(
|
13
|
+
:pathology_observation_descriptions,
|
14
|
+
:rr_coding_standard,
|
15
|
+
:integer,
|
16
|
+
default: 0,
|
17
|
+
null: false
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
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.95
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_type
|
@@ -2038,7 +2038,7 @@ files:
|
|
2038
2038
|
- app/presenters/renalware/transplants/patient_presenter.rb
|
2039
2039
|
- app/presenters/renalware/transplants/recipient_dashboard_presenter.rb
|
2040
2040
|
- app/presenters/renalware/transplants/wait_list_registration_presenter.rb
|
2041
|
-
- app/presenters/renalware/ukrdc/modality_presenter.rb
|
2041
|
+
- app/presenters/renalware/ukrdc/modality_presenter.rb.dead
|
2042
2042
|
- app/presenters/renalware/ukrdc/pathology_observation_presenter.rb
|
2043
2043
|
- app/presenters/renalware/ukrdc/pathology_observation_request_presenter.rb
|
2044
2044
|
- app/presenters/renalware/ukrdc/patient_presenter.rb
|
@@ -3535,6 +3535,8 @@ files:
|
|
3535
3535
|
- db/migrate/20190709101610_create_pd_regime_for_modalities.rb
|
3536
3536
|
- db/migrate/20190718091430_add_code_to_modality_descriptions.rb
|
3537
3537
|
- db/migrate/20190718095851_add_discharge_reason_code_to_ukrdc_treatments.rb
|
3538
|
+
- db/migrate/20190722145936_change_type_of_patients_ukrdc_external_id.rb
|
3539
|
+
- db/migrate/20190723150737_add_result_type_to_pathology_observation_descriptions.rb
|
3538
3540
|
- db/seeds.rb
|
3539
3541
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.csv
|
3540
3542
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.rb
|