health-data-standards 3.1.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/Rakefile +2 -8
  2. data/lib/health-data-standards.rb +4 -2
  3. data/lib/health-data-standards/export/hdata/metadata.rb +2 -2
  4. data/lib/health-data-standards/export/helper/cat1_view_helper.rb +7 -101
  5. data/lib/health-data-standards/export/helper/html_view_helper.rb +2 -0
  6. data/lib/health-data-standards/export/helper/scooped_view_helper.rb +109 -0
  7. data/lib/health-data-standards/export/html.rb +2 -2
  8. data/lib/health-data-standards/export/qrda/entry_template_resolver.rb +29 -5
  9. data/lib/health-data-standards/export/view_helper.rb +2 -2
  10. data/lib/health-data-standards/import/bundle/importer.rb +8 -2
  11. data/lib/health-data-standards/import/cda/result_importer.rb +5 -0
  12. data/lib/health-data-standards/import/hdata/metadata_importer.rb +1 -1
  13. data/lib/health-data-standards/models/condition.rb +5 -0
  14. data/lib/health-data-standards/models/cqm/measure.rb +118 -1
  15. data/lib/health-data-standards/models/cqm/patient_cache.rb +60 -0
  16. data/lib/health-data-standards/models/encounter.rb +11 -0
  17. data/lib/health-data-standards/models/entry.rb +8 -0
  18. data/lib/health-data-standards/models/facility.rb +5 -0
  19. data/lib/health-data-standards/models/fulfillment_history.rb +4 -0
  20. data/lib/health-data-standards/models/guarantor.rb +5 -0
  21. data/lib/health-data-standards/models/insurance_provider.rb +10 -0
  22. data/lib/health-data-standards/models/medical_equipment.rb +5 -0
  23. data/lib/health-data-standards/models/medication.rb +11 -0
  24. data/lib/health-data-standards/models/order_information.rb +6 -0
  25. data/lib/health-data-standards/models/procedure.rb +5 -0
  26. data/lib/health-data-standards/models/provider_performance.rb +5 -0
  27. data/lib/health-data-standards/models/record.rb +16 -0
  28. data/lib/health-data-standards/models/thing_with_codes.rb +35 -5
  29. data/lib/health-data-standards/util/code_system_helper.rb +12 -3
  30. data/lib/hqmf-model/data_criteria.json +2 -2
  31. data/lib/hqmf-model/document.rb +9 -2
  32. data/lib/hqmf-parser/1.0/document.rb +6 -1
  33. data/templates/_author.hdata.erb +3 -0
  34. data/templates/_pedigree.hdata.erb +16 -15
  35. data/templates/cat1/_2.16.840.1.113883.10.20.22.4.85.cat1.erb +1 -0
  36. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.1.cat1.erb +1 -1
  37. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.103.cat1.erb +1 -1
  38. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.105.cat1.erb +1 -1
  39. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.11.cat1.erb +1 -1
  40. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.12.cat1.erb +1 -1
  41. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.13.cat1.erb +1 -1
  42. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.14.cat1.erb +1 -1
  43. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.17.cat1.erb +1 -1
  44. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.18.cat1.erb +2 -2
  45. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.2.cat1.erb +2 -1
  46. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.20.cat1.erb +2 -2
  47. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.22.cat1.erb +1 -1
  48. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.23.cat1.erb +1 -1
  49. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.28.cat1.erb +2 -2
  50. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.3.cat1.erb +3 -2
  51. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.31.cat1.erb +1 -1
  52. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +1 -1
  53. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.34.cat1.erb +2 -2
  54. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.37.cat1.erb +1 -1
  55. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +1 -1
  56. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +1 -1
  57. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.40.cat1.erb +2 -2
  58. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.41.cat1.erb +1 -1
  59. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.42.cat1.erb +1 -1
  60. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.43.cat1.erb +1 -1
  61. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +1 -1
  62. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.45.cat1.erb +1 -1
  63. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +1 -1
  64. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.47.cat1.erb +2 -1
  65. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.55.cat1.erb +2 -2
  66. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.57.cat1.erb +2 -2
  67. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.59.cat1.erb +2 -2
  68. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +1 -1
  69. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.63.cat1.erb +1 -1
  70. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +6 -2
  71. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.66.cat1.erb +3 -3
  72. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +1 -1
  73. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.7.cat1.erb +1 -1
  74. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.76.cat1.erb +1 -1
  75. data/templates/cat1/_measures.cat1.erb +0 -2
  76. data/templates/cat1/_medication_details.cat1.erb +3 -3
  77. data/templates/cat1/_patient_data.cat1.erb +3 -0
  78. data/templates/cat1/_record_target.cat1.erb +6 -1
  79. data/templates/cat1/_result_value.cat1.erb +16 -13
  80. data/templates/html/_entries_by_section.html.erb +13 -5
  81. data/templates/html/show.html.erb +4 -2
  82. data/templates/metadata.hdata.erb +27 -24
  83. metadata +5 -2
@@ -4,7 +4,7 @@
4
4
  <templateId root="2.16.840.1.113883.10.20.22.4.44"/>
5
5
  <templateId root="2.16.840.1.113883.10.20.24.3.1"/>
6
6
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
7
- <%== code_display(entry, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
+ <%== code_display(entry,'value_set_map' => value_set_map, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
8
  <text><%= entry.description %></text>
9
9
  <statusCode code="active"/>
10
10
  <effectiveTime>
@@ -6,7 +6,7 @@
6
6
  <statusCode code="completed" />
7
7
  <effectiveTime <%= value_or_null_flavor(entry.start_time) %>/>
8
8
  <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT'],
9
- 'tag_name' => 'value',
9
+ 'tag_name' => 'value','value_set_map' => value_set_map,
10
10
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
11
11
  </observation>
12
12
  </entry>
@@ -47,7 +47,7 @@
47
47
  <templateId root="2.16.840.1.113883.10.20.22.4.23"/>
48
48
  <id root="<%= UUID.generate %>"/>
49
49
  <manufacturedMaterial>
50
- <%== code_display(entry, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
50
+ <%== code_display(entry,'value_set_map' => value_set_map, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
51
51
  </manufacturedMaterial>
52
52
  <manufacturerOrganization>
53
53
  <name>Medication Factory Inc.</name>
@@ -16,7 +16,7 @@
16
16
  </effectiveTime>
17
17
  <%== render(:partial => 'ordinality', :locals => {:entry => entry}) %>
18
18
 
19
- <%== code_display(entry, {'tag_name' => 'value', 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'],
19
+ <%== code_display(entry, {'tag_name' => 'value', 'value_set_map' => value_set_map,'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'],
20
20
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\""}) %>
21
21
 
22
22
  <entryRelationship typeCode="REFR">
@@ -40,7 +40,7 @@
40
40
  <low <%= value_or_null_flavor(entry.start_time) %>/>
41
41
  <high <%= value_or_null_flavor(entry.end_time) %>/>
42
42
  </effectiveTime>
43
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT'],
43
+ <%== code_display(entry, 'value_set_map' => value_set_map,'preferred_code_sets' => ['SNOMED-CT'],
44
44
  'tag_name' => 'value',
45
45
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
46
46
  </observation>
@@ -17,7 +17,7 @@
17
17
  </effectiveTime>
18
18
  <%== render(:partial => 'ordinality', :locals => {:entry => entry}) %>
19
19
 
20
- <%== code_display(entry, 'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'LOINC'], 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
20
+ <%== code_display(entry, 'value_set_map' => value_set_map,'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'LOINC'], 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
21
21
  <!-- Status -->
22
22
  <entryRelationship typeCode="REFR">
23
23
  <observation classCode="OBS" moodCode="EVN">
@@ -16,7 +16,7 @@
16
16
  </effectiveTime>
17
17
  <%== render(:partial => 'ordinality', :locals => {:entry => entry}) %>
18
18
 
19
- <%== code_display(entry, 'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT'],
19
+ <%== code_display(entry, 'value_set_map' => value_set_map,'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT'],
20
20
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
21
21
  <!-- Status -->
22
22
  <entryRelationship typeCode="REFR">
@@ -6,7 +6,7 @@
6
6
  <!-- Diagnostic Study, Order template -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.17"/>
8
8
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <%== code_display(entry, 'value_set_map' => value_set_map,'preferred_code_sets' => ['LOINC'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="new"/>
12
12
 
@@ -6,7 +6,7 @@
6
6
  <!-- Diagnostic Study, Performed template -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.18"/>
8
8
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <%== code_display(entry,'value_set_map' => value_set_map, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'LOINC'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="completed"/>
12
12
  <effectiveTime>
@@ -15,7 +15,7 @@
15
15
  <!-- Attribute: End Datetime -->
16
16
  <high <%= value_or_null_flavor(entry.end_time) %>/>
17
17
  </effectiveTime>
18
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
18
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
19
19
  <%== render(:partial => 'reason', :locals => {:entry => entry}) %>
20
20
  </observation>
21
21
  </entry>
@@ -3,13 +3,14 @@
3
3
  <!-- Communication from patient to provider -->
4
4
  <templateId root="2.16.840.1.113883.10.20.24.3.2"/>
5
5
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
- <%== code_display(entry, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
6
+ <%== code_display(entry, 'value_set_map' => value_set_map, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
7
  <text>
8
8
  <%= entry.description %>
9
9
  </text>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
12
12
  <low <%= value_or_null_flavor(entry.start_time) %>/>
13
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
13
14
  </effectiveTime>
14
15
 
15
16
  <participant typeCode="AUT">
@@ -5,7 +5,7 @@
5
5
  <!-- Diagnostic Study, Result template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.20"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT', 'LOINC'],
8
+ <%== code_display(entry,'value_set_map' => value_set_map, 'preferred_code_sets' => ['SNOMED-CT', 'LOINC'],
9
9
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="completed"/>
@@ -14,7 +14,7 @@
14
14
  <low <%= value_or_null_flavor(entry.start_time) %>/>
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
17
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
18
18
  <%== render(:partial => 'reason', :locals => {:entry => entry}) %>
19
19
  </observation>
20
20
  </entry>
@@ -5,7 +5,7 @@
5
5
  <!-- Encounter order template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.22"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="new"/>
11
11
 
@@ -5,7 +5,7 @@
5
5
  <!-- Encounter performed template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.23"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
@@ -5,7 +5,7 @@
5
5
  <!-- Functional Status, Result template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.28"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="completed"/>
11
11
 
@@ -15,6 +15,6 @@
15
15
  </effectiveTime>
16
16
 
17
17
  <!-- Result -->
18
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
18
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
19
19
  </observation>
20
20
  </entry>
@@ -2,12 +2,13 @@
2
2
  <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
3
3
  <templateId root="2.16.840.1.113883.10.20.24.3.3"/>
4
4
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
5
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
5
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
6
6
  <text><%= entry.description %></text>
7
7
  <statusCode code="completed"/>
8
8
 
9
9
  <effectiveTime>
10
- <low <%= value_or_null_flavor(entry.as_point_in_time) %>/>
10
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
11
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
11
12
  </effectiveTime>
12
13
 
13
14
  <participant typeCode="AUT">
@@ -5,7 +5,7 @@
5
5
  <!-- Intervention Order template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.31"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry,'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <statusCode code="completed"/>
10
10
  <effectiveTime>
11
11
  <low <%= value_or_null_flavor(entry.start_time) %>/>
@@ -4,7 +4,7 @@
4
4
  <templateId root="2.16.840.1.113883.10.20.22.4.12"/>
5
5
  <templateId root="2.16.840.1.113883.10.20.24.3.32"/>
6
6
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
7
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
8
  <statusCode code="completed"/>
9
9
  <effectiveTime>
10
10
  <low <%= value_or_null_flavor(entry.start_time) %>/>
@@ -4,7 +4,7 @@
4
4
  <templateId root="2.16.840.1.113883.10.20.22.4.12"/>
5
5
  <templateId root="2.16.840.1.113883.10.20.24.3.34"/>
6
6
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
7
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
8
  <statusCode code="completed"/>
9
9
  <effectiveTime>
10
10
  <low <%= value_or_null_flavor(entry.start_time) %>/>
@@ -17,7 +17,7 @@
17
17
  <!-- Result template -->
18
18
  <templateId root="2.16.840.1.113883.10.20.24.3.87"/>
19
19
  <id root="<%= UUID.generate %>"/>
20
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
20
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
21
21
  <statusCode code="completed"/>
22
22
  <effectiveTime <%= value_or_null_flavor(entry.start_time) %>/>
23
23
  <% ev = entry.values.first
@@ -5,7 +5,7 @@
5
5
  <!-- Lab Test Order -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.37"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="new"/>
11
11
 
@@ -3,7 +3,7 @@
3
3
  <!-- Lab test performed -->
4
4
  <templateId root="2.16.840.1.113883.10.20.24.3.38"/>
5
5
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
6
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
7
  <text><%= entry.description %></text>
8
8
  <statusCode code="completed"/>
9
9
 
@@ -3,7 +3,7 @@
3
3
  <!-- Communication from provider to provider -->
4
4
  <templateId root="2.16.840.1.113883.10.20.24.3.4"/>
5
5
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
6
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
7
7
  <text><%= entry.description %></text>
8
8
  <statusCode code="completed"/>
9
9
 
@@ -6,13 +6,13 @@
6
6
  <!-- Laboratory Test, Result template -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.40"/>
8
8
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <%== code_display(entry, 'value_set_map' => value_set_map,'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="completed"/>
12
12
  <effectiveTime>
13
13
  <low <%= value_or_null_flavor(entry.start_time) %>/>
14
14
  <high <%= value_or_null_flavor(entry.end_time) %>/>
15
15
  </effectiveTime>
16
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
16
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
17
17
  </observation>
18
18
  </entry>
@@ -26,7 +26,7 @@
26
26
  <templateId root="2.16.840.1.113883.10.20.22.4.23"/>
27
27
  <id root="<%= UUID.generate %>"/>
28
28
  <manufacturedMaterial>
29
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
29
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'RxNorm'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
30
30
  </manufacturedMaterial>
31
31
  <manufacturerOrganization>
32
32
  <name>Medication Factory Inc.</name>
@@ -27,7 +27,7 @@
27
27
  <templateId root="2.16.840.1.113883.10.20.22.4.23"/>
28
28
  <id root="<%= UUID.generate %>"/>
29
29
  <manufacturedMaterial>
30
- <%== code_display(entry, 'preferred_code_sets' => ['RxNorm', 'CVX', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
30
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['RxNorm', 'CVX', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
31
31
  </manufacturedMaterial>
32
32
  </manufacturedProduct>
33
33
  </consumable>
@@ -15,7 +15,7 @@
15
15
  <participant typeCode="CSM">
16
16
  <participantRole classCode="MANU">
17
17
  <playingEntity classCode="MMAT">
18
- <%== code_display(entry, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
18
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
19
19
  <name><%= entry.description %></name>
20
20
  </playingEntity>
21
21
  </participantRole>
@@ -16,7 +16,7 @@
16
16
  <participant typeCode="CSM">
17
17
  <participantRole classCode="MANU">
18
18
  <playingEntity classCode="MMAT">
19
- <%== code_display(entry, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
19
+ <%== code_display(entry, 'value_set_map' => value_set_map,'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
20
20
  <name><%= entry.description %></name>
21
21
  </playingEntity>
22
22
  </participantRole>
@@ -18,7 +18,7 @@
18
18
  <templateId root="2.16.840.1.113883.10.20.22.4.23"/>
19
19
  <id root="<%= UUID.generate %>"/>
20
20
  <manufacturedMaterial>
21
- <%== code_display(entry, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
21
+ <%== code_display(entry, 'value_set_map' => value_set_map, :extra_content => "sdtc:valueSet=\"#{value_set_oid}\"") %>
22
22
  </manufacturedMaterial>
23
23
  </manufacturedProduct>
24
24
  </product>
@@ -21,7 +21,7 @@
21
21
  <participant typeCode="CSM">
22
22
  <participantRole classCode="MANU">
23
23
  <playingEntity classCode="MMAT">
24
- <%== code_display(entry, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
24
+ <%== code_display(entry,'value_set_map' => value_set_map, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
25
25
  </playingEntity>
26
26
  </participantRole>
27
27
  </participant>
@@ -11,13 +11,14 @@
11
11
  <low <%= value_or_null_flavor(entry.start_time) %>/>
12
12
  <high <%= value_or_null_flavor(entry.end_time) %>/>
13
13
  </effectiveTime>
14
+ <%== render(:partial => 'medication_details', :locals => {:entry => entry}) %>
14
15
  <consumable>
15
16
  <manufacturedProduct classCode="MANU">
16
17
  <!-- Medication Information (consolidation) template -->
17
18
  <templateId root="2.16.840.1.113883.10.20.22.4.23"/>
18
19
  <id root="<%= UUID.generate %>"/>
19
20
  <manufacturedMaterial>
20
- <%== code_display(entry, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
21
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
21
22
  </manufacturedMaterial>
22
23
  </manufacturedProduct>
23
24
  </consumable>
@@ -3,8 +3,8 @@
3
3
  <observation classCode="OBS" moodCode="EVN">
4
4
  <templateId root="2.16.840.1.113883.10.20.24.3.55"/>
5
5
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
6
- <code code="48768-6" codeSystemName="LOINC" displayName="Payment source"/>
6
+ <code code="48768-6" codeSystemName="LOINC" codeSystem="2.16.840.1.113883.6.1" displayName="Payment source"/>
7
7
  <statusCode code="completed"/>
8
- <%== code_display(entry, 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"2.16.840.1.114222.4.11.3591\"") %>
8
+ <%== code_display(entry, 'preferred_code_sets' =>["SOP","Source of Payment Typology"] , 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"2.16.840.1.114222.4.11.3591\"") %>
9
9
  </observation>
10
10
  </entry>
@@ -6,7 +6,7 @@
6
6
  <!-- Physical Exam, Finding template -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.57"/>
8
8
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
 
11
11
  <statusCode code="completed"/>
12
12
 
@@ -14,6 +14,6 @@
14
14
  <low <%= value_or_null_flavor(entry.start_time) %>/>
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
17
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
18
18
  </observation>
19
19
  </entry>
@@ -5,13 +5,13 @@
5
5
  <!-- Physical Exam, Performed template -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.59"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
12
12
  <low <%= value_or_null_flavor(entry.start_time) %>/>
13
13
  <high <%= value_or_null_flavor(entry.end_time) %>/>
14
14
  </effectiveTime>
15
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
15
+ <%== render(:partial => 'result_value', :locals => {:values => [entry.values.first]}) %>
16
16
  </observation>
17
17
  </entry>
@@ -23,7 +23,7 @@
23
23
  <!-- Procedure Activity Procedure-->
24
24
  <templateId root="2.16.840.1.113883.10.20.22.4.14"/>
25
25
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
26
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
26
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
27
27
  <text><%= entry.description %></text>
28
28
  <statusCode code="completed"/>
29
29
  <effectiveTime>
@@ -5,7 +5,7 @@
5
5
  <!-- QRDA Procedure, Order TemplateId -->
6
6
  <templateId root="2.16.840.1.113883.10.20.24.3.63"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="new"/>
11
11
  <!-- Attribute: method-->
@@ -5,7 +5,7 @@
5
5
  <!-- Procedure Activity Procedure-->
6
6
  <templateId root="2.16.840.1.113883.10.20.22.4.14"/>
7
7
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
8
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
8
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT', 'ICD-9-PCS', 'ICD-10-PCS'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
@@ -27,4 +27,8 @@
27
27
  </entryRelationship>
28
28
  <% end -%>
29
29
  </procedure>
30
- </entry>
30
+ </entry>
31
+
32
+ <% unless entry.values.compact.empty? %>
33
+ <%== render(:partial => '2.16.840.1.113883.10.20.24.3.66', :locals => {:entry => entry,:value_set_oid=>value_set_oid,:value_set_map=>value_set_map }) %>
34
+ <% end -%>
@@ -6,7 +6,7 @@
6
6
  <!-- QRDA Procedure, Result TemplateId -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.66"/>
8
8
  <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
9
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="completed"/>
12
12
  <effectiveTime>
@@ -24,10 +24,10 @@
24
24
  <!-- Result template -->
25
25
  <templateId root="2.16.840.1.113883.10.20.24.3.87"/>
26
26
  <id root="<%= UUID.generate %>"/>
27
- <%== code_display(entry, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
27
+ <%== code_display(entry, 'value_set_map' => value_set_map, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'CPT'], 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
28
28
  <statusCode code="completed"/>
29
29
  <effectiveTime <%= value_or_null_flavor(entry.start_time) %>/>
30
- <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
30
+ <%== render(:partial => 'result_value', :locals => {:values => entry.values}) %>
31
31
  </observation>
32
32
  </entryRelationship>
33
33
  </procedure>