health-data-standards 2.2.1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/lib/health-data-standards.rb +55 -12
- data/lib/health-data-standards/export/c32.rb +7 -6
- data/lib/health-data-standards/export/cat_1.rb +18 -0
- data/lib/health-data-standards/export/ccda.rb +8 -8
- data/lib/health-data-standards/export/green_c32/entry.rb +8 -5
- data/lib/health-data-standards/export/green_c32/export_generator.rb +1 -1
- data/lib/health-data-standards/export/green_c32/record.rb +10 -7
- data/lib/health-data-standards/export/hdata/metadata.rb +7 -6
- data/lib/health-data-standards/export/helper/cat1_view_helper.rb +133 -0
- data/lib/health-data-standards/export/helper/gc32_view_helper.rb +39 -0
- data/lib/health-data-standards/export/helper/html_view_helper.rb +23 -0
- data/lib/health-data-standards/export/html.rb +22 -10
- data/lib/health-data-standards/export/qrda/entry_template_resolver.rb +31 -0
- data/lib/health-data-standards/export/qrda/hqmf-qrda-oids.json +638 -0
- data/lib/health-data-standards/export/rendering_context.rb +37 -3
- data/lib/health-data-standards/export/template_helper.rb +20 -23
- data/lib/health-data-standards/export/view_helper.rb +8 -42
- data/lib/health-data-standards/import/bundle/importer.rb +148 -0
- data/lib/health-data-standards/import/c32/care_goal_importer.rb +14 -26
- data/lib/health-data-standards/import/c32/condition_importer.rb +12 -51
- data/lib/health-data-standards/import/c32/immunization_importer.rb +9 -27
- data/lib/health-data-standards/import/c32/insurance_provider_importer.rb +24 -21
- data/lib/health-data-standards/import/c32/patient_importer.rb +27 -34
- data/lib/health-data-standards/import/cat1/diagnosis_active_importer.rb +19 -0
- data/lib/health-data-standards/import/cat1/diagnosis_inactive_importer.rb +19 -0
- data/lib/health-data-standards/import/cat1/diagnostic_study_order_importer.rb +24 -0
- data/lib/health-data-standards/import/cat1/encounter_order_importer.rb +24 -0
- data/lib/health-data-standards/import/cat1/entry_package.rb +25 -0
- data/lib/health-data-standards/import/cat1/gestational_age_importer.rb +42 -0
- data/lib/health-data-standards/import/cat1/lab_order_importer.rb +24 -0
- data/lib/health-data-standards/import/cat1/medication_dispensed_importer.rb +13 -0
- data/lib/health-data-standards/import/cat1/patient_importer.rb +104 -0
- data/lib/health-data-standards/import/cat1/procedure_intolerance_importer.rb +13 -0
- data/lib/health-data-standards/import/cat1/procedure_order_importer.rb +38 -0
- data/lib/health-data-standards/import/cat1/tobacco_use_importer.rb +19 -0
- data/lib/health-data-standards/import/ccda/allergy_importer.rb +2 -8
- data/lib/health-data-standards/import/ccda/care_goal_importer.rb +1 -1
- data/lib/health-data-standards/import/ccda/condition_importer.rb +2 -3
- data/lib/health-data-standards/import/ccda/encounter_importer.rb +2 -5
- data/lib/health-data-standards/import/ccda/immunization_importer.rb +1 -3
- data/lib/health-data-standards/import/ccda/insurance_provider_importer.rb +1 -1
- data/lib/health-data-standards/import/ccda/medical_equipment_importer.rb +2 -4
- data/lib/health-data-standards/import/ccda/medication_importer.rb +2 -4
- data/lib/health-data-standards/import/ccda/patient_importer.rb +1 -1
- data/lib/health-data-standards/import/ccda/procedure_importer.rb +2 -6
- data/lib/health-data-standards/import/ccda/result_importer.rb +2 -5
- data/lib/health-data-standards/import/ccda/vital_sign_importer.rb +2 -3
- data/lib/health-data-standards/import/cda/allergy_importer.rb +32 -0
- data/lib/health-data-standards/import/cda/condition_importer.rb +51 -0
- data/lib/health-data-standards/import/{c32 → cda}/encounter_importer.rb +9 -35
- data/lib/health-data-standards/import/cda/entry_finder.rb +22 -0
- data/lib/health-data-standards/import/{c32 → cda}/locatable_import_utils.rb +2 -3
- data/lib/health-data-standards/import/cda/medical_equipment_importer.rb +24 -0
- data/lib/health-data-standards/import/{c32 → cda}/medication_importer.rb +13 -15
- data/lib/health-data-standards/import/cda/narrative_reference_handler.rb +35 -0
- data/lib/health-data-standards/import/{c32 → cda}/organization_importer.rb +1 -1
- data/lib/health-data-standards/import/cda/procedure_importer.rb +35 -0
- data/lib/health-data-standards/import/{c32 → cda}/provider_importer.rb +4 -8
- data/lib/health-data-standards/import/cda/result_importer.rb +31 -0
- data/lib/health-data-standards/import/{c32 → cda}/section_importer.rb +26 -48
- data/lib/health-data-standards/import/{c32 → cda}/vital_sign_importer.rb +2 -3
- data/lib/health-data-standards/import/green_c32/section_importer.rb +8 -6
- data/lib/health-data-standards/import/provider_import_utils.rb +2 -2
- data/lib/health-data-standards/models/address.rb +1 -1
- data/lib/health-data-standards/models/condition.rb +7 -6
- data/lib/health-data-standards/models/cqm/bundle.rb +45 -0
- data/lib/health-data-standards/models/cqm/measure.rb +36 -0
- data/lib/health-data-standards/models/guarantor.rb +1 -0
- data/lib/health-data-standards/models/insurance_provider.rb +2 -0
- data/lib/health-data-standards/models/order_information.rb +2 -0
- data/lib/health-data-standards/models/record.rb +6 -5
- data/lib/health-data-standards/models/svs/value_set.rb +1 -1
- data/lib/health-data-standards/railtie.rb +11 -0
- data/lib/health-data-standards/tasks/bundle.rake +107 -0
- data/lib/health-data-standards/util/code_system_helper.rb +9 -1
- data/lib/hqmf-generator/attribute.xml.erb +11 -0
- data/lib/hqmf-generator/characteristic_criteria.xml.erb +21 -0
- data/lib/hqmf-generator/code.xml.erb +13 -0
- data/lib/hqmf-generator/condition_criteria.xml.erb +22 -0
- data/lib/hqmf-generator/derivation.xml.erb +6 -0
- data/lib/hqmf-generator/description.xml.erb +1 -0
- data/lib/hqmf-generator/document.xml.erb +63 -0
- data/lib/hqmf-generator/effective_time.xml.erb +4 -0
- data/lib/hqmf-generator/encounter_criteria.xml.erb +21 -0
- data/lib/hqmf-generator/field.xml.erb +28 -0
- data/lib/hqmf-generator/hqmf-generator.rb +292 -0
- data/lib/hqmf-generator/observation_criteria.xml.erb +25 -0
- data/lib/hqmf-generator/population_criteria.xml.erb +23 -0
- data/lib/hqmf-generator/precondition.xml.erb +14 -0
- data/lib/hqmf-generator/procedure_criteria.xml.erb +22 -0
- data/lib/hqmf-generator/reason.xml.erb +3 -0
- data/lib/hqmf-generator/reference.xml.erb +3 -0
- data/lib/hqmf-generator/source.xml.erb +6 -0
- data/lib/hqmf-generator/specific_occurrence.xml.erb +7 -0
- data/lib/hqmf-generator/subset.xml.erb +8 -0
- data/lib/hqmf-generator/substance_criteria.xml.erb +26 -0
- data/lib/hqmf-generator/supply_criteria.xml.erb +26 -0
- data/lib/hqmf-generator/template_id.xml.erb +5 -0
- data/lib/hqmf-generator/temporal_relationship.xml.erb +6 -0
- data/lib/hqmf-generator/value.xml.erb +24 -0
- data/lib/hqmf-generator/variable_criteria.xml.erb +12 -0
- data/lib/hqmf-model/attribute.rb +35 -0
- data/lib/hqmf-model/data_criteria.json +1123 -0
- data/lib/hqmf-model/data_criteria.rb +344 -0
- data/lib/hqmf-model/document.rb +178 -0
- data/lib/hqmf-model/population_criteria.rb +96 -0
- data/lib/hqmf-model/precondition.rb +91 -0
- data/lib/hqmf-model/types.rb +319 -0
- data/lib/hqmf-model/utilities.rb +52 -0
- data/lib/hqmf-parser.rb +56 -0
- data/lib/hqmf-parser/1.0/attribute.rb +68 -0
- data/lib/hqmf-parser/1.0/comparison.rb +34 -0
- data/lib/hqmf-parser/1.0/data_criteria.rb +92 -0
- data/lib/hqmf-parser/1.0/data_criteria_oid_xpath.json +91 -0
- data/lib/hqmf-parser/1.0/document.rb +203 -0
- data/lib/hqmf-parser/1.0/expression.rb +58 -0
- data/lib/hqmf-parser/1.0/observation.rb +61 -0
- data/lib/hqmf-parser/1.0/population_criteria.rb +75 -0
- data/lib/hqmf-parser/1.0/precondition.rb +89 -0
- data/lib/hqmf-parser/1.0/range.rb +65 -0
- data/lib/hqmf-parser/1.0/restriction.rb +160 -0
- data/lib/hqmf-parser/1.0/utilities.rb +41 -0
- data/lib/hqmf-parser/2.0/data_criteria.rb +319 -0
- data/lib/hqmf-parser/2.0/document.rb +165 -0
- data/lib/hqmf-parser/2.0/population_criteria.rb +53 -0
- data/lib/hqmf-parser/2.0/precondition.rb +44 -0
- data/lib/hqmf-parser/2.0/types.rb +223 -0
- data/lib/hqmf-parser/2.0/utilities.rb +30 -0
- data/lib/hqmf-parser/converter/pass1/data_criteria_converter.rb +252 -0
- data/lib/hqmf-parser/converter/pass1/document_converter.rb +185 -0
- data/lib/hqmf-parser/converter/pass1/population_criteria_converter.rb +165 -0
- data/lib/hqmf-parser/converter/pass1/precondition_converter.rb +173 -0
- data/lib/hqmf-parser/converter/pass1/precondition_extractor.rb +188 -0
- data/lib/hqmf-parser/converter/pass1/simple_data_criteria.rb +26 -0
- data/lib/hqmf-parser/converter/pass1/simple_operator.rb +89 -0
- data/lib/hqmf-parser/converter/pass1/simple_population_criteria.rb +10 -0
- data/lib/hqmf-parser/converter/pass1/simple_precondition.rb +51 -0
- data/lib/hqmf-parser/converter/pass1/simple_restriction.rb +64 -0
- data/lib/hqmf-parser/converter/pass2/comparison_converter.rb +112 -0
- data/lib/hqmf-parser/converter/pass2/operator_converter.rb +102 -0
- data/lib/hqmf-parser/parser.rb +54 -0
- data/lib/hqmf-parser/value_sets/value_set_parser.rb +241 -0
- data/lib/util/counter.rb +20 -0
- data/templates/{_allergies.c32.erb → c32/_allergies.c32.erb} +0 -0
- data/templates/{_allergies_no_current.c32.erb → c32/_allergies_no_current.c32.erb} +0 -0
- data/templates/{_care_goals.c32.erb → c32/_care_goals.c32.erb} +0 -0
- data/templates/{_code_with_reference.c32.erb → c32/_code_with_reference.c32.erb} +0 -0
- data/templates/{_conditions.c32.erb → c32/_conditions.c32.erb} +0 -0
- data/templates/{_conditions_no_current.c32.erb → c32/_conditions_no_current.c32.erb} +0 -0
- data/templates/{_encounters.c32.erb → c32/_encounters.c32.erb} +0 -0
- data/templates/{_immunizations.c32.erb → c32/_immunizations.c32.erb} +0 -0
- data/templates/{_medical_equipment.c32.erb → c32/_medical_equipment.c32.erb} +0 -0
- data/templates/{_medications.c32.erb → c32/_medications.c32.erb} +0 -0
- data/templates/{_medications_no_current.c32.erb → c32/_medications_no_current.c32.erb} +0 -0
- data/templates/{_narrative_block.c32.erb → c32/_narrative_block.c32.erb} +0 -0
- data/templates/{_procedures.c32.erb → c32/_procedures.c32.erb} +0 -0
- data/templates/{_results.c32.erb → c32/_results.c32.erb} +0 -0
- data/templates/{_social_history.c32.erb → c32/_social_history.c32.erb} +0 -0
- data/templates/{_vital_signs.c32.erb → c32/_vital_signs.c32.erb} +0 -0
- data/templates/{show.c32.erb → c32/show.c32.erb} +0 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.22.4.85.cat1.erb +18 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.101.cat1.erb +25 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +12 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +60 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +41 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +50 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +37 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.14.cat1.erb +35 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +22 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +21 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +28 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.20.cat1.erb +20 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +21 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +71 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.28.cat1.erb +20 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +24 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +20 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +15 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.34.cat1.erb +58 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +20 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +16 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +27 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.40.cat1.erb +17 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +38 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +38 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +24 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +24 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +26 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +30 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +26 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +13 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +16 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +10 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +19 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +17 -0
- data/templates/cat1/_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 +23 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +29 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.66.cat1.erb +34 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +23 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +30 -0
- data/templates/cat1/_2.16.840.1.113883.10.20.24.3.76.cat1.erb +32 -0
- data/templates/cat1/_measures.cat1.erb +66 -0
- data/templates/cat1/_medication_details.cat1.erb +9 -0
- data/templates/cat1/_ordinality.cat1.erb +4 -0
- data/templates/cat1/_patient_data.cat1.erb +14 -0
- data/templates/cat1/_reason.cat1.erb +16 -0
- data/templates/cat1/_record_target.cat1.erb +39 -0
- data/templates/cat1/_reporting_parameters.cat1.erb +24 -0
- data/templates/cat1/_result_value.cat1.erb +16 -0
- data/templates/cat1/show.cat1.erb +125 -0
- data/templates/{_address.gc32.erb → gc32/_address.gc32.erb} +1 -1
- data/templates/gc32/_advance_directive.gc32.erb +5 -0
- data/templates/gc32/_allergy.gc32.erb +12 -0
- data/templates/{_care_goal.gc32.erb → gc32/_care_goal.gc32.erb} +1 -1
- data/templates/gc32/_condition.gc32.erb +10 -0
- data/templates/gc32/_encounter.gc32.erb +28 -0
- data/templates/gc32/_entry.gc32.erb +3 -0
- data/templates/gc32/_entry_attributes.gc32.erb +10 -0
- data/templates/gc32/_immunization.gc32.erb +9 -0
- data/templates/gc32/_insurance_provider.gc32.erb +28 -0
- data/templates/gc32/_medical_equipment.gc32.erb +6 -0
- data/templates/gc32/_medication.gc32.erb +91 -0
- data/templates/{_name.gc32.erb → gc32/_name.gc32.erb} +0 -0
- data/templates/gc32/_organization.gc32.erb +10 -0
- data/templates/gc32/_person_attributes.gc32.erb +7 -0
- data/templates/gc32/_procedure.gc32.erb +9 -0
- data/templates/gc32/_provider.gc32.erb +9 -0
- data/templates/gc32/_result.gc32.erb +12 -0
- data/templates/gc32/_social_history.gc32.erb +6 -0
- data/templates/{_support.gc32.erb → gc32/_support.gc32.erb} +4 -3
- data/templates/gc32/_telecom.gc32.erb +1 -0
- data/templates/gc32/_vital_sign.gc32.erb +4 -0
- data/templates/{record.gc32.erb → gc32/record.gc32.erb} +26 -10
- data/templates/html/_entries_by_encounter.html.erb +2 -2
- data/templates/html/_entries_by_section.html.erb +1 -1
- data/templates/html/_entry.html.erb +16 -21
- data/templates/html/_header.html.erb +1 -1
- data/templates/html/_section.html.erb +1 -1
- data/templates/html/show.html.erb +23 -2
- data/templates/metadata.hdata.erb +3 -3
- metadata +282 -54
- data/lib/health-data-standards/import/c32/allergy_importer.rb +0 -47
- data/lib/health-data-standards/import/c32/medical_equipment_importer.rb +0 -45
- data/lib/health-data-standards/import/c32/procedure_importer.rb +0 -62
- data/lib/health-data-standards/import/c32/result_importer.rb +0 -56
- data/templates/_advance_directive.gc32.erb +0 -8
- data/templates/_allergy.gc32.erb +0 -23
- data/templates/_condition.gc32.erb +0 -9
- data/templates/_encounter.gc32.erb +0 -26
- data/templates/_entry.gc32.erb +0 -14
- data/templates/_immunization.gc32.erb +0 -11
- data/templates/_insurance_provider.gc32.erb +0 -0
- data/templates/_medical_equipment.gc32.erb +0 -7
- data/templates/_medication.gc32.erb +0 -72
- data/templates/_organization.gc32.erb +0 -10
- data/templates/_procedure.gc32.erb +0 -10
- data/templates/_provider.gc32.erb +0 -19
- data/templates/_result.gc32.erb +0 -16
- data/templates/_social_history.gc32.erb +0 -8
- data/templates/_telecom.gc32.erb +0 -1
- data/templates/_vital_sign.gc32.erb +0 -7
@@ -0,0 +1,24 @@
|
|
1
|
+
<component>
|
2
|
+
<section>
|
3
|
+
<!-- This is the templateId for Reporting Parameters section -->
|
4
|
+
<templateId root="2.16.840.1.113883.10.20.17.2.1"/>
|
5
|
+
<code code="55187-9" codeSystem="2.16.840.1.113883.6.1"/>
|
6
|
+
<title>Reporting Parameters</title>
|
7
|
+
<text>
|
8
|
+
<list>
|
9
|
+
<item>Reporting period: <%= start_date.to_formatted_s(:long_ordinal) %> - <%= end_date.to_formatted_s(:long_ordinal) %></item>
|
10
|
+
</list>
|
11
|
+
</text>
|
12
|
+
<entry typeCode="DRIV">
|
13
|
+
<act classCode="ACT" moodCode="EVN">
|
14
|
+
<!-- This is the templateId for Reporting Parameteres Act -->
|
15
|
+
<templateId root="2.16.840.1.113883.10.20.17.3.8"/>
|
16
|
+
<code code="252116004" codeSystem="2.16.840.1.113883.6.96" displayName="Observation Parameters"/>
|
17
|
+
<effectiveTime>
|
18
|
+
<low value="<%= start_date.to_formatted_s(:number) %>"/>
|
19
|
+
<high value="<%= end_date.to_formatted_s(:number) %>"/>
|
20
|
+
</effectiveTime>
|
21
|
+
</act>
|
22
|
+
</entry>
|
23
|
+
</section>
|
24
|
+
</component>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% ev = entry.values.first
|
2
|
+
if ev.present?
|
3
|
+
if ev.respond_to?(:codes) -%>
|
4
|
+
<%== code_display(ev, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\"") %>
|
5
|
+
<% elsif ev.respond_to?(:scalar) -%>
|
6
|
+
<% if is_num?(ev.scalar) -%>
|
7
|
+
<value xsi:type="PQ" value="<%= ev.scalar %>" <% if ev.units -%>unit="<%= ev.units %>"<% end -%>/>
|
8
|
+
<% elsif is_bool?(ev.scalar)%>
|
9
|
+
<value xsi:type="BL" value="<%= ev.scalar %>" />
|
10
|
+
<% else -%>
|
11
|
+
<value xsi:type="ST" ><%= ev.scalar %></value>
|
12
|
+
<% end
|
13
|
+
end
|
14
|
+
else -%>
|
15
|
+
<value xsi:type="CD" nullFlavor="UNK"/>
|
16
|
+
<% end -%>
|
@@ -0,0 +1,125 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<?xml-stylesheet type="text/xsl" href="cda.xsl"?>
|
3
|
+
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
+
xmlns="urn:hl7-org:v3"
|
5
|
+
xmlns:voc="urn:hl7-org:v3/voc"
|
6
|
+
xmlns:sdtc="urn:hl7-org:sdtc">
|
7
|
+
<!-- QRDA Header -->
|
8
|
+
<realmCode code="US"/>
|
9
|
+
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
|
10
|
+
<!-- US Realm Header Template Id -->
|
11
|
+
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
|
12
|
+
<!-- QRDA templateId -->
|
13
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.1"/>
|
14
|
+
<!-- QDM-based QRDA templateId -->
|
15
|
+
<templateId root="2.16.840.1.113883.10.20.24.1.2"/>
|
16
|
+
<!-- This is the globally unique identifier for this QRDA document -->
|
17
|
+
<id root="5b010313-eff2-432c-9909-6193d8416fac"/>
|
18
|
+
<!-- QRDA document type code -->
|
19
|
+
<code code="55182-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Quality Measure Report"/>
|
20
|
+
<title>QRDA Incidence Report</title>
|
21
|
+
<!-- This is the document creation time -->
|
22
|
+
<effectiveTime value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
|
23
|
+
<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
|
24
|
+
<languageCode code="en-US"/>
|
25
|
+
<!-- reported patient -->
|
26
|
+
<%== render :partial => 'record_target', :locals => {:patient => patient} %>
|
27
|
+
<!-- Example of an author who is a device -->
|
28
|
+
<author>
|
29
|
+
<time value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
|
30
|
+
<assignedAuthor>
|
31
|
+
<id extension="Cypress" root="2.16.840.1.113883.19.5"/>
|
32
|
+
<!-- NPI -->
|
33
|
+
<id extension="FakeNPI" root="2.16.840.1.113883.4.6"/>
|
34
|
+
<addr>
|
35
|
+
<streetAddressLine>202 Burlington Rd.</streetAddressLine>
|
36
|
+
<city>Bedford</city>
|
37
|
+
<state>MA</state>
|
38
|
+
<postalCode>01730</postalCode>
|
39
|
+
<country>US</country>
|
40
|
+
</addr>
|
41
|
+
<telecom use="WP" value="tel:(781)271-3000"/>
|
42
|
+
<assignedAuthoringDevice>
|
43
|
+
<manufacturerModelName>Cypress</manufacturerModelName >
|
44
|
+
<softwareName>Cypress</softwareName >
|
45
|
+
</assignedAuthoringDevice >
|
46
|
+
</assignedAuthor>
|
47
|
+
</author>
|
48
|
+
<custodian>
|
49
|
+
<assignedCustodian>
|
50
|
+
<representedCustodianOrganization>
|
51
|
+
<id root="2.16.840.1.113883.19.5"/>
|
52
|
+
<name>Cypress Test Deck</name>
|
53
|
+
<telecom use="WP" value="tel:(781)271-3000"/>
|
54
|
+
<addr>
|
55
|
+
<streetAddressLine>202 Burlington Rd.</streetAddressLine>
|
56
|
+
<city>Bedford</city>
|
57
|
+
<state>MA</state>
|
58
|
+
<postalCode>01730</postalCode>
|
59
|
+
<country>US</country>
|
60
|
+
</addr>
|
61
|
+
</representedCustodianOrganization>
|
62
|
+
</assignedCustodian>
|
63
|
+
</custodian>
|
64
|
+
<legalAuthenticator>
|
65
|
+
<time value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
|
66
|
+
<signatureCode code="S"/>
|
67
|
+
<assignedEntity>
|
68
|
+
<id root="bc01a5d1-3a34-4286-82cc-43eb04c972a7"/>
|
69
|
+
<addr>
|
70
|
+
<streetAddressLine>202 Burlington Rd.</streetAddressLine>
|
71
|
+
<city>Bedford</city>
|
72
|
+
<state>MA</state>
|
73
|
+
<postalCode>01730</postalCode>
|
74
|
+
<country>US</country>
|
75
|
+
</addr>
|
76
|
+
<telecom use="WP" value="tel:(781)271-3000"/>
|
77
|
+
<assignedPerson>
|
78
|
+
<name>
|
79
|
+
<given>Henry</given>
|
80
|
+
<family>Seven</family>
|
81
|
+
</name>
|
82
|
+
</assignedPerson>
|
83
|
+
<representedOrganization>
|
84
|
+
<id root="2.16.840.1.113883.19.5"/>
|
85
|
+
<name>Cypress</name>
|
86
|
+
</representedOrganization>
|
87
|
+
</assignedEntity>
|
88
|
+
</legalAuthenticator>
|
89
|
+
|
90
|
+
<!-- TODO: This is where the provider information will go.
|
91
|
+
It is currently hard coded, but should be replaced with the providers
|
92
|
+
and the time over which they are performing. -->
|
93
|
+
<documentationOf typeCode="DOC">
|
94
|
+
<serviceEvent classCode="PCPR"> <!-- care provision -->
|
95
|
+
<effectiveTime>
|
96
|
+
<low value="20100601"/>
|
97
|
+
<high value="20100915"/>
|
98
|
+
</effectiveTime>
|
99
|
+
<!-- You can include multiple performers, each with an NPI, TIN, CCN. -->
|
100
|
+
<performer typeCode="PRF">
|
101
|
+
<time>
|
102
|
+
<low value="20020716"/>
|
103
|
+
<high value="20070915"/>
|
104
|
+
</time>
|
105
|
+
<assignedEntity>
|
106
|
+
<!-- This is the provider NPI -->
|
107
|
+
<id root="2.16.840.1.113883.4.6" extension="111111111" />
|
108
|
+
<representedOrganization>
|
109
|
+
<!-- This is the organization TIN -->
|
110
|
+
<id root="2.16.840.1.113883.4.2" extension="1234567" />
|
111
|
+
<!-- This is the organization CCN -->
|
112
|
+
<id root="2.16.840.1.113883.4.336" extension="54321" />
|
113
|
+
</representedOrganization>
|
114
|
+
</assignedEntity>
|
115
|
+
</performer>
|
116
|
+
</serviceEvent>
|
117
|
+
</documentationOf>
|
118
|
+
<component>
|
119
|
+
<structuredBody>
|
120
|
+
<%== render :partial => 'measures', :locals => {:measures => measures} %>
|
121
|
+
<%== render :partial => 'reporting_parameters', :locals => {:start_date => start_date, :end_date => end_date} %>
|
122
|
+
<%== render :partial => 'patient_data', :locals => {:measures => measures, :patient => patient} %>
|
123
|
+
</structuredBody>
|
124
|
+
</component>
|
125
|
+
</ClinicalDocument>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<allergy xmlns="urn:hl7-org:greencda:c32" id="<%=allergy.id%>">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: allergy, code_sets: ['SNOMED-CT', "RxNorm", "FDA"]}%>
|
3
|
+
<% if allergy.type %>
|
4
|
+
<%== gc32_code_display allergy, "tag_name" => "type", "attribute" => "type", 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'] %>
|
5
|
+
<% end %>
|
6
|
+
<% if allergy.reaction && allergy.reaction['code'] %>
|
7
|
+
<reaction code="<%= allergy.reaction['code'] %>" codeSystem="<%= allergy.reaction['code_system'] %>" />
|
8
|
+
<% end %>
|
9
|
+
<% if allergy.severity && !allergy.severity.empty? %>
|
10
|
+
<%== gc32_code_display allergy, "tag_name" => "severity", "attribute" => "severity", 'preferred_code_sets' => ['SNOMED-CT'] %>
|
11
|
+
<% end %>
|
12
|
+
</allergy>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<condition id="<%= condition.id %>" <% unless condition.cause_of_death.nil? %>causeOfDeath="<%= condition.cause_of_death %>"<% end %> xmlns="urn:hl7-org:greencda:c32">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: condition, code_sets: ['SNOMED-CT', "ICD-9-CM", "ICD-10-CM"]}%>
|
3
|
+
<% if condition.priority %>
|
4
|
+
<priority><%= condition.priority %></priority>
|
5
|
+
<% end %>
|
6
|
+
<type><%= condition.type %></type>
|
7
|
+
<% condition.treating_provider.each do |tp| %>
|
8
|
+
<%== render partial: 'provider', locals: {provider: tp} %>
|
9
|
+
<% end %>
|
10
|
+
</condition>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<encounter xmlns="urn:hl7-org:greencda:c32" id="<%= encounter.id %>">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: encounter, code_sets: ["CPT", "SNOMED-CT"]}%>
|
3
|
+
<% if encounter.discharge_disposition %>
|
4
|
+
<%== gc32_code_display encounter, "tag_name" => "dischargeDisposition", 'attribute' => "discharge_disposition", 'preferred_code_sets' => ["NUBC"] %>
|
5
|
+
<% end %>
|
6
|
+
<% if encounter.admit_type%>
|
7
|
+
<%== gc32_code_display encounter, "tag_name" => "admissionType", 'attribute' => "admit_type", 'preferred_code_sets' => ["NUBC"] %>
|
8
|
+
<% end %>
|
9
|
+
<% if provider %>
|
10
|
+
<%== render partial: 'provider', locals: {provider: encounter.performer, tag_name: 'performer'}%>
|
11
|
+
<% end %>
|
12
|
+
<% facility = encounter.facility %>
|
13
|
+
<% if facility %>
|
14
|
+
<facility>
|
15
|
+
<name><%= facility.name%></name>
|
16
|
+
<% facility.addresses.each do |addr| %>
|
17
|
+
<%== render :partial => "address", locals: {address: addr} %>
|
18
|
+
<% end %>
|
19
|
+
<% facility.telecoms.each do |tele| %>
|
20
|
+
<%== render :partial => "telecom", locals: {telecom: tele} %>
|
21
|
+
<% end %>
|
22
|
+
<%== gc32_interval(encounter, "duration", :admit_time, :discharge_time) %>
|
23
|
+
</facility>
|
24
|
+
<% end %>
|
25
|
+
<% if encounter.performer %>
|
26
|
+
<%== render partial: 'provider', locals: {provider: encounter.performer} %>
|
27
|
+
<% end %>
|
28
|
+
</encounter>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% if entry.codes.empty? %>
|
2
|
+
<code />
|
3
|
+
<% else %>
|
4
|
+
<%== gc32_code_display entry, "tag_name" => "code", 'preferred_code_sets' => code_sets %>
|
5
|
+
<% end %>
|
6
|
+
<% if entry.status_code && !entry.status_code.empty? %>
|
7
|
+
<%== gc32_code_display entry, "tag_name" => "status", "attribute" => "status_code", 'preferred_code_sets' => ['SNOMED-CT', "HL7 ActStatus"] %>
|
8
|
+
<% end %>
|
9
|
+
<freeText><%=entry.free_text %></freeText>
|
10
|
+
<%== gc32_effective_time(entry)%>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<immunization xmlns="urn:hl7-org:greencda:c32" id="<%= immunization.id%>" <% if refused %> refused="true" <% end %>>
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: immunization, code_sets: ["RxNorm", "CVX", "FDA"]}%>
|
3
|
+
<% if immunization.series_number %>
|
4
|
+
<seriesNumber><%= immunization.series_number %></seriesNumber>
|
5
|
+
<% end %>
|
6
|
+
<% if immunization.refusal_reason %>
|
7
|
+
<%== gc32_code_display immunization, "tag_name" => "refusalReason", "attribute" => "refusal_reason", "preferred_code_sets" => ["HL7 ActNoImmunicationReason"] %>
|
8
|
+
<% end %>
|
9
|
+
</immunization>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<insuranceProvider xmlns="urn:hl7-org:greencda:c32" id="<%=insurance_provider.id%>">
|
2
|
+
<insuranceType code="<%== insurance_provider.type %>" codeSystem="2.16.840.1.113883.3.88.12.3221.5.2" />
|
3
|
+
<%== render partial: "organization", locals: {organization: insurance_provider.payer, tag_name: payer} %>
|
4
|
+
<% if insurance_provider.subscriber %>
|
5
|
+
<subscriber>
|
6
|
+
<%== render partial: 'person_attributes', locals: {person: insurance_provider.subscriber} %>
|
7
|
+
</subscriber>
|
8
|
+
<% end %>
|
9
|
+
<% if insurance_provider.relationship %>
|
10
|
+
<%== gc32_code_display insurance_provider, "attribute" => "relationship", "tag_name" => "relationshipToSubscriber" %>
|
11
|
+
<% end %>
|
12
|
+
<% insurance_provider.guarantors.each do |g| %>
|
13
|
+
<guarantor>
|
14
|
+
<%== gc32_interval(insurance_provider, "financialResponsibilityDateRange", :start_time, :end_time) %>
|
15
|
+
<% if g.organization %>
|
16
|
+
<%== render partial: 'organization', locals: {organization: g.organization}%>
|
17
|
+
<% elsif g.person%>
|
18
|
+
<person>
|
19
|
+
<%== render partial: 'person_attributes', locals: {person: g.person} %>
|
20
|
+
</person>
|
21
|
+
<% end %>
|
22
|
+
</guarantor>
|
23
|
+
<% end %>
|
24
|
+
<healthPlanName><%=insurance_provider.name%></healthPlanName>
|
25
|
+
<% if insurance_provider.free_text%>
|
26
|
+
<freeText><%= insurance_provider.free_text%></freeText>
|
27
|
+
<% end %>
|
28
|
+
</insuranceProvider>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<medicalEquipment xmlns="urn:hl7-org:greencda:c32" id="<%= medical_equipment.id%>">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: medical_equipment, code_sets: ["SNOMED-CT", "LOINC"]}%>
|
3
|
+
<% if medical_equipment.values.first %>
|
4
|
+
<%== quantity_display medical_equipment.values.first, "quantity" %>
|
5
|
+
<% end %>
|
6
|
+
</medicalEquipment>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<medication xmlns="urn:hl7-org:greencda:c32" id="<%=medication.id%>">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: medication, code_sets: ["RxNorm", "CVX", "FDA"]}%>
|
3
|
+
<% if medication.administration_timing %>
|
4
|
+
<administrationTiming institutionSpecified="<%= medication.administration_timing['institution_specified'] %>">
|
5
|
+
<period amount="<%=medication.administration_timing['period']['value'] %>" unit="<%= medication.administration_timing['period']['unit']%>" />
|
6
|
+
</administrationTiming>
|
7
|
+
<% end %>
|
8
|
+
<% if medication.route %>
|
9
|
+
<%== gc32_code_display medication, "tag_name" => "route", "attribute" => "route", "preferred_code_sets" => ["NCI Thesaurus"] %>
|
10
|
+
<% end %>
|
11
|
+
<% if medication.site %>
|
12
|
+
<%== gc32_code_display medication, "tag_name" => "site", "attribute" => "site", "preferred_code_sets" => ["SNOMED-CT"] %>
|
13
|
+
<% end %>
|
14
|
+
<%== quantity_display medication.dose, :dose %>
|
15
|
+
<% if medication.dose_indicator %>
|
16
|
+
<doseIndication><%=medication.dose_indicator%></doseIndication>
|
17
|
+
<% end %>
|
18
|
+
<% if medication.dose_restriction %>
|
19
|
+
<doseRestriction>
|
20
|
+
<numerator><%= medication.dose_restriction["numerator"]%></numerator>
|
21
|
+
<denominator><%= medication.dose_restriction["denominator"]%></denominator>
|
22
|
+
</doseRestriction>
|
23
|
+
<% end %>
|
24
|
+
<% if medication.product_form %>
|
25
|
+
<%== gc32_code_display medication, "tag_name" => "productForm", "attribute" => "product_form", "preferred_code_sets" => ["FDA", "NCI Thesaurus"] %>
|
26
|
+
<% end %>
|
27
|
+
<% if medication.delivery_method %>
|
28
|
+
<%== gc32_code_display medication, "tag_name" => "deliveryMethod", "attribute" => "delivery_method", "preferred_code_sets" => medication.delivery_method.keys %>
|
29
|
+
<% end %>
|
30
|
+
<% if medication.type_of_medication%>
|
31
|
+
<%== gc32_code_display medication, "tag_name" => "type", "attribute" => "type_of_medication", "preferred_code_sets" => ["SNOMED-CT"] %>
|
32
|
+
<% end %>
|
33
|
+
<% if medication.status_of_medication%>
|
34
|
+
<%== gc32_code_display medication, "tag_name" => "statusOfMedication", "attribute" => "status_of_medication", "preferred_code_sets" => ["SNOMED-CT"] %>
|
35
|
+
<% end %>
|
36
|
+
<%if medication.indication%>
|
37
|
+
<%== gc32_code_display medication, "tag_name" => "indication", "attribute" => "indication", "preferred_code_sets" => ["SNOMED-CT"] %>
|
38
|
+
<% end %>
|
39
|
+
<% if medication.vehicle %>
|
40
|
+
<%== gc32_code_display medication, "tag_name" => "vehicle", "attribute" => "vehicle", "preferred_code_sets" => ["SNOMED-CT"] %>
|
41
|
+
<% end%>
|
42
|
+
<% if medication.dose_indicator %>
|
43
|
+
<doseIndicator><%= medication.dose_indicator %></doseIndicator>
|
44
|
+
<% end %>
|
45
|
+
<% if medication.patient_instructions %>
|
46
|
+
<patientInstructions><%=medication.patient_instructions%></patientInstructions>
|
47
|
+
<% end %>
|
48
|
+
<% if medication.fulfillment_instructions %>
|
49
|
+
<fulfillmentInstructions><%=medication.fulfillment_instructions%></fulfillmentInstructions>
|
50
|
+
<% end %>
|
51
|
+
<% medication.fulfillment_history.each do |fh| %>
|
52
|
+
<fulfillmentHistory <%if (fh.fill_status) %> fillStatus="<%=fh.fill_status%>" <% end %>
|
53
|
+
<% if fh.fill_number %> fillNumber="<%=fh.fill_number%>" <% end %>>
|
54
|
+
<prescriptionNumber><%=fh.prescription_number%></prescriptionNumber>
|
55
|
+
<% if fh.dispense_date %>
|
56
|
+
<dispenseDate value="<%=Time.at(fh.dispense_date).xmlschema%>" />
|
57
|
+
<% end %>
|
58
|
+
<%== quantity_display fh.quantity_dispensed, :quantityDispensed %>
|
59
|
+
</fulfillmentHistory>
|
60
|
+
<% end %>
|
61
|
+
<% medication.order_information.each do |oi| %>
|
62
|
+
<orderInformation <% if oi.order_number %><%== "orderNumber=\"#{oi.order_number}\"" %> <% end %> <% if oi.fills %><%== "fills=\"#{oi.fills}\"" %><% end %>>
|
63
|
+
<% if oi.quantity_ordered %>
|
64
|
+
<%== quantity_display oi.quantity_ordered, "quantityOrdered" %>
|
65
|
+
<% end %>
|
66
|
+
<% if oi.order_date_time %>
|
67
|
+
<orderedDateTime value="<%=Time.at(oi.order_date_time).xmlschema%>" />
|
68
|
+
<% end %>
|
69
|
+
<% if oi.order_expiration_date_time %>
|
70
|
+
<expirationDateTime value="<%=Time.at(oi.order_expiration_date_time).xmlschema%>" />
|
71
|
+
<% end %>
|
72
|
+
</orderInformation>
|
73
|
+
<% end %>
|
74
|
+
<% include_providers ||= false %>
|
75
|
+
<% if include_providers %>
|
76
|
+
<prescribers>
|
77
|
+
<% medication.order_information.each do |oi| %>
|
78
|
+
<% if oi.provider %>
|
79
|
+
<%== render partial: 'provider', locals: {provider: oi.provider, tag_name: 'prescriber'} %>
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
</prescribers>
|
83
|
+
<pharmacists>
|
84
|
+
<% medication.fulfillment_history.each do |fh| %>
|
85
|
+
<% if oi.provider %>
|
86
|
+
<%== render partial: 'provider', locals: {provider: fh.provider, tag_name: 'pharmacist'} %>
|
87
|
+
<% end %>
|
88
|
+
<% end %>
|
89
|
+
</pharmacists>
|
90
|
+
<% end %>
|
91
|
+
</medication>
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% tag_name ||= "organization"%>
|
2
|
+
<<%=tag_name%> id="<%=organization.id%>">
|
3
|
+
<name><%= organization.name%></name>
|
4
|
+
<% organization.addresses.each do |addr| %>
|
5
|
+
<%== render :partial => "address", locals: {address: addr} %>
|
6
|
+
<% end %>
|
7
|
+
<% organization.telecoms.each do |tele| %>
|
8
|
+
<%== render :partial => "telecom", locals: {telecom: tele} %>
|
9
|
+
<% end %>
|
10
|
+
</organization>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%== render partial: 'name', locals: {person: person} %>
|
2
|
+
<% person.addresses.each do |addr| %>
|
3
|
+
<%== render :partial => "address", locals: {address: addr} %>
|
4
|
+
<% end %>
|
5
|
+
<% person.telecoms.each do |tele| %>
|
6
|
+
<%== render :partial => "telecom", locals: {telecom: tele} %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<procedure xmlns="urn:hl7-org:greencda:c32" id="<%=procedure.id%>">
|
2
|
+
<%== render partial: "entry_attributes", locals: {entry: procedure, code_sets: ['CPT', 'ICD-9-CM', 'ICD-10-CM', 'HCPCS', 'SNOMED-CT']}%>
|
3
|
+
<% if procedure.site %>
|
4
|
+
<%== gc32_code_display procedure, "tag_name" => "site", "attribute" => "site", "preferred_code_sets" => ["SNOMED-CT"] %>
|
5
|
+
<% end %>
|
6
|
+
<% if procedure.performer %>
|
7
|
+
<%== render partial: 'provider', locals: {provider: procedure.performer} %>
|
8
|
+
<% end %>
|
9
|
+
</procedure>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% tag_name ||= "provider" %>
|
2
|
+
<<%=tag_name%> id="<%= provider.id%>">
|
3
|
+
<%== render :partial => 'person_attributes', locals: {person: provider} %>
|
4
|
+
<npi>1234567890</npi>
|
5
|
+
<specialty></specialty>
|
6
|
+
<% if provider.organization %>
|
7
|
+
<%== render :partial => "organization", locals: { organization: provider.organization } %>
|
8
|
+
<% end %>
|
9
|
+
</<%=tag_name%>>
|