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,29 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Communication from patient to provider -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.2" extension="2017-08-01"/>
5
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
7
+ <text><%= entry.description %></text>
8
+ <statusCode code="completed"/>
9
+ <effectiveTime>
10
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
11
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
+ </effectiveTime>
13
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
14
+ <participant typeCode="AUT">
15
+ <participantRole classCode="PAT">
16
+ <code code="116154003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Patient"/>
17
+ </participantRole>
18
+ </participant>
19
+
20
+ <participant typeCode="IRCP">
21
+ <participantRole classCode="ASSIGNED">
22
+ <code code="158965000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Medical Practitioner"/>
23
+ </participantRole>
24
+ </participant>
25
+
26
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
27
+
28
+ </act>
29
+ </entry>
@@ -0,0 +1,24 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.132" extension="2017-08-01"/>
4
+ <id root="<%= UUID.generate %>" />
5
+ <code code="ENC" codeSystem="2.16.840.1.113883.5.6" displayName="Encounter" codeSystemName="ActClass"/>
6
+ <entryRelationship typeCode="SUBJ">
7
+ <encounter classCode="ENC" moodCode="RQO">
8
+ <!-- Plan of Care Activity Encounter template -->
9
+ <templateId root="2.16.840.1.113883.10.20.22.4.40" extension="2014-06-09"/>
10
+ <!-- Encounter order template -->
11
+ <templateId root="2.16.840.1.113883.10.20.24.3.22" extension="2017-08-01"/>
12
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
13
+ <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT', 'HCPCS', 'CDT'], 'value_set_map' => filtered_vs_map) %>
14
+ <text><%= entry.description %></text>
15
+ <statusCode code="active"/>
16
+
17
+ <!-- Attribute: datetime -->
18
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
19
+
20
+ </encounter>
21
+ </entryRelationship>
22
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
23
+ </act>
24
+ </entry>
@@ -0,0 +1,94 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!--Encounter performed Act -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.133" extension="2017-08-01"/>
5
+ <id root="<%= UUID.generate %>" />
6
+ <code code="ENC" codeSystem="2.16.840.1.113883.5.6" displayName="Encounter" codeSystemName="ActClass"/>
7
+ <entryRelationship typeCode="SUBJ">
8
+ <encounter classCode="ENC" moodCode="EVN">
9
+ <!-- Encounter activities template -->
10
+ <templateId root="2.16.840.1.113883.10.20.22.4.49" extension="2015-08-01"/>
11
+ <!-- Encounter performed template -->
12
+ <templateId root="2.16.840.1.113883.10.20.24.3.23" extension="2017-08-01"/>
13
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
14
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
15
+ <text><%= entry.description %></text>
16
+ <statusCode code="completed"/>
17
+ <effectiveTime>
18
+ <!-- We try to look for the admit/discharge times on the encounter if they are
19
+ there. If not, we fall back to the typical start/end date. -->
20
+ <low <%= value_or_null_flavor(entry.admit_time || entry.start_time) %>/>
21
+ <high <%= value_or_null_flavor(entry.discharge_time || entry.end_time) %>/>
22
+ </effectiveTime>
23
+ <% if entry.discharge_disposition.present? %>
24
+ <sdtc:dischargeDispositionCode code="<%= entry.discharge_disposition.code %>"
25
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.discharge_disposition.code_system) %>"/>
26
+ <% end -%>
27
+ <% if entry.respond_to?(:facility) && entry.facility.present? -%>
28
+ <participant typeCode="LOC">
29
+ <!-- Facility Location template -->
30
+ <templateId root="2.16.840.1.113883.10.20.24.3.100" extension="2017-08-01"/>
31
+ <time>
32
+ <!-- Attribute: facility location arrival datetime -->
33
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
34
+ <!-- Attribute: facility location departure datetime -->
35
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
36
+ </time>
37
+ <participantRole classCode="SDLOC">
38
+ <% if entry.facility[:values][0].present? -%>
39
+ <code code="<%= entry.facility.values[0][0].code.code %>"
40
+ codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.facility.values[0][0].code.code_system) %>"/>
41
+ <% else -%>
42
+ <code nullFlavor="UNK"/>
43
+ <% end -%>
44
+ <telecom nullFlavor="UNK"/>
45
+ <playingEntity classCode="PLC">
46
+ <name><%= entry.facility[:values][0]['display'] %></name>
47
+ </playingEntity>
48
+ </participantRole>
49
+ </participant>
50
+ <% end -%>
51
+ <% if entry.reason.present? -%>
52
+ <%== render(:partial => 'reason', :locals => {:entry => entry,:reason_oids=>field_oids["REASON"]}) %>
53
+ <% end -%>
54
+ <% if entry.principalDiagnosis %>
55
+ <entryRelationship typeCode="REFR">
56
+ <observation classCode="OBS" moodCode="EVN">
57
+ <templateId root="2.16.840.1.113883.10.20.24.3.152" extension="2017-08-01"/>
58
+ <id root="1.3.6.1.4.1.115" extension="<%= UUID.generate %>"/>
59
+ <code code="8319008" codeSystem="2.16.840.1.113883.6.96" displayName="Principal Diagnosis" codeSystemName="SNOMED CT"/>
60
+ <value code="<%= entry.principal_diagnosis.code %>" xsi:type="CD" codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.principal_diagnosis.code_system) %>"/>
61
+ </observation>
62
+ </entryRelationship>
63
+ <% end -%>
64
+ <% if entry.diagnosis %>
65
+ <entryRelationship typeCode="REFR">
66
+ <act classCode="ACT" moodCode="EVN">
67
+ <templateId root="2.16.840.1.113883.10.20.22.4.80" extension="2015-08-01"/>
68
+ <code code="29308-4" codeSystem="2.16.840.1.113883.6.1" displayName="Diagnosis" codeSystemName="LOINC"/>
69
+ <entryRelationship typeCode="SUBJ">
70
+ <observation classCode="OBS" moodCode="EVN">
71
+ <!-- Problem observation template -->
72
+ <templateId root="2.16.840.1.113883.10.20.22.4.4" extension="2015-08-01"/>
73
+ <id root="1.3.6.1.4.1.115" extension="<%= UUID.generate %>"/>
74
+ <code code="29308-4" codeSystem="2.16.840.1.113883.6.1">
75
+ <translation code="282291009" codeSystem="2.16.840.1.113883.6.96"/>
76
+ </code>
77
+ <statusCode code="completed"/>
78
+ <effectiveTime>
79
+ <!-- Attribute: admission datetime -->
80
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
81
+ <!-- Attribute: discharge datetime -->
82
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
83
+ </effectiveTime>
84
+ <value code="<%= entry.diagnosis.values[1][0].code %>" xsi:type="CD" codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.diagnosis.values[1][0].code_system) %>"/>
85
+ </observation>
86
+ </entryRelationship>
87
+ </act>
88
+ </entryRelationship>
89
+ <% end -%>
90
+ </encounter>
91
+ </entryRelationship>
92
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
93
+ </act>
94
+ </entry>
@@ -0,0 +1,25 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <templateId root="2.16.840.1.113883.10.20.24.3.3" extension="2017-08-01"/>
4
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
5
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['SNOMED-CT', 'LOINC']) %>
6
+ <text><%= entry.description %></text>
7
+ <statusCode code="completed"/>
8
+
9
+ <effectiveTime>
10
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
11
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
+ </effectiveTime>
13
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
14
+ <participant typeCode="AUT">
15
+ <participantRole classCode="ASSIGNED">
16
+ <code code="158965000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Medical Practitioner"/>
17
+ </participantRole>
18
+ </participant>
19
+
20
+ <participant typeCode="IRCP">
21
+ <participantRole classCode="PAT"/>
22
+ </participant>
23
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
24
+ </act>
25
+ </entry>
@@ -0,0 +1,18 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <!-- Plan of Care Activity Act template -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.39" extension="2014-06-09"/>
5
+ <!-- Intervention Order template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.31" 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
+ </act>
18
+ </entry>
@@ -0,0 +1,21 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Consolidation CDA: Procedure Activity Act template -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.12" extension="2014-06-09"/>
5
+ <!-- Intervention Performed Template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.32" 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="completed"/>
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 => 'reason', :locals => {:entry => entry ,:reason_oids=>field_oids["REASON"]}) %>
16
+ <%if !entry.values.empty? %>
17
+ <%== render(:partial=> 'result_value', :locals => {:values => entry.values}) %>
18
+ <% end %>
19
+
20
+ </act>
21
+ </entry>
@@ -0,0 +1,16 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="RQO" <%== negation_indicator(entry) %>>
3
+ <!-- Consolidation Plan of Care Activity Observation -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.44" extension="2014-06-09"/>
5
+ <!-- Lab Test Order -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.37" 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
+
12
+ <!-- Attribute: datetime -->
13
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
14
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
15
+ </observation>
16
+ </entry>
@@ -0,0 +1,23 @@
1
+ <entry>
2
+ <observation classCode="OBS" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Lab test performed -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.38" extension="2017-08-01"/>
5
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
7
+ <text><%= entry.description %></text>
8
+ <statusCode code="completed"/>
9
+
10
+ <effectiveTime>
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
+ </effectiveTime>
14
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
15
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
16
+ <%if !entry.values.empty? %>
17
+ <%== render(:partial => 'results', :locals => {:entry => entry, :result_oids => result_oids, :value_set_oid => value_set_oid}) %>
18
+ <% end %>
19
+ <% if entry.components -%>
20
+ <%== render(:partial => 'components', :locals => {:entry => entry} ) %>
21
+ <% end %>
22
+ </observation>
23
+ </entry>
@@ -0,0 +1,29 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Communication from provider to provider -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.4" extension="2017-08-01"/>
5
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT']) %>
7
+ <text><%= entry.description %></text>
8
+ <statusCode code="completed"/>
9
+
10
+ <effectiveTime>
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
+ </effectiveTime>
14
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
15
+ <participant typeCode="AUT">
16
+ <participantRole classCode="ASSIGNED">
17
+ <code code="158965000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Medical Practitioner"/>
18
+ </participantRole>
19
+ </participant>
20
+
21
+ <participant typeCode="IRCP">
22
+ <participantRole classCode="ASSIGNED">
23
+ <code code="158965000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Medical Practitioner"/>
24
+ </participantRole>
25
+ </participant>
26
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
27
+ <%== render(:partial => 'fulfills', :locals => {:entry => entry}) %>
28
+ </act>
29
+ </entry>
@@ -0,0 +1,45 @@
1
+ <entry>
2
+ <substanceAdministration classCode="SBADM" moodCode="EVN">
3
+ <!-- Medication Activity (consolidation) template -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/>
5
+ <!-- Medication, Active template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.41" extension="2017-08-01"/>
7
+
8
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
+ <text><%= entry.description %></text>
10
+ <statusCode code="active"/>
11
+ <effectiveTime xsi:type="IVL_TS">
12
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
13
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
14
+ </effectiveTime>
15
+ <% if entry.administrationTiming.present?
16
+ period = entry.administrationTiming['period'] %>
17
+ <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
18
+ <period value="<%= period['value']%>" unit="<%= period['unit']%>"/>
19
+ </effectiveTime>
20
+ <% end %>
21
+ <%== render(:partial => 'medication_details', :locals => {:entry => entry, :route_oids=>field_oids["ROUTE"]}) %>
22
+
23
+ <% if entry.product_form.present? -%>
24
+ <administrationUnitCode code="<%= entry.product_form['code'] %>" codeSystem="<%= entry.product_form['codeSystem'] %>"/>
25
+ <% end -%>
26
+
27
+ <consumable>
28
+ <manufacturedProduct classCode="MANU">
29
+ <!-- Medication Information (consolidation) template -->
30
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
31
+ <id root="<%= UUID.generate %>"/>
32
+ <manufacturedMaterial>
33
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
34
+ </manufacturedMaterial>
35
+ <manufacturerOrganization>
36
+ <name>Medication Factory Inc.</name>
37
+ </manufacturerOrganization>
38
+ </manufacturedProduct>
39
+ </consumable>
40
+
41
+ <%== render(:partial => 'medication_dispense', :collection => entry.fulfillmentHistory, :locals => {:entry => entry, :value_set_map => value_set_map, :value_set_oid => value_set_oid}) %>
42
+
43
+ </substanceAdministration>
44
+
45
+ </entry>
@@ -0,0 +1,27 @@
1
+ <entry>
2
+ <substanceAdministration classCode="SBADM" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Medication Activity (consolidation) template -->
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/>
5
+ <!-- Medication, Administered template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.42" 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 xsi:type="IVL_TS">
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
+ </effectiveTime>
14
+ <%== render(:partial => 'medication_details', :locals => {:entry => entry, :route_oids=>field_oids["ROUTE"]}) %>
15
+ <consumable>
16
+ <manufacturedProduct classCode="MANU">
17
+ <!-- Medication Information (consolidation) template -->
18
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
19
+ <id root="<%= UUID.generate %>"/>
20
+ <manufacturedMaterial>
21
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['*']) %>
22
+ </manufacturedMaterial>
23
+ </manufacturedProduct>
24
+ </consumable>
25
+ <%== render(:partial => 'reason', :locals => {:entry => entry,:reason_oids=>field_oids["REASON"]}) %>
26
+ </substanceAdministration>
27
+ </entry>
@@ -0,0 +1,36 @@
1
+ <entry>
2
+ <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
+ <!-- Medication Dispensed Act -->
4
+ <templateId root="2.16.840.1.113883.10.20.24.3.139" extension="2017-08-01"/>
5
+ <id root="<%= UUID.generate %>" />
6
+ <code code="SPLY" codeSystem="2.16.840.1.113883.5.6" displayName="supply" codeSystemName="ActClass"/>
7
+ <entryRelationship typeCode="SUBJ">
8
+ <!--Medication dispensed -->
9
+ <supply classCode="SPLY" moodCode="EVN">
10
+ <!-- Medication Dispensed template -->
11
+ <templateId root="2.16.840.1.113883.10.20.24.3.45" extension="2017-08-01"/>
12
+ <!-- Medication Dispense template -->
13
+ <templateId root="2.16.840.1.113883.10.20.22.4.18" extension="2014-06-09"/>
14
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
15
+ <text><%= entry.description %></text>
16
+ <statusCode code="completed"/>
17
+ <effectiveTime xsi:type="IVL_TS">
18
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
19
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
20
+ </effectiveTime>
21
+ <product>
22
+ <manufacturedProduct classCode="MANU">
23
+ <!-- Medication Information (consolidation) template -->
24
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
25
+ <id root="<%= UUID.generate %>"/>
26
+ <manufacturedMaterial>
27
+ <%== code_display(entry, 'preferred_code_sets' =>["RxNorm"], 'value_set_map' => filtered_vs_map) %>
28
+ </manufacturedMaterial>
29
+ </manufacturedProduct>
30
+ </product>
31
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
32
+ </supply>
33
+ </entryRelationship>
34
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"], :r2_compatibility => r2_compatibility}) %>
35
+ </act>
36
+ </entry>
@@ -0,0 +1,41 @@
1
+ <entry>
2
+ <!--Medication Order -->
3
+ <substanceAdministration classCode="SBADM" moodCode="RQO" <%== negation_indicator(entry) %>>
4
+ <templateId root="2.16.840.1.113883.10.20.22.4.42" extension="2014-06-09"/>
5
+ <!-- Medication, Order template -->
6
+ <templateId root="2.16.840.1.113883.10.20.24.3.47" extension="2017-08-01"/>
7
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
+ <text><%= entry.description %></text>
9
+ <statusCode code="active"/>
10
+ <effectiveTime xsi:type="IVL_TS">
11
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
+ </effectiveTime>
14
+ <% if entry.negationInd %>
15
+ <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
16
+ <period nullFlavor="NA"/>
17
+ </effectiveTime>
18
+ <% elsif entry.administrationTiming.present?
19
+ period = entry.administrationTiming['period'] %>
20
+ <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
21
+ <period value="<%= period['value']%>" unit="<%= period['unit']%>"/>
22
+ </effectiveTime>
23
+ <% end %>
24
+ <% if entry.allowedAdministrations.present? %>
25
+ <repeatNumber value="<%== entry.allowedAdministrations %>" />
26
+ <% end %>
27
+ <%== render(:partial => 'medication_details', :locals => {:entry => entry, :route_oids=>field_oids["ROUTE"]}) %>
28
+ <consumable>
29
+ <manufacturedProduct classCode="MANU">
30
+ <!-- Medication Information (consolidation) template -->
31
+ <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
32
+ <id root="<%= UUID.generate %>"/>
33
+ <manufacturedMaterial>
34
+ <%== code_display(entry, 'value_set_map' => filtered_vs_map, 'preferred_code_sets' => ['RxNorm']) %>
35
+ </manufacturedMaterial>
36
+ </manufacturedProduct>
37
+ </consumable>
38
+ <%== render(:partial => 'author_qdm', :locals => {:entry => entry}) %>
39
+ <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
40
+ </substanceAdministration>
41
+ </entry>