cqm-parsers 0.2.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +8 -4
  3. data/README.md +44 -5
  4. data/Rakefile +1 -0
  5. data/lib/ext/data_element.rb +1 -1
  6. data/lib/hqmf-parser.rb +13 -45
  7. data/lib/hqmf-parser/2.0/document.rb +1 -1
  8. data/lib/hqmf-parser/cql/document_helpers/doc_population_helper.rb +6 -1
  9. data/lib/measure-loader/cql_loader.rb +165 -0
  10. data/lib/measure-loader/elm_dependency_finder.rb +72 -0
  11. data/lib/measure-loader/elm_parser.rb +67 -0
  12. data/lib/measure-loader/exceptions.rb +10 -0
  13. data/lib/measure-loader/helpers.rb +11 -0
  14. data/lib/measure-loader/hqmf_measure_loader.rb +170 -0
  15. data/lib/measure-loader/mat_measure_files.rb +138 -0
  16. data/lib/measure-loader/source_data_criteria_loader.rb +65 -0
  17. data/lib/measure-loader/value_set_helpers.rb +68 -0
  18. data/lib/measure-loader/vsac_value_set_loader.rb +97 -0
  19. data/lib/util/util.rb +23 -0
  20. data/lib/util/vsac_api.rb +164 -101
  21. metadata +47 -129
  22. data/lib/ext/code.rb +0 -10
  23. data/lib/qrda-export/catI-r5/_code.mustache +0 -1
  24. data/lib/qrda-export/catI-r5/_codes.mustache +0 -10
  25. data/lib/qrda-export/catI-r5/_header.mustache +0 -28
  26. data/lib/qrda-export/catI-r5/_measure_section.mustache +0 -59
  27. data/lib/qrda-export/catI-r5/_reporting_period.mustache +0 -23
  28. data/lib/qrda-export/catI-r5/_values.mustache +0 -10
  29. data/lib/qrda-export/catI-r5/qrda1_r5.mustache +0 -137
  30. data/lib/qrda-export/catI-r5/qrda1_r5.rb +0 -125
  31. data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +0 -24
  32. data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +0 -43
  33. data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +0 -82
  34. data/lib/qrda-export/catI-r5/qrda_header/_information_recipient.mustache +0 -7
  35. data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +0 -25
  36. data/lib/qrda-export/catI-r5/qrda_header/_participant.mustache +0 -7
  37. data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +0 -28
  38. data/lib/qrda-export/catI-r5/qrda_templates/adverse_event.mustache +0 -28
  39. data/lib/qrda-export/catI-r5/qrda_templates/allergy_intolerance.mustache +0 -28
  40. data/lib/qrda-export/catI-r5/qrda_templates/assessment_performed.mustache +0 -25
  41. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_patient_to_provider.mustache +0 -29
  42. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_patient.mustache +0 -24
  43. data/lib/qrda-export/catI-r5/qrda_templates/communication_from_provider_to_provider.mustache +0 -31
  44. data/lib/qrda-export/catI-r5/qrda_templates/device_applied.mustache +0 -32
  45. data/lib/qrda-export/catI-r5/qrda_templates/device_ordered.mustache +0 -31
  46. data/lib/qrda-export/catI-r5/qrda_templates/diagnosis.mustache +0 -38
  47. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_ordered.mustache +0 -19
  48. data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache +0 -32
  49. data/lib/qrda-export/catI-r5/qrda_templates/encounter_ordered.mustache +0 -24
  50. data/lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache +0 -40
  51. data/lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache +0 -29
  52. data/lib/qrda-export/catI-r5/qrda_templates/insurance_provider.mustache +0 -11
  53. data/lib/qrda-export/catI-r5/qrda_templates/intervention_ordered.mustache +0 -18
  54. data/lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache +0 -25
  55. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_ordered.mustache +0 -18
  56. data/lib/qrda-export/catI-r5/qrda_templates/lab_test_performed.mustache +0 -22
  57. data/lib/qrda-export/catI-r5/qrda_templates/medication_active.mustache +0 -35
  58. data/lib/qrda-export/catI-r5/qrda_templates/medication_administered.mustache +0 -31
  59. data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +0 -55
  60. data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +0 -39
  61. data/lib/qrda-export/catI-r5/qrda_templates/medication_ordered.mustache +0 -38
  62. data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_expired.mustache +0 -16
  63. data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_performed.mustache +0 -25
  64. data/lib/qrda-export/catI-r5/qrda_templates/procedure_ordered.mustache +0 -19
  65. data/lib/qrda-export/catI-r5/qrda_templates/procedure_performed.mustache +0 -44
  66. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_admission_source.mustache +0 -6
  67. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_anatomical_location_site.mustache +0 -1
  68. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author.mustache +0 -7
  69. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author_participation.mustache +0 -7
  70. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_component.mustache +0 -11
  71. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_diagnosis.mustache +0 -19
  72. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_facility_location.mustache +0 -16
  73. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_mediation_frequency.mustache +0 -3
  74. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_details.mustache +0 -11
  75. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_ordinality.mustache +0 -1
  76. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_principal_diagnosis.mustache +0 -8
  77. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reason.mustache +0 -12
  78. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_related_to.mustache +0 -6
  79. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_results.mustache +0 -19
  80. data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_severity.mustache +0 -8
  81. data/lib/qrda-export/helper/cat_1_view_helper.rb +0 -150
  82. data/lib/qrda-export/helper/code_system_helper.rb +0 -77
  83. data/lib/qrda-export/helper/date_helper.rb +0 -89
  84. data/lib/qrda-import/base-importers/demographics_importer.rb +0 -49
  85. data/lib/qrda-import/base-importers/medication_importer.rb +0 -23
  86. data/lib/qrda-import/base-importers/section_importer.rb +0 -203
  87. data/lib/qrda-import/cda_identifier.rb +0 -19
  88. data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +0 -24
  89. data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +0 -22
  90. data/lib/qrda-import/data-element-importers/assessment_performed_importer.rb +0 -26
  91. data/lib/qrda-import/data-element-importers/communication_from_patient_to_provider_importer.rb +0 -20
  92. data/lib/qrda-import/data-element-importers/communication_from_provider_to_patient_importer.rb +0 -20
  93. data/lib/qrda-import/data-element-importers/communication_from_provider_to_provider_importer.rb +0 -22
  94. data/lib/qrda-import/data-element-importers/device_applied_importer.rb +0 -26
  95. data/lib/qrda-import/data-element-importers/device_order_importer.rb +0 -21
  96. data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +0 -24
  97. data/lib/qrda-import/data-element-importers/diagnostic_study_order_importer.rb +0 -23
  98. data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +0 -33
  99. data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +0 -23
  100. data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +0 -42
  101. data/lib/qrda-import/data-element-importers/immunization_administered_importer.rb +0 -20
  102. data/lib/qrda-import/data-element-importers/intervention_order_importer.rb +0 -21
  103. data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +0 -25
  104. data/lib/qrda-import/data-element-importers/laboratory_test_order_importer.rb +0 -23
  105. data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +0 -31
  106. data/lib/qrda-import/data-element-importers/medication_active_importer.rb +0 -17
  107. data/lib/qrda-import/data-element-importers/medication_administered_importer.rb +0 -19
  108. data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +0 -19
  109. data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +0 -19
  110. data/lib/qrda-import/data-element-importers/medication_order_importer.rb +0 -18
  111. data/lib/qrda-import/data-element-importers/patient_characteristic_expired.rb +0 -22
  112. data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +0 -29
  113. data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +0 -29
  114. data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +0 -37
  115. data/lib/qrda-import/data-element-importers/substance_administered_importer.rb +0 -17
  116. data/lib/qrda-import/entry_finder.rb +0 -20
  117. data/lib/qrda-import/entry_package.rb +0 -16
  118. data/lib/qrda-import/narrative_reference_handler.rb +0 -33
  119. data/lib/qrda-import/patient_importer.rb +0 -111
@@ -1,24 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class AdverseEventImporter < 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.146']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:entryRelationship/cda:observation/cda:value'
8
- @author_datetime_xpath = './cda:author/cda:time'
9
- @relevant_period_xpath = './cda:effectiveTime'
10
- @severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
11
- @facility_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
12
- @entry_class = QDM::AdverseEvent
13
- end
14
-
15
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
16
- adverse_event = super
17
- adverse_event.severity = code_if_present(entry_element.at_xpath(@severity_xpath))
18
- extract_facility(entry_element, adverse_event)
19
- adverse_event
20
- end
21
-
22
- end
23
- end
24
- end
@@ -1,22 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class AllergyIntoleranceImporter < 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.147']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:participant/cda:participantRole/cda:playingEntity/cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @prevalence_period_xpath = "./cda:effectiveTime"
10
- @severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
11
- @entry_class = QDM::AllergyIntolerance
12
- end
13
-
14
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
15
- allergy_intolerance = super
16
- allergy_intolerance.severity = code_if_present(entry_element.at_xpath(@severity_xpath))
17
- allergy_intolerance
18
- end
19
-
20
- end
21
- end
22
- end
@@ -1,26 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class AssessmentPerformedImporter < 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.144']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @result_xpath = "./cda:value"
10
- @method_xpath = './cda:methodCode'
11
- @components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
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::AssessmentPerformed
14
- end
15
-
16
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
17
- assessment_performed = super
18
- assessment_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
19
- assessment_performed.components = extract_components(entry_element)
20
- assessment_performed.reason = extract_reason(entry_element)
21
- assessment_performed
22
- end
23
-
24
- end
25
- end
26
- end
@@ -1,20 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class CommunicationFromPatientToProviderImporter < 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.2']"))
5
- super(entry_finder)
6
- @entry_does_not_have_reason = true
7
- @id_xpath = './cda:id'
8
- @code_xpath = './cda:code'
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @entry_class = QDM::CommunicationFromPatientToProvider
11
- end
12
-
13
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
14
- communication_from_patient_to_provider = super
15
- communication_from_patient_to_provider
16
- end
17
-
18
- end
19
- end
20
- end
@@ -1,20 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class CommunicationFromProviderToPatientImporter < 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.3']"))
5
- super(entry_finder)
6
- @entry_does_not_have_reason = true
7
- @id_xpath = './cda:id'
8
- @code_xpath = './cda:code'
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @entry_class = QDM::CommunicationFromProviderToPatient
11
- end
12
-
13
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
14
- communication_from_provider_to_patient = super
15
- communication_from_provider_to_patient
16
- end
17
-
18
- end
19
- end
20
- end
@@ -1,22 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class CommunicationFromProviderToProviderImporter < 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.4']"))
5
- super(entry_finder)
6
- @entry_does_not_have_reason = true
7
- @id_xpath = './cda:id'
8
- @code_xpath = './cda:code'
9
- @author_datetime_xpath = "./cda:author/cda:time"
10
- @related_to_xpath = "./sdtc:inFulfillmentOf1/sdtc:actReference"
11
- @entry_class = QDM::CommunicationFromProviderToProvider
12
- end
13
-
14
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
15
- communication_from_provider_to_provider = super
16
- communication_from_provider_to_provider.relatedTo = extract_related_to(entry_element)
17
- communication_from_provider_to_provider
18
- end
19
-
20
- end
21
- end
22
- end
@@ -1,26 +0,0 @@
1
- module QRDA
2
- module Cat1
3
- class DeviceAppliedImporter < SectionImporter
4
- def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:procedure[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.7']"))
5
- super(entry_finder)
6
- @id_xpath = './cda:id'
7
- @code_xpath = './cda:participant/cda:participantRole/cda:playingDevice/cda:code'
8
- @author_datetime_xpath = "./cda:author/cda:time"
9
- @relevant_period_xpath = "./cda:effectiveTime"
10
- @anatomical_location_site_xpath = "./cda:targetSiteCode"
11
- @anatomical_approach_site_xpath = "./cda:approachSiteCode"
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::DeviceApplied
14
- end
15
-
16
- def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
17
- device_applied = super
18
- device_applied.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
19
- device_applied.anatomicalApproachSite = code_if_present(entry_element.at_xpath(@anatomical_approach_site_xpath))
20
- device_applied.reason = extract_reason(entry_element)
21
- device_applied
22
- end
23
-
24
- end
25
- end
26
- end
@@ -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