cqm-reports 1.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +33 -0
  3. data/README.md +27 -0
  4. data/Rakefile +16 -0
  5. data/lib/cqm_report.rb +77 -0
  6. data/lib/ext/code.rb +11 -0
  7. data/lib/ext/data_element.rb +24 -0
  8. data/lib/html-export/qdm-patient/_header_css.mustache +61 -0
  9. data/lib/html-export/qdm-patient/_javascript.mustache +52 -0
  10. data/lib/html-export/qdm-patient/data_element/_data_element.mustache +4 -0
  11. data/lib/html-export/qdm-patient/data_element/_data_element_codes.mustache +9 -0
  12. data/lib/html-export/qdm-patient/data_element/_data_element_other_fields.mustache +106 -0
  13. data/lib/html-export/qdm-patient/data_element/_data_element_times.mustache +44 -0
  14. data/lib/html-export/qdm-patient/qdm_patient.mustache +73 -0
  15. data/lib/html-export/qdm-patient/qdm_patient.rb +47 -0
  16. data/lib/qrda-export/catI-r5/_code.mustache +1 -0
  17. data/lib/qrda-export/catI-r5/_codes.mustache +10 -0
  18. data/lib/qrda-export/catI-r5/_header.mustache +28 -0
  19. data/lib/qrda-export/catI-r5/_measure_section.mustache +59 -0
  20. data/lib/qrda-export/catI-r5/_reporting_period.mustache +23 -0
  21. data/lib/qrda-export/catI-r5/qrda1_r5.mustache +209 -0
  22. data/lib/qrda-export/catI-r5/qrda1_r5.rb +220 -0
  23. data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +26 -0
  24. data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +43 -0
  25. data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +88 -0
  26. data/lib/qrda-export/catI-r5/qrda_header/_information_recipient.mustache +7 -0
  27. data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +25 -0
  28. data/lib/qrda-export/catI-r5/qrda_header/_participant.mustache +7 -0
  29. data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +44 -0
  30. data/lib/qrda-export/catI-r5/qrda_templates/adverse_event.mustache +40 -0
  31. data/lib/qrda-export/catI-r5/qrda_templates/allergy_intolerance.mustache +42 -0
  32. data/lib/qrda-export/catI-r5/qrda_templates/assessment_order.mustache +25 -0
  33. data/lib/qrda-export/catI-r5/qrda_templates/assessment_performed.mustache +38 -0
  34. data/lib/qrda-export/catI-r5/qrda_templates/assessment_recommended.mustache +25 -0
  35. data/lib/qrda-export/catI-r5/qrda_templates/communication_performed.mustache +62 -0
  36. data/lib/qrda-export/catI-r5/qrda_templates/device_applied.mustache +41 -0
  37. data/lib/qrda-export/catI-r5/qrda_templates/device_order.mustache +38 -0
  38. data/lib/qrda-export/catI-r5/qrda_templates/device_recommended.mustache +37 -0
  39. data/lib/qrda-export/catI-r5/qrda_templates/diagnosis.mustache +55 -0
  40. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_order.mustache +25 -0
  41. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache +50 -0
  42. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_recommended.mustache +21 -0
  43. data/lib/qrda-export/catI-r5/qrda_templates/encounter_order.mustache +35 -0
  44. data/lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache +52 -0
  45. data/lib/qrda-export/catI-r5/qrda_templates/encounter_recommended.mustache +37 -0
  46. data/lib/qrda-export/catI-r5/qrda_templates/family_history.mustache +37 -0
  47. data/lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache +35 -0
  48. data/lib/qrda-export/catI-r5/qrda_templates/immunization_order.mustache +46 -0
  49. data/lib/qrda-export/catI-r5/qrda_templates/intervention_order.mustache +24 -0
  50. data/lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache +36 -0
  51. data/lib/qrda-export/catI-r5/qrda_templates/intervention_recommended.mustache +25 -0
  52. data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_order.mustache +24 -0
  53. data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_performed.mustache +42 -0
  54. data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_recommended.mustache +25 -0
  55. data/lib/qrda-export/catI-r5/qrda_templates/medication_active.mustache +32 -0
  56. data/lib/qrda-export/catI-r5/qrda_templates/medication_administered.mustache +39 -0
  57. data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +63 -0
  58. data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +70 -0
  59. data/lib/qrda-export/catI-r5/qrda_templates/medication_order.mustache +64 -0
  60. data/lib/qrda-export/catI-r5/qrda_templates/patient_care_experience.mustache +14 -0
  61. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_clinical_trial_participant.mustache +18 -0
  62. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_expired.mustache +32 -0
  63. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_payer.mustache +14 -0
  64. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_order.mustache +30 -0
  65. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_performed.mustache +45 -0
  66. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_recommended.mustache +30 -0
  67. data/lib/qrda-export/catI-r5/qrda_templates/procedure_order.mustache +32 -0
  68. data/lib/qrda-export/catI-r5/qrda_templates/procedure_performed.mustache +64 -0
  69. data/lib/qrda-export/catI-r5/qrda_templates/procedure_recommended.mustache +34 -0
  70. data/lib/qrda-export/catI-r5/qrda_templates/provider_care_experience.mustache +15 -0
  71. data/lib/qrda-export/catI-r5/qrda_templates/provider_characteristic.mustache +15 -0
  72. data/lib/qrda-export/catI-r5/qrda_templates/substance_recommended.mustache +35 -0
  73. data/lib/qrda-export/catI-r5/qrda_templates/symptom.mustache +48 -0
  74. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_admission_source.mustache +6 -0
  75. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_anatomical_location_site.mustache +1 -0
  76. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author.mustache +29 -0
  77. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author_participation.mustache +8 -0
  78. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_component.mustache +13 -0
  79. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_data_element_codes_as_values.mustache +10 -0
  80. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_days_supplied.mustache +6 -0
  81. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_diagnosis.mustache +21 -0
  82. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_facility_location.mustache +24 -0
  83. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_immunization_details.mustache +14 -0
  84. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_details.mustache +36 -0
  85. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_supply_request.mustache +17 -0
  86. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_method.mustache +1 -0
  87. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_ordinality.mustache +1 -0
  88. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_principal_diagnosis.mustache +8 -0
  89. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reaction_observation.mustache +9 -0
  90. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reason.mustache +12 -0
  91. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_related_to.mustache +6 -0
  92. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_results.mustache +24 -0
  93. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_severity.mustache +8 -0
  94. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_status.mustache +8 -0
  95. data/lib/qrda-export/catIII-r2-1/_continuous_variable_value.mustache +17 -0
  96. data/lib/qrda-export/catIII-r2-1/_header.mustache +25 -0
  97. data/lib/qrda-export/catIII-r2-1/_measure_data.mustache +41 -0
  98. data/lib/qrda-export/catIII-r2-1/_measure_section.mustache +74 -0
  99. data/lib/qrda-export/catIII-r2-1/_reporting_period.mustache +23 -0
  100. data/lib/qrda-export/catIII-r2-1/_stratification.mustache +29 -0
  101. data/lib/qrda-export/catIII-r2-1/_supplemental_data.mustache +28 -0
  102. data/lib/qrda-export/catIII-r2-1/qrda3_r21.mustache +11 -0
  103. data/lib/qrda-export/catIII-r2-1/qrda3_r21.rb +127 -0
  104. data/lib/qrda-export/catIII-r2-1/qrda_header/_author.mustache +25 -0
  105. data/lib/qrda-export/catIII-r2-1/qrda_header/_custodian.mustache +17 -0
  106. data/lib/qrda-export/catIII-r2-1/qrda_header/_documentation_of_service_event.mustache +88 -0
  107. data/lib/qrda-export/catIII-r2-1/qrda_header/_legal_authenticator.mustache +25 -0
  108. data/lib/qrda-export/helper/aggregate_object_helper.rb +154 -0
  109. data/lib/qrda-export/helper/cat1_view_helper.rb +81 -0
  110. data/lib/qrda-export/helper/date_helper.rb +108 -0
  111. data/lib/qrda-export/helper/frequency_helper.rb +83 -0
  112. data/lib/qrda-export/helper/patient_view_helper.rb +46 -0
  113. data/lib/qrda-export/helper/view_helper.rb +28 -0
  114. data/lib/qrda-import/base-importers/demographics_importer.rb +38 -0
  115. data/lib/qrda-import/base-importers/section_importer.rb +237 -0
  116. data/lib/qrda-import/cda_identifier.rb +20 -0
  117. data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +26 -0
  118. data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +24 -0
  119. data/lib/qrda-import/data-element-importers/assessment_order_importer.rb +19 -0
  120. data/lib/qrda-import/data-element-importers/assessment_performed_importer.rb +24 -0
  121. data/lib/qrda-import/data-element-importers/assessment_recommended_importer.rb +19 -0
  122. data/lib/qrda-import/data-element-importers/communication_performed_importer.rb +30 -0
  123. data/lib/qrda-import/data-element-importers/device_applied_importer.rb +22 -0
  124. data/lib/qrda-import/data-element-importers/device_order_importer.rb +19 -0
  125. data/lib/qrda-import/data-element-importers/device_recommended_importer.rb +19 -0
  126. data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +24 -0
  127. data/lib/qrda-import/data-element-importers/diagnostic_study_order_importer.rb +19 -0
  128. data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +32 -0
  129. data/lib/qrda-import/data-element-importers/diagnostic_study_recommended_importer.rb +19 -0
  130. data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +21 -0
  131. data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +46 -0
  132. data/lib/qrda-import/data-element-importers/encounter_recommended_importer.rb +21 -0
  133. data/lib/qrda-import/data-element-importers/family_history_importer.rb +21 -0
  134. data/lib/qrda-import/data-element-importers/immunization_administered_importer.rb +23 -0
  135. data/lib/qrda-import/data-element-importers/immunization_order_importer.rb +27 -0
  136. data/lib/qrda-import/data-element-importers/intervention_order_importer.rb +19 -0
  137. data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +23 -0
  138. data/lib/qrda-import/data-element-importers/intervention_recommended_importer.rb +19 -0
  139. data/lib/qrda-import/data-element-importers/laboratory_test_order_importer.rb +19 -0
  140. data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +29 -0
  141. data/lib/qrda-import/data-element-importers/laboratory_test_recommended_importer.rb +19 -0
  142. data/lib/qrda-import/data-element-importers/medication_active_importer.rb +25 -0
  143. data/lib/qrda-import/data-element-importers/medication_administered_importer.rb +26 -0
  144. data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +32 -0
  145. data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +37 -0
  146. data/lib/qrda-import/data-element-importers/medication_order_importer.rb +36 -0
  147. data/lib/qrda-import/data-element-importers/patient_care_experience_importer.rb +19 -0
  148. data/lib/qrda-import/data-element-importers/patient_characteristic_clinical_trial_participant_importer.rb +19 -0
  149. data/lib/qrda-import/data-element-importers/patient_characteristic_expired_importer.rb +22 -0
  150. data/lib/qrda-import/data-element-importers/patient_characteristic_payer_importer.rb +19 -0
  151. data/lib/qrda-import/data-element-importers/physical_exam_order_importer.rb +21 -0
  152. data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +27 -0
  153. data/lib/qrda-import/data-element-importers/physical_exam_recommended_importer.rb +21 -0
  154. data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +23 -0
  155. data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +33 -0
  156. data/lib/qrda-import/data-element-importers/procedure_recommended_importer.rb +23 -0
  157. data/lib/qrda-import/data-element-importers/provider_care_experience_importer.rb +19 -0
  158. data/lib/qrda-import/data-element-importers/provider_characteristic_importer.rb +19 -0
  159. data/lib/qrda-import/data-element-importers/substance_administered_importer.rb +27 -0
  160. data/lib/qrda-import/data-element-importers/substance_order_importer.rb +29 -0
  161. data/lib/qrda-import/data-element-importers/substance_recommended_importer.rb +27 -0
  162. data/lib/qrda-import/data-element-importers/symptom_importer.rb +21 -0
  163. data/lib/qrda-import/entry_finder.rb +20 -0
  164. data/lib/qrda-import/entry_package.rb +16 -0
  165. data/lib/qrda-import/narrative_reference_handler.rb +33 -0
  166. data/lib/qrda-import/patient_importer.rb +128 -0
  167. data/lib/util/code_system_helper.rb +77 -0
  168. data/lib/util/hqmf_template_helper.rb +52 -0
  169. data/lib/util/hqmf_template_oid_map.json +654 -0
  170. data/lib/util/hqmfr2_template_oid_map.json +378 -0
  171. data/lib/util/hqmfr2cql_template_oid_map.json +390 -0
  172. data/lib/util/qrda_template_helper.rb +20 -0
  173. data/lib/util/qrdar5_1_template_oid_map.json +406 -0
  174. data/lib/util/qrdar5_template_oid_map.json +406 -0
  175. metadata +344 -0
@@ -0,0 +1,59 @@
1
+ <component>
2
+ <section>
3
+ <!--
4
+ *****************************************************************
5
+ Measure Section
6
+ *****************************************************************
7
+ -->
8
+ <!-- This is the templateId for Measure Section -->
9
+ <templateId root="2.16.840.1.113883.10.20.24.2.2"/>
10
+ <!-- This is the templateId for Measure Section QDM -->
11
+ <templateId root="2.16.840.1.113883.10.20.24.2.3"/>
12
+ <!-- This is the LOINC code for "Measure document". This stays the same for all measure section required by QRDA standard -->
13
+ <code code="55186-1" codeSystem="2.16.840.1.113883.6.1"/>
14
+ <title>Measure Section</title>
15
+ <text>
16
+ <table border="1" width="100%">
17
+ <thead>
18
+ <tr>
19
+ <th>eMeasure Title</th>
20
+ <th>Version specific identifier</th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ {{#measures}}
25
+ <tr>
26
+ <td>{{description}}</td>
27
+ <td>{{hqmf_id}}</td>
28
+ <td/>
29
+ </tr>
30
+ {{/measures}}
31
+ </tbody>
32
+ </table>
33
+ </text>
34
+ <!-- 1..* Organizers, each containing a reference to an eMeasure -->
35
+ {{#measures}}
36
+ <entry>
37
+ <organizer classCode="CLUSTER" moodCode="EVN">
38
+ <!-- This is the templateId for Measure Reference -->
39
+ <templateId root="2.16.840.1.113883.10.20.24.3.98"/>
40
+ <!-- This is the templateId for eMeasure Reference QDM -->
41
+ <templateId root="2.16.840.1.113883.10.20.24.3.97"/>
42
+ <id extension="{{random_id}}" root="1.3.6.1.4.1.115"/>
43
+ <statusCode code="completed"/>
44
+ <!-- Containing isBranch external references -->
45
+ <reference typeCode="REFR">
46
+ <externalDocument classCode="DOC" moodCode="EVN">
47
+ <!-- SHALL: This is the version specific identifier for eMeasure: QualityMeasureDocument/id it is a GUID-->
48
+ <id extension="{{hqmf_id}}" root="2.16.840.1.113883.4.738"/>
49
+ <!-- SHOULD This is the title of the eMeasure -->
50
+ <text>{{description}}</text>
51
+ <!-- SHOULD: setId is the eMeasure version neutral id -->
52
+ <setId root="{{hqmf_set_id}}"/>
53
+ </externalDocument>
54
+ </reference>
55
+ </organizer>
56
+ </entry>
57
+ {{/measures}}
58
+ </section>
59
+ </component>
@@ -0,0 +1,23 @@
1
+ <component>
2
+ <section>
3
+ <!-- This is the templateId for Reporting Parameters section -->
4
+ <templateId root="2.16.840.1.113883.10.20.17.2.1"/>
5
+ <templateId extension="2016-03-01" root="2.16.840.1.113883.10.20.17.2.1.1"/>
6
+ <code code="55187-9" codeSystem="2.16.840.1.113883.6.1"/>
7
+ <title>Reporting Parameters</title>
8
+ <text></text>
9
+ <entry typeCode="DRIV">
10
+ <act classCode="ACT" moodCode="EVN">
11
+ <!-- This is the templateId for Reporting Parameteres Act -->
12
+ <templateId root="2.16.840.1.113883.10.20.17.3.8"/>
13
+ <templateId extension="2016-03-01" root="2.16.840.1.113883.10.20.17.3.8.1"/>
14
+ <id extension="{{random_id}}" root="1.3.6.1.4.1.115"/>
15
+ <code code="252116004" codeSystem="2.16.840.1.113883.6.96" displayName="Observation Parameters"/>
16
+ <effectiveTime>
17
+ <low value="{{{performance_period_start}}}"/>
18
+ <high value="{{{performance_period_end}}}"/>
19
+ </effectiveTime>
20
+ </act>
21
+ </entry>
22
+ </section>
23
+ </component>
@@ -0,0 +1,209 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:sdtc="urn:hl7-org:sdtc">
3
+
4
+ {{> _header}}
5
+
6
+ <component>
7
+ <structuredBody>
8
+ {{> _measure_section}}
9
+ {{> _reporting_period}}
10
+ <component>
11
+ <section>
12
+ <!-- This is the templateId for Patient Data section -->
13
+ <templateId root="2.16.840.1.113883.10.20.17.2.4"/>
14
+ <!-- This is the templateId for Patient Data QDM section -->
15
+ <templateId extension="2017-08-01" root="2.16.840.1.113883.10.20.24.2.1"/>
16
+ <templateId extension="2018-02-01" root="2.16.840.1.113883.10.20.24.2.1.1"/>
17
+ <code code="55188-7" codeSystem="2.16.840.1.113883.6.1"/>
18
+ <title>Patient Data</title>
19
+ <text/>
20
+
21
+ {{#adverse_event}}
22
+ {{> qrda_templates/adverse_event}}
23
+ {{/adverse_event}}
24
+
25
+ {{#allergy_intolerance}}
26
+ {{> qrda_templates/allergy_intolerance}}
27
+ {{/allergy_intolerance}}
28
+
29
+ {{#assessment_order}}
30
+ {{> qrda_templates/assessment_order}}
31
+ {{/assessment_order}}
32
+
33
+ {{#assessment_performed}}
34
+ {{> qrda_templates/assessment_performed}}
35
+ {{/assessment_performed}}
36
+
37
+ {{#assessment_recommended}}
38
+ {{> qrda_templates/assessment_recommended}}
39
+ {{/assessment_recommended}}
40
+
41
+ {{#communication_performed}}
42
+ {{> qrda_templates/communication_performed}}
43
+ {{/communication_performed}}
44
+
45
+ {{#diagnosis}}
46
+ {{> qrda_templates/diagnosis}}
47
+ {{/diagnosis}}
48
+
49
+ {{#device_applied}}
50
+ {{> qrda_templates/device_applied}}
51
+ {{/device_applied}}
52
+
53
+ {{#device_order}}
54
+ {{> qrda_templates/device_order}}
55
+ {{/device_order}}
56
+
57
+ {{#device_recommended}}
58
+ {{> qrda_templates/device_recommended}}
59
+ {{/device_recommended}}
60
+
61
+ {{#diagnostic_study_order}}
62
+ {{> qrda_templates/diagnostic_study_order}}
63
+ {{/diagnostic_study_order}}
64
+
65
+ {{#diagnostic_study_performed}}
66
+ {{> qrda_templates/diagnostic_study_performed}}
67
+ {{/diagnostic_study_performed}}
68
+
69
+ {{#diagnostic_study_recommended}}
70
+ {{> qrda_templates/diagnostic_study_recommended}}
71
+ {{/diagnostic_study_recommended}}
72
+
73
+ {{#encounter_order}}
74
+ {{> qrda_templates/encounter_order}}
75
+ {{/encounter_order}}
76
+
77
+ {{#encounter_performed}}
78
+ {{> qrda_templates/encounter_performed}}
79
+ {{/encounter_performed}}
80
+
81
+ {{#encounter_recommended}}
82
+ {{> qrda_templates/encounter_recommended}}
83
+ {{/encounter_recommended}}
84
+
85
+ {{#family_history}}
86
+ {{> qrda_templates/family_history}}
87
+ {{/family_history}}
88
+
89
+ {{#immunization_administered}}
90
+ {{> qrda_templates/immunization_administered}}
91
+ {{/immunization_administered}}
92
+
93
+ {{#immunization_order}}
94
+ {{> qrda_templates/immunization_order}}
95
+ {{/immunization_order}}
96
+
97
+ {{#intervention_order}}
98
+ {{> qrda_templates/intervention_order}}
99
+ {{/intervention_order}}
100
+
101
+ {{#intervention_performed}}
102
+ {{> qrda_templates/intervention_performed}}
103
+ {{/intervention_performed}}
104
+
105
+ {{#intervention_recommended}}
106
+ {{> qrda_templates/intervention_recommended}}
107
+ {{/intervention_recommended}}
108
+
109
+ {{#laboratory_test_order}}
110
+ {{> qrda_templates/laboratory_test_order}}
111
+ {{/laboratory_test_order}}
112
+
113
+ {{#laboratory_test_performed}}
114
+ {{> qrda_templates/laboratory_test_performed}}
115
+ {{/laboratory_test_performed}}
116
+
117
+ {{#laboratory_test_recommended}}
118
+ {{> qrda_templates/laboratory_test_recommended}}
119
+ {{/laboratory_test_recommended}}
120
+
121
+ {{#medication_active}}
122
+ {{> qrda_templates/medication_active}}
123
+ {{/medication_active}}
124
+
125
+ {{#medication_administered}}
126
+ {{> qrda_templates/medication_administered}}
127
+ {{/medication_administered}}
128
+
129
+ {{#medication_discharge}}
130
+ {{> qrda_templates/medication_discharge}}
131
+ {{/medication_discharge}}
132
+
133
+ {{#medication_dispensed}}
134
+ {{> qrda_templates/medication_dispensed}}
135
+ {{/medication_dispensed}}
136
+
137
+ {{#medication_order}}
138
+ {{> qrda_templates/medication_order}}
139
+ {{/medication_order}}
140
+
141
+ {{#patient_care_experience}}
142
+ {{> qrda_templates/patient_care_experience}}
143
+ {{/patient_care_experience}}
144
+
145
+ {{#patient_characteristic_clinical_trial_participant}}
146
+ {{> qrda_templates/patient_characteristic_clinical_trial_participant}}
147
+ {{/patient_characteristic_clinical_trial_participant}}
148
+
149
+ {{#patient_characteristic_expired}}
150
+ {{> qrda_templates/patient_characteristic_expired}}
151
+ {{/patient_characteristic_expired}}
152
+
153
+ {{#physical_exam_order}}
154
+ {{> qrda_templates/physical_exam_order}}
155
+ {{/physical_exam_order}}
156
+
157
+ {{#physical_exam_performed}}
158
+ {{> qrda_templates/physical_exam_performed}}
159
+ {{/physical_exam_performed}}
160
+
161
+ {{#physical_exam_recommended}}
162
+ {{> qrda_templates/physical_exam_recommended}}
163
+ {{/physical_exam_recommended}}
164
+
165
+ {{#procedure_order}}
166
+ {{> qrda_templates/procedure_order}}
167
+ {{/procedure_order}}
168
+
169
+ {{#procedure_performed}}
170
+ {{> qrda_templates/procedure_performed}}
171
+ {{/procedure_performed}}
172
+
173
+ {{#procedure_recommended}}
174
+ {{> qrda_templates/procedure_recommended}}
175
+ {{/procedure_recommended}}
176
+
177
+ {{#provider_care_experience}}
178
+ {{> qrda_templates/provider_care_experience}}
179
+ {{/provider_care_experience}}
180
+
181
+ {{#provider_characteristic}}
182
+ {{> qrda_templates/provider_characteristic}}
183
+ {{/provider_characteristic}}
184
+
185
+ {{#substance_administered}}
186
+ {{> qrda_templates/medication_administered}}
187
+ {{/substance_administered}}
188
+
189
+ {{#substance_order}}
190
+ {{> qrda_templates/medication_order}}
191
+ {{/substance_order}}
192
+
193
+ {{#substance_recommended}}
194
+ {{> qrda_templates/substance_recommended}}
195
+ {{/substance_recommended}}
196
+
197
+ {{#symptom}}
198
+ {{> qrda_templates/symptom}}
199
+ {{/symptom}}
200
+
201
+ {{#patient_characteristic_payer}}
202
+ {{> qrda_templates/patient_characteristic_payer}}
203
+ {{/patient_characteristic_payer}}
204
+
205
+ </section>
206
+ </component>
207
+ </structuredBody>
208
+ </component>
209
+ </ClinicalDocument>
@@ -0,0 +1,220 @@
1
+ require 'mustache'
2
+ class Qrda1R5 < Mustache
3
+ include Qrda::Export::Helper::DateHelper
4
+ include Qrda::Export::Helper::ViewHelper
5
+ include Qrda::Export::Helper::Cat1ViewHelper
6
+ include Qrda::Export::Helper::PatientViewHelper
7
+ include Qrda::Export::Helper::FrequencyHelper
8
+
9
+ self.template_path = __dir__
10
+
11
+ def initialize(patient, measures, options = {})
12
+ @patient = patient
13
+ @qdmPatient = patient.qdmPatient
14
+ @measures = measures
15
+ @provider = options[:provider]
16
+ @performance_period_start = options[:start_time]
17
+ @performance_period_end = options[:end_time]
18
+ @submission_program = options[:submission_program]
19
+ end
20
+
21
+ def patient_characteristic_payer
22
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'payer').to_json)
23
+ end
24
+
25
+ def patient_characteristic_birthdate
26
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'birthdate').to_json)
27
+ end
28
+
29
+ def patient_characteristic_sex
30
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'gender').to_json)
31
+ end
32
+
33
+ def patient_characteristic_race
34
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'race').to_json)
35
+ end
36
+
37
+ def patient_characteristic_ethnicity
38
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'ethnicity').to_json)
39
+ end
40
+
41
+ def adverse_event
42
+ JSON.parse(@qdmPatient.get_data_elements('adverse_event', nil).to_json)
43
+ end
44
+
45
+ def allergy_intolerance
46
+ JSON.parse(@qdmPatient.get_data_elements('allergy', 'intolerance').to_json)
47
+ end
48
+
49
+ def assessment_order
50
+ JSON.parse(@qdmPatient.get_data_elements('assessment', 'order').to_json)
51
+ end
52
+
53
+ def assessment_performed
54
+ JSON.parse(@qdmPatient.get_data_elements('assessment', 'performed').to_json)
55
+ end
56
+
57
+ def assessment_recommended
58
+ JSON.parse(@qdmPatient.get_data_elements('assessment', 'recommended').to_json)
59
+ end
60
+
61
+ def communication_performed
62
+ JSON.parse(@qdmPatient.get_data_elements('communication', 'performed').to_json)
63
+ end
64
+
65
+ def diagnosis
66
+ JSON.parse(@qdmPatient.get_data_elements('condition', nil).to_json)
67
+ end
68
+
69
+ def device_applied
70
+ JSON.parse(@qdmPatient.get_data_elements('device', 'applied').to_json)
71
+ end
72
+
73
+ def device_order
74
+ JSON.parse(@qdmPatient.get_data_elements('device', 'order').to_json)
75
+ end
76
+
77
+ def device_recommended
78
+ JSON.parse(@qdmPatient.get_data_elements('device', 'recommended').to_json)
79
+ end
80
+
81
+ def diagnostic_study_order
82
+ JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'order').to_json)
83
+ end
84
+
85
+ def diagnostic_study_performed
86
+ JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'performed').to_json)
87
+ end
88
+
89
+ def diagnostic_study_recommended
90
+ JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'recommended').to_json)
91
+ end
92
+
93
+ def encounter_order
94
+ JSON.parse(@qdmPatient.get_data_elements('encounter', 'order').to_json)
95
+ end
96
+
97
+ def encounter_performed
98
+ JSON.parse(@qdmPatient.get_data_elements('encounter', 'performed').to_json)
99
+ end
100
+
101
+ def encounter_recommended
102
+ JSON.parse(@qdmPatient.get_data_elements('encounter', 'recommended').to_json)
103
+ end
104
+
105
+ def family_history
106
+ JSON.parse(@qdmPatient.get_data_elements('family_history', nil).to_json)
107
+ end
108
+
109
+ def immunization_administered
110
+ JSON.parse(@qdmPatient.get_data_elements('immunization', 'administered').to_json)
111
+ end
112
+
113
+ def immunization_order
114
+ JSON.parse(@qdmPatient.get_data_elements('immunization', 'order').to_json)
115
+ end
116
+
117
+ def intervention_order
118
+ JSON.parse(@qdmPatient.get_data_elements('intervention', 'order').to_json)
119
+ end
120
+
121
+ def intervention_performed
122
+ JSON.parse(@qdmPatient.get_data_elements('intervention', 'performed').to_json)
123
+ end
124
+
125
+ def intervention_recommended
126
+ JSON.parse(@qdmPatient.get_data_elements('intervention', 'recommended').to_json)
127
+ end
128
+
129
+ def laboratory_test_order
130
+ JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'order').to_json)
131
+ end
132
+
133
+ def laboratory_test_performed
134
+ JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'performed').to_json)
135
+ end
136
+
137
+ def laboratory_test_recommended
138
+ JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'recommended').to_json)
139
+ end
140
+
141
+ def medication_active
142
+ JSON.parse(@qdmPatient.get_data_elements('medication', 'active').to_json)
143
+ end
144
+
145
+ def medication_administered
146
+ JSON.parse(@qdmPatient.get_data_elements('medication', 'administered').to_json) + JSON.parse(@qdmPatient.get_data_elements('substance', 'administered').to_json)
147
+ end
148
+
149
+ def medication_discharge
150
+ JSON.parse(@qdmPatient.get_data_elements('medication', 'discharge').to_json)
151
+ end
152
+
153
+ def medication_dispensed
154
+ JSON.parse(@qdmPatient.get_data_elements('medication', 'dispensed').to_json)
155
+ end
156
+
157
+ def medication_order
158
+ JSON.parse(@qdmPatient.get_data_elements('medication', 'order').to_json)
159
+ end
160
+
161
+ def patient_care_experience
162
+ JSON.parse(@qdmPatient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('patient_care_experience', '') }).to_json)
163
+ end
164
+
165
+ def patient_characteristic_clinical_trial_participant
166
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'clinical_trial_participant').to_json)
167
+ end
168
+
169
+ def patient_characteristic_expired
170
+ JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'expired').to_json)
171
+ end
172
+
173
+ def physical_exam_order
174
+ JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'order').to_json)
175
+ end
176
+
177
+ def physical_exam_performed
178
+ JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'performed').to_json)
179
+ end
180
+
181
+ def physical_exam_recommended
182
+ JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'recommended').to_json)
183
+ end
184
+
185
+ def procedure_order
186
+ JSON.parse(@qdmPatient.get_data_elements('procedure', 'order').to_json)
187
+ end
188
+
189
+ def procedure_performed
190
+ JSON.parse(@qdmPatient.get_data_elements('procedure', 'performed').to_json)
191
+ end
192
+
193
+ def procedure_recommended
194
+ JSON.parse(@qdmPatient.get_data_elements('procedure', 'recommended').to_json)
195
+ end
196
+
197
+ def provider_care_experience
198
+ JSON.parse(@qdmPatient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('provider_care_experience', '') }).to_json)
199
+ end
200
+
201
+ def provider_characteristic
202
+ JSON.parse(@qdmPatient.get_data_elements('provider_characteristic', nil).to_json)
203
+ end
204
+
205
+ def substance_administered
206
+ JSON.parse(@qdmPatient.get_data_elements('substance', 'administered').to_json)
207
+ end
208
+
209
+ def substance_order
210
+ JSON.parse(@qdmPatient.get_data_elements('substance', 'order').to_json)
211
+ end
212
+
213
+ def substance_recommended
214
+ JSON.parse(@qdmPatient.get_data_elements('substance', 'recommended').to_json)
215
+ end
216
+
217
+ def symptom
218
+ JSON.parse(@qdmPatient.get_data_elements('symptom', nil).to_json)
219
+ end
220
+ end
@@ -0,0 +1,26 @@
1
+ <author>
2
+ <time value="{{{current_time}}}"/>
3
+ <assignedAuthor>
4
+ <!-- NPI -->
5
+ {{#provider}}
6
+ {{#provider_npi}}
7
+ <id extension="{{value}}" root="2.16.840.1.113883.4.6"/>
8
+ {{/provider_npi}}
9
+ {{/provider}}
10
+ {{^provider}}
11
+ <id extension="1982671962" root="2.16.840.1.113883.4.6"/>
12
+ {{/provider}}
13
+ <addr>
14
+ <streetAddressLine>202 Burlington Rd.</streetAddressLine>
15
+ <city>Bedford</city>
16
+ <state>MA</state>
17
+ <postalCode>01730</postalCode>
18
+ <country>US</country>
19
+ </addr>
20
+ <telecom use="WP" value="tel:(781)271-3000"/>
21
+ <assignedAuthoringDevice>
22
+ <manufacturerModelName>Cypress</manufacturerModelName>
23
+ <softwareName>Cypress</softwareName>
24
+ </assignedAuthoringDevice>
25
+ </assignedAuthor>
26
+ </author>
@@ -0,0 +1,43 @@
1
+ {{#provider}}
2
+ <custodian>
3
+ <assignedCustodian>
4
+ <representedCustodianOrganization>
5
+ {{#provider_ccn}}
6
+ <id extension="{{value}}" 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
+ {{#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
+ {{/addresses}}
22
+ </representedCustodianOrganization>
23
+ </assignedCustodian>
24
+ </custodian>
25
+ {{/provider}}
26
+ {{^provider}}
27
+ <custodian>
28
+ <assignedCustodian>
29
+ <representedCustodianOrganization>
30
+ <id extension="800890" root="2.16.840.1.113883.4.336"/>
31
+ <name>Cypress Test Deck</name>
32
+ <telecom use="WP" value="tel:(781)271-3000"/>
33
+ <addr>
34
+ <streetAddressLine>202 Burlington Rd.</streetAddressLine>
35
+ <city>Bedford</city>
36
+ <state>MA</state>
37
+ <postalCode>01730</postalCode>
38
+ <country>US</country>
39
+ </addr>
40
+ </representedCustodianOrganization>
41
+ </assignedCustodian>
42
+ </custodian>
43
+ {{/provider}}
@@ -0,0 +1,88 @@
1
+ <documentationOf typeCode="DOC">
2
+ <serviceEvent classCode="PCPR">
3
+ <!-- care provision -->
4
+ <effectiveTime>
5
+ <low nullFlavor="UNK"/>
6
+ <high nullFlavor="UNK"/>
7
+ </effectiveTime>
8
+ <!-- You can include multiple performers, each with an NPI, TIN, CCN. -->
9
+ <performer typeCode="PRF">
10
+ <time>
11
+ <low nullFlavor="UNK"/>
12
+ <high nullFlavor="UNK"/>
13
+ </time>
14
+ {{#provider}}
15
+ <assignedEntity>
16
+ {{#provider_npi}}
17
+ <id extension="{{value}}" root="2.16.840.1.113883.4.6"/>
18
+ {{/provider_npi}}
19
+ {{#provider_ccn}}
20
+ <id extension="{{value}}" root="2.16.840.1.113883.4.336"/>
21
+ {{/provider_ccn}}
22
+ {{#specialty}}
23
+ <code code="{{specialty}}" codeSystem="2.16.840.1.113883.6.101" codeSystemName="Healthcare Provider Taxonomy (HIPAA)"/>
24
+ {{/specialty}}
25
+ {{#addresses}}
26
+ <addr use="HP">
27
+ <streetAddressLine>{{{provider_street}}}</streetAddressLine>
28
+ <city>{{city}}</city>
29
+ <state>{{state}}</state>
30
+ <postalCode>{{zip}}</postalCode>
31
+ <country>{{country}}</country>
32
+ </addr>
33
+ {{/addresses}}
34
+ <assignedPerson>
35
+ <name>
36
+ <given>{{{given_name}}}</given>
37
+ <family>{{familyName}}</family>
38
+ </name>
39
+ </assignedPerson>
40
+ <representedOrganization>
41
+ {{#provider_tin}}
42
+ <id extension="{{value}}" root="2.16.840.1.113883.4.2"/>
43
+ {{/provider_tin}}
44
+ {{#addresses}}
45
+ <addr use="HP">
46
+ <streetAddressLine>{{{provider_street}}}</streetAddressLine>
47
+ <city>{{city}}</city>
48
+ <state>{{state}}</state>
49
+ <postalCode>{{zip}}</postalCode>
50
+ <country>{{country}}</country>
51
+ </addr>
52
+ {{/addresses}}
53
+ </representedOrganization>
54
+ </assignedEntity>
55
+ {{/provider}}
56
+ {{^provider}}
57
+ <assignedEntity>
58
+ <id extension="1982671962" root="2.16.840.1.113883.4.6"/>
59
+ <id extension="463132" root="2.16.840.1.113883.4.336"/>
60
+ <code code="282N00000X" codeSystem="2.16.840.1.113883.6.101" codeSystemName="Healthcare Provider Taxonomy (HIPAA)"/>
61
+ <addr use="HP">
62
+ <streetAddressLine>16432 Jayme Viaduct Manor</streetAddressLine>
63
+ <city>Clairland</city>
64
+ <state>MS</state>
65
+ <postalCode>38796</postalCode>
66
+ <country>US</country>
67
+ </addr>
68
+ <assignedPerson>
69
+ <name>
70
+ <given>Daryl</given>
71
+ <family>Carroll</family>
72
+ </name>
73
+ </assignedPerson>
74
+ <representedOrganization>
75
+ <id extension="695939209" root="2.16.840.1.113883.4.2"/>
76
+ <addr use="HP">
77
+ <streetAddressLine>16432 Jayme Viaduct Manor</streetAddressLine>
78
+ <city>Clairland</city>
79
+ <state>MS</state>
80
+ <postalCode>38796</postalCode>
81
+ <country>US</country>
82
+ </addr>
83
+ </representedOrganization>
84
+ </assignedEntity>
85
+ {{/provider}}
86
+ </performer>
87
+ </serviceEvent>
88
+ </documentationOf>
@@ -0,0 +1,7 @@
1
+ {{#submission_program}}
2
+ <informationRecipient>
3
+ <intendedRecipient>
4
+ <id extension="{{submission_program}}" root="2.16.840.1.113883.3.249.7"/>
5
+ </intendedRecipient>
6
+ </informationRecipient>
7
+ {{/submission_program}}