cqm-reports 1.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +33 -0
- data/README.md +27 -0
- data/Rakefile +16 -0
- data/lib/cqm_report.rb +77 -0
- data/lib/ext/code.rb +11 -0
- data/lib/ext/data_element.rb +24 -0
- data/lib/html-export/qdm-patient/_header_css.mustache +61 -0
- data/lib/html-export/qdm-patient/_javascript.mustache +52 -0
- data/lib/html-export/qdm-patient/data_element/_data_element.mustache +4 -0
- data/lib/html-export/qdm-patient/data_element/_data_element_codes.mustache +9 -0
- data/lib/html-export/qdm-patient/data_element/_data_element_other_fields.mustache +106 -0
- data/lib/html-export/qdm-patient/data_element/_data_element_times.mustache +44 -0
- data/lib/html-export/qdm-patient/qdm_patient.mustache +73 -0
- data/lib/html-export/qdm-patient/qdm_patient.rb +47 -0
- data/lib/qrda-export/catI-r5/_code.mustache +1 -0
- data/lib/qrda-export/catI-r5/_codes.mustache +10 -0
- data/lib/qrda-export/catI-r5/_header.mustache +28 -0
- data/lib/qrda-export/catI-r5/_measure_section.mustache +59 -0
- data/lib/qrda-export/catI-r5/_reporting_period.mustache +23 -0
- data/lib/qrda-export/catI-r5/qrda1_r5.mustache +209 -0
- data/lib/qrda-export/catI-r5/qrda1_r5.rb +220 -0
- data/lib/qrda-export/catI-r5/qrda_header/_author.mustache +26 -0
- data/lib/qrda-export/catI-r5/qrda_header/_custodian.mustache +43 -0
- data/lib/qrda-export/catI-r5/qrda_header/_documentation_of_service_event.mustache +88 -0
- data/lib/qrda-export/catI-r5/qrda_header/_information_recipient.mustache +7 -0
- data/lib/qrda-export/catI-r5/qrda_header/_legal_authenticator.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_header/_participant.mustache +7 -0
- data/lib/qrda-export/catI-r5/qrda_header/_record_target.mustache +44 -0
- data/lib/qrda-export/catI-r5/qrda_templates/adverse_event.mustache +40 -0
- data/lib/qrda-export/catI-r5/qrda_templates/allergy_intolerance.mustache +42 -0
- data/lib/qrda-export/catI-r5/qrda_templates/assessment_order.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_templates/assessment_performed.mustache +38 -0
- data/lib/qrda-export/catI-r5/qrda_templates/assessment_recommended.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_templates/communication_performed.mustache +62 -0
- data/lib/qrda-export/catI-r5/qrda_templates/device_applied.mustache +41 -0
- data/lib/qrda-export/catI-r5/qrda_templates/device_order.mustache +38 -0
- data/lib/qrda-export/catI-r5/qrda_templates/device_recommended.mustache +37 -0
- data/lib/qrda-export/catI-r5/qrda_templates/diagnosis.mustache +55 -0
- data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_order.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_performed.mustache +50 -0
- data/lib/qrda-export/catI-r5/qrda_templates/diagnostic_study_recommended.mustache +21 -0
- data/lib/qrda-export/catI-r5/qrda_templates/encounter_order.mustache +35 -0
- data/lib/qrda-export/catI-r5/qrda_templates/encounter_performed.mustache +52 -0
- data/lib/qrda-export/catI-r5/qrda_templates/encounter_recommended.mustache +37 -0
- data/lib/qrda-export/catI-r5/qrda_templates/family_history.mustache +37 -0
- data/lib/qrda-export/catI-r5/qrda_templates/immunization_administered.mustache +35 -0
- data/lib/qrda-export/catI-r5/qrda_templates/immunization_order.mustache +46 -0
- data/lib/qrda-export/catI-r5/qrda_templates/intervention_order.mustache +24 -0
- data/lib/qrda-export/catI-r5/qrda_templates/intervention_performed.mustache +36 -0
- data/lib/qrda-export/catI-r5/qrda_templates/intervention_recommended.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_order.mustache +24 -0
- data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_performed.mustache +42 -0
- data/lib/qrda-export/catI-r5/qrda_templates/laboratory_test_recommended.mustache +25 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_active.mustache +32 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_administered.mustache +39 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_discharge.mustache +63 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_dispensed.mustache +70 -0
- data/lib/qrda-export/catI-r5/qrda_templates/medication_order.mustache +64 -0
- data/lib/qrda-export/catI-r5/qrda_templates/patient_care_experience.mustache +14 -0
- data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_clinical_trial_participant.mustache +18 -0
- data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_expired.mustache +32 -0
- data/lib/qrda-export/catI-r5/qrda_templates/patient_characteristic_payer.mustache +14 -0
- data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_order.mustache +30 -0
- data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_performed.mustache +45 -0
- data/lib/qrda-export/catI-r5/qrda_templates/physical_exam_recommended.mustache +30 -0
- data/lib/qrda-export/catI-r5/qrda_templates/procedure_order.mustache +32 -0
- data/lib/qrda-export/catI-r5/qrda_templates/procedure_performed.mustache +64 -0
- data/lib/qrda-export/catI-r5/qrda_templates/procedure_recommended.mustache +34 -0
- data/lib/qrda-export/catI-r5/qrda_templates/provider_care_experience.mustache +15 -0
- data/lib/qrda-export/catI-r5/qrda_templates/provider_characteristic.mustache +15 -0
- data/lib/qrda-export/catI-r5/qrda_templates/substance_recommended.mustache +35 -0
- data/lib/qrda-export/catI-r5/qrda_templates/symptom.mustache +48 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_admission_source.mustache +6 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_anatomical_location_site.mustache +1 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author.mustache +29 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_author_participation.mustache +8 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_component.mustache +13 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_data_element_codes_as_values.mustache +10 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_days_supplied.mustache +6 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_encounter_diagnosis.mustache +21 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_facility_location.mustache +24 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_immunization_details.mustache +14 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_details.mustache +36 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_medication_supply_request.mustache +17 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_method.mustache +1 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_ordinality.mustache +1 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_principal_diagnosis.mustache +8 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reaction_observation.mustache +9 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_reason.mustache +12 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_related_to.mustache +6 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_results.mustache +24 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_severity.mustache +8 -0
- data/lib/qrda-export/catI-r5/qrda_templates/template_partials/_status.mustache +8 -0
- data/lib/qrda-export/catIII-r2-1/_continuous_variable_value.mustache +17 -0
- data/lib/qrda-export/catIII-r2-1/_header.mustache +25 -0
- data/lib/qrda-export/catIII-r2-1/_measure_data.mustache +41 -0
- data/lib/qrda-export/catIII-r2-1/_measure_section.mustache +74 -0
- data/lib/qrda-export/catIII-r2-1/_reporting_period.mustache +23 -0
- data/lib/qrda-export/catIII-r2-1/_stratification.mustache +29 -0
- data/lib/qrda-export/catIII-r2-1/_supplemental_data.mustache +28 -0
- data/lib/qrda-export/catIII-r2-1/qrda3_r21.mustache +11 -0
- data/lib/qrda-export/catIII-r2-1/qrda3_r21.rb +127 -0
- data/lib/qrda-export/catIII-r2-1/qrda_header/_author.mustache +25 -0
- data/lib/qrda-export/catIII-r2-1/qrda_header/_custodian.mustache +17 -0
- data/lib/qrda-export/catIII-r2-1/qrda_header/_documentation_of_service_event.mustache +88 -0
- data/lib/qrda-export/catIII-r2-1/qrda_header/_legal_authenticator.mustache +25 -0
- data/lib/qrda-export/helper/aggregate_object_helper.rb +154 -0
- data/lib/qrda-export/helper/cat1_view_helper.rb +81 -0
- data/lib/qrda-export/helper/date_helper.rb +108 -0
- data/lib/qrda-export/helper/frequency_helper.rb +83 -0
- data/lib/qrda-export/helper/patient_view_helper.rb +46 -0
- data/lib/qrda-export/helper/view_helper.rb +28 -0
- data/lib/qrda-import/base-importers/demographics_importer.rb +38 -0
- data/lib/qrda-import/base-importers/section_importer.rb +237 -0
- data/lib/qrda-import/cda_identifier.rb +20 -0
- data/lib/qrda-import/data-element-importers/adverse_event_importer.rb +26 -0
- data/lib/qrda-import/data-element-importers/allergy_intolerance_importer.rb +24 -0
- data/lib/qrda-import/data-element-importers/assessment_order_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/assessment_performed_importer.rb +24 -0
- data/lib/qrda-import/data-element-importers/assessment_recommended_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/communication_performed_importer.rb +30 -0
- data/lib/qrda-import/data-element-importers/device_applied_importer.rb +22 -0
- data/lib/qrda-import/data-element-importers/device_order_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/device_recommended_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/diagnosis_importer.rb +24 -0
- data/lib/qrda-import/data-element-importers/diagnostic_study_order_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/diagnostic_study_performed_importer.rb +32 -0
- data/lib/qrda-import/data-element-importers/diagnostic_study_recommended_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/encounter_order_importer.rb +21 -0
- data/lib/qrda-import/data-element-importers/encounter_performed_importer.rb +46 -0
- data/lib/qrda-import/data-element-importers/encounter_recommended_importer.rb +21 -0
- data/lib/qrda-import/data-element-importers/family_history_importer.rb +21 -0
- data/lib/qrda-import/data-element-importers/immunization_administered_importer.rb +23 -0
- data/lib/qrda-import/data-element-importers/immunization_order_importer.rb +27 -0
- data/lib/qrda-import/data-element-importers/intervention_order_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/intervention_performed_importer.rb +23 -0
- data/lib/qrda-import/data-element-importers/intervention_recommended_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/laboratory_test_order_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/laboratory_test_performed_importer.rb +29 -0
- data/lib/qrda-import/data-element-importers/laboratory_test_recommended_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/medication_active_importer.rb +25 -0
- data/lib/qrda-import/data-element-importers/medication_administered_importer.rb +26 -0
- data/lib/qrda-import/data-element-importers/medication_discharge_importer.rb +32 -0
- data/lib/qrda-import/data-element-importers/medication_dispensed_importer.rb +37 -0
- data/lib/qrda-import/data-element-importers/medication_order_importer.rb +36 -0
- data/lib/qrda-import/data-element-importers/patient_care_experience_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/patient_characteristic_clinical_trial_participant_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/patient_characteristic_expired_importer.rb +22 -0
- data/lib/qrda-import/data-element-importers/patient_characteristic_payer_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/physical_exam_order_importer.rb +21 -0
- data/lib/qrda-import/data-element-importers/physical_exam_performed_importer.rb +27 -0
- data/lib/qrda-import/data-element-importers/physical_exam_recommended_importer.rb +21 -0
- data/lib/qrda-import/data-element-importers/procedure_order_importer.rb +23 -0
- data/lib/qrda-import/data-element-importers/procedure_performed_importer.rb +33 -0
- data/lib/qrda-import/data-element-importers/procedure_recommended_importer.rb +23 -0
- data/lib/qrda-import/data-element-importers/provider_care_experience_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/provider_characteristic_importer.rb +19 -0
- data/lib/qrda-import/data-element-importers/substance_administered_importer.rb +27 -0
- data/lib/qrda-import/data-element-importers/substance_order_importer.rb +29 -0
- data/lib/qrda-import/data-element-importers/substance_recommended_importer.rb +27 -0
- data/lib/qrda-import/data-element-importers/symptom_importer.rb +21 -0
- data/lib/qrda-import/entry_finder.rb +20 -0
- data/lib/qrda-import/entry_package.rb +16 -0
- data/lib/qrda-import/narrative_reference_handler.rb +33 -0
- data/lib/qrda-import/patient_importer.rb +128 -0
- data/lib/util/code_system_helper.rb +77 -0
- data/lib/util/hqmf_template_helper.rb +52 -0
- data/lib/util/hqmf_template_oid_map.json +654 -0
- data/lib/util/hqmfr2_template_oid_map.json +378 -0
- data/lib/util/hqmfr2cql_template_oid_map.json +390 -0
- data/lib/util/qrda_template_helper.rb +20 -0
- data/lib/util/qrdar5_1_template_oid_map.json +406 -0
- data/lib/util/qrdar5_template_oid_map.json +406 -0
- metadata +344 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class EncounterRecommendedImporter < 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.134']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:author/cda:time"
|
9
|
+
@facility_locations_xpath = "./cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.24']/cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
|
10
|
+
@entry_class = QDM::EncounterRecommended
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
14
|
+
encounter_recommended = super
|
15
|
+
encounter_recommended.facilityLocation = extract_facility_locations(entry_element)[0]
|
16
|
+
encounter_recommended
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class FamilyHistoryImporter < SectionImporter
|
4
|
+
def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:organizer[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.12']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:component/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.112']/cda:value"
|
8
|
+
@author_datetime_xpath = "./cda:component/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.112']/cda:author/cda:time"
|
9
|
+
@relationship_xpath = './cda:subject/cda:relatedSubject/cda:code'
|
10
|
+
@entry_class = QDM::FamilyHistory
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
14
|
+
family_history = super
|
15
|
+
family_history.relationship = code_if_present(entry_element.at_xpath(@relationship_xpath))
|
16
|
+
family_history
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class ImmunizationAdministeredImporter < SectionImporter
|
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
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:effectiveTime"
|
9
|
+
@dosage_xpath = "./cda:doseQuantity"
|
10
|
+
@route_xpath = "./cda:routeCode"
|
11
|
+
@entry_class = QDM::ImmunizationAdministered
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
15
|
+
immunization_administered = super
|
16
|
+
immunization_administered.dosage = extract_scalar(entry_element, @dosage_xpath)
|
17
|
+
immunization_administered.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
18
|
+
immunization_administered
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class ImmunizationOrderImporter < SectionImporter
|
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.143']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@active_datetime_xpath = "./cda:effectiveTime"
|
9
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
10
|
+
@dosage_xpath = "./cda:doseQuantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
|
+
@route_xpath = "./cda:routeCode"
|
13
|
+
@entry_class = QDM::ImmunizationOrder
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
17
|
+
immunization_order = super
|
18
|
+
immunization_order.activeDatetime = extract_interval(entry_element, @active_datetime_xpath).low
|
19
|
+
immunization_order.dosage = extract_scalar(entry_element, @dosage_xpath)
|
20
|
+
immunization_order.supply = extract_scalar(entry_element, @supply_xpath)
|
21
|
+
immunization_order.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
22
|
+
immunization_order
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
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
|
+
@entry_class = QDM::InterventionOrder
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
intervention_order = super
|
14
|
+
intervention_order
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
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/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/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
|
+
@entry_class = QDM::InterventionPerformed
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
16
|
+
intervention_performed = super
|
17
|
+
intervention_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
|
18
|
+
intervention_performed
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class InterventionRecommendedImporter < 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.33']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:code'
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@entry_class = QDM::InterventionRecommended
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
intervention_recommended = super
|
14
|
+
intervention_recommended
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
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
|
+
@entry_class = QDM::LaboratoryTestOrder
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
laboratory_test_order = super
|
14
|
+
laboratory_test_order
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,29 @@
|
|
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/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:effectiveTime"
|
14
|
+
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
15
|
+
@entry_class = QDM::LaboratoryTestPerformed
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
19
|
+
laboratory_test_performed = super
|
20
|
+
laboratory_test_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
|
21
|
+
laboratory_test_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
|
22
|
+
laboratory_test_performed.resultDatetime = extract_time(entry_element, @result_datetime_xpath)
|
23
|
+
laboratory_test_performed.components = extract_components(entry_element)
|
24
|
+
laboratory_test_performed
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class LaboratoryTestRecommendedImporter < 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.39']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:code'
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@entry_class = QDM::LaboratoryTestRecommended
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
laboratory_test_recommended = super
|
14
|
+
laboratory_test_recommended
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class MedicationActiveImporter < SectionImporter
|
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
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@relevant_period_xpath = "./cda:effectiveTime"
|
9
|
+
@dosage_xpath = "./cda:doseQuantity"
|
10
|
+
@frequency_xpath = "./cda:effectiveTime[@operator='A']/cda:period"
|
11
|
+
@route_xpath = "./cda:routeCode"
|
12
|
+
@entry_class = QDM::MedicationActive
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
16
|
+
medication_active = super
|
17
|
+
medication_active.dosage = extract_scalar(entry_element, @dosage_xpath)
|
18
|
+
medication_active.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
19
|
+
medication_active.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
20
|
+
medication_active
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class MedicationAdministeredImporter < SectionImporter
|
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
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@relevant_period_xpath = "./cda:effectiveTime"
|
10
|
+
@dosage_xpath = "./cda:doseQuantity"
|
11
|
+
@frequency_xpath = "./cda:effectiveTime[@operator='A']/cda:period"
|
12
|
+
@route_xpath = "./cda:routeCode"
|
13
|
+
@entry_class = QDM::MedicationAdministered
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
17
|
+
medication_administered = super
|
18
|
+
medication_administered.dosage = extract_scalar(entry_element, @dosage_xpath)
|
19
|
+
medication_administered.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
20
|
+
medication_administered.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
21
|
+
medication_administered
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class MedicationDischargeImporter < 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.105']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@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"
|
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
|
+
@refills_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:repeatNumber"
|
10
|
+
@dosage_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:doseQuantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
|
+
@frequency_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:effectiveTime[@operator='A']/cda:period"
|
13
|
+
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
14
|
+
@route_xpath = "./cda:entryRelationship/cda:substanceAdministration[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.16']/cda:routeCode"
|
15
|
+
|
16
|
+
@entry_class = QDM::MedicationDischarge
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
20
|
+
medication_discharge = super
|
21
|
+
medication_discharge.refills = extract_scalar(entry_element, @refills_xpath)&.value
|
22
|
+
medication_discharge.dosage = extract_scalar(entry_element, @dosage_xpath)
|
23
|
+
medication_discharge.supply = extract_scalar(entry_element, @supply_xpath)
|
24
|
+
medication_discharge.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
25
|
+
medication_discharge.daysSupplied = extract_scalar(entry_element, @days_supplied_xpath)&.value
|
26
|
+
medication_discharge.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
27
|
+
medication_discharge
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class MedicationDispensedImporter < 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.139']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@entry_does_not_have_reason = true
|
7
|
+
@id_xpath = './cda:id'
|
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
|
+
@relevant_period_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:effectiveTime"
|
10
|
+
@author_datetime_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:author/cda:time"
|
11
|
+
@refills_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:repeatNumber"
|
12
|
+
@dosage_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:doseQuantity"
|
13
|
+
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
14
|
+
@frequency_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:effectiveTime[@operator='A']/cda:period"
|
15
|
+
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
16
|
+
@route_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:entryRelationship/cda:substanceAdministration/cda:routeCode"
|
17
|
+
@dispenser_id_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:author/cda:assignedAuthor/cda:id"
|
18
|
+
@prescriber_id_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.18']/cda:participant/cda:participantRole/cda:id"
|
19
|
+
@entry_class = QDM::MedicationDispensed
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
23
|
+
medication_dispensed = super
|
24
|
+
medication_dispensed.refills = extract_scalar(entry_element, @refills_xpath)&.value
|
25
|
+
medication_dispensed.dosage = extract_scalar(entry_element, @dosage_xpath)
|
26
|
+
medication_dispensed.supply = extract_scalar(entry_element, @supply_xpath)
|
27
|
+
medication_dispensed.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
28
|
+
medication_dispensed.daysSupplied = extract_scalar(entry_element, @days_supplied_xpath)&.value
|
29
|
+
medication_dispensed.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
30
|
+
medication_dispensed.prescriberId = extract_id(entry_element, @prescriber_id_xpath)
|
31
|
+
medication_dispensed.dispenserId = extract_id(entry_element, @dispenser_id_xpath)
|
32
|
+
medication_dispensed
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class MedicationOrderImporter < SectionImporter
|
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
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
|
8
|
+
@relevant_period_xpath = "./cda:effectiveTime"
|
9
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
10
|
+
@dosage_xpath = "./cda:doseQuantity"
|
11
|
+
@supply_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.99']/cda:quantity"
|
12
|
+
@frequency_xpath = "./cda:effectiveTime[@operator='A']/cda:period"
|
13
|
+
@refills_xpath = "./cda:repeatNumber"
|
14
|
+
@route_xpath = "./cda:routeCode"
|
15
|
+
@setting_xpath = "./cda:participant/cda:participantRole/cda:code"
|
16
|
+
@prescriber_id_xpath = "./cda:author/cda:assignedAuthor/cda:id"
|
17
|
+
@days_supplied_xpath = "./cda:entryRelationship/cda:supply[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.157']/cda:quantity"
|
18
|
+
@entry_class = QDM::MedicationOrder
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
22
|
+
medication_order = super
|
23
|
+
medication_order.dosage = extract_scalar(entry_element, @dosage_xpath)
|
24
|
+
medication_order.supply = extract_scalar(entry_element, @supply_xpath)
|
25
|
+
medication_order.frequency = frequency_as_coded_value(entry_element, @frequency_xpath)
|
26
|
+
medication_order.refills = extract_scalar(entry_element, @refills_xpath)&.value
|
27
|
+
medication_order.route = code_if_present(entry_element.at_xpath(@route_xpath))
|
28
|
+
medication_order.setting = code_if_present(entry_element.at_xpath(@setting_xpath))
|
29
|
+
medication_order.prescriberId = extract_id(entry_element, @prescriber_id_xpath)
|
30
|
+
medication_order.daysSupplied = extract_scalar(entry_element, @days_supplied_xpath)&.value
|
31
|
+
medication_order
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PatientCareExperienceImporter < 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.48']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:value'
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@entry_class = QDM::PatientCareExperience
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
patient_care_experience = super
|
14
|
+
patient_care_experience
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PatientCharacteristicClinicalTrialParticipantImporter < 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.51']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:value'
|
8
|
+
@relevant_period_xpath = "./cda:effectiveTime"
|
9
|
+
@entry_class = QDM::PatientCharacteristicClinicalTrialParticipant
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
patient_characteristic_clinical_trial_participant = super
|
14
|
+
patient_characteristic_clinical_trial_participant
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PatientCharacteristicExpiredImporter < 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
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PatientCharacteristicPayerImporter < 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.55']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:value'
|
8
|
+
@relevant_period_xpath = './cda:effectiveTime'
|
9
|
+
@entry_class = QDM::PatientCharacteristicPayer
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
13
|
+
patient_characteristic_payer = super
|
14
|
+
patient_characteristic_payer
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PhysicalExamOrderImporter < 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.58']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:value"
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
|
+
@entry_class = QDM::PhysicalExamOrder
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
14
|
+
physical_exam_order = super
|
15
|
+
physical_exam_order.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
16
|
+
physical_exam_order
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
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
|
+
@entry_class = QDM::PhysicalExamPerformed
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
18
|
+
physical_exam_performed = super
|
19
|
+
physical_exam_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
|
20
|
+
physical_exam_performed.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
21
|
+
physical_exam_performed.components = extract_components(entry_element)
|
22
|
+
physical_exam_performed
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class PhysicalExamRecommendedImporter < 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.60']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:value"
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
|
+
@entry_class = QDM::PhysicalExamRecommended
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
14
|
+
physical_exam_recommended = super
|
15
|
+
physical_exam_recommended.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
16
|
+
physical_exam_recommended
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class ProcedureOrderImporter < 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.63']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = './cda:code'
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
|
+
@ordinality_xpath = "./cda:priorityCode"
|
11
|
+
@entry_class = QDM::ProcedureOrder
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
15
|
+
procedure_order = super
|
16
|
+
procedure_order.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
17
|
+
procedure_order.ordinality = code_if_present(entry_element.at_xpath(@ordinality_xpath))
|
18
|
+
procedure_order
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class ProcedurePerformedImporter < 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.64']"))
|
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:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.2']/cda:value"
|
12
|
+
@status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.93']/cda:value"
|
13
|
+
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
14
|
+
@ordinality_xpath = "./cda:priorityCode"
|
15
|
+
@incision_datetime_xpath = "./cda:entryRelationship/cda:procedure[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.89']/cda:effectiveTime"
|
16
|
+
@components_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.149']"
|
17
|
+
@entry_class = QDM::ProcedurePerformed
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
21
|
+
procedure_performed = super
|
22
|
+
procedure_performed.method = code_if_present(entry_element.at_xpath(@method_xpath))
|
23
|
+
procedure_performed.status = code_if_present(entry_element.at_xpath(@status_xpath))
|
24
|
+
procedure_performed.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
25
|
+
procedure_performed.ordinality = code_if_present(entry_element.at_xpath(@ordinality_xpath))
|
26
|
+
procedure_performed.incisionDatetime = extract_time(entry_element, @incision_datetime_xpath)
|
27
|
+
procedure_performed.components = extract_components(entry_element)
|
28
|
+
procedure_performed
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module QRDA
|
2
|
+
module Cat1
|
3
|
+
class ProcedureRecommendedImporter < 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.65']"))
|
5
|
+
super(entry_finder)
|
6
|
+
@id_xpath = './cda:id'
|
7
|
+
@code_xpath = "./cda:code"
|
8
|
+
@author_datetime_xpath = "./cda:author/cda:time"
|
9
|
+
@anatomical_location_site_xpath = "./cda:targetSiteCode"
|
10
|
+
@ordinality_xpath = "./cda:priorityCode"
|
11
|
+
@entry_class = QDM::ProcedureRecommended
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
15
|
+
procedure_recommended = super
|
16
|
+
procedure_recommended.anatomicalLocationSite = code_if_present(entry_element.at_xpath(@anatomical_location_site_xpath))
|
17
|
+
procedure_recommended.ordinality = code_if_present(entry_element.at_xpath(@ordinality_xpath))
|
18
|
+
procedure_recommended
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|