cqm-parsers 0.2.4 → 3.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +8 -4
  3. data/README.md +57 -5
  4. data/Rakefile +1 -0
  5. data/lib/{hqmf-parser.rb → cqm-parsers.rb} +13 -45
  6. data/lib/ext/data_element.rb +1 -1
  7. data/lib/hqmf-parser/2.0/document.rb +1 -1
  8. data/lib/hqmf-parser/2.0/population_criteria.rb +1 -1
  9. data/lib/hqmf-parser/cql/document_helpers/doc_population_helper.rb +11 -6
  10. data/lib/measure-loader/cql_loader.rb +165 -0
  11. data/lib/measure-loader/elm_dependency_finder.rb +72 -0
  12. data/lib/measure-loader/elm_parser.rb +67 -0
  13. data/lib/measure-loader/exceptions.rb +10 -0
  14. data/lib/measure-loader/helpers.rb +11 -0
  15. data/lib/measure-loader/hqmf_measure_loader.rb +170 -0
  16. data/lib/measure-loader/mat_measure_files.rb +138 -0
  17. data/lib/measure-loader/source_data_criteria_loader.rb +75 -0
  18. data/lib/measure-loader/value_set_helpers.rb +68 -0
  19. data/lib/measure-loader/vsac_value_set_loader.rb +97 -0
  20. data/lib/tasks/hqmf.rake +1 -1
  21. data/lib/util/util.rb +23 -0
  22. data/lib/util/vsac_api.rb +166 -103
  23. metadata +63 -131
  24. data/lib/ext/code.rb +0 -10
  25. data/lib/qrda-export/catI-r5/_code.mustache +0 -1
  26. data/lib/qrda-export/catI-r5/_codes.mustache +0 -10
  27. data/lib/qrda-export/catI-r5/_header.mustache +0 -28
  28. data/lib/qrda-export/catI-r5/_measure_section.mustache +0 -59
  29. data/lib/qrda-export/catI-r5/_reporting_period.mustache +0 -23
  30. data/lib/qrda-export/catI-r5/_values.mustache +0 -10
  31. data/lib/qrda-export/catI-r5/qrda1_r5.mustache +0 -137
  32. data/lib/qrda-export/catI-r5/qrda1_r5.rb +0 -125
  33. data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +0 -24
  34. data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +0 -43
  35. data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +0 -82
  36. data/lib/qrda-export/catI-r5/qrda_header/_information_recipient.mustache +0 -7
  37. data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +0 -25
  38. data/lib/qrda-export/catI-r5/qrda_header/_participant.mustache +0 -7
  39. data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +0 -28
  40. data/lib/qrda-export/catI-r5/qrda_templates/adverse_event.mustache +0 -28
  41. data/lib/qrda-export/catI-r5/qrda_templates/allergy_intolerance.mustache +0 -28
  42. data/lib/qrda-export/catI-r5/qrda_templates/assessment_performed.mustache +0 -25
  43. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_patient_to_provider.mustache +0 -29
  44. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_patient.mustache +0 -24
  45. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_provider.mustache +0 -31
  46. data/lib/qrda-export/catI-r5/qrda_templates/device_applied.mustache +0 -32
  47. data/lib/qrda-export/catI-r5/qrda_templates/device_ordered.mustache +0 -31
  48. data/lib/qrda-export/catI-r5/qrda_templates/diagnosis.mustache +0 -38
  49. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_ordered.mustache +0 -19
  50. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache +0 -32
  51. data/lib/qrda-export/catI-r5/qrda_templates/encounter_ordered.mustache +0 -24
  52. data/lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache +0 -40
  53. data/lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache +0 -29
  54. data/lib/qrda-export/catI-r5/qrda_templates/insurance_provider.mustache +0 -11
  55. data/lib/qrda-export/catI-r5/qrda_templates/intervention_ordered.mustache +0 -18
  56. data/lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache +0 -25
  57. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_ordered.mustache +0 -18
  58. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_performed.mustache +0 -22
  59. data/lib/qrda-export/catI-r5/qrda_templates/medication_active.mustache +0 -35
  60. data/lib/qrda-export/catI-r5/qrda_templates/medication_administered.mustache +0 -31
  61. data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +0 -55
  62. data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +0 -39
  63. data/lib/qrda-export/catI-r5/qrda_templates/medication_ordered.mustache +0 -38
  64. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_expired.mustache +0 -16
  65. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_performed.mustache +0 -25
  66. data/lib/qrda-export/catI-r5/qrda_templates/procedure_ordered.mustache +0 -19
  67. data/lib/qrda-export/catI-r5/qrda_templates/procedure_performed.mustache +0 -44
  68. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_admission_source.mustache +0 -6
  69. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_anatomical_location_site.mustache +0 -1
  70. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author.mustache +0 -7
  71. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author_participation.mustache +0 -7
  72. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_component.mustache +0 -11
  73. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_diagnosis.mustache +0 -19
  74. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_facility_location.mustache +0 -16
  75. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_mediation_frequency.mustache +0 -3
  76. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_details.mustache +0 -11
  77. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_ordinality.mustache +0 -1
  78. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_principal_diagnosis.mustache +0 -8
  79. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reason.mustache +0 -12
  80. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_related_to.mustache +0 -6
  81. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_results.mustache +0 -19
  82. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_severity.mustache +0 -8
  83. data/lib/qrda-export/helper/cat_1_view_helper.rb +0 -150
  84. data/lib/qrda-export/helper/code_system_helper.rb +0 -77
  85. data/lib/qrda-export/helper/date_helper.rb +0 -89
  86. data/lib/qrda-import/base-importers/demographics_importer.rb +0 -49
  87. data/lib/qrda-import/base-importers/medication_importer.rb +0 -23
  88. data/lib/qrda-import/base-importers/section_importer.rb +0 -203
  89. data/lib/qrda-import/cda_identifier.rb +0 -19
  90. data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +0 -24
  91. data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +0 -22
  92. data/lib/qrda-import/data-element-importers/assessment_performed_importer.rb +0 -26
  93. data/lib/qrda-import/data-element-importers/communication_from_patient_to_provider_importer.rb +0 -20
  94. data/lib/qrda-import/data-element-importers/communication_from_provider_to_patient_importer.rb +0 -20
  95. data/lib/qrda-import/data-element-importers/communication_from_provider_to_provider_importer.rb +0 -22
  96. data/lib/qrda-import/data-element-importers/device_applied_importer.rb +0 -26
  97. data/lib/qrda-import/data-element-importers/device_order_importer.rb +0 -21
  98. data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +0 -24
  99. data/lib/qrda-import/data-element-importers/diagnostic_study_order_importer.rb +0 -23
  100. data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +0 -33
  101. data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +0 -23
  102. data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +0 -42
  103. data/lib/qrda-import/data-element-importers/immunization_administered_importer.rb +0 -20
  104. data/lib/qrda-import/data-element-importers/intervention_order_importer.rb +0 -21
  105. data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +0 -25
  106. data/lib/qrda-import/data-element-importers/laboratory_test_order_importer.rb +0 -23
  107. data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +0 -31
  108. data/lib/qrda-import/data-element-importers/medication_active_importer.rb +0 -17
  109. data/lib/qrda-import/data-element-importers/medication_administered_importer.rb +0 -19
  110. data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +0 -19
  111. data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +0 -19
  112. data/lib/qrda-import/data-element-importers/medication_order_importer.rb +0 -18
  113. data/lib/qrda-import/data-element-importers/patient_characteristic_expired.rb +0 -22
  114. data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +0 -29
  115. data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +0 -29
  116. data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +0 -37
  117. data/lib/qrda-import/data-element-importers/substance_administered_importer.rb +0 -17
  118. data/lib/qrda-import/entry_finder.rb +0 -20
  119. data/lib/qrda-import/entry_package.rb +0 -16
  120. data/lib/qrda-import/narrative_reference_handler.rb +0 -33
  121. data/lib/qrda-import/patient_importer.rb +0 -111
@@ -1,21 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class DeviceOrderImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.130']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:entryRelationship/cda:supply/cda:id'
7
- @code_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:participant/cda:participantRole/cda:playingDevice/cda:code"
8
- @author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:author/cda:time"
9
- @reason_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.9']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
10
- @entry_class = QDM::DeviceOrder
11
- end
12
-
13
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
14
- device_order = super
15
- device_order.reason = extract_reason(entry_element)
16
- device_order
17
- end
18
-
19
- end
20
- end
21
- end
@@ -1,24 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class DiagnosisImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.137']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:entryRelationship/cda:observation/cda:id'
7
- @code_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:value"
8
- @author_datetime_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:author/cda:time"
9
- @prevalence_period_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:effectiveTime"
10
- @anatomical_location_site_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:targetSiteCode"
11
- @severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.135']/cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"
12
- @entry_class = QDM::Diagnosis
13
- end
14
-
15
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
16
- diagnosis = super
17
- diagnosis.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
18
- diagnosis.severity = code_if_present(entry_element.at_xpath(@severity_xpath))
19
- diagnosis
20
- end
21
-
22
- end
23
- end
24
- end
@@ -1,23 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class DiagnosticStudyOrderImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.17']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @method_xpath = './cda:methodCode'
10
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
11
- @entry_class = QDM::DiagnosticStudyOrder
12
- end
13
-
14
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
15
- diagnostic_study_order = super
16
- diagnostic_study_order.method = code_if_present(entry_element.at_xpath(@method_xpath))
17
- diagnostic_study_order.reason = extract_reason(entry_element)
18
- diagnostic_study_order
19
- end
20
-
21
- end
22
- end
23
- end
@@ -1,33 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class DiagnosticStudyPerformedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.18']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @relevant_period_xpath = "./cda:effectiveTime"
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
11
- @result_datetime_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:effectiveTime"
12
- @status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
13
- @method_xpath = './cda:methodCode'
14
- @facility_location_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']/cda:participantRole[@classCode='SDLOC']/cda:code"
15
- @components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
16
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
17
- @entry_class = QDM::DiagnosticStudyPerformed
18
- end
19
-
20
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
21
- diagnostic_study_performed = super
22
- diagnostic_study_performed.resultDatetime = extract_time(entry_element, @result_datetime_xpath)
23
- diagnostic_study_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
24
- diagnostic_study_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
25
- diagnostic_study_performed.facilityLocation = code_if_present(entry_element.at_xpath(@facility_location_xpath))
26
- diagnostic_study_performed.components = extract_components(entry_element)
27
- diagnostic_study_performed.reason = extract_reason(entry_element)
28
- diagnostic_study_performed
29
- end
30
-
31
- end
32
- end
33
- end
@@ -1,23 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class EncounterOrderImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.132']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:entryRelationship/cda:encounter/cda:id'
7
- @code_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:code"
8
- @author_datetime_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:author/cda:time"
9
- @facility_location_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']/cda:participantRole[@classCode='SDLOC']/cda:code"
10
- @reason_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.22']/cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
11
- @entry_class = QDM::EncounterOrder
12
- end
13
-
14
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
15
- encounter_order = super
16
- encounter_order.facilityLocation = code_if_present(entry_element.at_xpath(@facility_location_xpath))
17
- encounter_order.reason = extract_reason(entry_element)
18
- encounter_order
19
- end
20
-
21
- end
22
- end
23
- end
@@ -1,42 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class EncounterPerformedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.133']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:entryRelationship/cda:encounter/cda:id'
7
- @code_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:code"
8
- @relevant_period_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:effectiveTime"
9
- @author_datetime_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:author/cda:time"
10
- @admission_source_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:participant/cda:participantRole[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.151']/cda:code"
11
- @discharge_disposition_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/sdtc:dischargeDispositionCode"
12
- @facility_xpath = "./cda:entryRelationship/cda:encounter/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
13
- @principal_diagnosis_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:entryRelationship/cda:observation[cda:code/@code='8319008']/cda:value"
14
- @diagnosis_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:entryRelationship/cda:act/cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.4']"
15
- @entry_class = QDM::EncounterPerformed
16
- end
17
-
18
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
19
- encounter_performed = super
20
- encounter_performed.admissionSource = code_if_present(entry_element.at_xpath(@admission_source_xpath))
21
- encounter_performed.dischargeDisposition = code_if_present(entry_element.at_xpath(@discharge_disposition_xpath))
22
- extract_facility(entry_element, encounter_performed)
23
- encounter_performed.principalDiagnosis = code_if_present(entry_element.at_xpath(@principal_diagnosis_xpath))
24
- encounter_performed.diagnoses = extract_diagnoses(entry_element)
25
- encounter_performed
26
- end
27
-
28
- private
29
-
30
- def extract_diagnoses(parent_element)
31
- diagnosis_elements = parent_element.xpath(@diagnosis_xpath)
32
- diagnosis_list = []
33
- diagnosis_elements.each do |diagnosis_element|
34
- diagnosis_value = diagnosis_element.at_xpath("./cda:value")
35
- diagnosis_list << code_if_present(diagnosis_value)
36
- end
37
- diagnosis_list.empty? ? nil : diagnosis_list
38
- end
39
-
40
- end
41
- end
42
- end
@@ -1,20 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class ImmunizationAdministeredImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.140']"))
5
- super(entry_finder)
6
- @relevant_period_xpath = nil
7
- @author_datetime_xpath = "./cda:effectiveTime"
8
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
9
- @entry_class = QDM::ImmunizationAdministered
10
- end
11
-
12
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
13
- immunization_administered = super
14
- immunization_administered.reason = extract_reason(entry_element)
15
- immunization_administered
16
- end
17
-
18
- end
19
- end
20
- end
@@ -1,21 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class InterventionOrderImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.31']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
10
- @entry_class = QDM::InterventionOrder
11
- end
12
-
13
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
14
- intervention_order = super
15
- intervention_order.reason = extract_reason(entry_element)
16
- intervention_order
17
- end
18
-
19
- end
20
- end
21
- end
@@ -1,25 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class InterventionPerformedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.32']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @relevant_period_xpath = "./cda:effectiveTime"
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation/cda:value"
11
- @status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
12
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
13
- @entry_class = QDM::InterventionPerformed
14
- end
15
-
16
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
17
- intervention_performed = super
18
- intervention_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
19
- intervention_performed.reason = extract_reason(entry_element)
20
- intervention_performed
21
- end
22
-
23
- end
24
- end
25
- end
@@ -1,23 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class LaboratoryTestOrderImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.37']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @method_xpath = './cda:methodCode'
10
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
11
- @entry_class = QDM::LaboratoryTestOrder
12
- end
13
-
14
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
15
- laboratory_test_order = super
16
- laboratory_test_order.method = code_if_present(entry_element.at_xpath(@method_xpath))
17
- laboratory_test_order.reason = extract_reason(entry_element)
18
- laboratory_test_order
19
- end
20
-
21
- end
22
- end
23
- end
@@ -1,31 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class LaboratoryTestPerformedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.38']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @relevant_period_xpath = "./cda:effectiveTime"
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
11
- @method_xpath = './cda:methodCode'
12
- @result_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
13
- @result_datetime_xpath = "./cda:entryRelationship[@typeCode='REFR']/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:effectiveTime"
14
- @components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
15
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
16
- @entry_class = QDM::LaboratoryTestPerformed
17
- end
18
-
19
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
20
- laboratory_test_performed = super
21
- laboratory_test_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
22
- laboratory_test_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
23
- laboratory_test_performed.resultDatetime = extract_time(entry_element, @result_datetime_xpath)
24
- laboratory_test_performed.components = extract_components(entry_element)
25
- laboratory_test_performed.reason = extract_reason(entry_element)
26
- laboratory_test_performed
27
- end
28
-
29
- end
30
- end
31
- end
@@ -1,17 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class MedicationActiveImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.41']"))
5
- super(entry_finder)
6
- @author_datetime_xpath = nil
7
- @entry_class = QDM::MedicationActive
8
- end
9
-
10
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
11
- medication_active = super
12
- medication_active
13
- end
14
-
15
- end
16
- end
17
- end
@@ -1,19 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class MedicationAdministeredImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.42']"))
5
- super(entry_finder)
6
- @route_xpath = "./cda:routeCode"
7
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
8
- @entry_class = QDM::MedicationAdministered
9
- end
10
-
11
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
12
- medication_administered = super
13
- medication_administered.reason = extract_reason(entry_element)
14
- medication_administered
15
- end
16
-
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class MedicationDischargeImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.105']"))
5
- super(entry_finder)
6
- @code_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
7
- @relevant_period_xpath = nil
8
- @author_datetime_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:author/cda:time"
9
- @entry_class = QDM::MedicationDischarge
10
- end
11
-
12
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
13
- medication_discharge = super
14
- medication_discharge
15
- end
16
-
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class MedicationDispensedImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.139']"))
5
- super(entry_finder)
6
- @relevant_period_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
7
- @author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:author/cda:time"
8
- @code_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:product/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
9
- @entry_class = QDM::MedicationDispensed
10
- end
11
-
12
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
13
- medication_dispensed = super
14
- medication_dispensed
15
- end
16
-
17
- end
18
- end
19
- end
@@ -1,18 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class MedicationOrderImporter < MedicationImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.47']"))
5
- super(entry_finder)
6
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
7
- @entry_class = QDM::MedicationOrder
8
- end
9
-
10
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
11
- medication_order = super
12
- medication_order.reason = extract_reason(entry_element)
13
- medication_order
14
- end
15
-
16
- end
17
- end
18
- end
@@ -1,22 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class PatientCharacteristicExpired < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.54']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:value'
8
- @expired_datetime_xpath = './cda:effectiveTime/cda:low'
9
- @cause = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.4']/cda:value"
10
- @entry_class = QDM::PatientCharacteristicExpired
11
- end
12
-
13
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
14
- patient_characteristic_expired = super
15
- patient_characteristic_expired.expiredDatetime = extract_time(entry_element, @expired_datetime_xpath)
16
- patient_characteristic_expired.cause = code_if_present(entry_element.at_xpath(@cause))
17
- patient_characteristic_expired
18
- end
19
-
20
- end
21
- end
22
- end
@@ -1,29 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class PhysicalExamPerformedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.59']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = "./cda:code"
8
- @relevant_period_xpath = "./cda:effectiveTime"
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @method_xpath = './cda:methodCode'
11
- @result_xpath = "./cda:value"
12
- @anatomical_location_site_xpath = "./cda:targetSiteCode"
13
- @components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
14
- @reason_xpath = "./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value"
15
- @entry_class = QDM::PhysicalExamPerformed
16
- end
17
-
18
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
19
- physical_exam_performed = super
20
- physical_exam_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
21
- physical_exam_performed.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
22
- physical_exam_performed.components = extract_components(entry_element)
23
- physical_exam_performed.reason = extract_reason(entry_element)
24
- physical_exam_performed
25
- end
26
-
27
- end
28
- end
29
- end