cqm-reports 4.1.3 → 4.1.5

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html-export/qdm-patient/data_element/_data_element_other_fields.mustache +2 -2
  3. data/lib/html-export/qdm-patient/data_element/_data_element_times.mustache +15 -15
  4. data/lib/html-export/qdm-patient/qdm_patient.mustache +2 -2
  5. data/lib/html-export/qdm-patient/qdm_patient.rb +14 -0
  6. data/lib/qrda-export/catI-r5/_header.mustache +7 -0
  7. data/lib/qrda-export/catI-r5/qrda1_r5.rb +6 -0
  8. data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +8 -1
  9. data/lib/qrda-export/catIII/_header.mustache +14 -8
  10. data/lib/qrda-export/catIII/_measure_data.mustache +8 -2
  11. data/lib/qrda-export/catIII/_measure_section.mustache +14 -3
  12. data/lib/qrda-export/catIII/_supplemental_data.mustache +13 -1
  13. data/lib/qrda-export/catIII/qrda3.rb +20 -1
  14. data/lib/qrda-export/helper/patient_view_helper.rb +6 -0
  15. data/lib/qrda-import/base-importers/demographics_importer.rb +12 -0
  16. data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +3 -3
  17. data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +2 -2
  18. data/lib/qrda-import/data-element-importers/device_order_importer.rb +4 -4
  19. data/lib/qrda-import/data-element-importers/device_recommended_importer.rb +4 -4
  20. data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +6 -6
  21. data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +4 -4
  22. data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +7 -7
  23. data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +4 -4
  24. data/lib/qrda-import/data-element-importers/encounter_recommended_importer.rb +6 -6
  25. data/lib/qrda-import/data-element-importers/immunization_order_importer.rb +1 -1
  26. data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +2 -2
  27. data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +2 -2
  28. data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +9 -9
  29. data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +13 -13
  30. data/lib/qrda-import/data-element-importers/medication_order_importer.rb +2 -2
  31. data/lib/qrda-import/data-element-importers/patient_characteristic_expired_importer.rb +1 -1
  32. data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +1 -1
  33. data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +1 -1
  34. data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +5 -5
  35. data/lib/qrda-import/data-element-importers/procedure_recommended_importer.rb +1 -1
  36. data/lib/qrda-import/data-element-importers/substance_order_importer.rb +1 -1
  37. data/lib/qrda-import/data-element-importers/symptom_importer.rb +4 -4
  38. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d5f83d79b0b7295876fb917ec83383842ce49e204d01c6005922ff91768b541
4
- data.tar.gz: fc5bf5bf6ba3865c0eff6c25aa04dd23f5d9929502e3f989edba6e9602c177a7
3
+ metadata.gz: '08e7e657c2a3f3cfdde7ed644b30eabcf2fd4be7496b21b89b10e5c7a14def96'
4
+ data.tar.gz: '0008b828658cbc5b3c787e773aa28649407c03940b1cc913142c50bcd7d3d188'
5
5
  SHA512:
6
- metadata.gz: d0200cc9134c712897840cf3a580dbd00f33fc2d89f97a75750b6a96db9851104f67e7fe42cd83547de97e5bae0354ab2398340f50a78b8f214a6d6b6c57c25a
7
- data.tar.gz: d8959ab387cc0d6fdef054ccebe1d185d287f28fd9f562cef5da888f7394beffad526aaf01a9b2da7fad64833d995a891bae2be74b665b1d1e103554756e0a47
6
+ metadata.gz: 12ef53ecb61ebe05fab08cdc30b0a04d81122df35947ae4cc15d77e2481ec5c525e5362cdb278f8b559907b5c3f146f0f37edc0909d60556d897f279c5c621c2
7
+ data.tar.gz: fa94922e97bd9a5760142a2070560f6ca66b63f45667b37098dc86e8012e97f2cfd446f44bc330df04f0d3063aa5b514d38ec2ff1b0757a0498320ac7663d2df
@@ -169,10 +169,10 @@
169
169
  {{/recorder}}
170
170
  {{#referenceRange}}
171
171
  <div class="div-head-row">
172
- <div class="div-table-head--no-border"><span class="criteria-heading">Reference Range Start:</span> {{{low}}}</div>
172
+ <div class="div-table-head--no-border"><span class="criteria-heading">Reference Range Start:</span> {{#low}}{{format_time}}{{/low}}</div>
173
173
  </div>
174
174
  <div class="div-head-row">
175
- <div class="div-table-head--no-border"><span class="criteria-heading">Reference Range End:</span> {{{high}}}</div>
175
+ <div class="div-table-head--no-border"><span class="criteria-heading">Reference Range End:</span> {{#high}}{{format_time}}{{/high}}</div>
176
176
  </div>
177
177
  {{/referenceRange}}
178
178
  {{#refills}}
@@ -2,77 +2,77 @@
2
2
  <div class="div-table-body">
3
3
  {{#relevantPeriod}}
4
4
  <div class="div-head-row">
5
- <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Period Start:</span> {{{low}}}</div>
5
+ <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Period Start:</span> {{#low}}{{format_time}}{{/low}}</div>
6
6
  </div>
7
7
  {{#end_time?}}
8
8
  <div class="div-head-row">
9
- <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Period End:</span> {{{high}}}</div>
9
+ <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Period End:</span> {{#high}}{{format_time}}{{/high}}</div>
10
10
  </div>
11
11
  {{/end_time?}}
12
12
  {{/relevantPeriod}}
13
13
  {{#relevantDatetime}}
14
14
  <div class="div-head-row">
15
- <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Date/Time:</span> {{{relevantDatetime}}}</div>
15
+ <div class="div-table-head--no-border"><span class="criteria-heading">Relevant Date/Time:</span> {{#relevantDatetime}}{{format_time}}{{/relevantDatetime}}</div>
16
16
  </div>
17
17
  {{/relevantDatetime}}
18
18
  {{#prevalencePeriod}}
19
19
  <div class="div-head-row">
20
- <div class="div-table-head--no-border"><span class="criteria-heading">Prevalence Period Start:</span> {{{low}}}</div>
20
+ <div class="div-table-head--no-border"><span class="criteria-heading">Prevalence Period Start:</span> {{#low}}{{format_time}}{{/low}}</div>
21
21
  </div>
22
22
  {{#end_time?}}
23
23
  <div class="div-head-row">
24
- <div class="div-table-head--no-border"><span class="criteria-heading">Prevalence Period End:</span> {{{high}}}</div>
24
+ <div class="div-table-head--no-border"><span class="criteria-heading">Prevalence Period End:</span> {{#high}}{{format_time}}{{/high}}</div>
25
25
  </div>
26
26
  {{/end_time?}}
27
27
  {{/prevalencePeriod}}
28
28
  {{#participationPeriod}}
29
29
  <div class="div-head-row">
30
- <div class="div-table-head--no-border"><span class="criteria-heading">Participation Period Start:</span> {{{low}}}</div>
30
+ <div class="div-table-head--no-border"><span class="criteria-heading">Participation Period Start:</span> {{#low}}{{format_time}}{{/low}}</div>
31
31
  </div>
32
32
  {{#end_time?}}
33
33
  <div class="div-head-row">
34
- <div class="div-table-head--no-border"><span class="criteria-heading">Participation Period End:</span> {{{high}}}</div>
34
+ <div class="div-table-head--no-border"><span class="criteria-heading">Participation Period End:</span> {{#high}}{{format_time}}{{/high}}</div>
35
35
  </div>
36
36
  {{/end_time?}}
37
37
  {{/participationPeriod}}
38
38
  {{#authorDatetime}}
39
39
  <div class="div-head-row">
40
- <div class="div-table-head--no-border"><span class="criteria-heading">Author Date/Time:</span> {{{authorDatetime}}}</div>
40
+ <div class="div-table-head--no-border"><span class="criteria-heading">Author Date/Time:</span> {{#authorDatetime}}{{format_time}}{{/authorDatetime}}</div>
41
41
  </div>
42
42
  {{/authorDatetime}}
43
43
  {{#resultDatetime}}
44
44
  <div class="div-head-row">
45
- <div class="div-table-head--no-border"><span class="criteria-heading">Result Date/Time:</span> {{{resultDatetime}}}</div>
45
+ <div class="div-table-head--no-border"><span class="criteria-heading">Result Date/Time:</span> {{#resultDatetime}}{{format_time}}{{/resultDatetime}}</div>
46
46
  </div>
47
47
  {{/resultDatetime}}
48
48
  {{#activeDatetime}}
49
49
  <div class="div-head-row">
50
- <div class="div-table-head--no-border"><span class="criteria-heading">Active Date/Time:</span> {{{activeDatetime}}}</div>
50
+ <div class="div-table-head--no-border"><span class="criteria-heading">Active Date/Time:</span> {{#activeDatetime}}{{format_time}}{{/activeDatetime}}</div>
51
51
  </div>
52
52
  {{/activeDatetime}}
53
53
  {{#incisionDatetime}}
54
54
  <div class="div-head-row">
55
- <div class="div-table-head--no-border"><span class="criteria-heading">Incision Date/Time:</span> {{{incisionDatetime}}}</div>
55
+ <div class="div-table-head--no-border"><span class="criteria-heading">Incision Date/Time:</span> {{#incisionDatetime}}{{format_time}}{{/incisionDatetime}}</div>
56
56
  </div>
57
57
  {{/incisionDatetime}}
58
58
  {{#receivedDatetime}}
59
59
  <div class="div-head-row">
60
- <div class="div-table-head--no-border"><span class="criteria-heading">Received Date/Time:</span> {{{receivedDatetime}}}</div>
60
+ <div class="div-table-head--no-border"><span class="criteria-heading">Received Date/Time:</span> {{#receivedDatetime}}{{format_time}}{{/receivedDatetime}}</div>
61
61
  </div>
62
62
  {{/receivedDatetime}}
63
63
  {{#sentDatetime}}
64
64
  <div class="div-head-row">
65
- <div class="div-table-head--no-border"><span class="criteria-heading">Sent Date/Time:</span> {{{sentDatetime}}}</div>
65
+ <div class="div-table-head--no-border"><span class="criteria-heading">Sent Date/Time:</span> {{#sentDatetime}}{{format_time}}{{/sentDatetime}}</div>
66
66
  </div>
67
67
  {{/sentDatetime}}
68
68
  {{#birthDatetime}}
69
69
  <div class="div-head-row">
70
- <div class="div-table-head--no-border"><span class="criteria-heading">Birth Date/Time:</span> {{{birthDatetime}}}</div>
70
+ <div class="div-table-head--no-border"><span class="criteria-heading">Birth Date/Time:</span> {{#birthDatetime}}{{format_time}}{{/birthDatetime}}</div>
71
71
  </div>
72
72
  {{/birthDatetime}}
73
73
  {{#expiredDatetime}}
74
74
  <div class="div-head-row">
75
- <div class="div-table-head--no-border"><span class="criteria-heading">Expired Date/Time:</span> {{{expiredDatetime}}}</div>
75
+ <div class="div-table-head--no-border"><span class="criteria-heading">Expired Date/Time:</span> {{#expiredDatetime}}{{format_time}}{{/expiredDatetime}}</div>
76
76
  </div>
77
77
  {{/expiredDatetime}}
78
78
  </div>
@@ -22,9 +22,9 @@
22
22
  </div>
23
23
  <div class="div-head-row patient_narr_tr panel panel-default patient-details">
24
24
  <div class="div-table-head patient_narr_th panel-heading"><span class="td_label">Date of birth</span></div>
25
- <div class="div-table-head">{{{birthdate}}}</div>
25
+ <div class="div-table-head">{{#birthdate}}{{format_time}}{{/birthdate}}</div>
26
26
  <div class="div-table-head patient_narr_th panel-heading"><span class="td_label">Date of expiration</span></div>
27
- <div class="div-table-head">{{{expiration}}}</div>
27
+ <div class="div-table-head">{{#expiration}}{{format_time}}{{/expiration}}</div>
28
28
  </div>
29
29
  <div class="div-head-row patient_narr_tr panel panel-default patient-details">
30
30
  <div class="div-table-head patient_narr_th panel-heading"><span class="td_label">Race</span></div>
@@ -1,4 +1,5 @@
1
1
  require 'mustache'
2
+ require 'time'
2
3
  class QdmPatient < Mustache
3
4
  include Qrda::Export::Helper::PatientViewHelper
4
5
  include HQMF::Util::EntityHelper
@@ -151,4 +152,17 @@ class QdmPatient < Mustache
151
152
  def end_time?
152
153
  self['high'] && DateTime.parse(self['high']).year < 3000
153
154
  end
155
+
156
+ def format_time
157
+ str = render('{{.}}').to_s.strip # current section value
158
+ return "" if str.empty? || str == "null"
159
+ convert_iso_timestamp_to_human_readable(str)
160
+ rescue ArgumentError, TypeError => _e
161
+ str
162
+ end
163
+
164
+ def convert_iso_timestamp_to_human_readable(iso)
165
+ t = Time.parse(iso).in_time_zone
166
+ t.strftime('%B %e, %Y %l:%M%P')
167
+ end
154
168
  end
@@ -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
- <administrativeGenderCode {{> _code}}/>
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
- {{#ry2025_submission?}}
7
- <!-- QRDA Category III Report - CMS (V9) -->
8
- <templateId root="2.16.840.1.113883.10.20.27.1.2" extension="2024-12-01"/>
9
- {{/ry2025_submission?}}
10
- {{^ry2025_submission?}}
11
- <!-- QRDA Category III Report - CMS (V7) -->
12
- <templateId root="2.16.840.1.113883.10.20.27.1.2" extension="2022-12-01"/>
13
- {{/ry2025_submission?}}
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
- <!-- Measure Data - CMS (V4) -->
9
- <templateId root="2.16.840.1.113883.10.20.27.3.16" extension="2019-05-01"/>
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
- <!-- QRDA Category III Measure Section - CMS (V4) -->
14
- <templateId extension="2022-05-01" root="2.16.840.1.113883.10.20.27.2.3"/>
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
- <templateId extension="2022-05-01" root="2.16.840.1.113883.10.20.27.3.17"/>
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
- <value xsi:type="CD" code="{{code}}" codeSystem="{{supplemental_data_value_code_system}}"/>
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
- [{ tid: '2.16.840.1.113883.10.20.27.3.6', extension: '2016-09-01' }]
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 = './cda:entryRelationship/cda:observation/cda:id'
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 = './cda:entryRelationship/cda:encounter/cda:id'
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 = './cda:entryRelationship/cda:encounter/cda:priorityCode'
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 = './cda:entryRelationship/cda:encounter/cda:id'
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 = './cda:entryRelationship/cda:substanceAdministration/cda:id'
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 = './cda:entryRelationship/cda:supply/cda:id'
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 = './cda:entryRelationship/cda:observation/cda:id'
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.3
4
+ version: 4.1.5
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-01-08 00:00:00.000000000 Z
11
+ date: 2025-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cqm-models