health-data-standards 3.6.1 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -2
  3. data/Rakefile +2 -1
  4. data/lib/health-data-standards.rb +22 -1
  5. data/lib/health-data-standards/export/cat_1.rb +25 -6
  6. data/lib/health-data-standards/export/cat_1_r2.rb +8 -2
  7. data/lib/health-data-standards/export/cat_3.rb +8 -7
  8. data/lib/health-data-standards/export/exceptions.rb +13 -0
  9. data/lib/health-data-standards/export/helper/cat1_view_helper.rb +17 -11
  10. data/lib/health-data-standards/export/helper/html_view_helper.rb +13 -7
  11. data/lib/health-data-standards/export/helper/scooped_view_helper.rb +68 -25
  12. data/lib/health-data-standards/export/html.rb +9 -4
  13. data/lib/health-data-standards/export/qrda/entry_template_resolver.rb +29 -11
  14. data/lib/health-data-standards/export/qrda/hqmf-qrda-oids.json +89 -5
  15. data/lib/health-data-standards/export/rendering_context.rb +2 -2
  16. data/lib/health-data-standards/export/template_helper.rb +7 -2
  17. data/lib/health-data-standards/export/view_helper.rb +107 -39
  18. data/lib/health-data-standards/import/bulk_record_importer.rb +8 -5
  19. data/lib/health-data-standards/import/bundle/importer.rb +21 -14
  20. data/lib/health-data-standards/import/c32/care_goal_importer.rb +1 -1
  21. data/lib/health-data-standards/import/c32/immunization_importer.rb +1 -1
  22. data/lib/health-data-standards/import/cat1/clinical_trial_participant_importer.rb +20 -0
  23. data/lib/health-data-standards/import/cat1/device_order_importer.rb +20 -0
  24. data/lib/health-data-standards/import/cat1/diagnosis_active_importer.rb +4 -9
  25. data/lib/health-data-standards/import/cat1/diagnosis_importer.rb +15 -0
  26. data/lib/health-data-standards/import/cat1/diagnosis_inactive_importer.rb +1 -1
  27. data/lib/health-data-standards/import/cat1/diagnostic_study_order_importer.rb +6 -0
  28. data/lib/health-data-standards/import/cat1/encounter_order_act_importer.rb +19 -0
  29. data/lib/health-data-standards/import/cat1/encounter_performed_act_importer.rb +19 -0
  30. data/lib/health-data-standards/import/cat1/encounter_performed_importer.rb +16 -0
  31. data/lib/health-data-standards/import/cat1/immunization_administered_importer.rb +14 -0
  32. data/lib/health-data-standards/import/cat1/medication_dispensed_act_importer.rb +18 -0
  33. data/lib/health-data-standards/import/cat1/patient_importer.rb +44 -17
  34. data/lib/health-data-standards/import/cat1/procedure_order_importer.rb +4 -4
  35. data/lib/health-data-standards/import/cat1/procedure_performed_importer.rb +1 -0
  36. data/lib/health-data-standards/import/cat1/transfer_from_act_importer.rb +18 -0
  37. data/lib/health-data-standards/import/cat1/transfer_from_importer.rb +24 -0
  38. data/lib/health-data-standards/import/cat1/transfer_to_act_importer.rb +18 -0
  39. data/lib/health-data-standards/import/cat1/transfer_to_importer.rb +23 -0
  40. data/lib/health-data-standards/import/cda/allergy_importer.rb +1 -1
  41. data/lib/health-data-standards/import/cda/communication_importer.rb +55 -0
  42. data/lib/health-data-standards/import/cda/condition_importer.rb +17 -1
  43. data/lib/health-data-standards/import/cda/encounter_importer.rb +23 -21
  44. data/lib/health-data-standards/import/cda/medical_equipment_importer.rb +1 -0
  45. data/lib/health-data-standards/import/cda/medication_importer.rb +14 -4
  46. data/lib/health-data-standards/import/cda/procedure_importer.rb +4 -4
  47. data/lib/health-data-standards/import/cda/result_importer.rb +1 -1
  48. data/lib/health-data-standards/import/cda/section_importer.rb +59 -18
  49. data/lib/health-data-standards/models/assessment.rb +3 -0
  50. data/lib/health-data-standards/models/care_experience.rb +2 -0
  51. data/lib/health-data-standards/models/care_goal.rb +4 -0
  52. data/lib/health-data-standards/models/communication.rb +3 -0
  53. data/lib/health-data-standards/models/condition.rb +12 -9
  54. data/lib/health-data-standards/models/cqm/bundle.rb +2 -1
  55. data/lib/health-data-standards/models/cqm/measure.rb +2 -1
  56. data/lib/health-data-standards/models/cqm/patient_cache.rb +7 -3
  57. data/lib/health-data-standards/models/cqm/query_cache.rb +2 -0
  58. data/lib/health-data-standards/models/encounter.rb +14 -1
  59. data/lib/health-data-standards/models/encounter_principal_diagnosis.rb +36 -0
  60. data/lib/health-data-standards/models/entry.rb +5 -1
  61. data/lib/health-data-standards/models/family_history.rb +4 -0
  62. data/lib/health-data-standards/models/immunization.rb +1 -0
  63. data/lib/health-data-standards/models/lab_result.rb +10 -1
  64. data/lib/health-data-standards/models/medical_equipment.rb +2 -1
  65. data/lib/health-data-standards/models/medication.rb +19 -2
  66. data/lib/health-data-standards/models/patient_preference.rb +5 -0
  67. data/lib/health-data-standards/models/procedure.rb +16 -3
  68. data/lib/health-data-standards/models/provider.rb +17 -1
  69. data/lib/health-data-standards/models/provider_preference.rb +5 -0
  70. data/lib/health-data-standards/models/record.rb +8 -9
  71. data/lib/health-data-standards/models/reference.rb +1 -1
  72. data/lib/health-data-standards/models/svs/value_set.rb +28 -10
  73. data/lib/health-data-standards/models/transfer.rb +6 -1
  74. data/lib/health-data-standards/tasks/bundle.rake +5 -3
  75. data/lib/health-data-standards/util/hqmf_template_helper.rb +20 -14
  76. data/lib/health-data-standards/util/hqmfr2_template_oid_map.json +382 -0
  77. data/lib/health-data-standards/util/nlm_helper.rb +14 -0
  78. data/lib/health-data-standards/util/vs_api.rb +72 -54
  79. data/lib/health-data-standards/validate/measure_validator.rb +8 -3
  80. data/lib/health-data-standards/validate/performance_rate_validator.rb +1 -1
  81. data/lib/health-data-standards/validate/qrda_qdm_template_validator.rb +253 -0
  82. data/lib/health-data-standards/validate/reported_result_extractor.rb +5 -1
  83. data/lib/health-data-standards/validate/schematron_validator.rb +6 -0
  84. data/lib/health-data-standards/validate/validators.rb +49 -1
  85. data/lib/hqmf-generator/document.xml.erb +6 -5
  86. data/lib/hqmf-generator/field.xml.erb +1 -0
  87. data/lib/hqmf-generator/hqmf-generator.rb +85 -41
  88. data/lib/hqmf-generator/subset.xml.erb +15 -0
  89. data/lib/hqmf-generator/temporal_relationship.xml.erb +8 -3
  90. data/lib/hqmf-generator/temporal_relationship_attribute.xml.erb +10 -0
  91. data/lib/hqmf-generator/value.xml.erb +2 -2
  92. data/lib/hqmf-model/data_criteria.json +88 -17
  93. data/lib/hqmf-model/data_criteria.rb +144 -72
  94. data/lib/hqmf-model/population_criteria.rb +20 -18
  95. data/lib/hqmf-model/precondition.rb +6 -3
  96. data/lib/hqmf-model/types.rb +1 -1
  97. data/lib/hqmf-parser.rb +9 -0
  98. data/lib/hqmf-parser/1.0/utilities.rb +1 -1
  99. data/lib/hqmf-parser/2.0/data_criteria.rb +293 -319
  100. data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_base_extract.rb +80 -0
  101. data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_definition_from_template_or_type_extract.rb +201 -0
  102. data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_post_processing.rb +85 -0
  103. data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_specific_occurrences_and_source_data_criteria_extract.rb +117 -0
  104. data/lib/hqmf-parser/2.0/document.rb +246 -222
  105. data/lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb +175 -0
  106. data/lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb +131 -0
  107. data/lib/hqmf-parser/2.0/field_value_helper.rb +251 -0
  108. data/lib/hqmf-parser/2.0/population_criteria.rb +101 -32
  109. data/lib/hqmf-parser/2.0/precondition.rb +61 -35
  110. data/lib/hqmf-parser/2.0/source_data_criteria_helper.rb +112 -0
  111. data/lib/hqmf-parser/2.0/types.rb +253 -73
  112. data/lib/hqmf-parser/2.0/utilities.rb +27 -12
  113. data/lib/hqmf-parser/2.0/value_set_helper.rb +101 -0
  114. data/lib/hqmf-parser/converter/pass1/data_criteria_converter.rb +6 -1
  115. data/lib/hqmf-parser/converter/pass1/population_criteria_converter.rb +34 -30
  116. data/lib/hqmf-parser/parser.rb +5 -5
  117. data/resources/schematron/qrda/cat_1/{CDAR2_QRDA_I_R1_D3_2015MAY_Schematron.sch → HL7_CDAR2_QRDA_Category_I_2_12_16.sch} +4692 -4675
  118. data/resources/schematron/qrda/cat_1_r3_1/HL7 QRDA Category I STU 3.1.sch +3573 -0
  119. data/resources/schematron/qrda/cat_1_r3_1/HL7 QRDA Category III STU 1.1.sch +464 -0
  120. data/resources/schematron/qrda/cat_1_r3_1/QRDA Category I STU Release 3.1.sch +5394 -0
  121. data/resources/schematron/qrda/cat_1_r3_1/voc.xml +1229 -0
  122. data/resources/schematron/qrda/cat_1_r4/HL7 QRDA Category I STU 4.sch +3526 -0
  123. data/resources/schematron/qrda/cat_1_r4/voc.xml +1186 -0
  124. data/resources/schematron/qrda/cat_3_r1_1/HL7 QRDA Category III STU 1.1.sch +528 -0
  125. data/resources/schematron/qrda/cat_3_r1_1/voc.xml +8 -0
  126. data/resources/schematron/qrda/cat_3_r2/HL7 QRDA Category III STU 2.sch +677 -0
  127. data/resources/schematron/qrda/cat_3_r2/voc.xml +1186 -0
  128. data/resources/schematron/qrda/cat_3_r2_1/HL7 QRDA Category III STU 2.1.sch +678 -0
  129. data/resources/schematron/qrda/cat_3_r2_1/voc.xml +1186 -0
  130. data/templates/c32/_medical_equipment.c32.erb +1 -1
  131. data/templates/c32/_vital_signs.c32.erb +1 -1
  132. data/templates/cat1/{_2.16.840.1.113883.10.20.22.4.85.cat1.erb → r2/_2.16.840.1.113883.10.20.22.4.85.cat1.erb} +1 -1
  133. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.1.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.1.cat1.erb} +3 -3
  134. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.101.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.101.cat1.erb} +1 -1
  135. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.103.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.103.cat1.erb} +9 -5
  136. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.105.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.105.cat1.erb} +18 -10
  137. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +88 -0
  138. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +50 -0
  139. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +54 -0
  140. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +70 -0
  141. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
  142. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.14.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.14.cat1.erb} +24 -6
  143. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
  144. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
  145. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
  146. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
  147. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.20.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.20.cat1.erb} +4 -4
  148. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +22 -0
  149. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +114 -0
  150. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +20 -0
  151. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.28.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.28.cat1.erb} +2 -2
  152. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
  153. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +23 -0
  154. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +20 -0
  155. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.34.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.34.cat1.erb} +6 -6
  156. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
  157. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +20 -0
  158. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
  159. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.40.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.40.cat1.erb} +3 -3
  160. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +46 -0
  161. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
  162. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
  163. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
  164. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +26 -0
  165. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
  166. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
  167. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
  168. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
  169. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.55.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.55.cat1.erb} +0 -0
  170. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
  171. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
  172. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
  173. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
  174. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +52 -0
  175. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.66.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.66.cat1.erb} +6 -6
  176. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +23 -0
  177. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
  178. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.76.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.76.cat1.erb} +5 -3
  179. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +23 -0
  180. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +23 -0
  181. data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +64 -0
  182. data/templates/cat1/r2/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
  183. data/templates/cat1/{_address.cat1.erb → r2/_address.cat1.erb} +0 -0
  184. data/templates/cat1/{_author.cat1.erb → r2/_author.cat1.erb} +0 -0
  185. data/templates/cat1/r2/_fulfills.cat1.erb +14 -0
  186. data/templates/cat1/{_id.cat1.erb → r2/_id.cat1.erb} +0 -0
  187. data/templates/cat1/{_measures.cat1.erb → r2/_measures.cat1.erb} +1 -1
  188. data/templates/cat1/{_medication_details.cat1.erb → r2/_medication_details.cat1.erb} +3 -2
  189. data/templates/cat1/r2/_medication_dispense.cat1.erb +22 -0
  190. data/templates/cat1/{_ordinality.cat1.erb → r2/_ordinality.cat1.erb} +0 -0
  191. data/templates/cat1/{_organization.cat1.erb → r2/_organization.cat1.erb} +0 -0
  192. data/templates/cat1/{_patient_data.cat1.erb → r2/_patient_data.cat1.erb} +4 -1
  193. data/templates/cat1/r2/_patient_data_r3_1.cat1.erb +17 -0
  194. data/templates/cat1/r2/_providers.cat1.erb +76 -0
  195. data/templates/cat1/r2/_reason.cat1.erb +45 -0
  196. data/templates/cat1/{_record_target.cat1.erb → r2/_record_target.cat1.erb} +3 -0
  197. data/templates/cat1/r2/_reporting_parameters.cat1.erb +31 -0
  198. data/templates/cat1/{_result_value.cat1.erb → r2/_result_value.cat1.erb} +1 -1
  199. data/templates/cat1/{_telecom.cat1.erb → r2/_telecom.cat1.erb} +0 -0
  200. data/templates/cat1/{show.cat1.erb → r2/show.cat1.erb} +52 -5
  201. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
  202. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
  203. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
  204. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +58 -0
  205. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.12.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.12.cat1.erb} +4 -5
  206. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +39 -0
  207. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.14.cat1.erb +39 -0
  208. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
  209. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
  210. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
  211. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.22.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.22.cat1.erb} +6 -5
  212. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.23.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.23.cat1.erb} +26 -30
  213. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +20 -0
  214. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
  215. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +23 -0
  216. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.32.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.32.cat1.erb} +4 -4
  217. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
  218. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.38.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.38.cat1.erb} +3 -3
  219. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
  220. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.41.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.41.cat1.erb} +8 -10
  221. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
  222. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
  223. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
  224. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.45.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.45.cat1.erb} +5 -5
  225. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
  226. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
  227. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
  228. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.54.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.54.cat1.erb} +4 -4
  229. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
  230. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
  231. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
  232. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
  233. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.63.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.63.cat1.erb} +6 -8
  234. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +51 -0
  235. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +23 -0
  236. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
  237. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.76.cat1.erb +19 -0
  238. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +24 -0
  239. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +24 -0
  240. data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +57 -0
  241. data/templates/cat1/r3/_address.cat1.erb +9 -0
  242. data/templates/{cat3/_author.cat3.erb → cat1/r3/_author.cat1.erb} +0 -0
  243. data/templates/cat1/{_fulfills.cat1.erb → r3/_fulfills.cat1.erb} +0 -0
  244. data/templates/{cat3/_id.cat3.erb → cat1/r3/_id.cat1.erb} +0 -0
  245. data/templates/cat1/r3/_measures.cat1.erb +93 -0
  246. data/templates/cat1/r3/_medication_details.cat1.erb +16 -0
  247. data/templates/cat1/{_medication_dispense.cat1.erb → r3/_medication_dispense.cat1.erb} +3 -3
  248. data/templates/cat1/r3/_ordinality.cat1.erb +10 -0
  249. data/templates/cat1/r3/_organization.cat1.erb +9 -0
  250. data/templates/cat1/r3/_patient_data.cat1.erb +17 -0
  251. data/templates/cat1/r3/_providers.cat1.erb +76 -0
  252. data/templates/cat1/r3/_reason.cat1.erb +34 -0
  253. data/templates/cat1/r3/_record_target.cat1.erb +56 -0
  254. data/templates/cat1/r3/_reporting_parameters.cat1.erb +31 -0
  255. data/templates/cat1/r3/_result_value.cat1.erb +28 -0
  256. data/templates/{cat3/_telecom.cat3.erb → cat1/r3/_telecom.cat1.erb} +0 -0
  257. data/templates/cat1/r3/show.cat1.erb +183 -0
  258. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
  259. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
  260. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
  261. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +53 -0
  262. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +71 -0
  263. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
  264. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
  265. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
  266. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.18.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.18.cat1.erb} +3 -3
  267. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.2.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.2.cat1.erb} +2 -2
  268. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +30 -0
  269. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +116 -0
  270. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.26.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.26.cat1.erb} +4 -2
  271. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.3.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.3.cat1.erb} +2 -2
  272. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +24 -0
  273. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +21 -0
  274. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
  275. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +21 -0
  276. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.4.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb} +2 -2
  277. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +45 -0
  278. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.42.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.42.cat1.erb} +4 -4
  279. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.43.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.43.cat1.erb} +3 -3
  280. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.44.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.44.cat1.erb} +3 -3
  281. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +35 -0
  282. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.46.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.46.cat1.erb} +4 -4
  283. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
  284. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
  285. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
  286. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
  287. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.57.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.57.cat1.erb} +3 -3
  288. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
  289. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.62.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.62.cat1.erb} +5 -5
  290. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
  291. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.64.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb} +7 -7
  292. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.69.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.69.cat1.erb} +2 -2
  293. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.7.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.7.cat1.erb} +12 -9
  294. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +33 -0
  295. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +33 -0
  296. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +41 -0
  297. data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
  298. data/templates/cat1/r3_1/_address.cat1.erb +9 -0
  299. data/templates/cat1/r3_1/_author.cat1.erb +28 -0
  300. data/templates/cat1/r3_1/_fulfills.cat1.erb +14 -0
  301. data/templates/cat1/r3_1/_id.cat1.erb +1 -0
  302. data/templates/cat1/r3_1/_measures.cat1.erb +93 -0
  303. data/templates/cat1/r3_1/_medication_details.cat1.erb +16 -0
  304. data/templates/cat1/r3_1/_medication_dispense.cat1.erb +22 -0
  305. data/templates/cat1/r3_1/_ordinality.cat1.erb +10 -0
  306. data/templates/cat1/r3_1/_organization.cat1.erb +9 -0
  307. data/templates/cat1/r3_1/_patient_data.cat1.erb +17 -0
  308. data/templates/cat1/r3_1/_providers.cat1.erb +76 -0
  309. data/templates/cat1/r3_1/_reason.cat1.erb +34 -0
  310. data/templates/cat1/r3_1/_record_target.cat1.erb +56 -0
  311. data/templates/cat1/r3_1/_reporting_parameters.cat1.erb +31 -0
  312. data/templates/cat1/r3_1/_result_value.cat1.erb +28 -0
  313. data/templates/cat1/r3_1/_telecom.cat1.erb +1 -0
  314. data/templates/cat1/r3_1/show.cat1.erb +183 -0
  315. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
  316. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
  317. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
  318. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +53 -0
  319. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +75 -0
  320. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
  321. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
  322. data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.59.cat1.erb → r4/_2.16.840.1.113883.10.20.24.3.144.cat1.erb} +6 -6
  323. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.145.cat1.erb +24 -0
  324. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
  325. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
  326. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
  327. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +30 -0
  328. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +116 -0
  329. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
  330. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +24 -0
  331. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +21 -0
  332. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
  333. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +21 -0
  334. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
  335. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +45 -0
  336. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
  337. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
  338. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
  339. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +35 -0
  340. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
  341. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
  342. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
  343. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
  344. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
  345. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
  346. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
  347. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
  348. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
  349. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +52 -0
  350. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
  351. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +33 -0
  352. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +33 -0
  353. data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +41 -0
  354. data/templates/cat1/r4/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
  355. data/templates/cat1/r4/_address.cat1.erb +7 -0
  356. data/templates/cat1/r4/_author.cat1.erb +28 -0
  357. data/templates/cat1/r4/_fulfills.cat1.erb +14 -0
  358. data/templates/cat1/r4/_id.cat1.erb +1 -0
  359. data/templates/cat1/r4/_measures.cat1.erb +93 -0
  360. data/templates/cat1/r4/_medication_details.cat1.erb +16 -0
  361. data/templates/cat1/r4/_medication_dispense.cat1.erb +22 -0
  362. data/templates/cat1/r4/_ordinality.cat1.erb +10 -0
  363. data/templates/cat1/r4/_organization.cat1.erb +9 -0
  364. data/templates/cat1/r4/_patient_data.cat1.erb +17 -0
  365. data/templates/cat1/r4/_providers.cat1.erb +76 -0
  366. data/templates/cat1/r4/_reason.cat1.erb +34 -0
  367. data/templates/cat1/r4/_record_target.cat1.erb +54 -0
  368. data/templates/cat1/r4/_reporting_parameters.cat1.erb +31 -0
  369. data/templates/cat1/r4/_result_value.cat1.erb +28 -0
  370. data/templates/cat1/r4/_telecom.cat1.erb +1 -0
  371. data/templates/cat1/r4/show.cat1.erb +192 -0
  372. data/templates/cat3/{_address.cat3.erb → r1/_address.cat3.erb} +0 -0
  373. data/templates/cat3/r1/_author.cat3.erb +28 -0
  374. data/templates/cat3/{_continuous_variable_value.cat3.erb → r1/_continuous_variable_value.cat3.erb} +0 -0
  375. data/templates/cat3/r1/_id.cat3.erb +1 -0
  376. data/templates/cat3/{_measure_data.cat3.erb → r1/_measure_data.cat3.erb} +7 -6
  377. data/templates/cat3/{_organization.cat3.erb → r1/_organization.cat3.erb} +0 -0
  378. data/templates/cat3/{_performance_rate.cat3.erb → r1/_performance_rate.cat3.erb} +1 -3
  379. data/templates/cat3/{_providers.cat3.erb → r1/_providers.cat3.erb} +0 -0
  380. data/templates/cat3/{_reporting_parameters.cat3.erb → r1/_reporting_parameters.cat3.erb} +0 -0
  381. data/templates/cat3/{_supplemental_data.cat3.erb → r1/_supplemental_data.cat3.erb} +2 -0
  382. data/templates/cat3/r1/_telecom.cat3.erb +1 -0
  383. data/templates/cat3/{show.cat3.erb → r1/show.cat3.erb} +5 -5
  384. data/templates/cat3/r1_1/_address.cat3.erb +9 -0
  385. data/templates/cat3/r1_1/_author.cat3.erb +28 -0
  386. data/templates/cat3/r1_1/_continuous_variable_value.cat3.erb +20 -0
  387. data/templates/cat3/r1_1/_id.cat3.erb +1 -0
  388. data/templates/cat3/r1_1/_measure_data.cat3.erb +136 -0
  389. data/templates/cat3/r1_1/_organization.cat3.erb +6 -0
  390. data/templates/cat3/r1_1/_performance_rate.cat3.erb +18 -0
  391. data/templates/{cat1/_providers.cat1.erb → cat3/r1_1/_providers.cat3.erb} +18 -18
  392. data/templates/{cat1/_reporting_parameters.cat1.erb → cat3/r1_1/_reporting_parameters.cat3.erb} +5 -1
  393. data/templates/cat3/r1_1/_supplemental_data.cat3.erb +38 -0
  394. data/templates/cat3/r1_1/_telecom.cat3.erb +1 -0
  395. data/templates/cat3/r1_1/show.cat3.erb +150 -0
  396. data/templates/cat3/r2/_address.cat3.erb +9 -0
  397. data/templates/cat3/r2/_author.cat3.erb +28 -0
  398. data/templates/cat3/r2/_continuous_variable_value.cat3.erb +20 -0
  399. data/templates/cat3/r2/_id.cat3.erb +1 -0
  400. data/templates/cat3/r2/_measure_data.cat3.erb +136 -0
  401. data/templates/cat3/r2/_organization.cat3.erb +6 -0
  402. data/templates/cat3/r2/_performance_rate.cat3.erb +19 -0
  403. data/templates/cat3/r2/_providers.cat3.erb +57 -0
  404. data/templates/cat3/r2/_reporting_parameters.cat3.erb +29 -0
  405. data/templates/cat3/r2/_supplemental_data.cat3.erb +38 -0
  406. data/templates/cat3/r2/_telecom.cat3.erb +1 -0
  407. data/templates/cat3/r2/show.cat3.erb +150 -0
  408. data/templates/cat3/r2_1/_address.cat3.erb +9 -0
  409. data/templates/cat3/r2_1/_author.cat3.erb +28 -0
  410. data/templates/cat3/r2_1/_continuous_variable_value.cat3.erb +20 -0
  411. data/templates/cat3/r2_1/_id.cat3.erb +1 -0
  412. data/templates/cat3/r2_1/_measure_data.cat3.erb +136 -0
  413. data/templates/cat3/r2_1/_organization.cat3.erb +6 -0
  414. data/templates/cat3/r2_1/_performance_rate.cat3.erb +19 -0
  415. data/templates/cat3/r2_1/_providers.cat3.erb +57 -0
  416. data/templates/cat3/r2_1/_reporting_parameters.cat3.erb +20 -0
  417. data/templates/cat3/r2_1/_reporting_parameters_act.cat3.erb +10 -0
  418. data/templates/cat3/r2_1/_supplemental_data.cat3.erb +38 -0
  419. data/templates/cat3/r2_1/_telecom.cat3.erb +1 -0
  420. data/templates/cat3/r2_1/show.cat3.erb +153 -0
  421. data/templates/ccda/_medical_equipment.ccda.erb +1 -1
  422. data/templates/ccda/_social_history.ccda.erb +2 -2
  423. data/templates/ccda/_vital_signs.ccda.erb +1 -1
  424. data/templates/html/_entries_by_section.html.erb +1 -1
  425. metadata +425 -153
  426. data/lib/health-data-standards/import/cat1/procedure_importer.rb +0 -42
  427. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +0 -55
  428. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +0 -38
  429. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +0 -22
  430. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +0 -22
  431. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +0 -20
  432. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +0 -27
  433. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +0 -13
  434. data/templates/cat1/_reason.cat1.erb +0 -23
@@ -0,0 +1,21 @@
1
+ <entry>
2
+ <procedure classCode="PROC" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <!-- Consolidated Plan of Care Activity Procedure TemplateId (Implied Template) -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.41" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
5
+ <!-- QRDA Procedure, Order TemplateId -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.63" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="<%= r2_compatibility ? 'new' : 'active' %>"/>
11
+ <!-- Attribute: datetime -->
12
+ <author>
13
+ <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
14
+ <time <%= value_or_null_flavor(entry.start_time) %>/>
15
+ <assignedAuthor>
16
+ <id nullFlavor="NA"/>
17
+ </assignedAuthor>
18
+ </author>
19
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
20
+ </procedure>
21
+ </entry>
@@ -0,0 +1,52 @@
1
+ <entry>
2
+ <procedure classCode="PROC" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Procedure performed template -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.64" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
5
+ <!-- Procedure Activity Procedure-->
6
+ <templateId root="2.16.840.1.113883.10.20.22.4.14" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="completed"/>
11
+ <effectiveTime>
12
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
13
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
14
+ </effectiveTime>
15
+ <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINAL"]}) %>
16
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
17
+ <% if entry.respond_to?(:incision_time) && entry.incision_time.present? -%>
18
+ <entryRelationship typeCode="REFR">
19
+ <procedure classCode="PROC" moodCode="EVN">
20
+ <templateId root="2.16.840.1.113883.10.20.24.3.89"/>
21
+ <id root="1.3.6.1.4.1.115" extension="<%= identifier_for([entry.id, entry.incision_time]) %>" />
22
+ <code code="34896006"
23
+ codeSystem="2.16.840.1.113883.6.96"
24
+ codeSystemName="SNOMED CT"
25
+ displayName="incision"/>
26
+ <effectiveTime <%= value_or_null_flavor(entry.incision_time) %>/>
27
+ </procedure>
28
+ </entryRelationship>
29
+ <% end -%>
30
+
31
+ <% entry.values.each do |value| %>
32
+ <entryRelationship typeCode="REFR">
33
+ <observation classCode="OBS" moodCode="EVN">
34
+ <!-- Conforms to C-CDA R2 Result Observation (V2) -->
35
+ <templateId root="2.16.840.1.113883.10.20.22.4.2" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
36
+ <!-- Result (QRDA I R3) -->
37
+ <templateId root="2.16.840.1.113883.10.20.24.3.87" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
38
+ <id root="1.3.6.1.4.1.115" extension="<%= identifier_for(value) %>"/>
39
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
40
+ <statusCode code="completed"/>
41
+ <effectiveTime>
42
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
43
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
44
+ </effectiveTime>
45
+ <%== render(:partial=> 'result_value', :locals => {:values => [value]}) %>
46
+
47
+ </observation>
48
+ </entryRelationship>
49
+ <% end %>
50
+ </procedure>
51
+ </entry>
52
+
@@ -5,11 +5,11 @@
5
5
  <procedure classCode="PROC" moodCode="EVN">
6
6
  <!-- Consolidated Procedure Activity Procedure TemplateId
7
7
  (Implied Template) -->
8
- <templateId root="2.16.840.1.113883.10.20.22.4.14"/>
8
+ <templateId root="2.16.840.1.113883.10.20.22.4.14" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
9
9
  <!-- QRDA Procedure, Result TemplateId -->
10
- <templateId root="2.16.840.1.113883.10.20.24.3.66"/>
10
+ <templateId root="2.16.840.1.113883.10.20.24.3.66" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
11
11
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
12
- <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
12
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
13
13
  <text><%= entry.description %></text>
14
14
  <statusCode code="completed"/>
15
15
  <effectiveTime>
@@ -23,11 +23,11 @@
23
23
  <entryRelationship typeCode="REFR">
24
24
  <observation classCode="OBS" moodCode="EVN">
25
25
  <!-- Result Observation template (consolidation) -->
26
- <templateId root="2.16.840.1.113883.10.20.22.4.2"/>
26
+ <templateId root="2.16.840.1.113883.10.20.22.4.2" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
27
27
  <!-- Result template -->
28
- <templateId root="2.16.840.1.113883.10.20.24.3.87"/>
28
+ <templateId root="2.16.840.1.113883.10.20.24.3.87" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
29
29
  <id root="<%= UUID.generate %>"/>
30
- <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
30
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
31
31
  <statusCode code="completed"/>
32
32
  <effectiveTime <%= value_or_null_flavor(entry.start_time) %>/>
33
33
  <%== render(:partial => 'result_value', :locals => {:values => [value], :result_oids=>result_oids} ) %>
@@ -0,0 +1,23 @@
1
+ <% vals = entry.values.empty? ? [nil] : entry.values
2
+ vals.each do |value|
3
+ %>
4
+ <entry>
5
+ <observation classCode="OBS" moodCode="EVN" <%== negation_indicator(entry) %>>
6
+ <!-- Consolidation Assessment Scale Observation templateId -->
7
+ <templateId root="2.16.840.1.113883.10.20.22.4.69"/>
8
+ <!-- Risk Category Assessment -->
9
+ <templateId root="2.16.840.1.113883.10.20.24.3.69" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
10
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
11
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
12
+ <text><%= entry.description %></text>
13
+ <statusCode code="completed"/>
14
+
15
+ <effectiveTime>
16
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
17
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
18
+ </effectiveTime>
19
+ <%== render(:partial => 'result_value', :locals => {:values => [value], :result_oids=>result_oids} ) %>
20
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
21
+ </observation>
22
+ </entry>
23
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <entry>
2
+ <procedure classCode="PROC" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Procedure Activity Procedure -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.14" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
5
+ <!-- Device Applied -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.7" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <code code="360030002" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="application of device"/>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="completed"/>
11
+
12
+ <effectiveTime>
13
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
14
+ <high <%= value_or_null_flavor(entry.removal_time || entry.end_time) %>/>
15
+ </effectiveTime>
16
+
17
+ <% if entry.respond_to?(:anatomical_target) && entry.anatomical_target.present? -%>
18
+ <% vset = oid_for_code(entry.anatomical_target.code,field_oids["LATERALITY"]) %>
19
+ <% if vset %>
20
+ <targetSiteCode code="<%= entry.anatomical_target['code'] %>"
21
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.anatomical_target['code_system']) %>" sdtc:valueSet="<%= vset %>"/>
22
+ <% end %>
23
+ <% end -%>
24
+ <participant typeCode="DEV">
25
+ <participantRole classCode="MANU">
26
+ <playingDevice classCode="DEV">
27
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
28
+ </playingDevice>
29
+ </participantRole>
30
+ </participant>
31
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
32
+ </procedure>
33
+ </entry>
@@ -1,9 +1,9 @@
1
1
  <entry>
2
2
  <observation classCode="OBS" moodCode="EVN">
3
3
  <!-- Problem observation template -->
4
- <templateId root="2.16.840.1.113883.10.20.22.4.4"/>
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.4" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
5
5
  <!-- Symptom, active template -->
6
- <templateId root="2.16.840.1.113883.10.20.24.3.76"/>
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.76" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
8
  <code code="418799008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Symptom"/>
9
9
  <text><%= entry.description %></text>
@@ -15,7 +15,8 @@
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
17
 
18
- <%== code_display(entry, 'value_set_map' => value_set_map,'preferred_code_sets' => ['SNOMED-CT'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
18
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['SNOMED-CT'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
19
+ <% if r2_compatibility %>
19
20
  <!-- Status -->
20
21
  <entryRelationship typeCode="REFR">
21
22
  <observation classCode="OBS" moodCode="EVN">
@@ -29,5 +30,6 @@
29
30
  <value code="55561003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="active" xsi:type="CD"/>
30
31
  </observation>
31
32
  </entryRelationship>
33
+ <% end %>
32
34
  </observation>
33
35
  </entry>
@@ -0,0 +1,23 @@
1
+ <entry>
2
+ <encounter classCode="ENC" moodCode="EVN">
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.81" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
4
+ <id root="1.3.6.1.4.1.115" extension="<%= "#{entry.transferFrom.id}#{entry.id}".hash.abs.to_s(16) %>"/>
5
+ <code code="77305-1" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="transferred from"/>
6
+ <statusCode code="completed"/>
7
+ <participant typeCode="ORG">
8
+ <time>
9
+ <low <%= value_or_null_flavor(entry.transferFrom.time) %>/>
10
+ </time>
11
+ <participantRole classCode="LOCE">
12
+ <%
13
+ entry.transferFrom.codes[entry.transferFrom.code_system] = [entry.transferFrom.code]
14
+ transfer_vs_map = [{"set"=>entry.transferFrom.code_system, "values"=>[entry.transferFrom.code]}]
15
+ transfer_oid = (data_criteria.field_values || {})['TRANSFER_FROM'].try(:code_list_id)
16
+ options = {'value_set_map' => transfer_vs_map, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT']}
17
+ options['extra_content'] = "sdtc:valueSet=\"#{transfer_oid}\"" if transfer_oid
18
+ %>
19
+ <%== code_display(entry.transferFrom, options) %>
20
+ </participantRole>
21
+ </participant>
22
+ </encounter>
23
+ </entry>
@@ -0,0 +1,23 @@
1
+ <entry>
2
+ <encounter classCode="ENC" moodCode="EVN">
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.82" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
4
+ <id root="1.3.6.1.4.1.115" extension="<%= "#{entry.transferTo.id}#{entry.id}".hash.abs.to_s(16) %>"/>
5
+ <code code="77306-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Discharge disposition"/>
6
+ <statusCode code="completed"/>
7
+ <participant typeCode="DST">
8
+ <time>
9
+ <low <%= value_or_null_flavor(entry.transferTo.time) %>/>
10
+ </time>
11
+ <participantRole classCode="LOCE">
12
+ <%
13
+ entry.transferTo.codes[entry.transferTo.code_system] = [entry.transferTo.code]
14
+ transfer_vs_map = [{"set"=>entry.transferTo.code_system, "values"=>[entry.transferTo.code]}]
15
+ transfer_oid = (data_criteria.field_values || {})['TRANSFER_TO'].try(:code_list_id)
16
+ options = {'value_set_map' => transfer_vs_map, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT']}
17
+ options['extra_content'] = "sdtc:valueSet=\"#{transfer_oid}\"" if transfer_oid
18
+ %>
19
+ <%== code_display(entry.transferTo, options) %>
20
+ </participantRole>
21
+ </participant>
22
+ </encounter>
23
+ </entry>
@@ -0,0 +1,64 @@
1
+ <entry>
2
+ <% if !negation_indicator(entry) %>
3
+ <supply classCode="SPLY" moodCode="RQO">
4
+ <!-- Plan of Care Activity Supply -->
5
+ <templateId root="2.16.840.1.113883.10.20.22.4.43" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
6
+ <!-- Device, Order -->
7
+ <templateId root="2.16.840.1.113883.10.20.24.3.9" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
8
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="active"/>
11
+
12
+ <effectiveTime xsi:type="IVL_TS">
13
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
14
+ <high <%= value_or_null_flavor(entry.removal_time || entry.end_time) %>/>
15
+ </effectiveTime>
16
+ <author>
17
+ <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
18
+ <time <%= value_or_null_flavor(entry.as_point_in_time) %>/>
19
+ <assignedAuthor>
20
+ <id nullFlavor="NA" root="<%= UUID.generate %>"/>
21
+ </assignedAuthor>
22
+ </author>
23
+ <participant typeCode="DEV">
24
+ <participantRole classCode="MANU">
25
+ <playingDevice classCode="DEV">
26
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
27
+ </playingDevice>
28
+ </participantRole>
29
+ </participant>
30
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
31
+ </supply>
32
+ <% else %>
33
+ <act classCode="SPLY" moodCode="RQO" <%== negation_indicator(entry) %>>
34
+ <!-- Plan of Care Activity Supply -->
35
+ <templateId root="2.16.840.1.113883.10.20.22.4.43" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
36
+ <!-- Device, Order -->
37
+ <templateId root="2.16.840.1.113883.10.20.24.3.9" <% if !r2_compatibility %>extension="2014-12-01"<%end%>/>
38
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
39
+ <code code="SPLY" codeSystem="2.16.840.1.113883.5.6"/>
40
+ <text><%= entry.description %></text>
41
+ <statusCode code="active"/>
42
+
43
+ <effectiveTime xsi:type="IVL_TS">
44
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
45
+ <high <%= value_or_null_flavor(entry.removal_time || entry.end_time) %>/>
46
+ </effectiveTime>
47
+ <author>
48
+ <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
49
+ <time <%= value_or_null_flavor(entry.as_point_in_time) %>/>
50
+ <assignedAuthor>
51
+ <id nullFlavor="NA" root="<%= UUID.generate %>"/>
52
+ </assignedAuthor>
53
+ </author>
54
+ <participant typeCode="DEV">
55
+ <participantRole classCode="MANU">
56
+ <playingDevice classCode="DEV">
57
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
58
+ </playingDevice>
59
+ </participantRole>
60
+ </participant>
61
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
62
+ </act>
63
+ <% end %>
64
+ </entry>
@@ -0,0 +1,17 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="EVN">
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.51" <% if !r2_compatibility %>extension="2016-02-01"<%end%>/>
4
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
5
+ <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" />
6
+ <statusCode code="active" />
7
+ <effectiveTime>
8
+ <!-- Attribute: Start Datetime -->
9
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
10
+ <!-- Attribute: Stop Datetime -->
11
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
+ </effectiveTime>
13
+ <%== code_display(entry, 'preferred_code_sets' => ['*'],
14
+ 'tag_name' => 'value','value_set_map' => filtered_vs_map,
15
+ 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
16
+ </observation>
17
+ </entry>
@@ -0,0 +1,14 @@
1
+ <% if entry.references.present?
2
+ -%>
3
+ <% entry.references.each do |reference|
4
+ resolved_reference = reference.resolve_reference %>
5
+ <% if reference.type == "fulfills" %>
6
+ <sdtc:inFulfillmentOf1 typeCode="FLFS">
7
+ <sdtc:templateId root="2.16.840.1.113883.10.20.24.3.126" <% if !r2_compatibility %>extension="2014-12-01"<%end%> />
8
+ <sdtc:actReference classCode="ACT" moodCode="<%= resolved_reference.mood_code %>">
9
+ <sdtc:id root="1.3.6.1.4.1.115" extension="<%= reference.referenced_id %>"/>
10
+ </sdtc:actReference>
11
+ </sdtc:inFulfillmentOf1>
12
+ <% end %>
13
+ <% end %>
14
+ <% end -%>
@@ -43,7 +43,7 @@
43
43
  <templateId root="2.16.840.1.113883.10.20.24.3.98"/>
44
44
  <!-- This is the templateId for eMeasure Reference QDM -->
45
45
  <templateId root="2.16.840.1.113883.10.20.24.3.97"/>
46
- <id extension="<%= measure['id'] %>"/>
46
+ <id root="1.3.6.1.4.1.115" extension="<%= measure['id'] %>"/>
47
47
  <statusCode code="completed"/>
48
48
  <!-- Containing isBranch external references -->
49
49
  <reference typeCode="REFR">
@@ -9,7 +9,8 @@
9
9
  <% end -%>
10
10
  />
11
11
  <% end -%>
12
-
13
- <% if entry.respond_to?(:dose) && entry.dose.present? -%>
12
+ <% if entry.negationInd %>
13
+ <doseQuantity nullFlavor="NA"/>
14
+ <% elsif entry.respond_to?(:dose) && entry.dose.present? -%>
14
15
  <doseQuantity <%= dose_quantity(entry.codes, entry.dose) %>/>
15
16
  <% end -%>
@@ -0,0 +1,22 @@
1
+
2
+ <entryRelationship typeCode="REFR">
3
+ <supply classCode="SPLY" moodCode="EVN">
4
+ <!-- Medication Dispense template -->
5
+ <templateId root="2.16.840.1.113883.10.20.22.4.18" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
6
+ <id root="1.3.6.1.4.1.115" extension="<%= UUID.generate %>"/>
7
+ <statusCode code="completed"/>
8
+ <effectiveTime <%= value_or_null_flavor(medication_dispense.dispense_date) %>/>
9
+ <repeatNumber value="1"/>
10
+ <quantity <%= fulfillment_quantity(entry.codes, medication_dispense, entry.dose) %>/>
11
+ <product>
12
+ <manufacturedProduct classCode="MANU">
13
+ <!-- Medication Information (consolidation) template -->
14
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" <% if !r2_compatibility %>extension="2014-06-09"<%end%>/>
15
+ <id root="<%= UUID.generate %>"/>
16
+ <manufacturedMaterial>
17
+ <%== code_display(entry, 'preferred_code_sets' =>["RxNorm"], 'value_set_map' => filtered_vs_map, 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
18
+ </manufacturedMaterial>
19
+ </manufacturedProduct>
20
+ </product>
21
+ </supply>
22
+ </entryRelationship>
@@ -4,11 +4,14 @@
4
4
  <templateId root="2.16.840.1.113883.10.20.17.2.4"/>
5
5
  <!-- This is the templateId for Patient Data QDM section -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.2.1" <% if !r2_compatibility %>extension="2014-12-01"<%end%> />
7
+ <% if cms_compatibility %>
8
+ <templateId root="2.16.840.1.113883.10.20.24.2.1" extension="2015-07-01"/>
9
+ <% end %>
7
10
  <code code="55188-7" codeSystem="2.16.840.1.113883.6.1"/>
8
11
  <title>Patient Data</title>
9
12
  <text>
10
13
 
11
14
  </text>
12
- <%== render_patient_data(patient, measures) %>
15
+ <%== render_patient_data(patient, measures, r2_compatibility, qrda_version) %>
13
16
  </section>
14
17
  </component>
@@ -0,0 +1,17 @@
1
+ <component>
2
+ <section>
3
+ <!-- This is the templateId for Patient Data section -->
4
+ <templateId root="2.16.840.1.113883.10.20.17.2.4"/>
5
+ <!-- This is the templateId for Patient Data QDM section -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.2.1" <% if !r2_compatibility %>extension="2016-02-01"<%end%> />
7
+ <% if cms_compatibility %>
8
+ <templateId root="2.16.840.1.113883.10.20.24.2.1" extension="2015-07-01"/>
9
+ <% end %>
10
+ <code code="55188-7" codeSystem="2.16.840.1.113883.6.1"/>
11
+ <title>Patient Data</title>
12
+ <text>
13
+
14
+ </text>
15
+ <%== render_patient_data(patient, measures, r2_compatibility, qrda_version) %>
16
+ </section>
17
+ </component>
@@ -0,0 +1,76 @@
1
+ <documentationOf typeCode="DOC">
2
+ <serviceEvent classCode="PCPR"> <!-- care provision -->
3
+ <% if patient.provider_performances.empty? -%>
4
+ <!-- No provider data found in the patient record
5
+ putting in a fake provider -->
6
+ <effectiveTime>
7
+ <low value="20020716"/>
8
+ <high value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
9
+ </effectiveTime>
10
+ <!-- You can include multiple performers, each with an NPI, TIN, CCN. -->
11
+ <performer typeCode="PRF">
12
+ <time>
13
+ <low value="20020716"/>
14
+ <high value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
15
+ </time>
16
+ <assignedEntity>
17
+ <!-- This is the provider NPI -->
18
+ <id root="2.16.840.1.113883.4.6" extension="111111111" />
19
+ <representedOrganization>
20
+ <!-- This is the organization TIN -->
21
+ <id root="2.16.840.1.113883.4.2" extension="1234567" />
22
+ <!-- This is the organization CCN -->
23
+ <id root="2.16.840.1.113883.4.336" extension="54321" />
24
+ </representedOrganization>
25
+ </assignedEntity>
26
+ </performer>
27
+ <% else -%>
28
+ <% patient.provider_performances.each do |pp| -%>
29
+ <effectiveTime>
30
+ <low <%= value_or_null_flavor(pp.start_date) %>/>
31
+ <high <%= value_or_null_flavor(pp.end_date) %>/>
32
+ </effectiveTime>
33
+ <!-- You can include multiple performers, each with an NPI, TIN, CCN. -->
34
+ <performer typeCode="PRF">
35
+ <time>
36
+ <low <%= value_or_null_flavor(pp.start_date) %>/>
37
+ <high <%= value_or_null_flavor(pp.end_date) %>/>
38
+ </time>
39
+ <assignedEntity>
40
+ <% pp.provider.cda_identifiers.each do |cda_id| -%>
41
+ <% unless cda_id.root.eql? '2.16.840.1.113883.4.2' -%>
42
+ <id root="<%= cda_id.root %>" extension="<%= cda_id.extension %>" />
43
+ <% end -%>
44
+ <% end -%>
45
+ <% if pp.provider.specialty %>
46
+ <code code="<%= pp.provider.specialty %>" codeSystemName="Healthcare Provider Taxonomy (HIPAA)" codeSystem="2.16.840.1.113883.6.101"/>
47
+ <% end %>
48
+ <%== render :partial=>"address" , :collection=>pp.provider.addresses %>
49
+ <%== render :partial=>"telecom", :collection=>pp.provider.telecoms %>
50
+ <assignedPerson>
51
+ <name>
52
+ <given><%= pp.provider.given_name %></given>
53
+ <family><%= pp.provider.family_name %></family>
54
+ </name>
55
+ </assignedPerson>
56
+ <representedOrganization>
57
+ <% pp.provider.cda_identifiers.each do |cda_id| -%>
58
+ <% if cda_id.root.eql?('2.16.840.1.113883.4.2') -%>
59
+ <id root="2.16.840.1.113883.4.2" extension="<%= cda_id.extension %>" />
60
+ <% end -%>
61
+ <% end -%>
62
+ <%if pp.provider.organization %>
63
+ <name><%= pp.provider.organization.name %></name>
64
+ <%== render :partial=>"address" , :collection=>pp.provider.organization.addresses %>
65
+ <%== render :partial=>"telecom", :collection=>pp.provider.organization.telecoms %>
66
+ <% else %>
67
+ <%== render :partial=>"address" , :collection=>pp.provider.addresses %>
68
+ <%== render :partial=>"telecom", :collection=>pp.provider.telecoms %>
69
+ <% end %>
70
+ </representedOrganization>
71
+ </assignedEntity>
72
+ </performer>
73
+ <% end -%>
74
+ <% end -%>
75
+ </serviceEvent>
76
+ </documentationOf>