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
@@ -1,14 +1,17 @@
|
|
1
1
|
class Condition < Entry
|
2
|
-
field :type,
|
3
|
-
field :causeOfDeath,
|
4
|
-
field :time_of_death,
|
5
|
-
field :priority,
|
6
|
-
field :name,
|
7
|
-
field :ordinality,
|
8
|
-
field :severity,
|
2
|
+
field :type, type: String
|
3
|
+
field :causeOfDeath, type: Boolean
|
4
|
+
field :time_of_death, type: Integer
|
5
|
+
field :priority, type: Integer
|
6
|
+
field :name, type: String
|
7
|
+
field :ordinality, type: Hash
|
8
|
+
field :severity, type: Hash
|
9
|
+
field :laterality, type: Hash
|
10
|
+
field :anatomical_target, type: Hash
|
11
|
+
field :anatomical_location, type: Hash
|
9
12
|
|
10
13
|
embeds_many :treating_provider, class_name: "Provider"
|
11
|
-
|
14
|
+
|
12
15
|
alias :cause_of_death :causeOfDeath
|
13
16
|
alias :cause_of_death= :causeOfDeath=
|
14
17
|
|
@@ -16,4 +19,4 @@ class Condition < Entry
|
|
16
19
|
super
|
17
20
|
self.time_of_death = self.time_of_death.nil? ? nil : self.time_of_death + date_diff
|
18
21
|
end
|
19
|
-
end
|
22
|
+
end
|
@@ -16,6 +16,7 @@ module HealthDataStandards
|
|
16
16
|
field :measure_period_start
|
17
17
|
field :records, type: Array
|
18
18
|
field :active, type: Boolean
|
19
|
+
field :done_importing, type: Boolean, default: false
|
19
20
|
|
20
21
|
validates_presence_of :version
|
21
22
|
|
@@ -47,4 +48,4 @@ module HealthDataStandards
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
50
|
-
end
|
51
|
+
end
|
@@ -87,7 +87,8 @@ module HealthDataStandards
|
|
87
87
|
pipeline << {'$project' => {'category' => '$_id', 'measures' => 1, '_id' => 0}}
|
88
88
|
|
89
89
|
pipeline << {'$sort' => {"category" => 1}}
|
90
|
-
|
90
|
+
|
91
|
+
Mongoid.default_client.command(aggregate: 'measures', pipeline: pipeline).documents[0]["result"]
|
91
92
|
end
|
92
93
|
|
93
94
|
|
@@ -24,10 +24,10 @@ module HealthDataStandards
|
|
24
24
|
end
|
25
25
|
|
26
26
|
group = {"$group" => {"_id" => "$value.medical_record_id", "rational" => {"$push"=> "$value.rationale"}}}
|
27
|
-
aggregate = self.
|
28
|
-
|
27
|
+
aggregate = self.mongo_client.command(:aggregate => 'patient_cache', :pipeline => [{"$match" =>match},group])
|
28
|
+
aggregate_document = aggregate.documents[0]
|
29
29
|
merged = {}
|
30
|
-
|
30
|
+
aggregate_document["result"].each do |agg|
|
31
31
|
mrn = agg["_id"]
|
32
32
|
rational = {}
|
33
33
|
merged[mrn] = rational
|
@@ -48,15 +48,19 @@ module HealthDataStandards
|
|
48
48
|
|
49
49
|
field :DENOM, type: Integer
|
50
50
|
field :NUMER, type: Integer
|
51
|
+
field :NUMEX, type: Integer
|
51
52
|
field :DENEX, type: Integer
|
52
53
|
field :DENEXCEP, type: Integer
|
53
54
|
field :MSRPOPL, type: Integer
|
55
|
+
field :MSRPOPLEX, type: Integer
|
54
56
|
field :OBSERV
|
55
57
|
field :antinumerator, type: Integer
|
56
58
|
field :IPP, type: Integer
|
57
59
|
field :measure_id, type: String
|
58
60
|
field :sub_id, type: String
|
61
|
+
field :patient_id, type: BSON::ObjectId
|
59
62
|
end
|
60
63
|
|
61
64
|
end
|
65
|
+
|
62
66
|
end
|
@@ -14,10 +14,12 @@ module HealthDataStandards
|
|
14
14
|
field :IPP, type: Integer
|
15
15
|
field :DENOM, type: Integer
|
16
16
|
field :NUMER, type: Integer
|
17
|
+
field :NUMEX, type: Integer
|
17
18
|
field :antinumerator, type: Integer
|
18
19
|
field :DENEX, type: Integer
|
19
20
|
field :DENEXCEP, type: Integer
|
20
21
|
field :MSRPOPL, type: Integer
|
22
|
+
field :MSRPOPLEX, type: Integer
|
21
23
|
field :OBSERV, type: Float
|
22
24
|
field :supplemental_data, type: Hash
|
23
25
|
|
@@ -3,6 +3,9 @@ class Encounter < Entry
|
|
3
3
|
field :dischargeDisposition, as: :discharge_disposition, type: Hash
|
4
4
|
field :admitTime, as: :admit_time, type: Integer
|
5
5
|
field :dischargeTime, as: :discharge_time, type: Integer
|
6
|
+
|
7
|
+
embeds_one :principalDiagnosis, class_name: "EncounterPrincipalDiagnosis"
|
8
|
+
embeds_one :diagnosis, class_name: "EncounterPrincipalDiagnosis"
|
6
9
|
|
7
10
|
embeds_one :transferTo, class_name: "Transfer"
|
8
11
|
embeds_one :transferFrom, class_name: "Transfer"
|
@@ -16,13 +19,23 @@ class Encounter < Entry
|
|
16
19
|
alias :transfer_to= :transferTo=
|
17
20
|
alias :transfer_from :transferFrom
|
18
21
|
alias :transfer_from= :transferFrom=
|
22
|
+
alias :principal_diagnosis :principalDiagnosis
|
23
|
+
alias :principal_diagnosis= :principalDiagnosis=
|
19
24
|
|
20
25
|
def shift_dates(date_diff)
|
21
26
|
super
|
22
27
|
if self.facility
|
23
28
|
self.facility.shift_dates(date_diff)
|
24
29
|
end
|
25
|
-
|
30
|
+
|
31
|
+
if self.transferTo
|
32
|
+
self.transferTo.shift_dates(date_diff)
|
33
|
+
end
|
34
|
+
|
35
|
+
if self.transferFrom
|
36
|
+
self.transferFrom.shift_dates(date_diff)
|
37
|
+
end
|
38
|
+
|
26
39
|
self.admitTime = (self.admitTime.nil?) ? nil : self.admitTime + date_diff
|
27
40
|
self.dischargeTime = (self.dischargeTime.nil?) ? nil : self.dischargeTime + date_diff
|
28
41
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class EncounterPrincipalDiagnosis
|
2
|
+
include Mongoid::Document
|
3
|
+
include Mongoid::Attributes::Dynamic
|
4
|
+
|
5
|
+
embedded_in :encounter, class_name: "Encounter", inverse_of: nil
|
6
|
+
|
7
|
+
def preferred_code(preferred_code_sets=nil, codes_attribute=nil, value_set_map=nil)
|
8
|
+
if @attributes.key?('code') and @attributes.key?('code_system')
|
9
|
+
# This encounter principal diagnosis has the standard 'code' and
|
10
|
+
# 'code_system' attributes, so only one code possible.
|
11
|
+
return {'code' => @attributes['code'], 'code_set' => @attributes['code_system']}
|
12
|
+
elsif @attributes.key?('codes')
|
13
|
+
# This encounter principal diagnosis has the special 'codes' attribute
|
14
|
+
# set, so return the first code in the first code set.
|
15
|
+
code_set, code_set_codes = @attributes['codes'].first
|
16
|
+
return {'code' => code_set_codes.first, 'code_set' => code_set}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def translation_codes(preferred_code_sets=nil ,value_set_map=nil)
|
21
|
+
tx_codes = []
|
22
|
+
# Translations are only necessary when the encounter principal diagnosis
|
23
|
+
# contains the special 'codes' attribute rather than the normal 'code' and
|
24
|
+
# 'code_system', as 'codes' supports multiple codes/code sets.
|
25
|
+
if @attributes.key?('codes')
|
26
|
+
@attributes['codes'].each do |code_set, code_set_codes|
|
27
|
+
for code in code_set_codes
|
28
|
+
tx_codes.push({'code' => code, 'code_set' => code_set})
|
29
|
+
end
|
30
|
+
end
|
31
|
+
tx_codes.shift
|
32
|
+
end
|
33
|
+
tx_codes
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -10,6 +10,9 @@ class Entry
|
|
10
10
|
embeds_one :cda_identifier, class_name: "CDAIdentifier", as: :cda_identifiable
|
11
11
|
embeds_many :values, class_name: "ResultValue"
|
12
12
|
embeds_many :references
|
13
|
+
embeds_many :provider_preference, class_name: "Entry"
|
14
|
+
embeds_many :patient_preference, class_name: "Entry"
|
15
|
+
|
13
16
|
field :description, type: String
|
14
17
|
field :specifics, type: String
|
15
18
|
field :time, type: Integer
|
@@ -21,6 +24,7 @@ class Entry
|
|
21
24
|
field :negationReason, as: :negation_reason, type: Hash
|
22
25
|
field :oid, type: String
|
23
26
|
field :reason, type: Hash
|
27
|
+
field :health_record_field, type: Hash
|
24
28
|
|
25
29
|
attr_protected :version
|
26
30
|
attr_protected :_id
|
@@ -213,4 +217,4 @@ class Entry
|
|
213
217
|
end
|
214
218
|
end
|
215
219
|
|
216
|
-
end
|
220
|
+
end
|
@@ -1,4 +1,13 @@
|
|
1
1
|
class LabResult < Entry
|
2
2
|
field :referenceRange, as: :reference_range, type: String
|
3
|
+
field :referenceRangeHigh, as: :reference_range_high, type: String
|
4
|
+
field :referenceRangeLow, as: :reference_range_low, type: String
|
3
5
|
field :interpretation, type: Hash
|
4
|
-
|
6
|
+
field :reaction, type: Hash
|
7
|
+
field :method, type: Hash
|
8
|
+
# The resulting status of a procedure as defined in the QDM documentation. This is different
|
9
|
+
# than the status associated with the `Entry` object, which relates to the data criteria
|
10
|
+
# status as defined in health-data-standards/lib/hqmf-model/data_criteria.json.
|
11
|
+
field :qdm_status, type: Hash
|
12
|
+
|
13
|
+
end
|
@@ -3,7 +3,8 @@ class MedicalEquipment < Entry
|
|
3
3
|
field :manufacturer, type: String
|
4
4
|
field :anatomicalStructure, as: :anatomical_structure, type: Hash
|
5
5
|
field :removalTime, as: :removal_time, type: Integer
|
6
|
-
|
6
|
+
field :anatomical_approach , type: Hash
|
7
|
+
field :reaction, type: Hash
|
7
8
|
def shift_dates(date_diff)
|
8
9
|
super
|
9
10
|
self.removalTime = self.removalTime.nil? ? nil : self.removalTime + date_diff
|
@@ -8,7 +8,7 @@ class Medication < Entry
|
|
8
8
|
embeds_many :orderInformation, class_name: 'OrderInformation'
|
9
9
|
|
10
10
|
field :route, type: Hash
|
11
|
-
field :
|
11
|
+
field :anatomical_approach, type: Hash
|
12
12
|
field :doseRestriction, as: :dose_restriction, type: Hash
|
13
13
|
field :fulfillmentInstructions, as: :fulfillment_instructions, type: String
|
14
14
|
field :indication, type: Hash
|
@@ -19,6 +19,23 @@ class Medication < Entry
|
|
19
19
|
field :patientInstructions, as: :patient_instructions, type: String
|
20
20
|
field :doseIndicator, as: :dose_indicator, type: String
|
21
21
|
|
22
|
+
field :method , type: Hash
|
23
|
+
field :active_datetime , type: Integer
|
24
|
+
field :signed_datetime , type: Integer
|
25
|
+
|
26
|
+
# This is used for Medicaton, Order. It is the total number of times a dose of a particular
|
27
|
+
# medication can be administered. This, coupled with the administrationTiming will
|
28
|
+
# give the cumulative medication duration.
|
29
|
+
# E.g.
|
30
|
+
# allowedAdministrations = 90 doses
|
31
|
+
# administrationTiming = 1 dose / 12 hours
|
32
|
+
# cumulativeMedicationDuration = allowedAdministrations / administrationTiming * (time conversion)
|
33
|
+
# cumulativeMedicationDuration = (90 doses) * (12 hours)/(1 dose) * (1 day)/(24 hours) = 45 days
|
34
|
+
# Medication, Order can't use fulfillmentHistory because the fulfillment of the
|
35
|
+
# medication has not yet happened.
|
36
|
+
# This corresponds to 'repeatNumber' in the QRDA representation
|
37
|
+
field :allowedAdministrations, as: :allowed_administrations, type: Integer
|
38
|
+
|
22
39
|
# There are currently no importers that support this field
|
23
40
|
# It is expected to be a scalar and value, such as 7 days
|
24
41
|
field :cumulativeMedicationDuration, as: :cumulative_medication_duration, type: Hash
|
@@ -38,4 +55,4 @@ class Medication < Entry
|
|
38
55
|
end
|
39
56
|
end
|
40
57
|
|
41
|
-
end
|
58
|
+
end
|
@@ -1,13 +1,26 @@
|
|
1
1
|
class Procedure < Entry
|
2
|
-
|
2
|
+
|
3
3
|
field :incisionTime, type: Integer, as: :incision_time
|
4
4
|
field :ordinality, type: Hash
|
5
5
|
field :source, type: Hash
|
6
|
-
|
6
|
+
field :anatomical_approach, type: Hash
|
7
|
+
field :anatomical_target, type: Hash
|
8
|
+
field :method, type: Hash
|
9
|
+
field :reaction, type: Hash
|
10
|
+
# The resulting status of a procedure as defined in the QDM documentation. This is different
|
11
|
+
# than the status associated with the `Entry` object, which relates to the data criteria
|
12
|
+
# status as defined in health-data-standards/lib/hqmf-model/data_criteria.json.
|
13
|
+
field :qdm_status, type: Hash
|
14
|
+
|
15
|
+
field :radiation_dose, type: Hash
|
16
|
+
field :radiation_duration, type: Hash
|
17
|
+
|
18
|
+
embeds_one :facility
|
19
|
+
|
7
20
|
belongs_to :performer, class_name: "Provider"
|
8
21
|
|
9
22
|
def shift_dates(date_diff)
|
10
23
|
super
|
11
24
|
self.incisionTime = self.incisionTime.nil? ? nil : self.incisionTime + date_diff
|
12
25
|
end
|
13
|
-
end
|
26
|
+
end
|
@@ -2,9 +2,10 @@ class Provider
|
|
2
2
|
include Personable
|
3
3
|
include Mongoid::Tree
|
4
4
|
include Mongoid::Attributes::Dynamic
|
5
|
-
|
5
|
+
|
6
6
|
NPI_OID = '2.16.840.1.113883.4.6'
|
7
7
|
TAX_ID_OID = '2.16.840.1.113883.4.2'
|
8
|
+
CCN_OID = '2.16.840.1.113883.4.336'.freeze
|
8
9
|
|
9
10
|
field :specialty , type: String
|
10
11
|
field :phone , type: String
|
@@ -40,6 +41,21 @@ class Provider
|
|
40
41
|
cda_id_tin ? cda_id_tin.extension : nil
|
41
42
|
end
|
42
43
|
|
44
|
+
def ccn=(a_ccn)
|
45
|
+
cda_id_ccn = self.cda_identifiers.where(root: CCN_OID).first
|
46
|
+
if cda_id_ccn
|
47
|
+
cda_id_ccn.extension = a_ccn
|
48
|
+
cda_id_ccn.save!
|
49
|
+
else
|
50
|
+
self.cda_identifiers << CDAIdentifier.new(root: CCN_OID, extension: a_ccn)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def ccn
|
55
|
+
cda_id_ccn = self.cda_identifiers.where(root: CCN_OID).first
|
56
|
+
cda_id_ccn ? cda_id_ccn.extension : nil
|
57
|
+
end
|
58
|
+
|
43
59
|
def records(effective_date=nil)
|
44
60
|
Record.by_provider(self, effective_date)
|
45
61
|
end
|
@@ -16,13 +16,11 @@ class Record
|
|
16
16
|
field :ethnicity, type: Hash
|
17
17
|
field :languages, type: Array, default: []
|
18
18
|
field :test_id, type: BSON::ObjectId
|
19
|
+
field :bundle_id, type: BSON::ObjectId
|
19
20
|
field :marital_status, type: Hash
|
20
21
|
field :medical_record_number, type: String
|
21
22
|
field :medical_record_assigner, type: String
|
22
23
|
field :expired, type: Boolean
|
23
|
-
field :clinicalTrialParticipant, as: :clinical_trial_participant, type: Boolean # Currently not implemented in the C32 importer
|
24
|
-
# because it cannot be easily represented in a
|
25
|
-
# HITSP C32
|
26
24
|
|
27
25
|
index "last" => 1
|
28
26
|
index medical_record_number: 1
|
@@ -32,12 +30,16 @@ class Record
|
|
32
30
|
embeds_many :care_goals, class_name: "Entry" # This can be any number of different entry types
|
33
31
|
embeds_many :conditions
|
34
32
|
embeds_many :encounters
|
33
|
+
embeds_many :communications
|
34
|
+
embeds_many :family_history
|
35
35
|
embeds_many :immunizations
|
36
36
|
embeds_many :medical_equipment
|
37
37
|
embeds_many :medications
|
38
38
|
embeds_many :procedures
|
39
39
|
embeds_many :results, class_name: "LabResult"
|
40
40
|
embeds_many :socialhistories, class_name: "Entry"
|
41
|
+
embeds_many :care_experiences
|
42
|
+
embeds_many :assessments
|
41
43
|
|
42
44
|
alias :social_history :socialhistories
|
43
45
|
alias :social_history= :socialhistories=
|
@@ -49,8 +51,8 @@ class Record
|
|
49
51
|
embeds_many :functional_statuses
|
50
52
|
|
51
53
|
Sections = [:allergies, :care_goals, :conditions, :encounters, :immunizations, :medical_equipment,
|
52
|
-
:medications, :procedures, :results, :social_history, :vital_signs, :support, :advance_directives,
|
53
|
-
:insurance_providers, :functional_statuses]
|
54
|
+
:medications, :procedures, :results, :communications, :family_history, :social_history, :vital_signs, :support, :advance_directives,
|
55
|
+
:insurance_providers, :functional_statuses, :care_experiences, :assessments]
|
54
56
|
|
55
57
|
embeds_many :provider_performances
|
56
58
|
embeds_many :addresses, as: :locatable
|
@@ -98,9 +100,6 @@ class Record
|
|
98
100
|
|
99
101
|
memoize :entries_for_oid
|
100
102
|
|
101
|
-
alias :clinical_trial_participant :clinicalTrialParticipant
|
102
|
-
alias :clinical_trial_participant= :clinicalTrialParticipant=
|
103
|
-
|
104
103
|
# Remove duplicate entries from a section based on cda_identifier or id.
|
105
104
|
# This method may lose information because it does not compare entries
|
106
105
|
# based on clinical content
|
@@ -125,7 +124,7 @@ class Record
|
|
125
124
|
else
|
126
125
|
unique_entries[entry.identifier] = entry
|
127
126
|
end
|
128
|
-
|
127
|
+
|
129
128
|
end
|
130
129
|
self.send("#{section}=", unique_entries.values)
|
131
130
|
end
|
@@ -6,6 +6,7 @@ module HealthDataStandards
|
|
6
6
|
field :display_name, type: String
|
7
7
|
field :version, type: String
|
8
8
|
field :user_id, type: String # Eventually we need to delete this from bundles when exporting
|
9
|
+
field :categories, type: Hash
|
9
10
|
|
10
11
|
belongs_to :bundle, class_name: "HealthDataStandards::CQM::Bundle", inverse_of: :value_sets
|
11
12
|
|
@@ -37,20 +38,37 @@ module HealthDataStandards
|
|
37
38
|
|
38
39
|
def self.load_from_xml(doc)
|
39
40
|
doc.root.add_namespace_definition("vs","urn:ihe:iti:svs:2008")
|
40
|
-
vs_element = doc.at_xpath("/vs:RetrieveValueSetResponse/vs:ValueSet")
|
41
|
+
vs_element = doc.at_xpath("/vs:RetrieveValueSetResponse/vs:ValueSet|/vs:RetrieveMultipleValueSetsResponse/vs:DescribedValueSet")
|
41
42
|
if vs_element
|
42
43
|
vs = ValueSet.new(oid: vs_element["ID"], display_name: vs_element["displayName"], version: vs_element["version"])
|
43
|
-
concepts = vs_element
|
44
|
-
|
45
|
-
Concept.new(code: con["code"],
|
46
|
-
code_system_name: code_system_name,
|
47
|
-
code_system_version: con["codeSystemVersion"],
|
48
|
-
display_name: con["displayName"], code_system: con["codeSystem"])
|
49
|
-
end
|
50
|
-
vs.concepts = concepts
|
44
|
+
vs.concepts = extract_concepts(vs_element)
|
45
|
+
vs.categories = extract_categories(vs_element)
|
51
46
|
return vs
|
52
47
|
end
|
53
48
|
end
|
49
|
+
|
50
|
+
def self.extract_concepts(vs_element)
|
51
|
+
concepts = vs_element.xpath("//vs:Concept").collect do |con|
|
52
|
+
code_system_name = HealthDataStandards::Util::CodeSystemHelper::CODE_SYSTEMS[con["codeSystem"]] || con["codeSystemName"]
|
53
|
+
Concept.new(code: con["code"],
|
54
|
+
code_system_name: code_system_name,
|
55
|
+
code_system_version: con["codeSystemVersion"],
|
56
|
+
display_name: con["displayName"], code_system: con["codeSystem"])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.extract_categories(vs_element)
|
61
|
+
category_hash = Hash.new {|h,k| h[k]=[]}
|
62
|
+
groups_with_categories = vs_element.xpath("//vs:Group/@ID[../@displayName='CATEGORY']")
|
63
|
+
groups_with_categories.each do |group_number|
|
64
|
+
measure = vs_element.xpath("//vs:Group[@displayName='CMS eMeasure ID' and @ID='#{group_number}']/vs:Keyword").text
|
65
|
+
categories_for_group = vs_element.xpath("//vs:Group[@displayName='CATEGORY' and @ID='#{group_number}']/vs:Keyword")
|
66
|
+
categories_for_group.each do |category|
|
67
|
+
category_hash[measure] << category.text
|
68
|
+
end
|
69
|
+
end
|
70
|
+
category_hash.size > 0 ? category_hash : nil
|
71
|
+
end
|
54
72
|
end
|
55
73
|
end
|
56
|
-
end
|
74
|
+
end
|