health-data-standards 3.6.1 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -2
- data/Rakefile +2 -1
- data/lib/health-data-standards.rb +22 -1
- data/lib/health-data-standards/export/cat_1.rb +25 -6
- data/lib/health-data-standards/export/cat_1_r2.rb +8 -2
- data/lib/health-data-standards/export/cat_3.rb +8 -7
- data/lib/health-data-standards/export/exceptions.rb +13 -0
- data/lib/health-data-standards/export/helper/cat1_view_helper.rb +17 -11
- data/lib/health-data-standards/export/helper/html_view_helper.rb +13 -7
- data/lib/health-data-standards/export/helper/scooped_view_helper.rb +68 -25
- data/lib/health-data-standards/export/html.rb +9 -4
- data/lib/health-data-standards/export/qrda/entry_template_resolver.rb +29 -11
- data/lib/health-data-standards/export/qrda/hqmf-qrda-oids.json +89 -5
- data/lib/health-data-standards/export/rendering_context.rb +2 -2
- data/lib/health-data-standards/export/template_helper.rb +7 -2
- data/lib/health-data-standards/export/view_helper.rb +107 -39
- data/lib/health-data-standards/import/bulk_record_importer.rb +8 -5
- data/lib/health-data-standards/import/bundle/importer.rb +21 -14
- data/lib/health-data-standards/import/c32/care_goal_importer.rb +1 -1
- data/lib/health-data-standards/import/c32/immunization_importer.rb +1 -1
- data/lib/health-data-standards/import/cat1/clinical_trial_participant_importer.rb +20 -0
- data/lib/health-data-standards/import/cat1/device_order_importer.rb +20 -0
- data/lib/health-data-standards/import/cat1/diagnosis_active_importer.rb +4 -9
- data/lib/health-data-standards/import/cat1/diagnosis_importer.rb +15 -0
- data/lib/health-data-standards/import/cat1/diagnosis_inactive_importer.rb +1 -1
- data/lib/health-data-standards/import/cat1/diagnostic_study_order_importer.rb +6 -0
- data/lib/health-data-standards/import/cat1/encounter_order_act_importer.rb +19 -0
- data/lib/health-data-standards/import/cat1/encounter_performed_act_importer.rb +19 -0
- data/lib/health-data-standards/import/cat1/encounter_performed_importer.rb +16 -0
- data/lib/health-data-standards/import/cat1/immunization_administered_importer.rb +14 -0
- data/lib/health-data-standards/import/cat1/medication_dispensed_act_importer.rb +18 -0
- data/lib/health-data-standards/import/cat1/patient_importer.rb +44 -17
- data/lib/health-data-standards/import/cat1/procedure_order_importer.rb +4 -4
- data/lib/health-data-standards/import/cat1/procedure_performed_importer.rb +1 -0
- data/lib/health-data-standards/import/cat1/transfer_from_act_importer.rb +18 -0
- data/lib/health-data-standards/import/cat1/transfer_from_importer.rb +24 -0
- data/lib/health-data-standards/import/cat1/transfer_to_act_importer.rb +18 -0
- data/lib/health-data-standards/import/cat1/transfer_to_importer.rb +23 -0
- data/lib/health-data-standards/import/cda/allergy_importer.rb +1 -1
- data/lib/health-data-standards/import/cda/communication_importer.rb +55 -0
- data/lib/health-data-standards/import/cda/condition_importer.rb +17 -1
- data/lib/health-data-standards/import/cda/encounter_importer.rb +23 -21
- data/lib/health-data-standards/import/cda/medical_equipment_importer.rb +1 -0
- data/lib/health-data-standards/import/cda/medication_importer.rb +14 -4
- data/lib/health-data-standards/import/cda/procedure_importer.rb +4 -4
- data/lib/health-data-standards/import/cda/result_importer.rb +1 -1
- data/lib/health-data-standards/import/cda/section_importer.rb +59 -18
- data/lib/health-data-standards/models/assessment.rb +3 -0
- data/lib/health-data-standards/models/care_experience.rb +2 -0
- data/lib/health-data-standards/models/care_goal.rb +4 -0
- data/lib/health-data-standards/models/communication.rb +3 -0
- data/lib/health-data-standards/models/condition.rb +12 -9
- data/lib/health-data-standards/models/cqm/bundle.rb +2 -1
- data/lib/health-data-standards/models/cqm/measure.rb +2 -1
- data/lib/health-data-standards/models/cqm/patient_cache.rb +7 -3
- data/lib/health-data-standards/models/cqm/query_cache.rb +2 -0
- data/lib/health-data-standards/models/encounter.rb +14 -1
- data/lib/health-data-standards/models/encounter_principal_diagnosis.rb +36 -0
- data/lib/health-data-standards/models/entry.rb +5 -1
- data/lib/health-data-standards/models/family_history.rb +4 -0
- data/lib/health-data-standards/models/immunization.rb +1 -0
- data/lib/health-data-standards/models/lab_result.rb +10 -1
- data/lib/health-data-standards/models/medical_equipment.rb +2 -1
- data/lib/health-data-standards/models/medication.rb +19 -2
- data/lib/health-data-standards/models/patient_preference.rb +5 -0
- data/lib/health-data-standards/models/procedure.rb +16 -3
- data/lib/health-data-standards/models/provider.rb +17 -1
- data/lib/health-data-standards/models/provider_preference.rb +5 -0
- data/lib/health-data-standards/models/record.rb +8 -9
- data/lib/health-data-standards/models/reference.rb +1 -1
- data/lib/health-data-standards/models/svs/value_set.rb +28 -10
- data/lib/health-data-standards/models/transfer.rb +6 -1
- data/lib/health-data-standards/tasks/bundle.rake +5 -3
- data/lib/health-data-standards/util/hqmf_template_helper.rb +20 -14
- data/lib/health-data-standards/util/hqmfr2_template_oid_map.json +382 -0
- data/lib/health-data-standards/util/nlm_helper.rb +14 -0
- data/lib/health-data-standards/util/vs_api.rb +72 -54
- data/lib/health-data-standards/validate/measure_validator.rb +8 -3
- data/lib/health-data-standards/validate/performance_rate_validator.rb +1 -1
- data/lib/health-data-standards/validate/qrda_qdm_template_validator.rb +253 -0
- data/lib/health-data-standards/validate/reported_result_extractor.rb +5 -1
- data/lib/health-data-standards/validate/schematron_validator.rb +6 -0
- data/lib/health-data-standards/validate/validators.rb +49 -1
- data/lib/hqmf-generator/document.xml.erb +6 -5
- data/lib/hqmf-generator/field.xml.erb +1 -0
- data/lib/hqmf-generator/hqmf-generator.rb +85 -41
- data/lib/hqmf-generator/subset.xml.erb +15 -0
- data/lib/hqmf-generator/temporal_relationship.xml.erb +8 -3
- data/lib/hqmf-generator/temporal_relationship_attribute.xml.erb +10 -0
- data/lib/hqmf-generator/value.xml.erb +2 -2
- data/lib/hqmf-model/data_criteria.json +88 -17
- data/lib/hqmf-model/data_criteria.rb +144 -72
- data/lib/hqmf-model/population_criteria.rb +20 -18
- data/lib/hqmf-model/precondition.rb +6 -3
- data/lib/hqmf-model/types.rb +1 -1
- data/lib/hqmf-parser.rb +9 -0
- data/lib/hqmf-parser/1.0/utilities.rb +1 -1
- data/lib/hqmf-parser/2.0/data_criteria.rb +293 -319
- data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_base_extract.rb +80 -0
- data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_definition_from_template_or_type_extract.rb +201 -0
- data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_post_processing.rb +85 -0
- data/lib/hqmf-parser/2.0/data_criteria_helpers/dc_specific_occurrences_and_source_data_criteria_extract.rb +117 -0
- data/lib/hqmf-parser/2.0/document.rb +246 -222
- data/lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb +175 -0
- data/lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb +131 -0
- data/lib/hqmf-parser/2.0/field_value_helper.rb +251 -0
- data/lib/hqmf-parser/2.0/population_criteria.rb +101 -32
- data/lib/hqmf-parser/2.0/precondition.rb +61 -35
- data/lib/hqmf-parser/2.0/source_data_criteria_helper.rb +112 -0
- data/lib/hqmf-parser/2.0/types.rb +253 -73
- data/lib/hqmf-parser/2.0/utilities.rb +27 -12
- data/lib/hqmf-parser/2.0/value_set_helper.rb +101 -0
- data/lib/hqmf-parser/converter/pass1/data_criteria_converter.rb +6 -1
- data/lib/hqmf-parser/converter/pass1/population_criteria_converter.rb +34 -30
- data/lib/hqmf-parser/parser.rb +5 -5
- data/resources/schematron/qrda/cat_1/{CDAR2_QRDA_I_R1_D3_2015MAY_Schematron.sch → HL7_CDAR2_QRDA_Category_I_2_12_16.sch} +4692 -4675
- data/resources/schematron/qrda/cat_1_r3_1/HL7 QRDA Category I STU 3.1.sch +3573 -0
- data/resources/schematron/qrda/cat_1_r3_1/HL7 QRDA Category III STU 1.1.sch +464 -0
- data/resources/schematron/qrda/cat_1_r3_1/QRDA Category I STU Release 3.1.sch +5394 -0
- data/resources/schematron/qrda/cat_1_r3_1/voc.xml +1229 -0
- data/resources/schematron/qrda/cat_1_r4/HL7 QRDA Category I STU 4.sch +3526 -0
- data/resources/schematron/qrda/cat_1_r4/voc.xml +1186 -0
- data/resources/schematron/qrda/cat_3_r1_1/HL7 QRDA Category III STU 1.1.sch +528 -0
- data/resources/schematron/qrda/cat_3_r1_1/voc.xml +8 -0
- data/resources/schematron/qrda/cat_3_r2/HL7 QRDA Category III STU 2.sch +677 -0
- data/resources/schematron/qrda/cat_3_r2/voc.xml +1186 -0
- data/resources/schematron/qrda/cat_3_r2_1/HL7 QRDA Category III STU 2.1.sch +678 -0
- data/resources/schematron/qrda/cat_3_r2_1/voc.xml +1186 -0
- data/templates/c32/_medical_equipment.c32.erb +1 -1
- data/templates/c32/_vital_signs.c32.erb +1 -1
- data/templates/cat1/{_2.16.840.1.113883.10.20.22.4.85.cat1.erb → r2/_2.16.840.1.113883.10.20.22.4.85.cat1.erb} +1 -1
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.1.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.1.cat1.erb} +3 -3
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.101.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.101.cat1.erb} +1 -1
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.103.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.103.cat1.erb} +9 -5
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.105.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.105.cat1.erb} +18 -10
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +88 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +50 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +54 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +70 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.14.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.14.cat1.erb} +24 -6
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.20.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.20.cat1.erb} +4 -4
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +22 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +114 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +20 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.28.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.28.cat1.erb} +2 -2
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +20 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.34.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.34.cat1.erb} +6 -6
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +20 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.40.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.40.cat1.erb} +3 -3
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +46 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +26 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.55.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.55.cat1.erb} +0 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +52 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.66.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.66.cat1.erb} +6 -6
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.76.cat1.erb → r2/_2.16.840.1.113883.10.20.24.3.76.cat1.erb} +5 -3
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +23 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +64 -0
- data/templates/cat1/r2/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
- data/templates/cat1/{_address.cat1.erb → r2/_address.cat1.erb} +0 -0
- data/templates/cat1/{_author.cat1.erb → r2/_author.cat1.erb} +0 -0
- data/templates/cat1/r2/_fulfills.cat1.erb +14 -0
- data/templates/cat1/{_id.cat1.erb → r2/_id.cat1.erb} +0 -0
- data/templates/cat1/{_measures.cat1.erb → r2/_measures.cat1.erb} +1 -1
- data/templates/cat1/{_medication_details.cat1.erb → r2/_medication_details.cat1.erb} +3 -2
- data/templates/cat1/r2/_medication_dispense.cat1.erb +22 -0
- data/templates/cat1/{_ordinality.cat1.erb → r2/_ordinality.cat1.erb} +0 -0
- data/templates/cat1/{_organization.cat1.erb → r2/_organization.cat1.erb} +0 -0
- data/templates/cat1/{_patient_data.cat1.erb → r2/_patient_data.cat1.erb} +4 -1
- data/templates/cat1/r2/_patient_data_r3_1.cat1.erb +17 -0
- data/templates/cat1/r2/_providers.cat1.erb +76 -0
- data/templates/cat1/r2/_reason.cat1.erb +45 -0
- data/templates/cat1/{_record_target.cat1.erb → r2/_record_target.cat1.erb} +3 -0
- data/templates/cat1/r2/_reporting_parameters.cat1.erb +31 -0
- data/templates/cat1/{_result_value.cat1.erb → r2/_result_value.cat1.erb} +1 -1
- data/templates/cat1/{_telecom.cat1.erb → r2/_telecom.cat1.erb} +0 -0
- data/templates/cat1/{show.cat1.erb → r2/show.cat1.erb} +52 -5
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +58 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.12.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.12.cat1.erb} +4 -5
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +39 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.14.cat1.erb +39 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.22.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.22.cat1.erb} +6 -5
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.23.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.23.cat1.erb} +26 -30
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +20 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +23 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.32.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.32.cat1.erb} +4 -4
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.38.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.38.cat1.erb} +3 -3
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.41.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.41.cat1.erb} +8 -10
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.45.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.45.cat1.erb} +5 -5
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.54.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.54.cat1.erb} +4 -4
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.63.cat1.erb → r3/_2.16.840.1.113883.10.20.24.3.63.cat1.erb} +6 -8
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +51 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +23 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.76.cat1.erb +19 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +24 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +24 -0
- data/templates/cat1/r3/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +57 -0
- data/templates/cat1/r3/_address.cat1.erb +9 -0
- data/templates/{cat3/_author.cat3.erb → cat1/r3/_author.cat1.erb} +0 -0
- data/templates/cat1/{_fulfills.cat1.erb → r3/_fulfills.cat1.erb} +0 -0
- data/templates/{cat3/_id.cat3.erb → cat1/r3/_id.cat1.erb} +0 -0
- data/templates/cat1/r3/_measures.cat1.erb +93 -0
- data/templates/cat1/r3/_medication_details.cat1.erb +16 -0
- data/templates/cat1/{_medication_dispense.cat1.erb → r3/_medication_dispense.cat1.erb} +3 -3
- data/templates/cat1/r3/_ordinality.cat1.erb +10 -0
- data/templates/cat1/r3/_organization.cat1.erb +9 -0
- data/templates/cat1/r3/_patient_data.cat1.erb +17 -0
- data/templates/cat1/r3/_providers.cat1.erb +76 -0
- data/templates/cat1/r3/_reason.cat1.erb +34 -0
- data/templates/cat1/r3/_record_target.cat1.erb +56 -0
- data/templates/cat1/r3/_reporting_parameters.cat1.erb +31 -0
- data/templates/cat1/r3/_result_value.cat1.erb +28 -0
- data/templates/{cat3/_telecom.cat3.erb → cat1/r3/_telecom.cat1.erb} +0 -0
- data/templates/cat1/r3/show.cat1.erb +183 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +53 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +71 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.18.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.18.cat1.erb} +3 -3
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.2.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.2.cat1.erb} +2 -2
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +30 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +116 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.26.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.26.cat1.erb} +4 -2
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.3.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.3.cat1.erb} +2 -2
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +24 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +21 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +21 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.4.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb} +2 -2
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +45 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.42.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.42.cat1.erb} +4 -4
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.43.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.43.cat1.erb} +3 -3
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.44.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.44.cat1.erb} +3 -3
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +35 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.46.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.46.cat1.erb} +4 -4
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.57.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.57.cat1.erb} +3 -3
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.62.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.62.cat1.erb} +5 -5
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.64.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb} +7 -7
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.69.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.69.cat1.erb} +2 -2
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.7.cat1.erb → r3_1/_2.16.840.1.113883.10.20.24.3.7.cat1.erb} +12 -9
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +33 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +33 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +41 -0
- data/templates/cat1/r3_1/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
- data/templates/cat1/r3_1/_address.cat1.erb +9 -0
- data/templates/cat1/r3_1/_author.cat1.erb +28 -0
- data/templates/cat1/r3_1/_fulfills.cat1.erb +14 -0
- data/templates/cat1/r3_1/_id.cat1.erb +1 -0
- data/templates/cat1/r3_1/_measures.cat1.erb +93 -0
- data/templates/cat1/r3_1/_medication_details.cat1.erb +16 -0
- data/templates/cat1/r3_1/_medication_dispense.cat1.erb +22 -0
- data/templates/cat1/r3_1/_ordinality.cat1.erb +10 -0
- data/templates/cat1/r3_1/_organization.cat1.erb +9 -0
- data/templates/cat1/r3_1/_patient_data.cat1.erb +17 -0
- data/templates/cat1/r3_1/_providers.cat1.erb +76 -0
- data/templates/cat1/r3_1/_reason.cat1.erb +34 -0
- data/templates/cat1/r3_1/_record_target.cat1.erb +56 -0
- data/templates/cat1/r3_1/_reporting_parameters.cat1.erb +31 -0
- data/templates/cat1/r3_1/_result_value.cat1.erb +28 -0
- data/templates/cat1/r3_1/_telecom.cat1.erb +1 -0
- data/templates/cat1/r3_1/show.cat1.erb +183 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +68 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +53 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +75 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +52 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +39 -0
- data/templates/cat1/{_2.16.840.1.113883.10.20.24.3.59.cat1.erb → r4/_2.16.840.1.113883.10.20.24.3.144.cat1.erb} +6 -6
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.145.cat1.erb +24 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +23 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +25 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +30 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +116 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +24 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +21 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +22 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +21 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +45 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +25 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +35 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +47 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +22 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +36 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +21 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +52 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +33 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.81.cat1.erb +33 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.82.cat1.erb +33 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +41 -0
- data/templates/cat1/r4/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
- data/templates/cat1/r4/_address.cat1.erb +7 -0
- data/templates/cat1/r4/_author.cat1.erb +28 -0
- data/templates/cat1/r4/_fulfills.cat1.erb +14 -0
- data/templates/cat1/r4/_id.cat1.erb +1 -0
- data/templates/cat1/r4/_measures.cat1.erb +93 -0
- data/templates/cat1/r4/_medication_details.cat1.erb +16 -0
- data/templates/cat1/r4/_medication_dispense.cat1.erb +22 -0
- data/templates/cat1/r4/_ordinality.cat1.erb +10 -0
- data/templates/cat1/r4/_organization.cat1.erb +9 -0
- data/templates/cat1/r4/_patient_data.cat1.erb +17 -0
- data/templates/cat1/r4/_providers.cat1.erb +76 -0
- data/templates/cat1/r4/_reason.cat1.erb +34 -0
- data/templates/cat1/r4/_record_target.cat1.erb +54 -0
- data/templates/cat1/r4/_reporting_parameters.cat1.erb +31 -0
- data/templates/cat1/r4/_result_value.cat1.erb +28 -0
- data/templates/cat1/r4/_telecom.cat1.erb +1 -0
- data/templates/cat1/r4/show.cat1.erb +192 -0
- data/templates/cat3/{_address.cat3.erb → r1/_address.cat3.erb} +0 -0
- data/templates/cat3/r1/_author.cat3.erb +28 -0
- data/templates/cat3/{_continuous_variable_value.cat3.erb → r1/_continuous_variable_value.cat3.erb} +0 -0
- data/templates/cat3/r1/_id.cat3.erb +1 -0
- data/templates/cat3/{_measure_data.cat3.erb → r1/_measure_data.cat3.erb} +7 -6
- data/templates/cat3/{_organization.cat3.erb → r1/_organization.cat3.erb} +0 -0
- data/templates/cat3/{_performance_rate.cat3.erb → r1/_performance_rate.cat3.erb} +1 -3
- data/templates/cat3/{_providers.cat3.erb → r1/_providers.cat3.erb} +0 -0
- data/templates/cat3/{_reporting_parameters.cat3.erb → r1/_reporting_parameters.cat3.erb} +0 -0
- data/templates/cat3/{_supplemental_data.cat3.erb → r1/_supplemental_data.cat3.erb} +2 -0
- data/templates/cat3/r1/_telecom.cat3.erb +1 -0
- data/templates/cat3/{show.cat3.erb → r1/show.cat3.erb} +5 -5
- data/templates/cat3/r1_1/_address.cat3.erb +9 -0
- data/templates/cat3/r1_1/_author.cat3.erb +28 -0
- data/templates/cat3/r1_1/_continuous_variable_value.cat3.erb +20 -0
- data/templates/cat3/r1_1/_id.cat3.erb +1 -0
- data/templates/cat3/r1_1/_measure_data.cat3.erb +136 -0
- data/templates/cat3/r1_1/_organization.cat3.erb +6 -0
- data/templates/cat3/r1_1/_performance_rate.cat3.erb +18 -0
- data/templates/{cat1/_providers.cat1.erb → cat3/r1_1/_providers.cat3.erb} +18 -18
- data/templates/{cat1/_reporting_parameters.cat1.erb → cat3/r1_1/_reporting_parameters.cat3.erb} +5 -1
- data/templates/cat3/r1_1/_supplemental_data.cat3.erb +38 -0
- data/templates/cat3/r1_1/_telecom.cat3.erb +1 -0
- data/templates/cat3/r1_1/show.cat3.erb +150 -0
- data/templates/cat3/r2/_address.cat3.erb +9 -0
- data/templates/cat3/r2/_author.cat3.erb +28 -0
- data/templates/cat3/r2/_continuous_variable_value.cat3.erb +20 -0
- data/templates/cat3/r2/_id.cat3.erb +1 -0
- data/templates/cat3/r2/_measure_data.cat3.erb +136 -0
- data/templates/cat3/r2/_organization.cat3.erb +6 -0
- data/templates/cat3/r2/_performance_rate.cat3.erb +19 -0
- data/templates/cat3/r2/_providers.cat3.erb +57 -0
- data/templates/cat3/r2/_reporting_parameters.cat3.erb +29 -0
- data/templates/cat3/r2/_supplemental_data.cat3.erb +38 -0
- data/templates/cat3/r2/_telecom.cat3.erb +1 -0
- data/templates/cat3/r2/show.cat3.erb +150 -0
- data/templates/cat3/r2_1/_address.cat3.erb +9 -0
- data/templates/cat3/r2_1/_author.cat3.erb +28 -0
- data/templates/cat3/r2_1/_continuous_variable_value.cat3.erb +20 -0
- data/templates/cat3/r2_1/_id.cat3.erb +1 -0
- data/templates/cat3/r2_1/_measure_data.cat3.erb +136 -0
- data/templates/cat3/r2_1/_organization.cat3.erb +6 -0
- data/templates/cat3/r2_1/_performance_rate.cat3.erb +19 -0
- data/templates/cat3/r2_1/_providers.cat3.erb +57 -0
- data/templates/cat3/r2_1/_reporting_parameters.cat3.erb +20 -0
- data/templates/cat3/r2_1/_reporting_parameters_act.cat3.erb +10 -0
- data/templates/cat3/r2_1/_supplemental_data.cat3.erb +38 -0
- data/templates/cat3/r2_1/_telecom.cat3.erb +1 -0
- data/templates/cat3/r2_1/show.cat3.erb +153 -0
- data/templates/ccda/_medical_equipment.ccda.erb +1 -1
- data/templates/ccda/_social_history.ccda.erb +2 -2
- data/templates/ccda/_vital_signs.ccda.erb +1 -1
- data/templates/html/_entries_by_section.html.erb +1 -1
- metadata +425 -153
- data/lib/health-data-standards/import/cat1/procedure_importer.rb +0 -42
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +0 -55
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +0 -38
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +0 -22
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +0 -22
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +0 -20
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +0 -27
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +0 -13
- data/templates/cat1/_reason.cat1.erb +0 -23
@@ -11,8 +11,8 @@ module HealthDataStandards
|
|
11
11
|
procedure = super
|
12
12
|
procedure.status_code = {'HL7 ActStatus' => ['ordered']}
|
13
13
|
extract_performer(entry_element, procedure)
|
14
|
-
|
15
|
-
|
14
|
+
extract_anatomical_target(entry_element, procedure)
|
15
|
+
extract_reason_or_negation(entry_element, procedure)
|
16
16
|
procedure
|
17
17
|
end
|
18
18
|
|
@@ -29,8 +29,8 @@ module HealthDataStandards
|
|
29
29
|
procedure.performer = import_actor(performer_element) if performer_element
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
33
|
-
procedure.
|
32
|
+
def extract_anatomical_target(parent_element, procedure)
|
33
|
+
procedure.anatomical_target = extract_code(parent_element, "./cda:targetSiteCode")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -5,6 +5,7 @@ module HealthDataStandards
|
|
5
5
|
def initialize(entry_finder=CDA::EntryFinder.new("./cda:entry/cda:procedure[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.64']"))
|
6
6
|
super(entry_finder)
|
7
7
|
@incision_xpath ="./cda:entryRelationship/cda:procedure[./cda:templateId[@root='2.16.840.1.113883.10.20.24.3.89']]/cda:effectiveTime"
|
8
|
+
@ordinality_xpath = "./cda:priorityCode | ./cda:entryRelationship/cda:observation[./cda:code[@code='260870009']]/cda:value"
|
8
9
|
end
|
9
10
|
|
10
11
|
def create_entry(entry_element, nrh = CDA::NarrativeReferenceHandler.new)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module HealthDataStandards
|
2
|
+
module Import
|
3
|
+
module Cat1
|
4
|
+
class TransferFromActImporter < TransferFromImporter
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super(CDA::EntryFinder.new("./cda:entry/cda:act[./cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.141']/cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.81']"))
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_entry(entry_element, nrh = CDA::NarrativeReferenceHandler.new)
|
11
|
+
encounter = super
|
12
|
+
extract_reason_or_negation(entry_element.parent.parent, encounter)
|
13
|
+
encounter
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module HealthDataStandards
|
2
|
+
module Import
|
3
|
+
module Cat1
|
4
|
+
class TransferFromImporter < CDA::EncounterImporter
|
5
|
+
def initialize(entry_finder=CDA::EntryFinder.new("./cda:entry/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.81']"))
|
6
|
+
super(entry_finder)
|
7
|
+
@time_xpath = ""
|
8
|
+
@entry_class = Encounter
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_entry(entry_element, nrh = CDA::NarrativeReferenceHandler.new)
|
12
|
+
encounter = super
|
13
|
+
transfer_time = HL7Helper.timestamp_to_integer(entry_element.at_xpath("./cda:participant/cda:time/cda:low")['value'])
|
14
|
+
encounter[:start_time] = transfer_time
|
15
|
+
encounter[:end_time] = transfer_time
|
16
|
+
transfer_from_element = entry_element.at_xpath("./cda:participant[@typeCode='ORG']")
|
17
|
+
extract_transfer(transfer_from_element, encounter)
|
18
|
+
encounter
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module HealthDataStandards
|
2
|
+
module Import
|
3
|
+
module Cat1
|
4
|
+
class TransferToActImporter < TransferToImporter
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super(CDA::EntryFinder.new("./cda:entry/cda:act[./cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.142']/cda:entryRelationship/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.82']"))
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_entry(entry_element, nrh = CDA::NarrativeReferenceHandler.new)
|
11
|
+
encounter = super
|
12
|
+
extract_reason_or_negation(entry_element.parent.parent, encounter)
|
13
|
+
encounter
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module HealthDataStandards
|
2
|
+
module Import
|
3
|
+
module Cat1
|
4
|
+
class TransferToImporter < CDA::EncounterImporter
|
5
|
+
def initialize(entry_finder=CDA::EntryFinder.new("./cda:entry/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.82']"))
|
6
|
+
super(entry_finder)
|
7
|
+
@entry_class = Encounter
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
11
|
+
encounter = super
|
12
|
+
transfer_to_element = entry_element.at_xpath("./cda:participant[@typeCode='DST']")
|
13
|
+
extract_transfer(transfer_to_element, encounter)
|
14
|
+
transfer_time = HL7Helper.timestamp_to_integer(entry_element.at_xpath("./cda:participant/cda:time/cda:low")['value'])
|
15
|
+
encounter[:start_time] = transfer_time
|
16
|
+
encounter[:end_time] = transfer_time
|
17
|
+
encounter
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -16,7 +16,7 @@ module HealthDataStandards
|
|
16
16
|
|
17
17
|
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
18
18
|
allergy = super
|
19
|
-
|
19
|
+
extract_reason_or_negation(entry_element, allergy)
|
20
20
|
allergy.type = extract_code(entry_element, @type_xpath)
|
21
21
|
allergy.reaction = extract_code(entry_element, @reaction_xpath)
|
22
22
|
allergy.severity = extract_code(entry_element, @severity_xpath)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module HealthDataStandards
|
2
|
+
module Import
|
3
|
+
module CDA
|
4
|
+
class CommunicationImporter < SectionImporter
|
5
|
+
|
6
|
+
#scoped to not look in the plan of care section so planned procedures do not end up mixed with
|
7
|
+
#past procedures
|
8
|
+
def initialize(entry_finder=EntryFinder.new("./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.2'] | ./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.3'] | ./cda:entry/cda:act[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.4']"))
|
9
|
+
super(entry_finder)
|
10
|
+
@entry_class = Communication
|
11
|
+
@template_xpath = "./cda:templateId/@root"
|
12
|
+
@reference_xpath = "./sdtc:inFulfillmentOf1"
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
|
16
|
+
communication = super
|
17
|
+
communication.direction = find_communication_direction(entry_element)
|
18
|
+
extract_reason_or_negation(entry_element, communication)
|
19
|
+
extract_references(entry_element, communication)
|
20
|
+
communication
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def find_communication_direction(entry_element)
|
26
|
+
case entry_element.at_xpath(@template_xpath).value
|
27
|
+
when "2.16.840.1.113883.10.20.24.3.3"
|
28
|
+
return "communication_from_provider_to_patient"
|
29
|
+
when "2.16.840.1.113883.10.20.24.3.2"
|
30
|
+
return "communication_from_patient_to_provider"
|
31
|
+
when "2.16.840.1.113883.10.20.24.3.4"
|
32
|
+
return "communication_from_provider_to_provider"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def extract_references(parent_element, entry)
|
37
|
+
parent_element.xpath(@reference_xpath).each do |ref_xml|
|
38
|
+
ref = Reference.new
|
39
|
+
ref.type = case ref_xml.at_xpath("./@typeCode").value
|
40
|
+
when "FLFS"
|
41
|
+
"fulfills"
|
42
|
+
end
|
43
|
+
ref.referenced_type = case ref_xml.at_xpath("./sdtc:actReference/@classCode").value
|
44
|
+
when "ACT"
|
45
|
+
"Procedure"
|
46
|
+
end
|
47
|
+
id_element = ref_xml.at_xpath("./sdtc:actReference/sdtc:id")
|
48
|
+
ref.referenced_id = id_element['extension']
|
49
|
+
entry.references << ref
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -20,7 +20,7 @@ module HealthDataStandards
|
|
20
20
|
condition = super
|
21
21
|
|
22
22
|
extract_ordinality(entry_element, condition)
|
23
|
-
|
23
|
+
extract_reason_or_negation(entry_element, condition)
|
24
24
|
extract_priority(entry_element, condition)
|
25
25
|
|
26
26
|
if @provider_xpath
|
@@ -47,6 +47,22 @@ module HealthDataStandards
|
|
47
47
|
condition.priority = priority_element['value'].to_i
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
def extract_severity(entry_element,condition)
|
52
|
+
severity = entry_element.at_xpath(@severity_xpath)
|
53
|
+
if(severity)
|
54
|
+
condition.severity = { 'code_system' => CodeSystemHelper.code_system_for(severity['codeSystem']), 'code' => severity['code'] }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def extract_laterality(entry_element,condition)
|
59
|
+
laterality = entry_element.at_xpath(@laterality_xpath)
|
60
|
+
if laterality
|
61
|
+
# kept to be backward compatible
|
62
|
+
condition.laterality = { 'code_system' => CodeSystemHelper.code_system_for(laterality['codeSystem']), 'code' => laterality['code'] }
|
63
|
+
condition.anatomical_location = { 'code_system' => CodeSystemHelper.code_system_for(laterality['codeSystem']), 'code' => laterality['code'] }
|
64
|
+
end
|
65
|
+
end
|
50
66
|
end
|
51
67
|
end
|
52
68
|
end
|
@@ -15,10 +15,15 @@ module HealthDataStandards
|
|
15
15
|
extract_performer(entry_element, encounter)
|
16
16
|
extract_facility(entry_element, encounter)
|
17
17
|
extract_reason(entry_element, encounter, nrh)
|
18
|
-
|
18
|
+
extract_reason_or_negation(entry_element, encounter)
|
19
19
|
extract_admission(entry_element, encounter)
|
20
20
|
extract_discharge_disposition(entry_element, encounter)
|
21
|
-
|
21
|
+
transfer_elements = entry_element.xpath("./cda:participant[@typeCode='ORG' or 'DST']")
|
22
|
+
if transfer_elements
|
23
|
+
transfer_elements.each do |transfer_element|
|
24
|
+
extract_transfer(transfer_element, encounter)
|
25
|
+
end
|
26
|
+
end
|
22
27
|
encounter
|
23
28
|
end
|
24
29
|
|
@@ -62,26 +67,23 @@ module HealthDataStandards
|
|
62
67
|
encounter.discharge_disposition = extract_code(parent_element, "./sdtc:dischargeDispositionCode")
|
63
68
|
end
|
64
69
|
|
65
|
-
def
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
def extract_transfer(transfer_element, encounter)
|
71
|
+
transfer_from, transfer_to = transfer_from_or_to(transfer_element)
|
72
|
+
return unless transfer_to || transfer_from
|
73
|
+
transfer = Transfer.new
|
74
|
+
extract_dates(transfer_element, transfer, 'time')
|
75
|
+
raw_code = extract_code(transfer_element.at_xpath("./cda:participantRole[@classCode='LOCE']"), './cda:code')
|
76
|
+
code_hash = {CodeSystemHelper.code_system_for(raw_code["codeSystemOid"]) => [raw_code["code"]]}
|
77
|
+
transfer['code_system'] = code_hash.keys.first
|
78
|
+
transfer['code'] = code_hash[code_hash.keys.first].first
|
79
|
+
encounter.transfer_from = transfer if transfer_from
|
80
|
+
encounter.transfer_to = transfer if transfer_to
|
81
|
+
end
|
75
82
|
|
76
|
-
|
77
|
-
if
|
78
|
-
|
79
|
-
|
80
|
-
raw_tt_code = extract_code(transfer_to_subelement, './cda:code')
|
81
|
-
code_hash = {CodeSystemHelper.code_system_for(raw_tt_code["codeSystemOid"]) => [raw_tt_code["code"]]}
|
82
|
-
transfer_to.codes = code_hash
|
83
|
-
encounter.transfer_to = transfer_to
|
84
|
-
end
|
83
|
+
def transfer_from_or_to(transfer_element)
|
84
|
+
transfer_from = true if transfer_element['typeCode'] && transfer_element['typeCode'] == 'ORG'
|
85
|
+
transfer_to = true if transfer_element['typeCode'] && transfer_element['typeCode'] == 'DST'
|
86
|
+
[transfer_from, transfer_to]
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
@@ -14,6 +14,7 @@ module HealthDataStandards
|
|
14
14
|
extract_manufacturer(entry_element, medical_equipment)
|
15
15
|
extract_anatomical_structure(entry_element, medical_equipment)
|
16
16
|
extract_removal_time(entry_element, medical_equipment)
|
17
|
+
extract_reason_or_negation(entry_element, medical_equipment)
|
17
18
|
medical_equipment
|
18
19
|
end
|
19
20
|
|
@@ -29,8 +29,8 @@ module HealthDataStandards
|
|
29
29
|
|
30
30
|
medication.route = extract_code(entry_element, "./cda:routeCode")
|
31
31
|
medication.dose = extract_scalar(entry_element, "./cda:doseQuantity")
|
32
|
-
medication.
|
33
|
-
|
32
|
+
medication.anatomical_approach = extract_code(entry_element, "./cda:approachSiteCode", 'SNOMED-CT')
|
33
|
+
|
34
34
|
extract_dose_restriction(entry_element, medication)
|
35
35
|
|
36
36
|
medication.product_form = extract_code(entry_element, "./cda:administrationUnitCode", 'NCI Thesaurus')
|
@@ -39,16 +39,26 @@ module HealthDataStandards
|
|
39
39
|
medication.indication = extract_code(entry_element, @indication_xpath, 'SNOMED-CT')
|
40
40
|
medication.vehicle = extract_code(entry_element, @vehicle_xpath, 'SNOMED-CT')
|
41
41
|
|
42
|
+
medication.allowed_administrations = extract_scalar(entry_element, "./cda:repeatNumber").value unless extract_scalar(entry_element, "./cda:repeatNumber").nil?
|
43
|
+
|
42
44
|
extract_order_information(entry_element, medication)
|
43
45
|
|
44
46
|
extract_fulfillment_history(entry_element, medication)
|
45
|
-
|
47
|
+
extract_reason_or_negation(entry_element, medication)
|
46
48
|
|
47
49
|
medication
|
48
50
|
end
|
49
51
|
|
50
52
|
private
|
51
53
|
|
54
|
+
def extract_reason_or_negation(parent_element, medication)
|
55
|
+
if parent_element.parent.name == "entryRelationship"
|
56
|
+
super(parent_element.parent.parent, medication, parent_element)
|
57
|
+
else
|
58
|
+
super(parent_element, medication)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
52
62
|
def extract_fulfillment_history(parent_element, medication)
|
53
63
|
fhs = parent_element.xpath("./cda:entryRelationship/cda:supply[@moodCode='EVN']")
|
54
64
|
if fhs
|
@@ -113,4 +123,4 @@ module HealthDataStandards
|
|
113
123
|
end
|
114
124
|
end
|
115
125
|
end
|
116
|
-
end
|
126
|
+
end
|
@@ -16,8 +16,8 @@ module HealthDataStandards
|
|
16
16
|
procedure = super
|
17
17
|
extract_ordinality(entry_element, procedure)
|
18
18
|
extract_performer(entry_element, procedure)
|
19
|
-
|
20
|
-
|
19
|
+
extract_anatomical_target(entry_element, procedure)
|
20
|
+
extract_reason_or_negation(entry_element, procedure)
|
21
21
|
extract_scalar(entry_element, procedure)
|
22
22
|
procedure
|
23
23
|
end
|
@@ -36,8 +36,8 @@ module HealthDataStandards
|
|
36
36
|
procedure.performer = import_actor(performer_element) if performer_element
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
procedure.
|
39
|
+
def extract_anatomical_target(parent_element, procedure)
|
40
|
+
procedure.anatomical_target = extract_code(parent_element, "./cda:targetSiteCode")
|
41
41
|
end
|
42
42
|
|
43
43
|
def extract_scalar(parent_element, procedure)
|
@@ -11,7 +11,7 @@ module HealthDataStandards
|
|
11
11
|
result = super
|
12
12
|
extract_interpretation(entry_element, result)
|
13
13
|
extract_reference_range(entry_element, result)
|
14
|
-
|
14
|
+
extract_reason_or_negation(entry_element, result)
|
15
15
|
extract_reason_description(entry_element, result, nrh)
|
16
16
|
result
|
17
17
|
end
|
@@ -20,7 +20,7 @@ module HealthDataStandards
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# Traverses an HL7 CDA document passed in and creates an Array of Entry
|
23
|
-
# objects based on what it finds
|
23
|
+
# objects based on what it finds
|
24
24
|
# @param [Nokogiri::XML::Document] doc It is expected that the root node of this document
|
25
25
|
# will have the "cda" namespace registered to "urn:hl7-org:v3"
|
26
26
|
# measure definition
|
@@ -47,7 +47,7 @@ module HealthDataStandards
|
|
47
47
|
if @value_xpath
|
48
48
|
extract_values(entry_element, entry)
|
49
49
|
end
|
50
|
-
entry
|
50
|
+
extract_description(entry_element, entry, nrh)
|
51
51
|
if @status_xpath
|
52
52
|
extract_status(entry_element, entry)
|
53
53
|
end
|
@@ -56,6 +56,18 @@ module HealthDataStandards
|
|
56
56
|
|
57
57
|
private
|
58
58
|
|
59
|
+
def extract_description(parent_element, entry, nrh)
|
60
|
+
orig_text_ref_element = parent_element.at_xpath(@description_xpath)
|
61
|
+
desc_ref_element = parent_element.at_xpath("./cda:text/cda:reference")
|
62
|
+
if orig_text_ref_element && orig_text_ref_element['value']
|
63
|
+
entry.description = nrh.lookup_tag(orig_text_ref_element['value'])
|
64
|
+
elsif desc_ref_element && desc_ref_element['value']
|
65
|
+
entry.description = nrh.lookup_tag(desc_ref_element['value'])
|
66
|
+
else
|
67
|
+
entry.description = parent_element.at_xpath("./cda:text").try("text")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
59
71
|
def extract_status(parent_element, entry)
|
60
72
|
status_element = parent_element.at_xpath(@status_xpath)
|
61
73
|
if status_element
|
@@ -120,7 +132,7 @@ module HealthDataStandards
|
|
120
132
|
end
|
121
133
|
|
122
134
|
def extract_value(parent_element, value_element, entry)
|
123
|
-
if value_element
|
135
|
+
if value_element && !value_element['nullFlavor']
|
124
136
|
value = value_element['value']
|
125
137
|
if value.present?
|
126
138
|
unit = value_element['unit']
|
@@ -135,14 +147,14 @@ module HealthDataStandards
|
|
135
147
|
unit = value_element['unit']
|
136
148
|
entry.set_value(value.strip, unit)
|
137
149
|
end
|
138
|
-
|
150
|
+
|
139
151
|
end
|
140
152
|
end
|
141
|
-
|
153
|
+
|
142
154
|
def import_actor(actor_element)
|
143
155
|
return ProviderImporter.instance.extract_provider(actor_element)
|
144
156
|
end
|
145
|
-
|
157
|
+
|
146
158
|
def import_organization(organization_element)
|
147
159
|
return OrganizationImporter.instance.extract_organization(organization_element)
|
148
160
|
end
|
@@ -157,26 +169,55 @@ module HealthDataStandards
|
|
157
169
|
person.family_name = name_element.at_xpath("./cda:family").try(:text)
|
158
170
|
end
|
159
171
|
person.addresses = person_element.xpath("./cda:addr").map { |addr| import_address(addr) }
|
160
|
-
person.telecoms = person_element.xpath("./cda:telecom").map { |tele| import_telecom(tele) }
|
172
|
+
person.telecoms = person_element.xpath("./cda:telecom").map { |tele| import_telecom(tele) }
|
161
173
|
return person
|
162
174
|
end
|
163
175
|
|
164
|
-
|
176
|
+
# extracts the reason or negation data. if an element is negated and the code has a null flavor, a random code is assigned for calculation
|
177
|
+
# coded_parent_element is the 'parent' element when the coded is nested (e.g., medication order)
|
178
|
+
def extract_reason_or_negation(parent_element, entry, coded_parent_element = nil)
|
179
|
+
coded_parent_element ||= parent_element
|
180
|
+
reason_element = parent_element.at_xpath("./cda:entryRelationship[@typeCode='RSON']/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.88']/cda:value | ./cda:entryRelationship[@typeCode='RSON']/cda:act[cda:templateId/@root='2.16.840.1.113883.10.20.1.27']/cda:code")
|
165
181
|
negation_indicator = parent_element['negationInd']
|
166
|
-
|
182
|
+
if reason_element
|
183
|
+
code_system_oid = reason_element['codeSystem']
|
184
|
+
code = reason_element['code']
|
185
|
+
code_system = HealthDataStandards::Util::CodeSystemHelper.code_system_for(code_system_oid)
|
167
186
|
entry.negation_ind = negation_indicator.eql?('true')
|
168
187
|
if entry.negation_ind
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
188
|
+
entry.negation_reason = {'code' => code, 'code_system' => code_system, 'codeSystem' => code_system}
|
189
|
+
else
|
190
|
+
entry.reason = {'code' => code, 'code_system' => code_system, 'codeSystem' => code_system}
|
191
|
+
end
|
192
|
+
elsif negation_indicator
|
193
|
+
entry.negation_ind = negation_indicator.eql?('true')
|
194
|
+
end
|
195
|
+
extract_negated_code(coded_parent_element, entry)
|
196
|
+
end
|
197
|
+
|
198
|
+
def extract_negated_code(coded_parent_element, entry)
|
199
|
+
code_elements = coded_parent_element.xpath(@code_xpath)
|
200
|
+
code_elements.each do |code_element|
|
201
|
+
if code_element['nullFlavor'] == 'NA' && code_element['sdtc:valueSet']
|
202
|
+
# choose code from valueset
|
203
|
+
valueset = HealthDataStandards::SVS::ValueSet.where(oid: code_element['sdtc:valueSet'], bundle_id: get_bundle_id(coded_parent_element))
|
204
|
+
entry.add_code(valueset.first.concepts.first['code'], valueset.first.concepts.first['code_system_name'])
|
205
|
+
# A "code" is added to indicate the Non-Applicable valueset.
|
206
|
+
entry.add_code(code_element['sdtc:valueSet'], 'NA_VALUESET')
|
176
207
|
end
|
177
208
|
end
|
178
209
|
end
|
179
|
-
|
210
|
+
|
211
|
+
def get_bundle_id(parent_element)
|
212
|
+
while parent_element.name != 'document'
|
213
|
+
parent_element = parent_element.parent
|
214
|
+
end
|
215
|
+
# first measure id specified in the document
|
216
|
+
measure_id = parent_element.xpath("cda:ClinicalDocument/cda:component/cda:structuredBody/cda:component/cda:section/cda:entry/cda:organizer[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.98']/cda:reference/cda:externalDocument/cda:id[@root='2.16.840.1.113883.4.738']/@extension").first.value.upcase
|
217
|
+
# bundle of the first measure id
|
218
|
+
HealthDataStandards::CQM::Measure.where(hqmf_id: measure_id).first['bundle_id']
|
219
|
+
end
|
220
|
+
|
180
221
|
def extract_code(parent_element, code_xpath, code_system=nil)
|
181
222
|
code_element = parent_element.at_xpath(code_xpath)
|
182
223
|
code_hash = nil
|
@@ -205,4 +246,4 @@ module HealthDataStandards
|
|
205
246
|
end
|
206
247
|
end
|
207
248
|
end
|
208
|
-
end
|
249
|
+
end
|