cqm-parsers 0.2.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +8 -4
  3. data/README.md +44 -5
  4. data/Rakefile +1 -0
  5. data/lib/ext/data_element.rb +1 -1
  6. data/lib/hqmf-parser.rb +13 -45
  7. data/lib/hqmf-parser/2.0/document.rb +1 -1
  8. data/lib/hqmf-parser/cql/document_helpers/doc_population_helper.rb +6 -1
  9. data/lib/measure-loader/cql_loader.rb +165 -0
  10. data/lib/measure-loader/elm_dependency_finder.rb +72 -0
  11. data/lib/measure-loader/elm_parser.rb +67 -0
  12. data/lib/measure-loader/exceptions.rb +10 -0
  13. data/lib/measure-loader/helpers.rb +11 -0
  14. data/lib/measure-loader/hqmf_measure_loader.rb +170 -0
  15. data/lib/measure-loader/mat_measure_files.rb +138 -0
  16. data/lib/measure-loader/source_data_criteria_loader.rb +65 -0
  17. data/lib/measure-loader/value_set_helpers.rb +68 -0
  18. data/lib/measure-loader/vsac_value_set_loader.rb +97 -0
  19. data/lib/util/util.rb +23 -0
  20. data/lib/util/vsac_api.rb +164 -101
  21. metadata +47 -129
  22. data/lib/ext/code.rb +0 -10
  23. data/lib/qrda-export/catI-r5/_code.mustache +0 -1
  24. data/lib/qrda-export/catI-r5/_codes.mustache +0 -10
  25. data/lib/qrda-export/catI-r5/_header.mustache +0 -28
  26. data/lib/qrda-export/catI-r5/_measure_section.mustache +0 -59
  27. data/lib/qrda-export/catI-r5/_reporting_period.mustache +0 -23
  28. data/lib/qrda-export/catI-r5/_values.mustache +0 -10
  29. data/lib/qrda-export/catI-r5/qrda1_r5.mustache +0 -137
  30. data/lib/qrda-export/catI-r5/qrda1_r5.rb +0 -125
  31. data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +0 -24
  32. data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +0 -43
  33. data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +0 -82
  34. data/lib/qrda-export/catI-r5/qrda_header/_information_recipient.mustache +0 -7
  35. data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +0 -25
  36. data/lib/qrda-export/catI-r5/qrda_header/_participant.mustache +0 -7
  37. data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +0 -28
  38. data/lib/qrda-export/catI-r5/qrda_templates/adverse_event.mustache +0 -28
  39. data/lib/qrda-export/catI-r5/qrda_templates/allergy_intolerance.mustache +0 -28
  40. data/lib/qrda-export/catI-r5/qrda_templates/assessment_performed.mustache +0 -25
  41. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_patient_to_provider.mustache +0 -29
  42. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_patient.mustache +0 -24
  43. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_provider.mustache +0 -31
  44. data/lib/qrda-export/catI-r5/qrda_templates/device_applied.mustache +0 -32
  45. data/lib/qrda-export/catI-r5/qrda_templates/device_ordered.mustache +0 -31
  46. data/lib/qrda-export/catI-r5/qrda_templates/diagnosis.mustache +0 -38
  47. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_ordered.mustache +0 -19
  48. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache +0 -32
  49. data/lib/qrda-export/catI-r5/qrda_templates/encounter_ordered.mustache +0 -24
  50. data/lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache +0 -40
  51. data/lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache +0 -29
  52. data/lib/qrda-export/catI-r5/qrda_templates/insurance_provider.mustache +0 -11
  53. data/lib/qrda-export/catI-r5/qrda_templates/intervention_ordered.mustache +0 -18
  54. data/lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache +0 -25
  55. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_ordered.mustache +0 -18
  56. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_performed.mustache +0 -22
  57. data/lib/qrda-export/catI-r5/qrda_templates/medication_active.mustache +0 -35
  58. data/lib/qrda-export/catI-r5/qrda_templates/medication_administered.mustache +0 -31
  59. data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +0 -55
  60. data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +0 -39
  61. data/lib/qrda-export/catI-r5/qrda_templates/medication_ordered.mustache +0 -38
  62. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_expired.mustache +0 -16
  63. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_performed.mustache +0 -25
  64. data/lib/qrda-export/catI-r5/qrda_templates/procedure_ordered.mustache +0 -19
  65. data/lib/qrda-export/catI-r5/qrda_templates/procedure_performed.mustache +0 -44
  66. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_admission_source.mustache +0 -6
  67. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_anatomical_location_site.mustache +0 -1
  68. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author.mustache +0 -7
  69. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author_participation.mustache +0 -7
  70. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_component.mustache +0 -11
  71. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_diagnosis.mustache +0 -19
  72. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_facility_location.mustache +0 -16
  73. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_mediation_frequency.mustache +0 -3
  74. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_details.mustache +0 -11
  75. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_ordinality.mustache +0 -1
  76. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_principal_diagnosis.mustache +0 -8
  77. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reason.mustache +0 -12
  78. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_related_to.mustache +0 -6
  79. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_results.mustache +0 -19
  80. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_severity.mustache +0 -8
  81. data/lib/qrda-export/helper/cat_1_view_helper.rb +0 -150
  82. data/lib/qrda-export/helper/code_system_helper.rb +0 -77
  83. data/lib/qrda-export/helper/date_helper.rb +0 -89
  84. data/lib/qrda-import/base-importers/demographics_importer.rb +0 -49
  85. data/lib/qrda-import/base-importers/medication_importer.rb +0 -23
  86. data/lib/qrda-import/base-importers/section_importer.rb +0 -203
  87. data/lib/qrda-import/cda_identifier.rb +0 -19
  88. data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +0 -24
  89. data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +0 -22
  90. data/lib/qrda-import/data-element-importers/assessment_performed_importer.rb +0 -26
  91. data/lib/qrda-import/data-element-importers/communication_from_patient_to_provider_importer.rb +0 -20
  92. data/lib/qrda-import/data-element-importers/communication_from_provider_to_patient_importer.rb +0 -20
  93. data/lib/qrda-import/data-element-importers/communication_from_provider_to_provider_importer.rb +0 -22
  94. data/lib/qrda-import/data-element-importers/device_applied_importer.rb +0 -26
  95. data/lib/qrda-import/data-element-importers/device_order_importer.rb +0 -21
  96. data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +0 -24
  97. data/lib/qrda-import/data-element-importers/diagnostic_study_order_importer.rb +0 -23
  98. data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +0 -33
  99. data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +0 -23
  100. data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +0 -42
  101. data/lib/qrda-import/data-element-importers/immunization_administered_importer.rb +0 -20
  102. data/lib/qrda-import/data-element-importers/intervention_order_importer.rb +0 -21
  103. data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +0 -25
  104. data/lib/qrda-import/data-element-importers/laboratory_test_order_importer.rb +0 -23
  105. data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +0 -31
  106. data/lib/qrda-import/data-element-importers/medication_active_importer.rb +0 -17
  107. data/lib/qrda-import/data-element-importers/medication_administered_importer.rb +0 -19
  108. data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +0 -19
  109. data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +0 -19
  110. data/lib/qrda-import/data-element-importers/medication_order_importer.rb +0 -18
  111. data/lib/qrda-import/data-element-importers/patient_characteristic_expired.rb +0 -22
  112. data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +0 -29
  113. data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +0 -29
  114. data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +0 -37
  115. data/lib/qrda-import/data-element-importers/substance_administered_importer.rb +0 -17
  116. data/lib/qrda-import/entry_finder.rb +0 -20
  117. data/lib/qrda-import/entry_package.rb +0 -16
  118. data/lib/qrda-import/narrative_reference_handler.rb +0 -33
  119. data/lib/qrda-import/patient_importer.rb +0 -111
@@ -1,31 +0,0 @@
1
- <entry>
2
- <substanceAdministration classCode="SBADM" moodCode="EVN" {{{negation_ind}}}>
3
- <!-- Medication Activity (consolidation) template -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/>
5
- <!-- Medication, Administered template -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.42" extension="2017-08-01"/>
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- <code code="416118004" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Administration"/>
9
- <statusCode code="completed"/>
10
- {{#relevantPeriod}}
11
- {{{medication_duration_effective_time}}}
12
- {{/relevantPeriod}}
13
- {{> qrda_templates/template_partials/_medication_details}}
14
- <consumable>
15
- <manufacturedProduct classCode="MANU">
16
- <!-- Medication Information (consolidation) template -->
17
- <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
18
- <id root="{{random_id}}"/>
19
- <manufacturedMaterial>
20
- {{> _codes}}
21
- </manufacturedMaterial>
22
- </manufacturedProduct>
23
- </consumable>
24
- {{#authorDatetime}}
25
- {{> qrda_templates/template_partials/_author_participation}}
26
- {{/authorDatetime}}
27
- {{#negationRationale}}
28
- {{> qrda_templates/template_partials/_reason}}
29
- {{/negationRationale}}
30
- </substanceAdministration>
31
- </entry>
@@ -1,55 +0,0 @@
1
- <entry>
2
- <act classCode="ACT" moodCode="RQO" {{{negation_ind}}}>
3
- <!-- Discharge Medication Entry -->
4
- <templateId root="2.16.840.1.113883.10.20.24.3.105" extension="2016-02-01"/>
5
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
6
- <code code="75311-1"
7
- codeSystem="2.16.840.1.113883.6.1"
8
- codeSystemName="LOINC"
9
- displayName="Discharge medications"/>
10
- <statusCode code="active"/>
11
- <entryRelationship typeCode="SUBJ">
12
- <substanceAdministration moodCode="EVN" classCode="SBADM">
13
- <!-- Medication Activity (consolidation) template -->
14
- <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/>
15
- <!-- Medication, Active template -->
16
- <templateId root="2.16.840.1.113883.10.20.24.3.41" extension="2016-02-01"/>
17
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
18
- <text>{{description}}</text>
19
- <statusCode code="active"/>
20
- {{#relevantPeriod}}
21
- {{{medication_duration_effective_time}}}
22
- {{/relevantPeriod}}
23
- {{^relevantPeriod}}
24
- {{#authorDatetime}}
25
- {{{author_effective_time}}}
26
- {{/authorDatetime}}
27
- {{/relevantPeriod}}
28
- {{#frequency}}
29
- {> qrda_templates/template_partials/_medication_frequency}}
30
- {{/frequency}}
31
- {{> qrda_templates/template_partials/_medication_details}}
32
-
33
- <consumable>
34
- <manufacturedProduct classCode="MANU">
35
- <!-- Medication Information (consolidation) template -->
36
- <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
37
- <id root="{{random_id}}"/>
38
- <manufacturedMaterial>
39
- {{> _codes}}
40
- </manufacturedMaterial>
41
- <manufacturerOrganization>
42
- <name>Medication Factory Inc.</name>
43
- </manufacturerOrganization>
44
- </manufacturedProduct>
45
- </consumable>
46
- {{#authorDatetime}}
47
- {{> qrda_templates/template_partials/_author_participation}}
48
- {{/authorDatetime}}
49
- </substanceAdministration>
50
- </entryRelationship>
51
- {{#negationRationale}}
52
- {{> qrda_templates/template_partials/_reason}}
53
- {{/negationRationale}}
54
- </act>
55
- </entry>
@@ -1,39 +0,0 @@
1
- <entry>
2
- <act classCode="ACT" moodCode="EVN" {{{negation_ind}}}>
3
- <!-- Medication Dispensed Act -->
4
- <templateId root="2.16.840.1.113883.10.20.24.3.139" extension="2017-08-01"/>
5
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
6
- <code code="SPLY" codeSystem="2.16.840.1.113883.5.6" displayName="supply" codeSystemName="ActClass"/>
7
- <entryRelationship typeCode="SUBJ">
8
- <!--Medication dispensed -->
9
- <supply classCode="SPLY" moodCode="EVN">
10
- <!-- Medication Dispensed template -->
11
- <templateId root="2.16.840.1.113883.10.20.24.3.45" extension="2017-08-01"/>
12
- <!-- Medication Dispense template -->
13
- <templateId root="2.16.840.1.113883.10.20.22.4.18" extension="2014-06-09"/>
14
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
15
- <text>{{description}}</text>
16
- <statusCode code="completed"/>
17
- {{#relevantPeriod}}
18
- {{{medication_duration_effective_time}}}
19
- {{/relevantPeriod}}
20
- <product>
21
- <manufacturedProduct classCode="MANU">
22
- <!-- Medication Information (consolidation) template -->
23
- <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
24
- <id root="{{random_id}}"/>
25
- <manufacturedMaterial>
26
- {{> _codes}}
27
- </manufacturedMaterial>
28
- </manufacturedProduct>
29
- </product>
30
- {{#authorDatetime}}
31
- {{> qrda_templates/template_partials/_author}}
32
- {{/authorDatetime}}
33
- </supply>
34
- </entryRelationship>
35
- {{#negationRationale}}
36
- {{> qrda_templates/template_partials/_reason}}
37
- {{/negationRationale}}
38
- </act>
39
- </entry>
@@ -1,38 +0,0 @@
1
- <entry>
2
- <!--Medication Order -->
3
- <substanceAdministration classCode="SBADM" moodCode="RQO" {{{negation_ind}}}>
4
- <templateId root="2.16.840.1.113883.10.20.22.4.42" extension="2014-06-09"/>
5
- <!-- Medication, Order template -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.47" extension="2017-08-01"/>
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- <text>{{description}}</text>
9
- <statusCode code="active"/>
10
- {{#relevantPeriod}}
11
- {{{medication_duration_effective_time}}}
12
- {{/relevantPeriod}}
13
- {{#negated}}
14
- <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
15
- <period nullFlavor="NA"/>
16
- </effectiveTime>
17
- {{/negated}}
18
- {{#frequency}}
19
- {{> qrda_templates/template_partials/_medication_frequency}}
20
- {{/frequency}}
21
- <consumable>
22
- <manufacturedProduct classCode="MANU">
23
- <!-- Medication Information (consolidation) template -->
24
- <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
25
- <id root="{{random_id}}"/>
26
- <manufacturedMaterial>
27
- {{> _codes}}
28
- </manufacturedMaterial>
29
- </manufacturedProduct>
30
- </consumable>
31
- {{#authorDatetime}}
32
- {{> qrda_templates/template_partials/_author}}
33
- {{/authorDatetime}}
34
- {{#negationRationale}}
35
- {{> qrda_templates/template_partials/_reason}}
36
- {{/negationRationale}}
37
- </substanceAdministration>
38
- </entry>
@@ -1,16 +0,0 @@
1
- <entry>
2
- <observation classCode="OBS" moodCode="EVN">
3
- <!-- C-CDA R2.1 Deceased Observation (V3) templateId -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.79" extension="2015-08-01" />
5
- <!-- Patient Characteristic Expired (V3) -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.54" extension="2016-02-01" />
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" />
9
- <statusCode code="completed" />
10
- <!-- QDM Attributes: Date and Time -->
11
- {{#expiredDatetime}}
12
- {{{expired_date_time}}}
13
- {{/expiredDatetime}}
14
- <value xsi:type="CD" code="419099009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Dead" />
15
- </observation>
16
- </entry>
@@ -1,25 +0,0 @@
1
- <entry>
2
- <observation classCode="OBS" moodCode="EVN" {{{negation_ind}}}>
3
- <!-- Procedure Activity Procedure (Consolidation) template -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.13" extension="2014-06-09"/>
5
- <!-- Physical Exam, Performed template -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.59" extension="2017-08-01"/>
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- {{> _codes}}
9
- <text>{{description}}</text>
10
- <statusCode code="completed"/>
11
- {{#relevantPeriod}}
12
- {{{relevant_period}}}
13
- {{/relevantPeriod}}
14
- {{{result_value}}}
15
- {{#authorDatetime}}
16
- {{> qrda_templates/template_partials/_author}}
17
- {{/authorDatetime}}
18
- {{#negationRationale}}
19
- {{> qrda_templates/template_partials/_reason}}
20
- {{/negationRationale}}
21
- {{#components}}
22
- {{> qrda_templates/template_partials/_component}}
23
- {{/components}}
24
- </observation>
25
- </entry>
@@ -1,19 +0,0 @@
1
- <entry>
2
- <procedure classCode="PROC" moodCode="RQO" {{{negation_ind}}}>
3
- <!-- Consolidated Plan of Care Activity Procedure TemplateId (Implied Template) -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.41" extension="2014-06-09"/>
5
- <!-- QRDA Procedure, Order TemplateId -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.63" extension="2017-08-01"/>
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- {{> _codes}}
9
- <text>{{description}}</text>
10
- <statusCode code="active"/>
11
- <!-- Attribute: datetime -->
12
- {{#authorDatetime}}
13
- {{> qrda_templates/template_partials/_author}}
14
- {{/authorDatetime}}
15
- {{#negationRationale}}
16
- {{> qrda_templates/template_partials/_reason}}
17
- {{/negationRationale}}
18
- </procedure>
19
- </entry>
@@ -1,44 +0,0 @@
1
- <entry>
2
- <procedure classCode="PROC" moodCode="EVN" {{{negation_ind}}}>
3
- <!-- Procedure performed template -->
4
- <templateId root="2.16.840.1.113883.10.20.24.3.64" extension="2017-08-01"/>
5
- <!-- Procedure Activity Procedure-->
6
- <templateId root="2.16.840.1.113883.10.20.22.4.14" extension="2014-06-09"/>
7
- <id root="1.3.6.1.4.1.115" extension="{{object_id}}"/>
8
- {{> _codes}}
9
- <text>{{description}}</text>
10
- <statusCode code="completed"/>
11
- {{#relevantPeriod}}
12
- {{{relevant_period}}}
13
- {{/relevantPeriod}}
14
- {{#ordinality}}
15
- {{> qrda_templates/template_partials/_ordinality}}
16
- {{/ordinality}}
17
- {{#authorDatetime}}
18
- {{> qrda_templates/template_partials/_author}}
19
- {{/authorDatetime}}
20
- {{#negationRationale}}
21
- {{> qrda_templates/template_partials/_reason}}
22
- {{/negationRationale}}
23
- {{#incisionDatetime}}
24
- <entryRelationship typeCode="REFR">
25
- <procedure classCode="PROC" moodCode="EVN">
26
- <templateId root="2.16.840.1.113883.10.20.24.3.89"/>
27
- <id root="1.3.6.1.4.1.115" extension="{{random_id}}"/>
28
- <code code="34896006"
29
- codeSystem="2.16.840.1.113883.6.96"
30
- codeSystemName="SNOMED CT"
31
- displayName="incision"/>
32
- {{{incision_datetime}}}
33
- </procedure>
34
- </entryRelationship>
35
- {{/incisionDatetime}}
36
- {{#result}}
37
- {{> qrda_templates/template_partials/_results}}
38
- {{/result}}
39
- {{#components}}
40
- {{> qrda_templates/template_partials/_component}}
41
- {{/components}}
42
- </procedure>
43
- </entry>
44
-
@@ -1,6 +0,0 @@
1
- <participant typeCode="LOC">
2
- <participantRole classCode="SDLOC">
3
- <templateId root="2.16.840.1.113883.10.20.24.3.151" extension="2017-08-01"/>
4
- <code {{> _code}}/>
5
- </participantRole>
6
- </participant>
@@ -1,7 +0,0 @@
1
- <author>
2
- <templateId root="2.16.840.1.113883.10.20.24.3.155" extension="2017-08-01"/>
3
- {{{author_time}}}
4
- <assignedAuthor>
5
- <id nullFlavor="NA"/>
6
- </assignedAuthor>
7
- </author>
@@ -1,7 +0,0 @@
1
- <author>
2
- <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
3
- {{{author_time}}}
4
- <assignedAuthor>
5
- <id nullFlavor="NA"/>
6
- </assignedAuthor>
7
- </author>
@@ -1,11 +0,0 @@
1
- <entryRelationship typeCode="REFR">
2
- <observation classCode="OBS" moodCode="EVN">
3
- <!-- Component -->
4
- <templateId root="2.16.840.1.113883.10.20.24.3.149" extension="2017-08-01" />
5
- <id root="{{random_id}}"/>
6
- {{#code}}
7
- <code {{> _code}}/>
8
- {{/code}}
9
- {{{result_value}}}
10
- </observation>
11
- </entryRelationship>
@@ -1,19 +0,0 @@
1
- <entryRelationship typeCode="REFR">
2
- <act classCode="ACT" moodCode="EVN">
3
- <templateId extension="2015-08-01" root="2.16.840.1.113883.10.20.22.4.80"/>
4
- <code code="29308-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Diagnosis"/>
5
- <entryRelationship typeCode="SUBJ">
6
- <observation classCode="OBS" moodCode="EVN">
7
- <!-- Problem observation template -->
8
- <templateId extension="2015-08-01" root="2.16.840.1.113883.10.20.22.4.4"/>
9
- <id root="{{random_id}}"/>
10
- <code code="29308-4" codeSystem="2.16.840.1.113883.6.1">
11
- <translation code="282291009" codeSystem="2.16.840.1.113883.6.96"/>
12
- </code>
13
- <statusCode code="completed"/>
14
- {{{relevant_period}}}
15
- <value {{> _code}} xsi:type="CD"/>
16
- </observation>
17
- </entryRelationship>
18
- </act>
19
- </entryRelationship>
@@ -1,16 +0,0 @@
1
- <participant typeCode="LOC">
2
- <!-- Facility Location template -->
3
- <templateId extension="2017-08-01" root="2.16.840.1.113883.10.20.24.3.100"/>
4
- <time>
5
- {{{facility_period}}}
6
- </time>
7
- <participantRole classCode="SDLOC">
8
- {{#code}}
9
- <code {{> _code}}/>
10
- {{/code}}
11
- <telecom nullFlavor="UNK"/>
12
- <playingEntity classCode="PLC">
13
- <name/>
14
- </playingEntity>
15
- </participantRole>
16
- </participant>
@@ -1,3 +0,0 @@
1
- <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
2
- <period value="1" unit="d"/>
3
- </effectiveTime>
@@ -1,11 +0,0 @@
1
- {{#route}}
2
- <routeCode {{> _code}}/>
3
- {{/route}}
4
- {{#negated}}
5
- <doseQuantity nullFlavor="NA"/>
6
- {{/negated}}
7
- {{^negated}}
8
- {{#dosage}}
9
- <doseQuantity value="{{value_as_float}}"/>
10
- {{/dosage}}
11
- {{/negated}}
@@ -1,8 +0,0 @@
1
- <entryRelationship typeCode="REFR">
2
- <observation classCode="OBS" moodCode="EVN">
3
- <templateId root="2.16.840.1.113883.10.20.24.3.152" extension="2017-08-01"/>
4
- <id root="{{random_id}}"/>
5
- <code code="8319008" codeSystem="2.16.840.1.113883.6.96" displayName="Principal Diagnosis" codeSystemName="SNOMED"/>
6
- <value {{> _code}} xsi:type="CD"/>
7
- </observation>
8
- </entryRelationship>
@@ -1,12 +0,0 @@
1
- <entryRelationship typeCode="RSON">
2
- <observation classCode="OBS" moodCode="EVN">
3
- <templateId root="2.16.840.1.113883.10.20.24.3.88" extension="2017-08-01"/>
4
- <id root="1.3.6.1.4.1.115" extension="{{random_id}}" />
5
- <code code="77301-0" codeSystem="2.16.840.1.113883.6.1" displayName="reason" codeSystemName="LOINC"/>
6
- <statusCode code="completed"/>
7
- {{#relevantPeriod}}
8
- {{{relevant_period}}}
9
- {{/relevantPeriod}}
10
- <value {{> _code}} xsi:type="CD"/>
11
- </observation>
12
- </entryRelationship>
@@ -1,6 +0,0 @@
1
- <sdtc:inFulfillmentOf1 typeCode="FLFS">
2
- <sdtc:templateId root="2.16.840.1.113883.10.20.24.3.150" extension="2017-08-01"/>
3
- <sdtc:actReference classCode="ACT" moodCode="EVN">
4
- <sdtc:id root="1.3.6.1.4.1.115" extension="{{{as_id}}}"/>
5
- </sdtc:actReference>
6
- </sdtc:inFulfillmentOf1>
@@ -1,19 +0,0 @@
1
- <entryRelationship typeCode="REFR">
2
- <observation classCode="OBS" moodCode="EVN">
3
- <!-- Conforms to C-CDA R2 Result Observation (V2) -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.2" extension="2015-08-01"/>
5
- <id root="1.3.6.1.4.1.115" extension="{{random_id}}"/>
6
- {{> _codes}}
7
- <statusCode code="completed"/>
8
- {{#relevantPeriod}}
9
- {{{relevant_period_as_value}}}
10
- {{/relevantPeriod}}
11
- {{^relevantPeriod}}
12
- {{#authorDatetime}}
13
- {{{author_effective_time}}}
14
- {{/authorDatetime}}
15
- {{/relevantPeriod}}
16
- {{{result_value}}}
17
- </observation>
18
- </entryRelationship>
19
-
@@ -1,8 +0,0 @@
1
- <entryRelationship typeCode="REFR">
2
- <observation classCode="OBS" moodCode="EVN">
3
- <templateId root="2.16.840.1.113883.10.20.22.4.8" extension="2014-06-09" />
4
- <code code="SEV" codeSystem="2.16.840.1.113883.5.4" />
5
- <statusCode code="completed" />
6
- <value xsi:type="CD" {{> _code}}/>
7
- </observation>
8
- </entryRelationship>
@@ -1,150 +0,0 @@
1
- module Qrda
2
- module Export
3
- module Helper
4
- module Cat1ViewHelper
5
- def random_id
6
- UUID.generate
7
- end
8
-
9
- def as_id
10
- self[:value]
11
- end
12
-
13
- def object_id
14
- self[:_id]
15
- end
16
-
17
- def submission_program
18
- @submission_program
19
- end
20
-
21
- def provider
22
- JSON.parse(@provider.to_json) if @provider
23
- end
24
-
25
- def provider_addresses
26
- @provider['addresses']
27
- end
28
-
29
- def provider_street
30
- self['street'].join('')
31
- end
32
-
33
- def provider_npi
34
- @provider['cda_identifiers'].map { |cda| cda['extension'] if cda['root'] == '2.16.840.1.113883.4.6' }.compact.first
35
- end
36
-
37
- def provider_tin
38
- @provider['cda_identifiers'].map { |cda| cda['extension'] if cda['root'] == '2.16.840.1.113883.4.2' }.compact.first
39
- end
40
-
41
- def provider_ccn
42
- @provider['cda_identifiers'].map { |cda| cda['extension'] if cda['root'] == '2.16.840.1.113883.4.336' }.compact.first
43
- end
44
-
45
- def provider_type_code
46
- @provider['specialty']
47
- end
48
-
49
- def mrn
50
- @patient.extendedData['medical_record_number']
51
- end
52
-
53
- def given_name
54
- @patient.givenNames.join(' ')
55
- end
56
-
57
- def family_name
58
- @patient.familyName
59
- end
60
-
61
- def birthdate
62
- @patient.birthDatetime.to_formatted_s(:number)
63
- end
64
-
65
- def gender
66
- @patient.dataElements.where(hqmfOid: '2.16.840.1.113883.10.20.28.3.55').first.dataElementCodes.first['code']
67
- end
68
-
69
- def race
70
- @patient.dataElements.where(hqmfOid: '2.16.840.1.113883.10.20.28.3.59').first.dataElementCodes.first['code']
71
- end
72
-
73
- def ethnic_group
74
- @patient.dataElements.where(hqmfOid: '2.16.840.1.113883.10.20.28.3.56').first.dataElementCodes.first['code']
75
- end
76
-
77
- def insurance_provider
78
- @insurance_provider
79
- end
80
-
81
- def insurance_provider_code_and_code_system
82
- "code=\"#{self['codes'].values.first[0]}\" codeSystem=\"#{code_system_oid(self['codes'].keys.first)}\" codeSystemName=\"#{self['codes'].keys.first}\""
83
- end
84
-
85
- def measures
86
- @measures.only(:hqmf_id, :hqmf_set_id, :description).as_json
87
- end
88
-
89
- def negation_ind
90
- self[:negationRationale].nil? ? "" : "negationInd=\"true\""
91
- end
92
-
93
- def negated
94
- self[:negationRationale].nil? ? false : true
95
- end
96
-
97
- def multiple_codes?
98
- self[:dataElementCodes].size > 1
99
- end
100
-
101
- def code_system_oid(name)
102
- Qrda::Export::Helper::CodeSystemHelper.oid_for_code_system(name)
103
- end
104
-
105
- def code_and_codesystem
106
- if self['codeSystem'] == 'NA_VALUESET'
107
- "nullFlavor=\"NA\" sdtc:valueSet=\"#{self['code']}\""
108
- else
109
- "code=\"#{self['code']}\" codeSystem=\"#{code_system_oid(self['codeSystem'])}\" codeSystemName=\"#{self['codeSystem']}\""
110
- end
111
- end
112
-
113
- def primary_code_and_codesystem
114
- "code=\"#{self[:dataElementCodes][0]['code']}\" codeSystem=\"#{code_system_oid(self[:dataElementCodes][0]['codeSystem'])}\" codeSystemName=\"#{self[:dataElementCodes][0]['codeSystem']}\""
115
- end
116
-
117
- def translation_codes_and_codesystem_list
118
- translation_list = ""
119
- self[:dataElementCodes].each_with_index do |_dec, index|
120
- next if index.zero?
121
- translation_list += "<translation code=\"#{self[:dataElementCodes][index]['code']}\" codeSystem=\"#{code_system_oid(self[:dataElementCodes][index]['codeSystem'])}\" codeSystemName=\"#{self[:dataElementCodes][index]['codeSystem']}\"/>"
122
- end
123
- translation_list
124
- end
125
-
126
- def value_as_float
127
- self['value'].to_f
128
- end
129
-
130
- def result_value
131
- return "<value xsi:type=\"CD\" nullFlavor=\"UNK\"/>" unless self['result']
132
- result_string = if self['result'].is_a? Array
133
- result_value_as_string(self['result'][0])
134
- elsif self['result'].is_a? Hash
135
- result_value_as_string(self['result'])
136
- elsif !self['result'].nil?
137
- "<value xsi:type=\"PQ\" value=\"#{self['result']}\" unit=\"1\"/>"
138
- end
139
- result_string
140
- end
141
-
142
- def result_value_as_string(result)
143
- return "<value xsi:type=\"CD\" nullFlavor=\"UNK\"/>" unless result
144
- return "<value xsi:type=\"CD\" code=\"#{result['code']}\" codeSystem=\"#{code_system_oid(result['codeSystem'])}\" codeSystemName=\"#{result['codeSystem']}\"/>" if result['code']
145
- return "<value xsi:type=\"PQ\" value=\"#{result['value']}\" unit=\"#{result['unit']}\"/>" if result['unit']
146
- end
147
- end
148
- end
149
- end
150
- end