health-data-standards 4.0.6 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/health-data-standards.rb +3 -0
  3. data/lib/health-data-standards/export/cat_1.rb +2 -2
  4. data/lib/health-data-standards/export/qrda/hqmf-qrda-oids.json +13 -1
  5. data/lib/health-data-standards/export/view_helper.rb +11 -4
  6. data/lib/health-data-standards/import/cat1/adverse_event_importer.rb +12 -0
  7. data/lib/health-data-standards/import/cat1/allergy_intolerance_importer.rb +13 -0
  8. data/lib/health-data-standards/import/cat1/medication_substance_administered_importer.rb +19 -0
  9. data/lib/health-data-standards/validate/qrda_qdm_template_validator.rb +70 -1
  10. data/lib/health-data-standards/validate/validators.rb +10 -0
  11. data/resources/schematron/qrda/cat_1_r5/HL7 QRDA Category I STU 5.sch +3069 -0
  12. data/resources/schematron/qrda/cat_1_r5/voc.xml +1186 -0
  13. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +14 -0
  14. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +17 -0
  15. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +65 -0
  16. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +53 -0
  17. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.135.cat1.erb +69 -0
  18. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.136.cat1.erb +50 -0
  19. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.140.cat1.erb +25 -0
  20. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.144.cat1.erb +24 -0
  21. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.145.cat1.erb +18 -0
  22. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.146.cat1.erb +33 -0
  23. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.147.cat1.erb +28 -0
  24. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +17 -0
  25. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +29 -0
  26. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +29 -0
  27. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +24 -0
  28. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +94 -0
  29. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +25 -0
  30. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +18 -0
  31. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +21 -0
  32. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +16 -0
  33. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +23 -0
  34. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +29 -0
  35. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +45 -0
  36. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +27 -0
  37. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +36 -0
  38. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +41 -0
  39. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.51.cat1.erb +14 -0
  40. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +32 -0
  41. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +18 -0
  42. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +23 -0
  43. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +25 -0
  44. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +15 -0
  45. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +55 -0
  46. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +31 -0
  47. data/templates/cat1/r5/_2.16.840.1.113883.10.20.24.3.9.cat1.erb +35 -0
  48. data/templates/cat1/r5/_2.16.840.1.113883.10.20.28.3.6.cat1.erb +17 -0
  49. data/templates/cat1/r5/_address.cat1.erb +7 -0
  50. data/templates/cat1/r5/_author.cat1.erb +28 -0
  51. data/templates/cat1/r5/_author_qdm.cat1.erb +8 -0
  52. data/templates/cat1/r5/_component_value.cat1.erb +5 -0
  53. data/templates/cat1/r5/_components.cat1.erb +11 -0
  54. data/templates/cat1/r5/_fulfills.cat1.erb +14 -0
  55. data/templates/cat1/r5/_id.cat1.erb +1 -0
  56. data/templates/cat1/r5/_measures.cat1.erb +93 -0
  57. data/templates/cat1/r5/_medication_details.cat1.erb +12 -0
  58. data/templates/cat1/r5/_medication_dispense.cat1.erb +22 -0
  59. data/templates/cat1/r5/_ordinality.cat1.erb +6 -0
  60. data/templates/cat1/r5/_organization.cat1.erb +9 -0
  61. data/templates/cat1/r5/_patient_data.cat1.erb +17 -0
  62. data/templates/cat1/r5/_providers.cat1.erb +76 -0
  63. data/templates/cat1/r5/_reason.cat1.erb +30 -0
  64. data/templates/cat1/r5/_record_target.cat1.erb +54 -0
  65. data/templates/cat1/r5/_reporting_parameters.cat1.erb +31 -0
  66. data/templates/cat1/r5/_result_value.cat1.erb +20 -0
  67. data/templates/cat1/r5/_results.cat1.erb +18 -0
  68. data/templates/cat1/r5/_telecom.cat1.erb +1 -0
  69. data/templates/cat1/r5/show.cat1.erb +192 -0
  70. metadata +65 -3
@@ -0,0 +1,14 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="GOL">
3
+ <!-- Conforms to C-CDA R2 Goal Observation -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.121" />
5
+ <templateId root="2.16.840.1.113883.10.20.24.3.1" extension="2017-08-01"/>
6
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
7
+ <%== code_display(entry,'value_set_map' => filtered_vs_map) %>
8
+ <text><%= entry.description %></text>
9
+ <statusCode code="active"/>
10
+ <effectiveTime>
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ </effectiveTime>
13
+ </observation>
14
+ </entry>
@@ -0,0 +1,17 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="EVN">
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.103" extension="2017-08-01"/>
4
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
5
+ <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" />
6
+ <statusCode code="completed" />
7
+ <effectiveTime>
8
+ <!-- Attribute: Start Datetime -->
9
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
10
+ <!-- Attribute: Stop Datetime -->
11
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
+ </effectiveTime>
13
+ <%== code_display(entry, 'preferred_code_sets' => ['*'],
14
+ 'tag_name' => 'value','value_set_map' => filtered_vs_map,
15
+ 'extra_content' => "xsi:type=\"CD\"") %>
16
+ </observation>
17
+ </entry>
@@ -0,0 +1,65 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <!-- Discharge Medication Entry -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.105" extension="2016-02-01"/>
5
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
+ <code code="75311-1"
7
+ codeSystem="2.16.840.1.113883.6.1"
8
+ codeSystemName="LOINC"
9
+ displayName="Discharge medications"/>
10
+ <statusCode code="active"/>
11
+ <effectiveTime>
12
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
13
+ </effectiveTime>
14
+ <entryRelationship typeCode="SUBJ">
15
+ <substanceAdministration moodCode="EVN" classCode="SBADM">
16
+ <!-- Medication Activity (consolidation) template -->
17
+ <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/>
18
+ <!-- Medication, Active template -->
19
+ <templateId root="2.16.840.1.113883.10.20.24.3.41" extension="2016-02-01"/>
20
+
21
+ <id root="<%= UUID.generate %>"/>
22
+ <text><%= entry.description %></text>
23
+ <statusCode code="active"/>
24
+ <effectiveTime xsi:type="IVL_TS">
25
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
26
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
27
+ </effectiveTime>
28
+ <% if entry.administrationTiming.present?
29
+ period = entry.administrationTiming['period'] %>
30
+ <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
31
+ <period value="<%= period['value']%>" unit="<%= period['unit']%>"/>
32
+ </effectiveTime>
33
+ <% end %>
34
+ <% if entry.route.present? -%>
35
+ <!-- Attribute: route -->
36
+ <routeCode code="<%= entry.route[:code] %>" codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.route[:code_system]) %>"/>
37
+ <% end -%>
38
+
39
+ <!-- Attribute: dose -->
40
+ <% if entry.dose.present? -%>
41
+ <doseQuantity value="<%= entry.dose[:value]%>"/>
42
+ <% end -%>
43
+
44
+ <% if entry.product_form.present? -%>
45
+ <administrationUnitCode code="<%= entry.product_form['code'] %>" codeSystem="<%= entry.product_form['codeSystem'] %>"/>
46
+ <% end -%>
47
+
48
+ <consumable>
49
+ <manufacturedProduct classCode="MANU">
50
+ <!-- Medication Information (consolidation) template -->
51
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
52
+ <id root="<%= UUID.generate %>"/>
53
+ <manufacturedMaterial>
54
+ <%== code_display(entry,'preferred_code_sets' => ['RxNorm'],'value_set_map' => filtered_vs_map) %>
55
+ </manufacturedMaterial>
56
+ <manufacturerOrganization>
57
+ <name>Medication Factory Inc.</name>
58
+ </manufacturerOrganization>
59
+ </manufacturedProduct>
60
+ </consumable>
61
+ </substanceAdministration>
62
+ </entryRelationship>
63
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
64
+ </act>
65
+ </entry>
@@ -0,0 +1,53 @@
1
+ <entry typeCode="DRIV">
2
+ <organizer moodCode="EVN" classCode="CLUSTER">
3
+ <templateId root="2.16.840.1.113883.10.20.22.4.45" extension="2015-08-01"/>
4
+ <!-- Family history organizer template -->
5
+ <templateId root="2.16.840.1.113883.10.20.24.3.12" extension="2016-02-01"/>
6
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
7
+ <statusCode code="completed"/>
8
+ <effectiveTime>
9
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
10
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
11
+ </effectiveTime>
12
+ <!-- The subject is currently hardcoded to father -->
13
+ <subject>
14
+ <relatedSubject classCode="PRS">
15
+ <code code="FTH" displayName="Father"
16
+ codeSystemName="HL7RoleCode"
17
+ codeSystem="2.16.840.1.113883.5.111">
18
+ <translation code="9947008"
19
+ displayName="Biological father"
20
+ codeSystemName="SNOMED CT"
21
+ codeSystem="2.16.840.1.113883.6.96"/>
22
+ </code>
23
+ <subject>
24
+ <administrativeGenderCode
25
+ code="M" codeSystem="2.16.840.1.113883.5.1"
26
+ codeSystemName="HL7AdministrativeGender"
27
+ displayName="Male"/>
28
+ <birthTime value="1912"/>
29
+ </subject>
30
+ </relatedSubject>
31
+ </subject>
32
+ <component>
33
+ <observation classCode="OBS" moodCode="EVN">
34
+ <!-- Conforms to C-CDA R2.1 Family History Observation (V3) -->
35
+ <templateId root="2.16.840.1.113883.10.20.22.4.46" extension="2015-08-01"/>
36
+ <!-- Family History QDM (V2) -->
37
+ <templateId root="2.16.840.1.113883.10.20.24.3.112" extension="2016-12-01"/>
38
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
39
+ <code code="55607006" displayName="Problem" codeSystemName="SNOMED CT" codeSystem="2.16.840.1.113883.6.96">
40
+ <translation code="55607006" displayName="Problem" codeSystemName="SNOMED CT" codeSystem="2.16.840.1.113883.6.96"/>
41
+ </code>
42
+ <statusCode code="completed"/>
43
+ <effectiveTime>
44
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
45
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
46
+ </effectiveTime>
47
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['SNOMED-CT'],
48
+ 'tag_name' => 'value',
49
+ 'extra_content' => "xsi:type=\"CD\"") %>
50
+ </observation>
51
+ </component>
52
+ </organizer>
53
+ </entry>
@@ -0,0 +1,69 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN">
3
+ <!-- Conforms to C-CDA 2.1 Problem Concern Act (V3) -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.3" extension="2015-08-01" />
5
+ <!-- Diagnosis Concern Act -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.137" extension="2017-08-01"/>
7
+ <id root="<%= UUID.generate %>" />
8
+ <code code="CONC" codeSystem="2.16.840.1.113883.5.6" displayName="Concern" />
9
+ <% if entry.end_time %>
10
+ <statusCode code="completed" />
11
+ <% else %>
12
+ <statusCode code="active" />
13
+ <% end %>
14
+ <effectiveTime>
15
+ <low <%= value_or_null_flavor(entry.start_time) %> />
16
+ <high <%= value_or_null_flavor(entry.end_time) %> />
17
+ </effectiveTime>
18
+ <entryRelationship typeCode="SUBJ">
19
+ <observation classCode="OBS" moodCode="EVN">
20
+ <!-- Conforms to C-CDA R2.1 Problem Observation (V3) -->
21
+ <templateId root="2.16.840.1.113883.10.20.22.4.4" extension="2015-08-01" />
22
+ <!-- Diagnosis template -->
23
+ <templateId root="2.16.840.1.113883.10.20.24.3.135" extension="2017-08-01" />
24
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>" />
25
+ <code code="29308-4" codeSystem="2.16.840.1.113883.6.1">
26
+ <translation code="282291009" codeSystem="2.16.840.1.113883.6.96"/>
27
+ </code>
28
+ <statusCode code="completed" />
29
+ <effectiveTime>
30
+ <!-- Attribute: onset datetime -->
31
+ <low <%= value_or_null_flavor(entry.start_time) %> />
32
+ <!-- Attribute: abatement datetime -->
33
+ <high <%= value_or_null_flavor(entry.end_time) %> />
34
+ </effectiveTime>
35
+ <%== code_display(entry, 'tag_name' => 'value', 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'],
36
+ 'extra_content' => "xsi:type=\"CD\"") %>
37
+ <% if entry.laterality -%>
38
+ <targetSiteCode code="<%= entry.laterality[:code] %>"
39
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.laterality[:codeSystem] || entry.laterality[:code_system]) %>"
40
+ <% if entry.laterality.has_key?(:title) -%>
41
+ displayName="<%=entry.laterality[:title]%>"
42
+ <% end -%>/>
43
+ <% end -%>
44
+ <% if entry.anatomical_location -%>
45
+ <targetSiteCode code="<%= entry.anatomical_location[:code] %>"
46
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.anatomical_location[:codeSystem] || entry.anatomical_location[:code_system]) %>"
47
+ <% if entry.anatomical_location.has_key?(:title) -%>
48
+ displayName="<%=entry.anatomical_location[:title]%>"
49
+ <% end -%>/>
50
+ <% end -%>
51
+ <% if entry.severity -%>
52
+ <entryRelationship typeCode="REFR">
53
+ <observation classCode="OBS" moodCode="EVN">
54
+ <templateId root="2.16.840.1.113883.10.20.22.4.8" extension="2014-06-09" />
55
+ <code code="SEV" codeSystem="2.16.840.1.113883.5.4" />
56
+ <statusCode code="completed" />
57
+ <value xsi:type="CD"
58
+ code="<%= entry.severity[:code] %>"
59
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.severity[:codeSystem] || entry.severity[:code_system]) %>"
60
+ <% if entry.severity.has_key?(:title) -%>
61
+ displayName="<%=entry.severity[:title]%>"
62
+ <% end -%>/>
63
+ </observation>
64
+ </entryRelationship>
65
+ <% end -%>
66
+ </observation>
67
+ </entryRelationship>
68
+ </act>
69
+ </entry>
@@ -0,0 +1,50 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN">
3
+ <!-- Conforms to C-CDA 2.1 Problem Concern Act (V3) -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.3" extension="2015-08-01" />
5
+ <!-- Symptom Concern Act -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.138" extension="2016-08-01"/>
7
+ <id root="<%= UUID.generate %>" />
8
+ <code code="CONC" codeSystem="2.16.840.1.113883.5.6" displayName="Concern" />
9
+ <statusCode code="active" />
10
+ <effectiveTime>
11
+ <low <%= value_or_null_flavor(entry.start_time) %> />
12
+ </effectiveTime>
13
+ <entryRelationship typeCode="SUBJ">
14
+ <observation classCode="OBS" moodCode="EVN">
15
+ <!-- Conforms to C-CDA R2.1 Problem Observation (V3) -->
16
+ <templateId root="2.16.840.1.113883.10.20.22.4.4" extension="2015-08-01" />
17
+ <!-- Symptom template -->
18
+ <templateId root="2.16.840.1.113883.10.20.24.3.136" />
19
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>" />
20
+ <code code="75325-1" codeSystem="2.16.840.1.113883.6.1">
21
+ <translation code="418799008" codeSystem="2.16.840.1.113883.6.96"/>
22
+ </code>
23
+ <statusCode code="completed" />
24
+ <effectiveTime>
25
+ <!-- Attribute: onset datetime -->
26
+ <low <%= value_or_null_flavor(entry.start_time) %> />
27
+ <!-- Attribute: abatement datetime -->
28
+ <high <%= value_or_null_flavor(entry.end_time) %> />
29
+ </effectiveTime>
30
+ <%== code_display(entry, 'tag_name' => 'value', 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'],
31
+ 'extra_content' => "xsi:type=\"CD\"") %>
32
+ <% if entry.severity -%>
33
+ <entryRelationship typeCode="REFR">
34
+ <observation classCode="OBS" moodCode="EVN">
35
+ <templateId root="2.16.840.1.113883.10.20.22.4.8" extension="2014-06-09" />
36
+ <code code="SEV" codeSystem="2.16.840.1.113883.5.4" />
37
+ <statusCode code="completed" />
38
+ <value xsi:type="CD"
39
+ code="<%= entry.severity[:code] %>"
40
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.severity[:codeSystem] || entry.severity[:code_system]) %>"
41
+ <% if entry.severity.has_key?(:title) -%>
42
+ displayName="<%=entry.severity[:title]%>"
43
+ <% end -%>/>
44
+ </observation>
45
+ </entryRelationship>
46
+ <% end -%>
47
+ </observation>
48
+ </entryRelationship>
49
+ </act>
50
+ </entry>
@@ -0,0 +1,25 @@
1
+ <entry>
2
+ <substanceAdministration classCode="SBADM" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Immunization Activity template -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.52" extension="2014-06-09"/>
5
+ <!-- Immunization, Administered template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.140" extension="2017-08-01"/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <code code="416118004" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Administration"/>
9
+ <statusCode code="completed"/>
10
+ <effectiveTime <%= value_or_null_flavor(entry.start_time) %>/>
11
+ <%== render(:partial => 'medication_details', :locals => {:entry => entry, :route_oids=>field_oids["ROUTE"]}) %>
12
+ <consumable>
13
+ <manufacturedProduct classCode="MANU">
14
+ <!-- Immunization Information (consolidation) template -->
15
+ <templateId root="2.16.840.1.113883.10.20.22.4.54" extension="2014-06-09"/>
16
+ <id root="<%= UUID.generate %>"/>
17
+ <manufacturedMaterial>
18
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['CVX', 'RxNorm']) %>
19
+ <lotNumberText>1</lotNumberText>
20
+ </manufacturedMaterial>
21
+ </manufacturedProduct>
22
+ </consumable>
23
+ <%== render(:partial => 'reason', :locals => {:entry => entry,:reason_oids=>field_oids["REASON"]}) %>
24
+ </substanceAdministration>
25
+ </entry>
@@ -0,0 +1,24 @@
1
+ <% vals = entry.values.empty? ? [nil] : entry.values
2
+ vals.each do |value|
3
+ %>
4
+ <entry>
5
+ <observation classCode="OBS" moodCode="EVN" <%== negation_indicator(entry) %>>
6
+ <!-- Assessment Performed -->
7
+ <templateId root="2.16.840.1.113883.10.20.24.3.144" extension="2017-08-01" />
8
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['*']) %>
10
+ <text><%= entry.description %></text>
11
+ <statusCode code="completed"/>
12
+
13
+ <effectiveTime>
14
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
15
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
16
+ </effectiveTime>
17
+ <%== render(:partial => 'result_value', :locals => {:values => [value], :result_oids=>result_oids} ) %>
18
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
19
+ <% if entry.components -%>
20
+ <%== render(:partial => 'components', :locals => {:entry => entry} ) %>
21
+ <% end %>
22
+ </observation>
23
+ </entry>
24
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="INT" <%== negation_indicator(entry) %>>
3
+ <!-- Conforms to C-CDA R2.1 Planned Observation (V2) -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.44" extension="2014-06-09" />
5
+ <!-- Assessment Recommended -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.145" extension="2017-08-01"/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['*']) %>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="active"/>
11
+ <effectiveTime>
12
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
13
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
14
+ </effectiveTime>
15
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
16
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
17
+ </observation>
18
+ </entry>
@@ -0,0 +1,33 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="EVN">
3
+ <!-- Adverse Event -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.146" extension="2017-08-01"/>
5
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
+ <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
7
+ <statusCode code="completed"/>
8
+ <effectiveTime>
9
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
10
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
11
+ </effectiveTime>
12
+ <value xsi:type="CD"
13
+ code="281647001"
14
+ displayName="Adverse reaction"
15
+ codeSystem="2.16.840.1.113883.6.96"
16
+ codeSystemName="SNOMED CT"/>
17
+ <author>
18
+ <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
19
+ <time <%= value_or_null_flavor(entry.as_point_in_time) %>/>
20
+ <assignedAuthor>
21
+ <id root="<%= UUID.generate %>"/>
22
+ </assignedAuthor>
23
+ </author>
24
+ <entryRelationship typeCode="CAUS" inversionInd="true">
25
+ <observation classCode="OBS" moodCode="EVN">
26
+ <templateId root="2.16.840.1.113883.10.20.24.3.148" extension="2017-08-01" />
27
+ <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" />
28
+ <statusCode code="completed" />
29
+ <%== code_display(entry, 'tag_name' => 'value', 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
30
+ </observation>
31
+ </entryRelationship>
32
+ </observation>
33
+ </entry>
@@ -0,0 +1,28 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="EVN">
3
+ <!-- Conforms to C-CDA R2.1 Substance or Device Allergy - Intolerance Observation (V2) -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.90" extension="2014-06-09"/>
5
+ <!-- Allergy Intolerance -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.147" extension="2017-08-01"/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
9
+ <statusCode code="completed"/>
10
+ <effectiveTime>
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
+ </effectiveTime>
14
+ <value xsi:type="CD"
15
+ code="419199007"
16
+ displayName="Allergy to substance"
17
+ codeSystem="2.16.840.1.113883.6.96"
18
+ codeSystemName="SNOMED CT"/>
19
+ <participant typeCode="CSM">
20
+ <participantRole classCode="MANU">
21
+ <playingEntity classCode="MMAT">
22
+ <%== code_display(entry,'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT', 'CVX']) %>
23
+ <name><%= entry.description %></name>
24
+ </playingEntity>
25
+ </participantRole>
26
+ </participant>
27
+ </observation>
28
+ </entry>
@@ -0,0 +1,17 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <!-- Consolidated Plan of Care Activity Observation
4
+ templateId (Implied Template) -->
5
+ <templateId root="2.16.840.1.113883.10.20.22.4.44" extension="2014-06-09"/>
6
+ <!-- Diagnostic Study, Order template -->
7
+ <templateId root="2.16.840.1.113883.10.20.24.3.17" extension="2017-08-01"/>
8
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map,'preferred_code_sets' => ['LOINC']) %>
10
+ <text><%= entry.description %></text>
11
+ <statusCode code="active"/>
12
+
13
+ <!-- Attribute: datetime -->
14
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
15
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
16
+ </observation>
17
+ </entry>
@@ -0,0 +1,29 @@
1
+ <% vals = entry.values.empty? ? [nil] : entry.values
2
+ vals.each do |value|
3
+ %>
4
+ <entry>
5
+ <observation classCode="OBS" moodCode="EVN" <%== negation_indicator(entry) %>>
6
+ <!-- Consolidated Procedure Activity Observation templateId
7
+ (Implied Template) -->
8
+ <templateId root="2.16.840.1.113883.10.20.22.4.13" extension="2014-06-09"/>
9
+ <!-- Diagnostic Study, Performed template -->
10
+ <templateId root="2.16.840.1.113883.10.20.24.3.18" extension="2017-08-01"/>
11
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
12
+ <%== code_display(entry,'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
13
+ <text><%= entry.description %></text>
14
+ <statusCode code="completed"/>
15
+ <effectiveTime>
16
+ <!-- Attribute: Start Datetime -->
17
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
18
+ <!-- Attribute: End Datetime -->
19
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
20
+ </effectiveTime>
21
+ <value nullFlavor="NA" xsi:type="CD" />
22
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
23
+ <%== render(:partial => 'results', :locals => {:entry => entry, :result_oids => result_oids, :value_set_oid => value_set_oid}) %>
24
+ <% if entry.components -%>
25
+ <%== render(:partial => 'components', :locals => {:entry => entry} ) %>
26
+ <% end %>
27
+ </observation>
28
+ </entry>
29
+ <% end %>