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
@@ -152,7 +152,11 @@ module ReportedResultExtractor
|
|
152
152
|
value = node.at_xpath('cda:value')
|
153
153
|
count = get_aggregate_count(node)
|
154
154
|
if value.at_xpath("./@nullFlavor")
|
155
|
-
|
155
|
+
if supp == "PAYER" && value['xsi:type'] == 'CD' && value['nullFlavor'] == 'OTH' && value.at_xpath("cda:translation") && value.at_xpath("cda:translation")['code']
|
156
|
+
key_hash[value.at_xpath("cda:translation")['code']] = count
|
157
|
+
else
|
158
|
+
key_hash["UNK"] = count
|
159
|
+
end
|
156
160
|
else
|
157
161
|
key_hash[value['code']] = count
|
158
162
|
end
|
@@ -22,6 +22,12 @@ module HealthDataStandards
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def validate(document,data = {})
|
25
|
+
file_errors = document.errors.select { |e| e.fatal? || e.error? }
|
26
|
+
if file_errors
|
27
|
+
file_errors.each do |error|
|
28
|
+
build_error(error, '/', data[:file_name])
|
29
|
+
end
|
30
|
+
end
|
25
31
|
errors = get_errors(document).root.xpath("//svrl:failed-assert",NAMESPACE).map do |el|
|
26
32
|
build_error(el.xpath('svrl:text',NAMESPACE).text, el['location'], data[:file_name])
|
27
33
|
end
|
@@ -5,14 +5,20 @@ require_relative 'schematron_validator'
|
|
5
5
|
require_relative 'measure_validator'
|
6
6
|
require_relative 'data_validator'
|
7
7
|
require_relative 'performance_rate_validator'
|
8
|
+
require_relative 'qrda_qdm_template_validator'
|
8
9
|
|
9
10
|
module HealthDataStandards
|
10
11
|
module Validate
|
11
12
|
|
12
13
|
CDA_SDTC_SCHEMA = 'resources/schema/infrastructure/cda/CDA_SDTC.xsd'
|
13
14
|
QRDA_CAT1_SCHEMATRON = 'resources/schematron/qrda/cat_1_r2/QRDA Category I Release 2.sch'
|
14
|
-
QRDA_CAT1_R3_SCHEMATRON = 'resources/schematron/qrda/cat_1/
|
15
|
+
QRDA_CAT1_R3_SCHEMATRON = 'resources/schematron/qrda/cat_1/HL7_CDAR2_QRDA_Category_I_2_12_16.sch'
|
16
|
+
QRDA_CAT1_R3_1_SCHEMATRON = 'resources/schematron/qrda/cat_1_r3_1/HL7 QRDA Category I STU 3.1.sch'
|
17
|
+
QRDA_CAT1_R4_SCHEMATRON = 'resources/schematron/qrda/cat_1_r4/HL7 QRDA Category I STU 4.sch'
|
15
18
|
QRDA_CAT3_SCHEMATRON = 'resources/schematron/qrda/cat_3/QRDA Category III.sch'
|
19
|
+
QRDA_CAT3_1_1SCHEMATRON = 'resources/schematron/qrda/cat_3_r1_1/HL7 QRDA Category III STU 1.1.sch'
|
20
|
+
QRDA_CAT3_2SCHEMATRON = 'resources/schematron/qrda/cat_3_r2/HL7 QRDA Category III STU 2.sch'
|
21
|
+
QRDA_CAT3_21SCHEMATRON = 'resources/schematron/qrda/cat_3_r2_1/HL7 QRDA Category III STU 2.1.sch'
|
16
22
|
BASE_DIR = File.expand_path("../../../../", __FILE__)
|
17
23
|
|
18
24
|
class Cat1Measure < MeasureValidator
|
@@ -60,6 +66,24 @@ module HealthDataStandards
|
|
60
66
|
|
61
67
|
end
|
62
68
|
|
69
|
+
class Cat1R31 < Schematron::Validator
|
70
|
+
include Singleton
|
71
|
+
|
72
|
+
def initialize
|
73
|
+
super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_R3_1_SCHEMATRON))
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
class Cat1R4 < Schematron::Validator
|
79
|
+
include Singleton
|
80
|
+
|
81
|
+
def initialize
|
82
|
+
super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_R4_SCHEMATRON))
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
63
87
|
class Cat3 < Schematron::Validator
|
64
88
|
include Singleton
|
65
89
|
|
@@ -68,6 +92,30 @@ module HealthDataStandards
|
|
68
92
|
end
|
69
93
|
end
|
70
94
|
|
95
|
+
class Cat3R11 < Schematron::Validator
|
96
|
+
include Singleton
|
97
|
+
|
98
|
+
def initialize
|
99
|
+
super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_1_1SCHEMATRON))
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
class Cat3R2 < Schematron::Validator
|
104
|
+
include Singleton
|
105
|
+
|
106
|
+
def initialize
|
107
|
+
super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_2SCHEMATRON))
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
class Cat3R21 < Schematron::Validator
|
112
|
+
include Singleton
|
113
|
+
|
114
|
+
def initialize
|
115
|
+
super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_21SCHEMATRON))
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
71
119
|
class Cat3PerformanceRate < PerformanceRateValidator
|
72
120
|
include Singleton
|
73
121
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<QualityMeasureDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
2
|
+
<QualityMeasureDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qdm="urn:hhs-qdm:hqmf-r2-extensions:v1">
|
3
3
|
<typeId root="2.16.840.1.113883.1.3" extension="POQM_MT000001UV03" />
|
4
4
|
<templateId>
|
5
5
|
<item root="2.16.840.1.113883.10.20.28.1.1" />
|
@@ -77,10 +77,12 @@
|
|
77
77
|
<%- end -%>
|
78
78
|
</populationCriteriaSection>
|
79
79
|
</component>
|
80
|
-
|
80
|
+
|
81
|
+
<%- end -%>
|
82
|
+
<%- if doc.is_cv? -%>
|
81
83
|
|
82
84
|
<component>
|
83
|
-
<
|
85
|
+
<measureObservationSection>
|
84
86
|
<templateId>
|
85
87
|
<item root="2.16.840.1.113883.10.20.28.2.4" />
|
86
88
|
</templateId>
|
@@ -90,9 +92,8 @@
|
|
90
92
|
<title value="Measure Observation Section" />
|
91
93
|
<text></text>
|
92
94
|
<%= xml_for_measure_observation_definition(doc) %>
|
93
|
-
</
|
95
|
+
</measureObservationSection>
|
94
96
|
</component>
|
95
97
|
|
96
98
|
<%- end -%>
|
97
|
-
<%- end -%>
|
98
99
|
</QualityMeasureDocument>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module HQMF2
|
2
2
|
module Generator
|
3
|
-
|
3
|
+
|
4
4
|
def self.render_template(name, params)
|
5
5
|
template_path = File.expand_path(File.join('..', "#{name}.xml.erb"), __FILE__)
|
6
6
|
template_str = File.read(template_path)
|
7
7
|
template = ERB.new(template_str, nil, '-', "_templ#{HQMF::Counter.instance.next}")
|
8
8
|
context = ErbContext.new(params)
|
9
|
-
template.result(context.get_binding)
|
9
|
+
template.result(context.get_binding)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
# Class to serialize HQMF::Document as HQMF V2 XML
|
13
13
|
class ModelProcessor
|
14
14
|
# Convert the supplied model instance to XML
|
@@ -18,28 +18,28 @@ module HQMF2
|
|
18
18
|
HQMF2::Generator.render_template('document', {'doc' => doc})
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# Utility class used to supply a binding to Erb. Contains utility functions used
|
23
23
|
# by the erb templates that are used to generate the HQMF document.
|
24
24
|
class ErbContext < OpenStruct
|
25
|
-
|
25
|
+
|
26
26
|
|
27
27
|
def initialize(vars)
|
28
28
|
super(vars)
|
29
29
|
@local_var_names = {}
|
30
30
|
@local_var_counter = {}
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
# Get a binding that contains all the instance variables
|
34
34
|
# @return [Binding]
|
35
35
|
def get_binding
|
36
36
|
binding
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def xml_for_local_variable(criteria)
|
40
40
|
name = @local_var_names[criteria.id]
|
41
41
|
unless name
|
42
|
-
if criteria.specific_occurrence
|
42
|
+
if criteria.specific_occurrence && !criteria.id.starts_with?("Occurrence#{criteria.specific_occurrence}")
|
43
43
|
name = "Occurrence#{criteria.specific_occurrence}#{criteria.id}"
|
44
44
|
else
|
45
45
|
name = criteria.id
|
@@ -53,22 +53,22 @@ module HQMF2
|
|
53
53
|
reference = HQMF::Reference.new(id)
|
54
54
|
xml_for_reference(reference)
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def xml_for_reference(reference)
|
58
58
|
HQMF2::Generator.render_template('reference', {'doc' => doc, 'reference' => reference})
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
def xml_for_attribute(attribute)
|
62
62
|
HQMF2::Generator.render_template('attribute', {'attribute' => attribute})
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def xml_for_fields(criteria)
|
66
66
|
fields = []
|
67
67
|
if criteria.field_values
|
68
68
|
criteria.field_values.each_pair do |key, value|
|
69
69
|
if key == "FLFS"
|
70
70
|
fields << HQMF2::Generator.render_template('fulfills', {'value' => value})
|
71
|
-
else
|
71
|
+
else
|
72
72
|
details = HQMF::DataCriteria::FIELDS[key]
|
73
73
|
details[:code_system_name] = HealthDataStandards::Util::CodeSystemHelper.code_system_for(details[:code_system])
|
74
74
|
details[:id] = "#{criteria.id}_#{key}"
|
@@ -83,15 +83,15 @@ module HQMF2
|
|
83
83
|
end
|
84
84
|
fields.join
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
def xml_for_value(value, element_name='value', include_type=true)
|
88
88
|
HQMF2::Generator.render_template('value', {'doc' => doc, 'value' => value, 'name' => element_name, 'include_type' => include_type})
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
def xml_for_code(criteria, element_name='code', include_type=true)
|
92
92
|
HQMF2::Generator.render_template('code', {'doc' => doc, 'criteria' => criteria, 'name' => element_name, 'include_type' => include_type})
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
def xml_for_derivation(data_criteria)
|
96
96
|
xml = ''
|
97
97
|
if data_criteria.derivation_operator
|
@@ -99,7 +99,7 @@ module HQMF2
|
|
99
99
|
end
|
100
100
|
xml
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def xml_for_effective_time(data_criteria)
|
104
104
|
xml = ''
|
105
105
|
if data_criteria.effective_time
|
@@ -107,7 +107,7 @@ module HQMF2
|
|
107
107
|
end
|
108
108
|
xml
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
def xml_for_reason(data_criteria)
|
112
112
|
xml = ''
|
113
113
|
if data_criteria.negation && data_criteria.negation_code_list_id
|
@@ -115,14 +115,14 @@ module HQMF2
|
|
115
115
|
end
|
116
116
|
xml
|
117
117
|
end
|
118
|
-
|
118
|
+
|
119
119
|
def xml_for_template(data_criteria, is_source_data_criteria)
|
120
120
|
xml = ''
|
121
121
|
templates = []
|
122
122
|
# Add a template ID if one is defined for this data criteria
|
123
|
-
template_id = HQMF::DataCriteria.template_id_for_definition(data_criteria.definition, data_criteria.status,
|
123
|
+
template_id = HQMF::DataCriteria.template_id_for_definition(data_criteria.definition, data_criteria.status, false, "r2")
|
124
124
|
if template_id
|
125
|
-
templates << {:id => template_id, :title => HQMF::DataCriteria.title_for_template_id(template_id)}
|
125
|
+
templates << {:id => template_id, :title => HQMF::DataCriteria.title_for_template_id(template_id, 'r2')}
|
126
126
|
end
|
127
127
|
# Add our own template id if this is a source data criteria from HQMF V1. Source
|
128
128
|
# data criteria are the 'raw' HQMF V1 data criteria before any restrictions are applied
|
@@ -135,7 +135,7 @@ module HQMF2
|
|
135
135
|
end
|
136
136
|
xml
|
137
137
|
end
|
138
|
-
|
138
|
+
|
139
139
|
def xml_for_description(data_criteria)
|
140
140
|
xml = ''
|
141
141
|
if data_criteria.description
|
@@ -143,7 +143,7 @@ module HQMF2
|
|
143
143
|
end
|
144
144
|
xml
|
145
145
|
end
|
146
|
-
|
146
|
+
|
147
147
|
def xml_for_subsets(data_criteria)
|
148
148
|
subsets_xml = []
|
149
149
|
if data_criteria.subset_operators
|
@@ -161,11 +161,11 @@ module HQMF2
|
|
161
161
|
def xml_for_precondition(precondition)
|
162
162
|
HQMF2::Generator.render_template('precondition', {'doc' => doc, 'precondition' => precondition})
|
163
163
|
end
|
164
|
-
|
164
|
+
|
165
165
|
def xml_for_data_criteria(data_criteria, is_source_data_criteria)
|
166
166
|
HQMF2::Generator.render_template(data_criteria_template_name(data_criteria), {'doc' => doc, 'criteria' => data_criteria, 'is_source_data_criteria' => is_source_data_criteria})
|
167
167
|
end
|
168
|
-
|
168
|
+
|
169
169
|
def xml_for_population_criteria(population, criteria_id)
|
170
170
|
xml = ''
|
171
171
|
population_criteria = doc.population_criteria(population[criteria_id])
|
@@ -174,17 +174,45 @@ module HQMF2
|
|
174
174
|
end
|
175
175
|
xml
|
176
176
|
end
|
177
|
-
|
177
|
+
|
178
178
|
def xml_for_temporal_references(criteria)
|
179
179
|
refs = []
|
180
180
|
if criteria.temporal_references
|
181
181
|
refs = criteria.temporal_references.collect do |reference|
|
182
|
-
HQMF2::Generator.render_template('temporal_relationship', {'doc' => doc, 'relationship' => reference})
|
182
|
+
HQMF2::Generator.render_template('temporal_relationship', {'doc' => doc, 'relationship' => reference, 'criteria' => criteria})
|
183
183
|
end
|
184
184
|
end
|
185
185
|
refs.join
|
186
186
|
end
|
187
187
|
|
188
|
+
def xml_for_temporal_relationship_attribute(criteria, relationship)
|
189
|
+
targetCriteria = doc.data_criteria(relationship.reference.id)
|
190
|
+
if (criteria.field_values || targetCriteria.try(:field_values))
|
191
|
+
sourceKeys = (criteria.field_values || {}).keys.select {|key| [:timestamp, :nested_timestamp].include? HQMF::DataCriteria::FIELDS[key][:field_type]}
|
192
|
+
targetKeys = (targetCriteria.try(:field_values) || {}).keys.select {|key| [:timestamp, :nested_timestamp].include? HQMF::DataCriteria::FIELDS[key][:field_type]}
|
193
|
+
if (!sourceKeys.empty? || !targetKeys.empty?)
|
194
|
+
data = {
|
195
|
+
sourceKeys: sourceKeys,
|
196
|
+
targetKeys: targetKeys
|
197
|
+
}
|
198
|
+
|
199
|
+
HQMF2::Generator.render_template('temporal_relationship_attribute', {'doc' => doc, 'criteria' => criteria, 'targetCriteria'=>targetCriteria, 'data'=> data})
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
|
205
|
+
def temporal_relationship_attribute_effective_time(field)
|
206
|
+
{facility_arrival: 'low',
|
207
|
+
facility_departure: 'high',
|
208
|
+
discharge_time: 'high',
|
209
|
+
admit_time: 'low',
|
210
|
+
start_date: 'low',
|
211
|
+
end_date: 'high',
|
212
|
+
incision_time: 'low',
|
213
|
+
removal_time: 'high'}[HQMF::DataCriteria::FIELDS[field][:coded_entry_method]]
|
214
|
+
end
|
215
|
+
|
188
216
|
def xml_for_measure_observation_definition(doc)
|
189
217
|
observation = doc.find_population_by_type(HQMF::PopulationCriteria::OBSERV)
|
190
218
|
msrpopl = doc.find_population_by_type( HQMF::PopulationCriteria::MSRPOPL)
|
@@ -192,7 +220,14 @@ module HQMF2
|
|
192
220
|
end
|
193
221
|
|
194
222
|
def expression_for_observation(doc,observation)
|
195
|
-
|
223
|
+
pre = observation.preconditions[0]
|
224
|
+
if pre && pre.reference
|
225
|
+
dc = doc.data_criteria(pre.reference.id)
|
226
|
+
children = dc.children_criteria
|
227
|
+
if children && children.length == 2
|
228
|
+
return "#{children[0]} - #{children[1]}"
|
229
|
+
end
|
230
|
+
end
|
196
231
|
end
|
197
232
|
|
198
233
|
def data_criteria_should_be_grouper?(criteria)
|
@@ -201,16 +236,21 @@ module HQMF2
|
|
201
236
|
return true unless criteria.subset_operators
|
202
237
|
criteria.subset_operators.all? {|o| o.supports_grouper_criteria?}
|
203
238
|
end
|
204
|
-
|
239
|
+
|
240
|
+
def percision_unit_for_range(relationship)
|
241
|
+
percision_map = {'a'=>'d', 'mo'=>'d', 'wk'=>'d', 'd'=>'d', 'h'=>'min', 'min'=>'min', 's'=>'s'}
|
242
|
+
percision_map[relationship.try(:range).try(:high).try(:unit) || relationship.try(:range).try(:low).try(:unit) || "min"]
|
243
|
+
end
|
244
|
+
|
205
245
|
def oid_for_name(code_system_name)
|
206
246
|
HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(code_system_name)
|
207
247
|
end
|
208
|
-
|
248
|
+
|
209
249
|
def reference_element_name(id)
|
210
250
|
referenced_criteria = doc.data_criteria(id)
|
211
251
|
element_name_prefix(referenced_criteria)
|
212
252
|
end
|
213
|
-
|
253
|
+
|
214
254
|
def reference_type_name(id)
|
215
255
|
referenced_criteria = doc.data_criteria(id)
|
216
256
|
type = nil
|
@@ -241,7 +281,7 @@ module HQMF2
|
|
241
281
|
end
|
242
282
|
end
|
243
283
|
end
|
244
|
-
|
284
|
+
|
245
285
|
def code_for_characteristic(characteristic)
|
246
286
|
case characteristic
|
247
287
|
when :birthtime
|
@@ -260,7 +300,7 @@ module HQMF2
|
|
260
300
|
raise "Unknown demographic code [#{characteristic}]"
|
261
301
|
end
|
262
302
|
end
|
263
|
-
|
303
|
+
|
264
304
|
def is_transfer(code)
|
265
305
|
if code == "TRANSFER_TO" || code == "TRANSFER_FROM"
|
266
306
|
true
|
@@ -268,7 +308,7 @@ module HQMF2
|
|
268
308
|
false
|
269
309
|
end
|
270
310
|
end
|
271
|
-
|
311
|
+
|
272
312
|
def oid_for_characteristic(characteristic)
|
273
313
|
case characteristic
|
274
314
|
when :birthtime
|
@@ -277,12 +317,12 @@ module HQMF2
|
|
277
317
|
'2.16.840.1.113883.6.96'
|
278
318
|
end
|
279
319
|
end
|
280
|
-
|
320
|
+
|
281
321
|
def data_criteria_template_name(data_criteria)
|
282
322
|
case data_criteria.definition
|
283
323
|
when 'diagnosis', 'diagnosis_family_history'
|
284
324
|
'condition_criteria'
|
285
|
-
when 'encounter'
|
325
|
+
when 'encounter'
|
286
326
|
'encounter_criteria'
|
287
327
|
when 'procedure', 'risk_category_assessment', 'physical_exam', 'communication_from_patient_to_provider', 'communication_from_provider_to_provider', 'device', 'diagnostic_study', 'intervention'
|
288
328
|
if data_criteria.value.nil?
|
@@ -335,7 +375,7 @@ module HQMF2
|
|
335
375
|
end
|
336
376
|
end
|
337
377
|
end
|
338
|
-
|
378
|
+
|
339
379
|
def population_element_prefix(population_criteria_code)
|
340
380
|
case population_criteria_code
|
341
381
|
when HQMF::PopulationCriteria::IPP
|
@@ -344,21 +384,25 @@ module HQMF2
|
|
344
384
|
'denominator'
|
345
385
|
when HQMF::PopulationCriteria::NUMER
|
346
386
|
'numerator'
|
387
|
+
when HQMF::PopulationCriteria::NUMEX
|
388
|
+
'numeratorExclusion'
|
347
389
|
when HQMF::PopulationCriteria::DENEXCEP
|
348
390
|
'denominatorException'
|
349
391
|
when HQMF::PopulationCriteria::DENEX
|
350
392
|
'denominatorExclusion'
|
351
393
|
when HQMF::PopulationCriteria::MSRPOPL
|
352
|
-
'measurePopulation'
|
394
|
+
'measurePopulation'
|
395
|
+
when HQMF::PopulationCriteria::MSRPOPLEX
|
396
|
+
'measurePopulationExclusion'
|
353
397
|
when HQMF::PopulationCriteria::OBSERV
|
354
|
-
'measureObservation'
|
398
|
+
'measureObservation'
|
355
399
|
when HQMF::PopulationCriteria::STRAT
|
356
|
-
'stratifier'
|
357
|
-
else
|
400
|
+
'stratifier'
|
401
|
+
else
|
358
402
|
raise "Unknown population criteria type #{population_criteria_code}"
|
359
403
|
end
|
360
404
|
end
|
361
405
|
end
|
362
|
-
|
406
|
+
|
363
407
|
end
|
364
408
|
end
|