cqm-parsers 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/qrda-export/catI-r5/_header.mustache +4 -4
- data/lib/qrda-export/catI-r5/qrda1_r5.mustache +4 -4
- data/lib/qrda-export/catI-r5/qrda1_r5.rb +28 -28
- data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +7 -3
- data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +28 -2
- data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +3 -1
- data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +1 -1
- data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +2 -2
- data/lib/qrda-export/catI-r5/qrda_templates/device_ordered.mustache +3 -3
- data/lib/qrda-export/catI-r5/qrda_templates/encounter_ordered.mustache +3 -3
- data/lib/qrda-export/catI-r5/qrda_templates/{immunization_aministered.mustache → immunization_administered.mustache} +0 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +3 -3
- data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +3 -3
- data/lib/qrda-export/helper/cat_1_view_helper.rb +2 -2
- data/lib/qrda-export/helper/date_helper.rb +4 -0
- data/lib/qrda-import/base-importers/demographics_importer.rb +20 -24
- data/lib/qrda-import/base-importers/section_importer.rb +9 -9
- data/lib/qrda-import/patient_importer.rb +8 -2
- data/lib/util/hqmf_template_helper.rb +13 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fee41ae3629b17642d96a32021c2a88a482e487
|
4
|
+
data.tar.gz: 12beb393c3857d3bbe976680b9af8d8c40675855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 399ea7c2f02c5e22bf470d4f8044f6b838bad480da19cc314f60cd29586250a3591c62ae44aaa3f5783ede0d4678093ea9af8d6cf217b109c88b7323d63e6f3a
|
7
|
+
data.tar.gz: d977ad998ebb9789568542fe8e98835a225fb5ff1c0e4b4858b4d9832e0c6c7cca784f649e81af087c9a5b1fcc45d08c5cd49073dd56d0435c211d64ee26a6bb
|
data/Gemfile
CHANGED
@@ -4,18 +4,18 @@
|
|
4
4
|
<!-- US Realm Header Template Id -->
|
5
5
|
<templateId root="2.16.840.1.113883.10.20.22.1.1" extension="2015-08-01"/>
|
6
6
|
<!-- QRDA templateId -->
|
7
|
-
<templateId root="2.16.840.1.113883.10.20.24.1.1" extension="
|
7
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.1" extension="2017-08-01"/>
|
8
8
|
<!-- QDM-based QRDA templateId -->
|
9
|
-
<templateId root="2.16.840.1.113883.10.20.24.1.2" extension="
|
9
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.2" extension="2017-08-01"/>
|
10
10
|
<!-- CMS QRDA templateId -->
|
11
|
-
<templateId root="2.16.840.1.113883.10.20.24.1.3" extension="
|
11
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.3" extension="2018-02-01"/>
|
12
12
|
<!-- This is the globally unique identifier for this QRDA document -->
|
13
13
|
<id root="{{random_id}}"/>
|
14
14
|
<!-- QRDA document type code -->
|
15
15
|
<code code="55182-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Quality Measure Report"/>
|
16
16
|
<title>QRDA Incidence Report</title>
|
17
17
|
<!-- This is the document creation time -->
|
18
|
-
<effectiveTime value="
|
18
|
+
<effectiveTime value="{{{current_time}}}"/>
|
19
19
|
<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
|
20
20
|
<languageCode code="en"/>
|
21
21
|
<!-- reported patient -->
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<templateId root="2.16.840.1.113883.10.20.17.2.4"/>
|
14
14
|
<!-- This is the templateId for Patient Data QDM section -->
|
15
15
|
<templateId extension="2017-08-01" root="2.16.840.1.113883.10.20.24.2.1"/>
|
16
|
-
<templateId extension="
|
16
|
+
<templateId extension="2018-02-01" root="2.16.840.1.113883.10.20.24.2.1.1"/>
|
17
17
|
<code code="55188-7" codeSystem="2.16.840.1.113883.6.1"/>
|
18
18
|
<title>Patient Data</title>
|
19
19
|
<text/>
|
@@ -70,9 +70,9 @@
|
|
70
70
|
{{> qrda_templates/encounter_performed}}
|
71
71
|
{{/encounter_performed}}
|
72
72
|
|
73
|
-
{{#
|
74
|
-
{{> qrda_templates/
|
75
|
-
{{/
|
73
|
+
{{#immunization_administered}}
|
74
|
+
{{> qrda_templates/immunization_administered}}
|
75
|
+
{{/immunization_administered}}
|
76
76
|
|
77
77
|
{{#intervention_ordered}}
|
78
78
|
{{> qrda_templates/intervention_ordered}}
|
@@ -16,110 +16,110 @@ class Qrda1R5 < Mustache
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def adverse_event
|
19
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
19
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('adverse_event', '') }).to_json)
|
20
20
|
end
|
21
21
|
|
22
22
|
def allergy_intolerance
|
23
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
23
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('allergy_intolerance', '') }).to_json)
|
24
24
|
end
|
25
25
|
|
26
26
|
def assessment_performed
|
27
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
27
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('assessment', 'performed') }).to_json)
|
28
28
|
end
|
29
29
|
|
30
30
|
def communication_from_patient_to_provider
|
31
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
31
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('communication_from_patient_to_provider', '') }).to_json)
|
32
32
|
end
|
33
33
|
|
34
34
|
def communication_from_provider_to_patient
|
35
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
35
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('communication_from_provider_to_patient', '') }).to_json)
|
36
36
|
end
|
37
37
|
|
38
38
|
def communication_from_provider_to_provider
|
39
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
39
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('communication_from_provider_to_provider', '') }).to_json)
|
40
40
|
end
|
41
41
|
|
42
42
|
def diagnosis
|
43
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
43
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('diagnosis', '') }).to_json)
|
44
44
|
end
|
45
45
|
|
46
46
|
def device_ordered
|
47
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
47
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('device', 'ordered') }).to_json)
|
48
48
|
end
|
49
49
|
|
50
50
|
def device_applied
|
51
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
51
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('device', 'applied') }).to_json)
|
52
52
|
end
|
53
53
|
|
54
54
|
def diagnostic_study_ordered
|
55
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
55
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('diagnostic_study', 'ordered') }).to_json)
|
56
56
|
end
|
57
57
|
|
58
58
|
def diagnostic_study_performed
|
59
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
59
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('diagnostic_study', 'performed') }).to_json)
|
60
60
|
end
|
61
61
|
|
62
62
|
def encounter_ordered
|
63
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
63
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('encounter', 'ordered') }).to_json)
|
64
64
|
end
|
65
65
|
|
66
66
|
def encounter_performed
|
67
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
67
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('encounter', 'performed') }).to_json)
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
71
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
70
|
+
def immunization_administered
|
71
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('immunization', 'administered') }).to_json)
|
72
72
|
end
|
73
73
|
|
74
74
|
def intervention_ordered
|
75
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
75
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('intervention', 'ordered') }).to_json)
|
76
76
|
end
|
77
77
|
|
78
78
|
def intervention_performed
|
79
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
79
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('intervention', 'performed') }).to_json)
|
80
80
|
end
|
81
81
|
|
82
82
|
def lab_test_performed
|
83
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
83
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('laboratory_test', 'performed') }).to_json)
|
84
84
|
end
|
85
85
|
|
86
86
|
def lab_test_ordered
|
87
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
87
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('laboratory_test', 'ordered') }).to_json)
|
88
88
|
end
|
89
89
|
|
90
90
|
def medication_active
|
91
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
91
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('medication', 'active') }).to_json)
|
92
92
|
end
|
93
93
|
|
94
94
|
def medication_administered
|
95
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
95
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('medication', 'administered') + HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('substance', 'administered') }).to_json)
|
96
96
|
end
|
97
97
|
|
98
98
|
def medication_discharge
|
99
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
99
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('medication', 'discharge') }).to_json)
|
100
100
|
end
|
101
101
|
|
102
102
|
def medication_dispensed
|
103
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
103
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('medication', 'dispensed') }).to_json)
|
104
104
|
end
|
105
105
|
|
106
106
|
def medication_ordered
|
107
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
107
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('medication', 'ordered') }).to_json)
|
108
108
|
end
|
109
109
|
|
110
110
|
def patient_characteristic_expired
|
111
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
111
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('patient_characteristic_expired', '') }).to_json)
|
112
112
|
end
|
113
113
|
|
114
114
|
def physical_exam_performed
|
115
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
115
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('physical_exam', 'performed') }).to_json)
|
116
116
|
end
|
117
117
|
|
118
118
|
def procedure_ordered
|
119
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: '
|
119
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('procedure', 'ordered') }).to_json)
|
120
120
|
end
|
121
121
|
|
122
122
|
def procedure_performed
|
123
|
-
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' =>
|
123
|
+
JSON.parse(@patient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('procedure', 'performed') }).to_json)
|
124
124
|
end
|
125
125
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
<author>
|
2
|
-
<time value="
|
2
|
+
<time value="{{{current_time}}}"/>
|
3
3
|
<assignedAuthor>
|
4
|
-
<!-- id extension="Cypress" root="2.16.840.1.113883.19.5"/ -->
|
5
4
|
<!-- NPI -->
|
6
|
-
|
5
|
+
{{#provider}}
|
6
|
+
<id extension="{{{provider_npi}}}" root="2.16.840.1.113883.4.6"/>
|
7
|
+
{{/provider}}
|
8
|
+
{{^provider}}
|
9
|
+
<id extension="1982671962" root="2.16.840.1.113883.4.6"/>
|
10
|
+
{{/provider}}
|
7
11
|
<addr>
|
8
12
|
<streetAddressLine>202 Burlington Rd.</streetAddressLine>
|
9
13
|
<city>Bedford</city>
|
@@ -1,7 +1,32 @@
|
|
1
|
+
{{#provider}}
|
2
|
+
<custodian>
|
3
|
+
<assignedCustodian>
|
4
|
+
<representedCustodianOrganization>
|
5
|
+
{{#provider_ccn}}
|
6
|
+
<id extension="{{{provider_ccn}}}" root="2.16.840.1.113883.4.336"/>
|
7
|
+
{{/provider_ccn}}
|
8
|
+
{{^provider_ccn}}
|
9
|
+
<id extension="800890" root="2.16.840.1.113883.4.336"/>
|
10
|
+
{{/provider_ccn}}
|
11
|
+
<name>Cypress Test Deck</name>
|
12
|
+
<telecom use="WP" value="tel:(781)271-3000"/>
|
13
|
+
{{#provider_addresses}}
|
14
|
+
<addr use="HP">
|
15
|
+
<streetAddressLine>{{{provider_street}}}</streetAddressLine>
|
16
|
+
<city>{{{city}}}</city>
|
17
|
+
<state>{{{state}}}</state>
|
18
|
+
<postalCode>{{{zip}}}</postalCode>
|
19
|
+
<country>{{{country}}}</country>
|
20
|
+
</addr>
|
21
|
+
{{/provider_addresses}}
|
22
|
+
</representedCustodianOrganization>
|
23
|
+
</assignedCustodian>
|
24
|
+
</custodian>
|
25
|
+
{{/provider}}
|
26
|
+
{{^provider}}
|
1
27
|
<custodian>
|
2
28
|
<assignedCustodian>
|
3
29
|
<representedCustodianOrganization>
|
4
|
-
<!-- HQR Only -->
|
5
30
|
<id extension="800890" root="2.16.840.1.113883.4.336"/>
|
6
31
|
<name>Cypress Test Deck</name>
|
7
32
|
<telecom use="WP" value="tel:(781)271-3000"/>
|
@@ -14,4 +39,5 @@
|
|
14
39
|
</addr>
|
15
40
|
</representedCustodianOrganization>
|
16
41
|
</assignedCustodian>
|
17
|
-
</custodian>
|
42
|
+
</custodian>
|
43
|
+
{{/provider}}
|
@@ -14,7 +14,9 @@
|
|
14
14
|
{{#provider}}
|
15
15
|
<assignedEntity>
|
16
16
|
<id extension="{{{provider_npi}}}" root="2.16.840.1.113883.4.6"/>
|
17
|
-
|
17
|
+
{{#provider_ccn}}
|
18
|
+
<id extension="{{{provider_ccn}}}" root="2.16.840.1.113883.4.336"/>
|
19
|
+
{{/provider_ccn}}
|
18
20
|
<code code="{{{provider_type_code}}}" codeSystem="2.16.840.1.113883.6.101" codeSystemName="Healthcare Provider Taxonomy (HIPAA)"/>
|
19
21
|
{{#provider_addresses}}
|
20
22
|
<addr use="HP">
|
@@ -17,8 +17,8 @@
|
|
17
17
|
</name>
|
18
18
|
<administrativeGenderCode code="{{{gender}}}" codeSystem="2.16.840.1.113883.5.1" codeSystemName="HL7 AdministrativeGender"/>
|
19
19
|
<birthTime value="{{{birthdate}}}"/>
|
20
|
-
<raceCode code="{{{race}}}"
|
21
|
-
<ethnicGroupCode code="{{{ethnic_group}}}"
|
20
|
+
<raceCode code="{{{race}}}" codeSystemName="CDC Race and Ethnicity" codeSystem="2.16.840.1.113883.6.238"/>
|
21
|
+
<ethnicGroupCode code="{{{ethnic_group}}}" codeSystemName="CDC Race and Ethnicity" codeSystem="2.16.840.1.113883.6.238"/>
|
22
22
|
<languageCommunication>
|
23
23
|
<templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
|
24
24
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
|
@@ -22,10 +22,10 @@
|
|
22
22
|
</playingDevice>
|
23
23
|
</participantRole>
|
24
24
|
</participant>
|
25
|
+
{{#negationRationale}}
|
26
|
+
{{> qrda_templates/template_partials/_reason}}
|
27
|
+
{{/negationRationale}}
|
25
28
|
</supply>
|
26
29
|
</entryRelationship>
|
27
|
-
{{#negationRationale}}
|
28
|
-
{{> qrda_templates/template_partials/_reason}}
|
29
|
-
{{/negationRationale}}
|
30
30
|
</act>
|
31
31
|
</entry>
|
@@ -16,10 +16,10 @@
|
|
16
16
|
{{#authorDatetime}}
|
17
17
|
{{> qrda_templates/template_partials/_author}}
|
18
18
|
{{/authorDatetime}}
|
19
|
+
{{#negationRationale}}
|
20
|
+
{{> qrda_templates/template_partials/_reason}}
|
21
|
+
{{/negationRationale}}
|
19
22
|
</encounter>
|
20
23
|
</entryRelationship>
|
21
|
-
{{#negationRationale}}
|
22
|
-
{{> qrda_templates/template_partials/_reason}}
|
23
|
-
{{/negationRationale}}
|
24
24
|
</act>
|
25
25
|
</entry>
|
File without changes
|
@@ -46,10 +46,10 @@
|
|
46
46
|
{{#authorDatetime}}
|
47
47
|
{{> qrda_templates/template_partials/_author_participation}}
|
48
48
|
{{/authorDatetime}}
|
49
|
+
{{#negationRationale}}
|
50
|
+
{{> qrda_templates/template_partials/_reason}}
|
51
|
+
{{/negationRationale}}
|
49
52
|
</substanceAdministration>
|
50
53
|
</entryRelationship>
|
51
|
-
{{#negationRationale}}
|
52
|
-
{{> qrda_templates/template_partials/_reason}}
|
53
|
-
{{/negationRationale}}
|
54
54
|
</act>
|
55
55
|
</entry>
|
@@ -30,10 +30,10 @@
|
|
30
30
|
{{#authorDatetime}}
|
31
31
|
{{> qrda_templates/template_partials/_author}}
|
32
32
|
{{/authorDatetime}}
|
33
|
+
{{#negationRationale}}
|
34
|
+
{{> qrda_templates/template_partials/_reason}}
|
35
|
+
{{/negationRationale}}
|
33
36
|
</supply>
|
34
37
|
</entryRelationship>
|
35
|
-
{{#negationRationale}}
|
36
|
-
{{> qrda_templates/template_partials/_reason}}
|
37
|
-
{{/negationRationale}}
|
38
38
|
</act>
|
39
39
|
</entry>
|
@@ -2,11 +2,8 @@ module QRDA
|
|
2
2
|
module Cat1
|
3
3
|
module DemographicsImporter
|
4
4
|
def get_demographics(patient, doc)
|
5
|
-
# effective_date = doc.at_xpath('/cda:ClinicalDocument/cda:effectiveTime')['value']
|
6
|
-
# patient.effective_time = HL7Helper.timestamp_to_integer(effective_date)
|
7
5
|
patient_role_element = doc.at_xpath('/cda:ClinicalDocument/cda:recordTarget/cda:patientRole')
|
8
6
|
patient_element = patient_role_element.at_xpath('./cda:patient')
|
9
|
-
# patient.title = patient_element.at_xpath('cda:name/cda:title').try(:text)
|
10
7
|
patient.givenNames = [patient_element.at_xpath('cda:name/cda:given').text]
|
11
8
|
patient.familyName = patient_element.at_xpath('cda:name/cda:family').text
|
12
9
|
patient.birthDatetime = Time.parse(patient_element.at_xpath('cda:birthTime')['value']).utc
|
@@ -20,27 +17,26 @@ module QRDA
|
|
20
17
|
pcs.dataElementCodes = [{ code: gender_code, codeSystem: 'AdministrativeGender' }]
|
21
18
|
patient.dataElements << pcs
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
20
|
+
pcr = QDM::PatientCharacteristicRace.new
|
21
|
+
race_code = patient_element.at_xpath('cda:raceCode')['code']
|
22
|
+
pcr.dataElementCodes = [{ code: race_code, codeSystem: 'cdcrec' }]
|
23
|
+
patient.dataElements << pcr
|
24
|
+
|
25
|
+
pce = QDM::PatientCharacteristicEthnicity.new
|
26
|
+
ethnicity_code = patient_element.at_xpath('cda:ethnicGroupCode')['code']
|
27
|
+
pce.dataElementCodes = [{ code: ethnicity_code, codeSystem: 'cdcrec' }]
|
28
|
+
patient.dataElements << pce
|
29
|
+
|
30
|
+
provider_element = doc.xpath("//cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.55']")
|
31
|
+
|
32
|
+
# If a provider element isn't in the record, return wiihout adding one.
|
33
|
+
return if provider_element.blank?
|
34
|
+
provider_code = provider_element.first.at_xpath('cda:value')['code']
|
35
|
+
ip = {}
|
36
|
+
ip['financial_responsibility_type'] = { 'code' => 'SELF', 'codeSystem' => 'HL7 Relationship Code' }
|
37
|
+
ip['codes'] = { 'SOP' => [provider_code] }
|
38
|
+
patient.extendedData = {}
|
39
|
+
patient.extendedData['insurance_providers'] = JSON.generate([ip])
|
44
40
|
end
|
45
41
|
end
|
46
42
|
end
|
@@ -38,8 +38,8 @@ module QRDA
|
|
38
38
|
|
39
39
|
def create_entry(entry_element, _nrh = NarrativeReferenceHandler.new)
|
40
40
|
entry = @entry_class.new
|
41
|
-
@entry_id_map[extract_id(entry_element, "./cda:id")] ||= []
|
42
|
-
@entry_id_map[extract_id(entry_element, "./cda:id")] << entry.id
|
41
|
+
@entry_id_map[extract_id(entry_element, "./cda:id").value] ||= []
|
42
|
+
@entry_id_map[extract_id(entry_element, "./cda:id").value] << entry.id
|
43
43
|
entry.dataElementCodes = extract_codes(entry_element, @code_xpath)
|
44
44
|
extract_dates(entry_element, entry)
|
45
45
|
if @result_xpath
|
@@ -54,9 +54,9 @@ module QRDA
|
|
54
54
|
def extract_id(parent_element, id_xpath)
|
55
55
|
id_element = parent_element.at_xpath(id_xpath)
|
56
56
|
return unless id_element
|
57
|
-
|
58
|
-
|
59
|
-
identifier
|
57
|
+
# If an extension is not included, use the root as the value. Other wise use the extension
|
58
|
+
value = id_element['extension'] ? id_element['extension'] : id_element['root']
|
59
|
+
identifier = QDM::Id.new(value: value, namingSystem: id_element['root'])
|
60
60
|
identifier
|
61
61
|
end
|
62
62
|
|
@@ -133,13 +133,13 @@ module QRDA
|
|
133
133
|
# coded_parent_element is the 'parent' element when the coded is nested (e.g., medication order)
|
134
134
|
def extract_reason_or_negation(parent_element, entry, coded_parent_element = nil)
|
135
135
|
coded_parent_element ||= parent_element
|
136
|
-
reason_element = parent_element.
|
136
|
+
reason_element = parent_element.xpath(".//cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value | .//cda:entryRelationship[@typeCode='RSON']/cda:act[cda:templateId/@root='2.16.840.1.113883.10.20.1.27']/cda:code")
|
137
137
|
negation_indicator = parent_element['negationInd']
|
138
|
-
|
138
|
+
unless reason_element.blank?
|
139
139
|
if negation_indicator.eql?('true')
|
140
|
-
entry.negationRationale = code_if_present(reason_element)
|
140
|
+
entry.negationRationale = code_if_present(reason_element.first)
|
141
141
|
else
|
142
|
-
entry.reason = code_if_present(reason_element)
|
142
|
+
entry.reason = code_if_present(reason_element.first)
|
143
143
|
end
|
144
144
|
end
|
145
145
|
extract_negated_code(coded_parent_element, entry)
|
@@ -89,8 +89,14 @@ module QRDA
|
|
89
89
|
|
90
90
|
def normalize_references(patient, entry_id_map)
|
91
91
|
patient.dataElements.each do |data_element|
|
92
|
-
|
93
|
-
|
92
|
+
next unless data_element.respond_to?(:relatedTo) && data_element.relatedTo
|
93
|
+
relations_to_add = []
|
94
|
+
data_element.relatedTo.each do |related_to|
|
95
|
+
relations_to_add << entry_id_map[related_to.value]
|
96
|
+
end
|
97
|
+
data_element.relatedTo.destroy
|
98
|
+
relations_to_add.each do |relation_to_add|
|
99
|
+
data_element.relatedTo << relation_to_add
|
94
100
|
end
|
95
101
|
end
|
96
102
|
end
|
@@ -34,6 +34,19 @@ module HQMF
|
|
34
34
|
nil
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
# Returns a list of all hqmf_oids (regardless of version) for the combination of definition and status
|
39
|
+
def self.get_all_hqmf_oids(definition, status)
|
40
|
+
status ||= ""
|
41
|
+
version_negation_combinations = [{ version: 'r1', negation: false },
|
42
|
+
{ version: 'r1', negation: true },
|
43
|
+
{ version: 'r2', negation: false },
|
44
|
+
{ version: 'r2cql', negation: false }]
|
45
|
+
hqmf_oids = version_negation_combinations.collect do |obj|
|
46
|
+
template_id_by_definition_and_status(definition, status, obj[:negation], obj[:version])
|
47
|
+
end
|
48
|
+
hqmf_oids
|
49
|
+
end
|
37
50
|
end
|
38
51
|
end
|
39
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
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: 2018-
|
11
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.8.
|
131
|
+
version: 1.8.5
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.8.
|
138
|
+
version: 1.8.5
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: highline
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.2.
|
159
|
+
version: 1.2.2
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.2.
|
166
|
+
version: 1.2.2
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: zip-zip
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,7 +300,7 @@ files:
|
|
300
300
|
- lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache
|
301
301
|
- lib/qrda-export/catI-r5/qrda_templates/encounter_ordered.mustache
|
302
302
|
- lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache
|
303
|
-
- lib/qrda-export/catI-r5/qrda_templates/
|
303
|
+
- lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache
|
304
304
|
- lib/qrda-export/catI-r5/qrda_templates/insurance_provider.mustache
|
305
305
|
- lib/qrda-export/catI-r5/qrda_templates/intervention_ordered.mustache
|
306
306
|
- lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache
|