cqm-reports 4.1.3 → 4.1.4
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/lib/qrda-export/catI-r5/_header.mustache +7 -0
- data/lib/qrda-export/catI-r5/qrda1_r5.rb +6 -0
- data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +8 -1
- data/lib/qrda-export/catIII/_header.mustache +14 -8
- data/lib/qrda-export/catIII/_measure_data.mustache +8 -2
- data/lib/qrda-export/catIII/_measure_section.mustache +14 -3
- data/lib/qrda-export/catIII/_supplemental_data.mustache +13 -1
- data/lib/qrda-export/catIII/qrda3.rb +20 -1
- data/lib/qrda-export/helper/patient_view_helper.rb +6 -0
- data/lib/qrda-import/base-importers/demographics_importer.rb +12 -0
- data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +3 -3
- data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +2 -2
- data/lib/qrda-import/data-element-importers/device_order_importer.rb +4 -4
- data/lib/qrda-import/data-element-importers/device_recommended_importer.rb +4 -4
- data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +6 -6
- data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +4 -4
- data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +7 -7
- data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +4 -4
- data/lib/qrda-import/data-element-importers/encounter_recommended_importer.rb +6 -6
- data/lib/qrda-import/data-element-importers/immunization_order_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +2 -2
- data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +2 -2
- data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +9 -9
- data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +13 -13
- data/lib/qrda-import/data-element-importers/medication_order_importer.rb +2 -2
- data/lib/qrda-import/data-element-importers/patient_characteristic_expired_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +5 -5
- data/lib/qrda-import/data-element-importers/procedure_recommended_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/substance_order_importer.rb +1 -1
- data/lib/qrda-import/data-element-importers/symptom_importer.rb +4 -4
- 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: a0216ff9df831482810cabde27398288b568998fab528e5fbf75803a841c99a0
|
4
|
+
data.tar.gz: 62219cfad2abf3ea311d2e69c44f121e4bc8bea4df4235c5bab7196a17c825c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107e0fd97f6278f9e537acc10551dfe5a83e649e83ffe5445858560978c419ccb18fa2e98e82195f9d7d98e89d6fd5cf0a98c30391d1e915a476dddbf369277b
|
7
|
+
data.tar.gz: 324e145f33405855bbf397dcf9b6614db6101013ec272d858d21858c7a3ae54b242eefab722512c32fa19f74f97612c81e7669089e9e988fffdc86b84b753604
|
@@ -8,7 +8,14 @@
|
|
8
8
|
<!-- QDM-based QRDA templateId -->
|
9
9
|
<templateId root="2.16.840.1.113883.10.20.24.1.2" extension="2021-08-01"/>
|
10
10
|
<!-- CMS QRDA templateId -->
|
11
|
+
{{#ry2026_submission?}}
|
12
|
+
<!-- QRDA Category I Report - CMS (V9) -->
|
13
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.3" extension="2025-03-01"/>
|
14
|
+
{{/ry2026_submission?}}
|
15
|
+
{{^ry2026_submission?}}
|
16
|
+
<!-- QRDA Category I Report - CMS (V8) -->
|
11
17
|
<templateId root="2.16.840.1.113883.10.20.24.1.3" extension="2022-02-01"/>
|
18
|
+
{{/ry2026_submission?}}
|
12
19
|
<!-- This is the globally unique identifier for this QRDA document -->
|
13
20
|
<id root="{{random_id}}"/>
|
14
21
|
<!-- QRDA document type code -->
|
@@ -20,11 +20,17 @@ class Qrda1R5 < Mustache
|
|
20
20
|
@performance_period_start = options[:start_time]
|
21
21
|
@performance_period_end = options[:end_time]
|
22
22
|
@submission_program = options[:submission_program]
|
23
|
+
@ry2026_submission = options[:ry2026_submission]
|
23
24
|
@medicare_beneficiary_identifier = options[:medicare_beneficiary_identifier]
|
24
25
|
@hicn = options[:hicn]
|
25
26
|
@authoring_system = options[:authoring_system]
|
26
27
|
end
|
27
28
|
|
29
|
+
# use 2026 template ids if 2026 submission is specified as true, or if it unspecified
|
30
|
+
def ry2026_submission?
|
31
|
+
@ry2026_submission || @ry2026_submission.nil?
|
32
|
+
end
|
33
|
+
|
28
34
|
def authoring_system
|
29
35
|
@authoring_system || 'TestSystem'
|
30
36
|
end
|
@@ -33,7 +33,14 @@
|
|
33
33
|
{{/patient}}
|
34
34
|
{{#patient_characteristic_sex}}
|
35
35
|
{{#dataElementCodes}}
|
36
|
-
|
36
|
+
{{#onc_gender_code?}}
|
37
|
+
<administrativeGenderCode {{> _code}}/>
|
38
|
+
{{/onc_gender_code?}}
|
39
|
+
{{^onc_gender_code?}}
|
40
|
+
<administrativeGenderCode nullFlavor="OTH">
|
41
|
+
<translation {{> _code}}/>
|
42
|
+
</administrativeGenderCode>
|
43
|
+
{{/onc_gender_code?}}
|
37
44
|
{{/dataElementCodes}}
|
38
45
|
{{/patient_characteristic_sex}}
|
39
46
|
{{^patient_characteristic_sex}}
|
@@ -3,14 +3,20 @@
|
|
3
3
|
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
|
4
4
|
<!-- US Realm Header Template Id -->
|
5
5
|
<templateId root="2.16.840.1.113883.10.20.27.1.1" extension="2020-12-01"/>
|
6
|
-
{{#
|
7
|
-
<!-- QRDA Category III Report - CMS (
|
8
|
-
<templateId root="2.16.840.1.113883.10.20.27.1.2" extension="
|
9
|
-
{{/
|
10
|
-
{{^
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
{{#ry2026_submission?}}
|
7
|
+
<!-- QRDA Category III Report - CMS (V10) -->
|
8
|
+
<templateId root="2.16.840.1.113883.10.20.27.1.2" extension="2025-05-01"/>
|
9
|
+
{{/ry2026_submission?}}
|
10
|
+
{{^ry2026_submission?}}
|
11
|
+
{{#ry2025_submission?}}
|
12
|
+
<!-- QRDA Category III Report - CMS (V9) -->
|
13
|
+
<templateId root="2.16.840.1.113883.10.20.27.1.2" extension="2024-12-01"/>
|
14
|
+
{{/ry2025_submission?}}
|
15
|
+
{{^ry2025_submission?}}
|
16
|
+
<!-- QRDA Category III Report - CMS (V7) -->
|
17
|
+
<templateId root="2.16.840.1.113883.10.20.27.1.2" extension="2022-12-01"/>
|
18
|
+
{{/ry2025_submission?}}
|
19
|
+
{{/ry2026_submission?}}
|
14
20
|
<!-- This is the globally unique identifier for this QRDA document -->
|
15
21
|
<id root="{{random_id}}"/>
|
16
22
|
<!-- QRDA III document type code -->
|
@@ -5,8 +5,14 @@
|
|
5
5
|
<observation classCode="OBS" moodCode="EVN">
|
6
6
|
<!-- Measure Data template -->
|
7
7
|
<templateId root="2.16.840.1.113883.10.20.27.3.5" extension="2016-09-01"/>
|
8
|
-
|
9
|
-
|
8
|
+
{{#ry2026_submission?}}
|
9
|
+
<!-- Measure Data - CMS (V5) -->
|
10
|
+
<templateId root="2.16.840.1.113883.10.20.27.3.16" extension="2025-05-01"/>
|
11
|
+
{{/ry2026_submission?}}
|
12
|
+
{{^ry2026_submission?}}
|
13
|
+
<!-- Measure Data - CMS (V4) -->
|
14
|
+
<templateId root="2.16.840.1.113883.10.20.27.3.16" extension="2019-05-01"/>
|
15
|
+
{{/ry2026_submission?}}
|
10
16
|
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" displayName="Assertion" codeSystemName="ActCode"/>
|
11
17
|
<statusCode code="completed"/>
|
12
18
|
<value xsi:type="CD" code="{{population_type}}" codeSystem="2.16.840.1.113883.5.4" codeSystemName="ActCode"/>
|
@@ -10,8 +10,14 @@
|
|
10
10
|
<!-- In this case the query is using an eMeasure -->
|
11
11
|
<!-- QRDA Category III Measure Section template -->
|
12
12
|
<templateId extension="2020-12-01" root="2.16.840.1.113883.10.20.27.2.1"/>
|
13
|
-
|
14
|
-
|
13
|
+
{{#ry2026_submission?}}
|
14
|
+
<!-- QRDA Category III Measure Section - CMS (V6) -->
|
15
|
+
<templateId extension="2025-05-01" root="2.16.840.1.113883.10.20.27.2.3"/>
|
16
|
+
{{/ry2026_submission?}}
|
17
|
+
{{^ry2026_submission?}}
|
18
|
+
<!-- QRDA Category III Measure Section - CMS (V5) -->
|
19
|
+
<templateId extension="2022-05-01" root="2.16.840.1.113883.10.20.27.2.3"/>
|
20
|
+
{{/ry2026_submission?}}
|
15
21
|
<code code="55186-1" codeSystem="2.16.840.1.113883.6.1"/>
|
16
22
|
<title>Measure Section</title>
|
17
23
|
<text>
|
@@ -41,7 +47,12 @@
|
|
41
47
|
<templateId root="2.16.840.1.113883.10.20.24.3.98"/>
|
42
48
|
<!-- SHALL 1..* (one for each referenced measure) Measure Reference and Results template -->
|
43
49
|
<templateId extension="2020-12-01" root="2.16.840.1.113883.10.20.27.3.1"/>
|
44
|
-
|
50
|
+
{{#ry2026_submission?}}
|
51
|
+
<templateId extension="2025-05-01" root="2.16.840.1.113883.10.20.27.3.17"/>
|
52
|
+
{{/ry2026_submission?}}
|
53
|
+
{{^ry2026_submission?}}
|
54
|
+
<templateId extension="2022-05-01" root="2.16.840.1.113883.10.20.27.3.17"/>
|
55
|
+
{{/ry2026_submission?}}
|
45
56
|
<id extension="{{random_id}}" root="1.3.6.1.4.1.115"/>
|
46
57
|
<statusCode code="completed"/>
|
47
58
|
<!-- Containing isBranch external references -->
|
@@ -19,7 +19,19 @@
|
|
19
19
|
</value>
|
20
20
|
{{/payer_code?}}
|
21
21
|
{{^payer_code?}}
|
22
|
-
|
22
|
+
{{#gender_code?}}
|
23
|
+
{{#other_gender_code?}}
|
24
|
+
<value xsi:type="CD" nullFlavor="OTH">
|
25
|
+
<translation code="{{{code}}}" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
|
26
|
+
</value>
|
27
|
+
{{/other_gender_code?}}
|
28
|
+
{{^other_gender_code?}}
|
29
|
+
<value xsi:type="CD" code="{{code}}" codeSystem="{{supplemental_data_value_code_system}}"/>
|
30
|
+
{{/other_gender_code?}}
|
31
|
+
{{/gender_code?}}
|
32
|
+
{{^gender_code?}}
|
33
|
+
<value xsi:type="CD" code="{{code}}" codeSystem="{{supplemental_data_value_code_system}}"/>
|
34
|
+
{{/gender_code?}}
|
23
35
|
{{/payer_code?}}
|
24
36
|
{{/unknown_supplemental_value?}}
|
25
37
|
<entryRelationship typeCode="SUBJ" inversionInd="true">
|
@@ -29,6 +29,7 @@ class Qrda3 < Mustache
|
|
29
29
|
@submission_program = options[:submission_program]
|
30
30
|
@ry2022_submission = options[:ry2022_submission]
|
31
31
|
@ry2025_submission = options[:ry2025_submission]
|
32
|
+
@ry2026_submission = options[:ry2026_submission]
|
32
33
|
@authoring_system = options[:authoring_system]
|
33
34
|
end
|
34
35
|
|
@@ -75,7 +76,12 @@ class Qrda3 < Mustache
|
|
75
76
|
when 'ETHNICITY'
|
76
77
|
[{ tid: '2.16.840.1.113883.10.20.27.3.7', extension: '2016-09-01' }]
|
77
78
|
when 'SEX'
|
78
|
-
|
79
|
+
if other_gender_code?
|
80
|
+
[{ tid: '2.16.840.1.113883.10.20.27.3.6', extension: '2016-09-01' },
|
81
|
+
{ tid: '2.16.840.1.113883.10.20.27.3.21', extension: '2025-05-01' }]
|
82
|
+
else
|
83
|
+
[{ tid: '2.16.840.1.113883.10.20.27.3.6', extension: '2016-09-01' }]
|
84
|
+
end
|
79
85
|
when 'PAYER'
|
80
86
|
[{ tid: '2.16.840.1.113883.10.20.27.3.9', extension: '2016-02-01' },
|
81
87
|
{ tid: '2.16.840.1.113883.10.20.27.3.18', extension: '2018-05-01' }]
|
@@ -98,6 +104,11 @@ class Qrda3 < Mustache
|
|
98
104
|
@ry2025_submission
|
99
105
|
end
|
100
106
|
|
107
|
+
# use 2026 template ids if 2026 submission is specified as true, or if it unspecified
|
108
|
+
def ry2026_submission?
|
109
|
+
@ry2026_submission || @ry2026_submission.nil?
|
110
|
+
end
|
111
|
+
|
101
112
|
def authoring_system
|
102
113
|
@authoring_system || 'TestSystem'
|
103
114
|
end
|
@@ -106,6 +117,14 @@ class Qrda3 < Mustache
|
|
106
117
|
self['type'] == 'PAYER'
|
107
118
|
end
|
108
119
|
|
120
|
+
def gender_code?
|
121
|
+
self['type'] == 'SEX'
|
122
|
+
end
|
123
|
+
|
124
|
+
def other_gender_code?
|
125
|
+
!%w[M F].include?(self['code'])
|
126
|
+
end
|
127
|
+
|
109
128
|
def supplemental_data_code
|
110
129
|
case self['type']
|
111
130
|
when 'RACE'
|
@@ -44,6 +44,12 @@ module Qrda
|
|
44
44
|
self['givenNames'].join(' ')
|
45
45
|
end
|
46
46
|
|
47
|
+
def onc_gender_code?
|
48
|
+
gender_elements = @qdmPatient.dataElements.select { |de| de._type == "QDM::PatientCharacteristicSex" }
|
49
|
+
return false if gender_elements.empty?
|
50
|
+
gender_elements.first.dataElementCodes.first['system'] == '2.16.840.1.113883.5.1'
|
51
|
+
end
|
52
|
+
|
47
53
|
def gender
|
48
54
|
gender_elements = @qdmPatient.dataElements.select { |de| de._type == "QDM::PatientCharacteristicSex" }
|
49
55
|
return if gender_elements.empty?
|
@@ -30,10 +30,22 @@ module QRDA
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def code_if_present(code_element, codes)
|
33
|
+
other_code = other_code_if_present(code_element, codes)
|
34
|
+
return other_code if other_code
|
33
35
|
return unless code_element && code_element['code'] && code_element['codeSystem']
|
34
36
|
codes.add("#{code_element['code']}:#{code_element['codeSystem']}")
|
35
37
|
QDM::Code.new(code_element['code'], code_element['codeSystem'])
|
36
38
|
end
|
39
|
+
|
40
|
+
def other_code_if_present(code_element, codes)
|
41
|
+
return unless code_element['nullFlavor']
|
42
|
+
translations = code_element.xpath('cda:translation')
|
43
|
+
return if translations.blank?
|
44
|
+
|
45
|
+
translations.each do |translation|
|
46
|
+
return code_if_present(translation, codes)
|
47
|
+
end
|
48
|
+
end
|
37
49
|
end
|
38
50
|
end
|
39
51
|
end
|
@@ -4,12 +4,12 @@ module QRDA
|
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.146']"))
|
5
5
|
super(entry_finder)
|
6
6
|
@id_xpath = './cda:id'
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.148']/cda:value"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='CAUS']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.148']/cda:value"
|
8
8
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
9
|
@relevant_date_time_xpath = './cda:effectiveTime[@value]'
|
10
10
|
@facility_locations_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
11
|
-
@severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
12
|
-
@type_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.9']/cda:value"
|
11
|
+
@severity_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
12
|
+
@type_xpath = "./cda:entryRelationship[@typeCode='MFST']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.9']/cda:value"
|
13
13
|
@entry_class = QDM::AdverseEvent
|
14
14
|
end
|
15
15
|
|
@@ -7,8 +7,8 @@ module QRDA
|
|
7
7
|
@code_xpath = "./cda:participant[@typeCode='CSM']/cda:participantRole/cda:playingEntity/cda:code"
|
8
8
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
9
|
@prevalence_period_xpath = "./cda:effectiveTime"
|
10
|
-
@severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
11
|
-
@type_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.9']/cda:value"
|
10
|
+
@severity_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
11
|
+
@type_xpath = "./cda:entryRelationship[@typeCode='MFST']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.9']/cda:value"
|
12
12
|
@entry_class = QDM::AllergyIntolerance
|
13
13
|
end
|
14
14
|
|
@@ -3,10 +3,10 @@ module QRDA
|
|
3
3
|
class DeviceOrderImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.130']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:id"
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:participant/cda:participantRole/cda:playingDevice/cda:code"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@reason_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:participant/cda:participantRole/cda:playingDevice/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@reason_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
10
10
|
@entry_class = QDM::DeviceOrder
|
11
11
|
end
|
12
12
|
|
@@ -3,10 +3,10 @@ module QRDA
|
|
3
3
|
class DeviceRecommendedImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.131']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:id"
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:participant/cda:participantRole/cda:playingDevice/cda:code"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@reason_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:participant/cda:participantRole/cda:playingDevice/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@reason_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.10']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
10
10
|
@entry_class = QDM::DeviceRecommended
|
11
11
|
end
|
12
12
|
|
@@ -3,12 +3,12 @@ module QRDA
|
|
3
3
|
class DiagnosisImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.137']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:value"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@prevalence_period_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:effectiveTime"
|
10
|
-
@anatomical_location_site_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:targetSiteCode"
|
11
|
-
@severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:value"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@prevalence_period_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:effectiveTime"
|
10
|
+
@anatomical_location_site_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:targetSiteCode"
|
11
|
+
@severity_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
12
12
|
@entry_class = QDM::Diagnosis
|
13
13
|
end
|
14
14
|
|
@@ -8,13 +8,13 @@ module QRDA
|
|
8
8
|
@relevant_period_xpath = "./cda:effectiveTime"
|
9
9
|
@relevant_date_time_xpath = './cda:effectiveTime[@value]'
|
10
10
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
|
-
@result_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
12
|
-
@result_datetime_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:effectiveTime"
|
13
|
-
@status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
11
|
+
@result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
12
|
+
@result_datetime_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:effectiveTime"
|
13
|
+
@status_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
14
14
|
@method_xpath = './cda:methodCode'
|
15
15
|
@interpretation_xpath = './cda:interpretationCode'
|
16
16
|
@facility_locations_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
17
|
-
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
17
|
+
@components_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
18
18
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
19
19
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
20
20
|
@entry_class = QDM::DiagnosticStudyPerformed
|
@@ -3,12 +3,12 @@ module QRDA
|
|
3
3
|
class EncounterOrderImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.132']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:code"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@facility_locations_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
10
|
-
@reason_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
11
|
-
@priority_xpath =
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@facility_locations_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
10
|
+
@reason_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
11
|
+
@priority_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter/cda:priorityCode"
|
12
12
|
@entry_class = QDM::EncounterOrder
|
13
13
|
end
|
14
14
|
|
@@ -17,7 +17,7 @@ module QRDA
|
|
17
17
|
encounter_order.facilityLocation = extract_facility_locations(entry_element)[0]
|
18
18
|
encounter_order.reason = extract_reason(entry_element)
|
19
19
|
encounter_order.priority = code_if_present(entry_element.at_xpath(@priority_xpath))
|
20
|
-
entity = extract_entity(entry_element, "./cda:entryRelationship/cda:encounter//cda:participant[@typeCode='PRF']")
|
20
|
+
entity = extract_entity(entry_element, "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter//cda:participant[@typeCode='PRF']")
|
21
21
|
encounter_order.requester.concat(entity) if entity
|
22
22
|
encounter_order
|
23
23
|
end
|
@@ -10,8 +10,8 @@ module QRDA
|
|
10
10
|
@admission_source_xpath = "./cda:participant/cda:participantRole[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.151']/cda:code"
|
11
11
|
@discharge_disposition_xpath = "./sdtc:dischargeDispositionCode"
|
12
12
|
@facility_locations_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
13
|
-
@clazz_xpath = "./cda:entryRelationship/cda:act[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.171']/cda:code"
|
14
|
-
@diagnosis_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.168']"
|
13
|
+
@clazz_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:act[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.171']/cda:code"
|
14
|
+
@diagnosis_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.168']"
|
15
15
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
16
16
|
@entry_class = QDM::EncounterPerformed
|
17
17
|
end
|
@@ -51,8 +51,8 @@ module QRDA
|
|
51
51
|
diagnosis_elements.each do |diagnosis_element|
|
52
52
|
diagnosis_component = QDM::DiagnosisComponent.new
|
53
53
|
diagnosis_component.code = code_if_present(diagnosis_element.at_xpath('./cda:value'))
|
54
|
-
diagnosis_component.presentOnAdmissionIndicator = code_if_present(diagnosis_element.at_xpath("./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.169']/cda:value"))
|
55
|
-
diagnosis_component.rank = diagnosis_element.at_xpath("./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value")&.value&.strip.to_i
|
54
|
+
diagnosis_component.presentOnAdmissionIndicator = code_if_present(diagnosis_element.at_xpath("./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.169']/cda:value"))
|
55
|
+
diagnosis_component.rank = diagnosis_element.at_xpath("./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value")&.value&.strip.to_i
|
56
56
|
diagnosis_list << diagnosis_component
|
57
57
|
end
|
58
58
|
diagnosis_list.empty? ? nil : diagnosis_list
|
@@ -3,11 +3,11 @@ module QRDA
|
|
3
3
|
class EncounterRecommendedImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.134']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:code"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@facility_locations_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
10
|
-
@reason_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@facility_locations_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
10
|
+
@reason_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
11
11
|
@entry_class = QDM::EncounterRecommended
|
12
12
|
end
|
13
13
|
|
@@ -15,7 +15,7 @@ module QRDA
|
|
15
15
|
encounter_recommended = super
|
16
16
|
encounter_recommended.facilityLocation = extract_facility_locations(entry_element)[0]
|
17
17
|
encounter_recommended.reason = extract_reason(entry_element)
|
18
|
-
entity = extract_entity(entry_element, "./cda:entryRelationship/cda:encounter//cda:participant[@typeCode='PRF']")
|
18
|
+
entity = extract_entity(entry_element, "./cda:entryRelationship[@typeCode='SUBJ']/cda:encounter//cda:participant[@typeCode='PRF']")
|
19
19
|
encounter_recommended.requester.concat(entity) if entity
|
20
20
|
encounter_recommended
|
21
21
|
end
|
@@ -8,7 +8,7 @@ module QRDA
|
|
8
8
|
@active_datetime_xpath = "./cda:effectiveTime[@value]"
|
9
9
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
10
10
|
@dosage_xpath = "./cda:doseQuantity"
|
11
|
-
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.167']/cda:quantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.167']/cda:quantity"
|
12
12
|
@route_xpath = "./cda:routeCode"
|
13
13
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
14
14
|
@entry_class = QDM::ImmunizationOrder
|
@@ -8,8 +8,8 @@ module QRDA
|
|
8
8
|
@relevant_period_xpath = "./cda:effectiveTime"
|
9
9
|
@relevant_date_time_xpath = './cda:effectiveTime'
|
10
10
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
|
-
@result_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
12
|
-
@status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
11
|
+
@result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
12
|
+
@status_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
13
13
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
14
14
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
15
15
|
@entry_class = QDM::InterventionPerformed
|
@@ -10,9 +10,9 @@ module QRDA
|
|
10
10
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
11
|
@status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
12
12
|
@method_xpath = './cda:methodCode'
|
13
|
-
@result_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
13
|
+
@result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
14
14
|
@result_datetime_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation/cda:effectiveTime"
|
15
|
-
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
15
|
+
@components_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
16
16
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
17
17
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
18
18
|
@entry_class = QDM::LaboratoryTestPerformed
|
@@ -3,15 +3,15 @@ module QRDA
|
|
3
3
|
class MedicationDischargeImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.105']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
-
@refills_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:repeatNumber"
|
10
|
-
@dosage_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:doseQuantity"
|
11
|
-
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
|
-
@frequency_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:effectiveTime[@operator='A']/cda:period"
|
13
|
-
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
14
|
-
@route_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:routeCode"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
|
+
@refills_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:repeatNumber"
|
10
|
+
@dosage_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:doseQuantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship[@typeCode='COMP']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
|
+
@frequency_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:effectiveTime[@operator='A']/cda:period"
|
13
|
+
@days_supplied_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
14
|
+
@route_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:routeCode"
|
15
15
|
|
16
16
|
@entry_class = QDM::MedicationDischarge
|
17
17
|
end
|
@@ -3,17 +3,17 @@ module QRDA
|
|
3
3
|
class MedicationDispensedImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.139']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:product/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
-
@relevant_period_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
|
9
|
-
@relevant_date_time_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
|
10
|
-
@author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
|
-
@refills_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:repeatNumber"
|
12
|
-
@dosage_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:doseQuantity"
|
13
|
-
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
14
|
-
@frequency_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:effectiveTime[@operator='A']/cda:period"
|
15
|
-
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
16
|
-
@route_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:routeCode"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:product/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@relevant_period_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
|
9
|
+
@relevant_date_time_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
|
10
|
+
@author_datetime_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
|
+
@refills_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='REFR']/cda:substanceAdministration/cda:repeatNumber"
|
12
|
+
@dosage_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='REFR']/cda:substanceAdministration/cda:doseQuantity"
|
13
|
+
@supply_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='COMP']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
14
|
+
@frequency_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='REFR']/cda:substanceAdministration/cda:effectiveTime[@operator='A']/cda:period"
|
15
|
+
@days_supplied_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='REFR']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
16
|
+
@route_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship[@typeCode='REFR']/cda:substanceAdministration/cda:routeCode"
|
17
17
|
@entry_class = QDM::MedicationDispensed
|
18
18
|
end
|
19
19
|
|
@@ -25,9 +25,9 @@ module QRDA
|
|
25
25
|
medication_dispensed.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
26
26
|
medication_dispensed.daysSupplied = extract_scalar(entry_element, @days_supplied_xpath)&.value
|
27
27
|
medication_dispensed.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
28
|
-
entity1 = extract_entity(entry_element, "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']//cda:participant[@typeCode='PRF']")
|
28
|
+
entity1 = extract_entity(entry_element, "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']//cda:participant[@typeCode='PRF']")
|
29
29
|
medication_dispensed.prescriber.concat(entity1) if entity1
|
30
|
-
entity2 = extract_entity(entry_element, "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:participant[@typeCode='DIST']")
|
30
|
+
entity2 = extract_entity(entry_element, "./cda:entryRelationship[@typeCode='SUBJ']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:participant[@typeCode='DIST']")
|
31
31
|
medication_dispensed.dispenser.concat(entity2) if entity2
|
32
32
|
medication_dispensed
|
33
33
|
end
|
@@ -8,13 +8,13 @@ module QRDA
|
|
8
8
|
@relevant_period_xpath = "./cda:effectiveTime"
|
9
9
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
10
10
|
@dosage_xpath = "./cda:doseQuantity"
|
11
|
-
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship[@typeCode='COMP']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
12
|
@frequency_xpath = "./cda:effectiveTime[@operator='A']/cda:period"
|
13
13
|
@refills_xpath = "./cda:repeatNumber"
|
14
14
|
@route_xpath = "./cda:routeCode"
|
15
15
|
@setting_xpath = "./cda:participant[@typeCode='LOC']/cda:participantRole/cda:code"
|
16
16
|
@prescriber_id_xpath = "./cda:author/cda:assignedAuthor/cda:id"
|
17
|
-
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
17
|
+
@days_supplied_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
18
18
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
19
19
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
20
20
|
@entry_class = QDM::MedicationOrder
|
@@ -6,7 +6,7 @@ module QRDA
|
|
6
6
|
@id_xpath = './cda:id'
|
7
7
|
@code_xpath = './cda:value'
|
8
8
|
@expired_datetime_xpath = './cda:effectiveTime/cda:low'
|
9
|
-
@cause = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.4']/cda:value"
|
9
|
+
@cause = "./cda:entryRelationship[@typeCode='CAUS']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.4']/cda:value"
|
10
10
|
@entry_class = QDM::PatientCharacteristicExpired
|
11
11
|
end
|
12
12
|
|
@@ -11,7 +11,7 @@ module QRDA
|
|
11
11
|
@method_xpath = './cda:methodCode'
|
12
12
|
@result_xpath = "./cda:value"
|
13
13
|
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
14
|
-
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
14
|
+
@components_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
15
15
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
16
16
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
17
17
|
@entry_class = QDM::PhysicalExamPerformed
|
@@ -8,7 +8,7 @@ module QRDA
|
|
8
8
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
9
|
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
10
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
11
|
-
@rank_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
11
|
+
@rank_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
12
12
|
@entry_class = QDM::ProcedureOrder
|
13
13
|
end
|
14
14
|
|
@@ -9,13 +9,13 @@ module QRDA
|
|
9
9
|
@relevant_date_time_xpath = './cda:effectiveTime'
|
10
10
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
11
11
|
@method_xpath = './cda:methodCode'
|
12
|
-
@result_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
13
|
-
@status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
12
|
+
@result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
13
|
+
@status_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
14
14
|
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
15
|
-
@incision_datetime_xpath = "./cda:entryRelationship/cda:procedure[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.89']/cda:effectiveTime"
|
16
|
-
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
15
|
+
@incision_datetime_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:procedure[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.89']/cda:effectiveTime"
|
16
|
+
@components_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
17
17
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
18
|
-
@rank_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
18
|
+
@rank_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
19
19
|
@related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
|
20
20
|
@entry_class = QDM::ProcedurePerformed
|
21
21
|
end
|
@@ -8,7 +8,7 @@ module QRDA
|
|
8
8
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
9
9
|
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
10
|
@reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
|
11
|
-
@rank_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
11
|
+
@rank_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.166']/cda:value/@value"
|
12
12
|
@entry_class = QDM::ProcedureRecommended
|
13
13
|
end
|
14
14
|
|
@@ -8,7 +8,7 @@ module QRDA
|
|
8
8
|
@relevant_period_xpath = "./cda:effectiveTime"
|
9
9
|
@author_datetime_xpath = "./cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time"
|
10
10
|
@dosage_xpath = "./cda:doseQuantity"
|
11
|
-
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship[@typeCode='COMP']/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
12
|
@frequency_xpath = "./cda:effectiveTime[@operator='A']/cda:period"
|
13
13
|
@refills_xpath = "./cda:repeatNumber"
|
14
14
|
@route_xpath = "./cda:routeCode"
|
@@ -3,10 +3,10 @@ module QRDA
|
|
3
3
|
class SymptomImporter < SectionImporter
|
4
4
|
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.138']"))
|
5
5
|
super(entry_finder)
|
6
|
-
@id_xpath =
|
7
|
-
@code_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:value"
|
8
|
-
@prevalence_period_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:effectiveTime"
|
9
|
-
@severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
6
|
+
@id_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation/cda:id"
|
7
|
+
@code_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:value"
|
8
|
+
@prevalence_period_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:effectiveTime"
|
9
|
+
@severity_xpath = "./cda:entryRelationship[@typeCode='SUBJ']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.136']/cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"
|
10
10
|
@entry_class = QDM::Symptom
|
11
11
|
end
|
12
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-reports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The MITRE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cqm-models
|