health-data-standards 3.0.6 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.md +3 -1
  2. data/Rakefile +2 -0
  3. data/lib/health-data-standards.rb +10 -0
  4. data/lib/health-data-standards/export/cat_3.rb +24 -0
  5. data/lib/health-data-standards/export/html.rb +2 -1
  6. data/lib/health-data-standards/import/bundle/importer.rb +178 -146
  7. data/lib/health-data-standards/import/cat1/diagnosis_active_importer.rb +0 -5
  8. data/lib/health-data-standards/import/cat1/diagnosis_inactive_importer.rb +1 -6
  9. data/lib/health-data-standards/import/cat1/diagnostic_study_order_importer.rb +0 -4
  10. data/lib/health-data-standards/import/cat1/ecog_status_importer.rb +12 -0
  11. data/lib/health-data-standards/import/cat1/encounter_order_importer.rb +0 -5
  12. data/lib/health-data-standards/import/cat1/lab_order_importer.rb +1 -5
  13. data/lib/health-data-standards/import/cat1/lab_result_importer.rb +18 -0
  14. data/lib/health-data-standards/import/cat1/medication_active_importer.rb +27 -0
  15. data/lib/health-data-standards/import/cat1/patient_importer.rb +54 -46
  16. data/lib/health-data-standards/import/cat1/procedure_performed_importer.rb +28 -0
  17. data/lib/health-data-standards/import/cat1/symptom_active_importer.rb +12 -0
  18. data/lib/health-data-standards/import/cda/condition_importer.rb +2 -0
  19. data/lib/health-data-standards/import/cda/encounter_importer.rb +6 -0
  20. data/lib/health-data-standards/import/cda/procedure_importer.rb +1 -0
  21. data/lib/health-data-standards/import/cda/section_importer.rb +27 -5
  22. data/lib/health-data-standards/models/cda_identifier.rb +17 -0
  23. data/lib/health-data-standards/models/cqm/aggregate_objects.rb +92 -0
  24. data/lib/health-data-standards/models/cqm/measure.rb +51 -30
  25. data/lib/health-data-standards/models/cqm/query_cache.rb +64 -0
  26. data/lib/health-data-standards/models/entry.rb +1 -1
  27. data/lib/health-data-standards/models/record.rb +28 -3
  28. data/lib/health-data-standards/models/svs/value_set.rb +20 -0
  29. data/lib/health-data-standards/tasks/bundle.rake +18 -8
  30. data/lib/health-data-standards/util/hqmf_template_helper.rb +6 -2
  31. data/lib/health-data-standards/util/hqmf_template_oid_map.json +4 -0
  32. data/lib/health-data-standards/util/vs_api.rb +9 -6
  33. data/lib/hqmf-model/data_criteria.json +10 -10
  34. data/lib/hqmf-parser.rb +0 -2
  35. data/lib/hqmf-parser/1.0/range.rb +21 -9
  36. data/templates/c32/show.c32.erb +1 -1
  37. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +1 -0
  38. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.40.cat1.erb +2 -1
  39. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.44.cat1.erb +1 -0
  40. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.46.cat1.erb +1 -1
  41. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.54.cat1.erb +16 -1
  42. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.62.cat1.erb +1 -1
  43. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.69.cat1.erb +7 -2
  44. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.76.cat1.erb +2 -1
  45. data/templates/cat1/_medication_details.cat1.erb +4 -4
  46. data/templates/cat1/_record_target.cat1.erb +2 -2
  47. data/templates/cat1/_result_value.cat1.erb +1 -1
  48. data/templates/cat1/show.cat1.erb +2 -2
  49. data/templates/cat3/_continuous_variable_value.cat3.erb +20 -0
  50. data/templates/cat3/_measure_data.cat3.erb +126 -0
  51. data/templates/cat3/_performance_rate.cat3.erb +16 -0
  52. data/templates/cat3/_supplemental_data.cat3.erb +36 -0
  53. data/templates/cat3/show.cat3.erb +157 -0
  54. data/templates/ccda/show.ccda.erb +1 -1
  55. metadata +25 -45
  56. data/lib/hqmf-parser/value_sets/value_set_parser.rb +0 -241
@@ -8,7 +8,7 @@
8
8
  <templateId root="2.16.840.1.113883.3.88.10.20.3" assigningAuthorityName="HITSP/C32"/>
9
9
 
10
10
  <templateId root="2.16.840.1.113883.3.88.11.32.1" assigningAuthorityName="HITSP/C32"/>
11
- <id root="2.16.840.1.113883.3.72" extension="<%= patient.id %>" assigningAuthorityName="NIST Healthcare Project"/>
11
+ <id root="2.16.840.1.113883.19.5" extension="<%= patient.id %>" assigningAuthorityName="Cypress Project"/>
12
12
  <code code="34133-9" displayName="Summarization of episode note" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
13
13
  <title>Cypress C32 Patient Test Record: <%= patient.first %> <%= patient.last %></title>
14
14
  <effectiveTime value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
@@ -9,6 +9,7 @@
9
9
 
10
10
  <effectiveTime>
11
11
  <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
13
  </effectiveTime>
13
14
 
14
15
  <participant typeCode="AUT">
@@ -10,7 +10,8 @@
10
10
  <text><%= entry.description %></text>
11
11
  <statusCode code="completed"/>
12
12
  <effectiveTime>
13
- <low value="<%= entry.start_time %>"/>
13
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
14
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
14
15
  </effectiveTime>
15
16
  <%== render(:partial => 'result_value', :locals => {:entry => entry}) %>
16
17
  </observation>
@@ -9,6 +9,7 @@
9
9
  <statusCode code="completed"/>
10
10
  <effectiveTime>
11
11
  <low <%= value_or_null_flavor(entry.start_time) %>/>
12
+ <high <%= value_or_null_flavor(entry.end_time) %>/>
12
13
  </effectiveTime>
13
14
  <value code="416098002" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Drug allergy" xsi:type="CD"/>
14
15
 
@@ -10,7 +10,7 @@
10
10
  codeSystemName="ActCode"/>
11
11
  <statusCode code="completed"/>
12
12
  <effectiveTime>
13
- <low value="<%= entry.start_time %>"/>
13
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
14
14
  </effectiveTime>
15
15
  <value xsi:type="CD"
16
16
  code="59037007"
@@ -5,12 +5,27 @@
5
5
  <templateId root="2.16.840.1.113883.10.20.22.4.79"/>
6
6
  <!-- Patient Characteristic Expired -->
7
7
  <templateId root="2.16.840.1.113883.10.20.24.3.54"/>
8
- <id root="<%= UUID.generate %>"/>
8
+ <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
9
9
  <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
12
12
  <low <%= value_or_null_flavor(entry.start_time) %>/>
13
13
  </effectiveTime>
14
14
  <value code="419099009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Dead" sdtc:valueSet="2.16.840.1.113883.3.666.5.539" xsi:type="CD"/>
15
+ <% if entry.respond_to? :code
16
+ # Currently, Record does not support coded cause of death, but this should allow it to work
17
+ # when Record supports it.
18
+ -%>
19
+ <entryRelationship typeCode="CAUS">
20
+ <observation classCode="OBS" moodCode="EVN">
21
+ <id root="<%= UUID.generate %>"/>
22
+ <code code="ASSERTION"
23
+ codeSystem="2.16.840.1.113883.5.4"
24
+ codeSystemName="HL7ActCode"/>
25
+ <statusCode code="completed"/>
26
+ <%== code_display(entry, 'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'extra_content' => "xsi:type=\"CD\"") %>
27
+ </observation>
28
+ </entryRelationship>
29
+ <% end -%>
15
30
  </observation>
16
31
  </entry>
@@ -9,7 +9,7 @@
9
9
  displayName="Assertion"/>
10
10
  <statusCode code="completed"/>
11
11
  <effectiveTime>
12
- <low value="<%= entry.start_time %>"/>
12
+ <low <%= value_or_null_flavor(entry.start_time) %>/>
13
13
  </effectiveTime>
14
14
  <value xsi:type="CD"
15
15
  code="102460003"
@@ -10,13 +10,18 @@
10
10
 
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
  <% ev = entry.values.first
16
- if ev.present? && ev.respond_to?(:scalar) -%>
17
+ if ev.present? && ev.respond_to?(:scalar)
18
+ if is_num?(ev.scalar) -%>
17
19
  <value xsi:type="INT" value="<%= ev.scalar %>"/>
20
+ <% else -%>
21
+ <value xsi:type="ST"><%= ev.scalar%></value>
22
+ <% end %>
18
23
  <% else -%>
19
- <value nullFlavor="UNK"/>
24
+ <value xsi:type="CD" nullFlavor="UNK"/>
20
25
  <% end -%>
21
26
  <%== render(:partial => 'reason', :locals => {:entry => entry}) %>
22
27
  </observation>
@@ -8,13 +8,14 @@
8
8
  <code code="418799008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Symptom"/>
9
9
  <text><%= entry.description %></text>
10
10
  <statusCode code="completed"/>
11
- <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
11
+
12
12
 
13
13
  <effectiveTime>
14
14
  <low <%= value_or_null_flavor(entry.start_time) %>/>
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
17
 
18
+ <%== code_display(entry, 'preferred_code_sets' => ['SNOMED-CT'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
18
19
  <!-- Status -->
19
20
  <entryRelationship typeCode="REFR">
20
21
  <observation classCode="OBS" moodCode="EVN">
@@ -1,9 +1,9 @@
1
- <% if entry.route.present? -%>
2
- <!-- Attribute: route -->
3
- <routeCode code="<%= entry.route['code'] %>" codeSystem="<%= entry.route['codeSystem'] %>"/>
1
+ <% if entry.route.present?
2
+ # hard coded to NCI Thesaurus for the code system since Cat I mandates that
3
+ -%>
4
+ <routeCode code="<%= entry.route['code'] %>" codeSystem="2.16.840.1.113883.3.26.1.1"/>
4
5
  <% end -%>
5
6
 
6
- <!-- Attribute: dose -->
7
7
  <% if entry.dose.present? -%>
8
8
  <doseQuantity value="<%= entry.dose['value']%>"/>
9
9
  <% end -%>
@@ -1,6 +1,6 @@
1
1
  <recordTarget>
2
2
  <patientRole>
3
- <id root="Cypress" extension="<%= patient.id %>"/>
3
+ <!-- id root="Cypress" extension="<%= patient.id %>"/ -->
4
4
  <!-- Fake Medicare HIC number -->
5
5
  <id extension="12345" root="2.16.840.1.113883.4.572"/>
6
6
  <addr use="HP">
@@ -26,7 +26,7 @@
26
26
  <% end %>
27
27
  <%
28
28
  languages = patient.languages
29
- languages = ["en-US"] if languages.nil? or languages.empty?
29
+ languages = ["eng"] if languages.nil? or languages.empty?
30
30
  languages.each do |language|%>
31
31
  <languageCommunication>
32
32
  <templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
@@ -4,7 +4,7 @@
4
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
5
  <% elsif ev.respond_to?(:scalar) -%>
6
6
  <% if is_num?(ev.scalar) -%>
7
- <value xsi:type="PQ" value="<%= ev.scalar %>" <% if ev.units -%>unit="<%= ev.units %>"<% end -%>/>
7
+ <value xsi:type="PQ" value="<%= ev.scalar %>" <% if ev.units && (ev.units != "") -%>unit="<%= ev.units %>"<% end -%>/>
8
8
  <% elsif is_bool?(ev.scalar)%>
9
9
  <value xsi:type="BL" value="<%= ev.scalar %>" />
10
10
  <% else -%>
@@ -21,14 +21,14 @@
21
21
  <!-- This is the document creation time -->
22
22
  <effectiveTime value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
23
23
  <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
24
- <languageCode code="en-US"/>
24
+ <languageCode code="eng"/>
25
25
  <!-- reported patient -->
26
26
  <%== render :partial => 'record_target', :locals => {:patient => patient} %>
27
27
  <!-- Example of an author who is a device -->
28
28
  <author>
29
29
  <time value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
30
30
  <assignedAuthor>
31
- <id extension="Cypress" root="2.16.840.1.113883.19.5"/>
31
+ <!-- id extension="Cypress" root="2.16.840.1.113883.19.5"/ -->
32
32
  <!-- NPI -->
33
33
  <id extension="FakeNPI" root="2.16.840.1.113883.4.6"/>
34
34
  <addr>
@@ -0,0 +1,20 @@
1
+ <entryRelationship type="COMP">
2
+ <observation classCode="OBS" moodCode="EVN">
3
+ <templateId root="2.16.840.1.113883.10.20.27.3.2"/>
4
+ <code nullFlavor="OTH">
5
+ <originalText>Time Difference</originalText>
6
+ </code>
7
+ <statusCode code="completed"/>
8
+ <value xsi:type="PQ" value="<%= population.population_count('OBSERV') %>" unit="min"/>
9
+ <methodCode code="MEDIAN"
10
+ displayName="Median"
11
+ codeSystem="2.16.840.1.113883.5.84"
12
+ codeSystemName="ObservationMethod"/>
13
+ <reference typeCode="REFR">
14
+ <!-- reference to the relevant measure observation in the eMeasure -->
15
+ <externalObservation classCode="OBS" moodCode="EVN">
16
+ <id root="<%= population.population_id('OBSERV') %>"/>
17
+ </externalObservation>
18
+ </reference>
19
+ </observation>
20
+ </entryRelationship>
@@ -0,0 +1,126 @@
1
+
2
+ <!-- MEASURE DATA REPORTING FOR <%= population_type %> <%= aggregate_count.population_id(population_type) %> -->
3
+ <observation classCode="OBS" moodCode="EVN">
4
+ <!-- Measure Data template -->
5
+ <templateId root="2.16.840.1.113883.10.20.27.3.5"/>
6
+ <code code="ASSERTION"
7
+ codeSystem="2.16.840.1.113883.5.4"
8
+ displayName="Assertion"
9
+ codeSystemName="ActCode"/>
10
+ <statusCode code="completed"/>
11
+ <value xsi:type="CD" code="<%= population_type %>"
12
+ codeSystem="2.16.840.1.113883.5.1063"
13
+ codeSystemName="ObservationValue"/>
14
+ <!-- Aggregate Count -->
15
+ <entryRelationship typeCode="SUBJ" inversionInd="true">
16
+ <observation classCode="OBS" moodCode="EVN">
17
+ <templateId root="2.16.840.1.113883.10.20.27.3.3"/>
18
+ <code code="MSRAGG"
19
+ displayName="rate aggregation"
20
+ codeSystem="2.16.840.1.113883.5.4"
21
+ codeSystemName="ActCode"/>
22
+ <value xsi:type="INT" value="<%= aggregate_count.population_count(population_type, population_id) %>"/>
23
+ <methodCode code="COUNT"
24
+ displayName="Count"
25
+ codeSystem="2.16.840.1.113883.5.84"
26
+ codeSystemName="ObservationMethod"/>
27
+ </observation>
28
+ </entryRelationship>
29
+ <% aggregate_count.stratifications.each do |strat| -%>
30
+
31
+ <!-- Startification Reporting Template for <%= population_type %> <%= aggregate_count.population_id(population_type) %> Stratification <%= strat.id %> -->
32
+
33
+ <entryRelationship typeCode="COMP">
34
+ <observation classCode="OBS" moodCode="EVN">
35
+ <templateId root="2.16.840.1.113883.10.20.27.3.4"/>
36
+ <code code="ASSERTION"
37
+ codeSystem="2.16.840.1.113883.5.4"
38
+ displayName="Assertion"
39
+ codeSystemName="ActCode"/>
40
+ <statusCode code="completed"/>
41
+ <value xsi:type="CD" nullFlavor="OTH">
42
+ <originalText>Stratum</originalText>
43
+ </value>
44
+ <entryRelationship typeCode="SUBJ" inversionInd="true">
45
+ <observation classCode="OBS" moodCode="EVN">
46
+ <templateId root="2.16.840.1.113883.10.20.27.3.3"/>
47
+ <code code="MSRAGG"
48
+ displayName="rate aggregation"
49
+ codeSystem="2.16.840.1.113883.5.4"
50
+ codeSystemName="ActCode"/>
51
+ <value xsi:type="INT" value="<%= strat.population_count(population_type, population_id) %>"/>
52
+ <methodCode code="COUNT"
53
+ displayName="Count"
54
+ codeSystem="2.16.840.1.113883.5.84"
55
+ codeSystemName="ObservationMethod"/>
56
+ </observation>
57
+ </entryRelationship>
58
+ <% if population_type == 'MSRPOPL' -%>
59
+ <%== render :partial => 'continuous_variable_value', :locals => {:population => strat} %>
60
+ <% end -%>
61
+ <reference typeCode="REFR">
62
+ <externalObservation classCode="OBS" moodCode="EVN">
63
+ <id root="<%= strat.id %>"/>
64
+ </externalObservation>
65
+ </reference>
66
+ </observation>
67
+ </entryRelationship>
68
+ <% end -%>
69
+ <% if aggregate_count.supplemental_data.present? -%>
70
+ <% sex_supplimental_data = aggregate_count.supplemental_data_for(population_type, "SEX")
71
+ if sex_supplimental_data.present?
72
+ sex_supplimental_data.each do |sex, count| -%>
73
+
74
+ <!-- SEX Supplemental Data Reporting for <%= population_type %> <%= aggregate_count.population_id(population_type) %> -->
75
+
76
+ <%== render :partial => 'supplemental_data', :locals => {:template_name => 'Sex Supplemental Data',
77
+ :template_id => '2.16.840.1.113883.10.20.27.3.6', :supplemental_data_code => '184100006',
78
+ :supplemental_data_code_system => '2.16.840.1.113883.6.96', :supplemental_data_value_code => sex,
79
+ :supplemental_data_value_code_system => '2.16.840.1.113883.5.1', :count => count} %>
80
+ <% end -%>
81
+ <% end -%>
82
+ <% ethnicity_supplimental_data = aggregate_count.supplemental_data_for(population_type, "ETHNICITY")
83
+ if ethnicity_supplimental_data.present?
84
+ ethnicity_supplimental_data.each do |ethnicity, count| -%>
85
+
86
+ <!-- ETHNICITY Supplemental Data Reporting for <%= population_type %> <%= aggregate_count.population_id(population_type) %> -->
87
+
88
+ <%== render :partial => 'supplemental_data', :locals => {:template_name => 'Ethnicity Supplemental Data',
89
+ :template_id => '2.16.840.1.113883.10.20.27.3.7', :supplemental_data_code => '364699009',
90
+ :supplemental_data_code_system => '2.16.840.1.113883.6.96', :supplemental_data_value_code => ethnicity,
91
+ :supplemental_data_value_code_system => '2.16.840.1.113883.6.238', :count => count} %>
92
+ <% end -%>
93
+ <% end -%>
94
+ <% race_supplimental_data = aggregate_count.supplemental_data_for(population_type, "RACE")
95
+ if race_supplimental_data.present?
96
+ race_supplimental_data.each do |race, count| -%>
97
+
98
+ <!-- RACE Supplemental Data Reporting for <%= population_type %> <%= aggregate_count.population_id(population_type) %> -->
99
+
100
+ <%== render :partial => 'supplemental_data', :locals => {:template_name => 'Race Supplemental Data',
101
+ :template_id => '2.16.840.1.113883.10.20.27.3.8', :supplemental_data_code => '103579009',
102
+ :supplemental_data_code_system => '2.16.840.1.113883.6.96', :supplemental_data_value_code => race,
103
+ :supplemental_data_value_code_system => '2.16.840.1.113883.6.238', :count => count} %>
104
+ <% end -%>
105
+ <% end -%>
106
+ <% payer_supplimental_data = aggregate_count.supplemental_data_for(population_type, "PAYER")
107
+ if payer_supplimental_data.present?
108
+ payer_supplimental_data.each do |payer, count| -%>
109
+
110
+ <!-- PAYER Supplemental Data Reporting for <%= population_type %> <%= aggregate_count.population_id(population_type) %> -->
111
+ <%== render :partial => 'supplemental_data', :locals => {:template_name => 'Payer Supplemental Data',
112
+ :template_id => '2.16.840.1.113883.10.20.27.3.9', :supplemental_data_code => '48768-6',
113
+ :supplemental_data_code_system => '2.16.840.1.113883.6.1', :supplemental_data_value_code => payer,
114
+ :supplemental_data_value_code_system => '2.16.840.1.113883.3.221.5', :count => count} %>
115
+ <% end -%>
116
+ <% end -%>
117
+ <% end -%>
118
+ <% if population_type == 'MSRPOPL' -%>
119
+ <%== render :partial => 'continuous_variable_value', :locals => {:population => aggregate_count} %>
120
+ <% end -%>
121
+ <reference typeCode="REFR">
122
+ <externalObservation classCode="OBS" moodCode="EVN">
123
+ <id root="<%= aggregate_count.population_id(population_type) %>"/>
124
+ </externalObservation>
125
+ </reference>
126
+ </observation>
@@ -0,0 +1,16 @@
1
+ <observation classCode="OBS" moodCode="EVN">
2
+ <templateId root="2.16.840.1.113883.10.20.27.3.14"/>
3
+ <code code="72510-1" codeSystem="2.16.840.1.113883.6.1"
4
+ displayName="Performance Rate"
5
+ codeSystemName="2.16.840.1.113883.6.1"/>
6
+ <statusCode code="completed"/>
7
+ <value xsi:type="REAL" value="<%= aggregate_count.performance_rate %>"/>
8
+ <reference typeCode="REFR">
9
+ <externalObservation classCode="OBS" moodCode="EVN">
10
+ <id root="<%= aggregate_count.numerator.id %>"/>
11
+ <code code="NUMER" displayName="Numerator"
12
+ codeSystem="2.16.840.1.113883.5.1063"
13
+ codeSystemName="ObservationValue"/>
14
+ </externalObservation>
15
+ </reference>
16
+ </observation>
@@ -0,0 +1,36 @@
1
+ <!-- Supplemental Date Template -->
2
+
3
+ <entryRelationship typeCode="COMP">
4
+ <observation classCode="OBS" moodCode="EVN">
5
+ <!-- <%= template_name %> -->
6
+ <templateId root="<%= template_id %>"/>
7
+ <id nullFlavor="NA" />
8
+ <code code="<%= supplemental_data_code %>"
9
+ codeSystem="<%= supplemental_data_code_system %>"/>
10
+ <statusCode code="completed"/>
11
+ <% if supplemental_data_value_code == "" || supplemental_data_value_code == "UNK" -%>
12
+ <value xsi:type="CD"
13
+ nullFlavor="UNK" />
14
+ <% else -%>
15
+
16
+ <value xsi:type="CD"
17
+ code="<%= supplemental_data_value_code %>"
18
+ codeSystem="<%= supplemental_data_value_code_system %>"/>
19
+ <% end %>
20
+ <entryRelationship typeCode="SUBJ" inversionInd="true">
21
+ <!-- Aggregate Count template -->
22
+ <observation classCode="OBS" moodCode="EVN">
23
+ <templateId root="2.16.840.1.113883.10.20.27.3.3"/>
24
+ <code code="MSRAGG"
25
+ displayName="rate aggregation"
26
+ codeSystem="2.16.840.1.113883.5.4"
27
+ codeSystemName="ActCode"/>
28
+ <value xsi:type="INT" value="<%= count %>"/>
29
+ <methodCode code="COUNT"
30
+ displayName="Count"
31
+ codeSystem="2.16.840.1.113883.5.84"
32
+ codeSystemName="ObservationMethod"/>
33
+ </observation>
34
+ </entryRelationship>
35
+ </observation>
36
+ </entryRelationship>
@@ -0,0 +1,157 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns="urn:hl7-org:v3"
4
+ xmlns:cda="urn:hl7-org:v3">
5
+
6
+ <!--
7
+ ********************************************************
8
+ CDA Header
9
+ ********************************************************
10
+ -->
11
+ <realmCode code="US"/>
12
+ <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
13
+ <!-- QRDA Category III Release 1 template ID (this template ID differs from QRDA III comment only template ID). -->
14
+ <templateId root="2.16.840.1.113883.10.20.27.1.1"/>
15
+ <id root="<%= UUID.generate %>"/>
16
+ <!-- SHALL QRDA III document type code -->
17
+ <code code="55184-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"
18
+ displayName="Quality Reporting Document Architecture Calculated Summary Report"/>
19
+ <!-- SHALL Title, SHOULD have this content -->
20
+ <title>QRDA Calculated Summary Report</title>
21
+ <!-- SHALL -->
22
+ <effectiveTime value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
23
+ <confidentialityCode codeSystem="2.16.840.1.113883.5.25" code="N"/>
24
+ <languageCode code="en-US"/>
25
+ <!-- SHOULD The version of the file being submitted. -->
26
+ <versionNumber value="1"/>
27
+ <!-- SHALL contain recordTarget and ID - but ID is nulled to NA. This is an aggregate summary report. Therefore CDA's required patient identifier is nulled. -->
28
+ <recordTarget>
29
+ <patientRole>
30
+ <id nullFlavor="NA"/>
31
+ </patientRole>
32
+ </recordTarget>
33
+ <!-- SHALL have 1..* author. MAY be device or person.
34
+ The author of the CDA document in this example is a device at a data submission vendor/registry. -->
35
+ <author>
36
+ <time value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
37
+ <assignedAuthor>
38
+ <!-- Registry author ID -->
39
+ <id extension="Cypress" root="MITRE"/>
40
+ <assignedAuthoringDevice>
41
+ <softwareName></softwareName>
42
+ </assignedAuthoringDevice>
43
+ <representedOrganization>
44
+ <!-- Represents unique registry organization TIN -->
45
+ <id root="root" extension="ext"/>
46
+ <!-- Contains name - specific registry not required-->
47
+ <name></name>
48
+ </representedOrganization>
49
+ </assignedAuthor>
50
+ </author>
51
+ <!-- The custodian of the CDA document is the same as the legal authenticator in this
52
+ example and represents the reporting organization. -->
53
+ <!-- SHALL -->
54
+ <custodian>
55
+ <assignedCustodian>
56
+ <representedCustodianOrganization>
57
+ <!-- SHALL have an id - This is an example root -->
58
+ <id root="root"/>
59
+ <!-- SHOULD Name not required -->
60
+ <name>Cypress</name>
61
+ </representedCustodianOrganization>
62
+ </assignedCustodian>
63
+ </custodian>
64
+ <!-- The legal authenticator of the CDA document is a single person who is at the
65
+ same organization as the custodian in this example. This element must be present. -->
66
+ <!-- SHALL -->
67
+ <legalAuthenticator>
68
+ <!-- SHALL -->
69
+ <time value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
70
+ <!-- SHALL -->
71
+ <signatureCode code="S"/>
72
+ <assignedEntity>
73
+ <!-- SHALL ID -->
74
+ <id root="root"/>
75
+ <!-- SHALL -->
76
+ <representedOrganization>
77
+ <!-- SHALL Id -->
78
+ <!-- example root -->
79
+ <id root="root"/>
80
+ </representedOrganization>
81
+ </assignedEntity>
82
+ </legalAuthenticator>
83
+
84
+
85
+ <!--
86
+ ********************************************************
87
+ CDA Body
88
+ ********************************************************
89
+ -->
90
+ <component>
91
+ <structuredBody>
92
+ <!--
93
+ ********************************************************
94
+ QRDA Category III Reporting Parameters
95
+ ********************************************************
96
+ -->
97
+ <%== cat1_renderer.render :partial => 'reporting_parameters', :locals => {:start_date => start_date, :end_date => end_date} %>
98
+ <!--
99
+ ********************************************************
100
+ Measure Section
101
+ ********************************************************
102
+ -->
103
+ <component>
104
+ <section>
105
+ <!-- Implied template Measure Section templateId -->
106
+ <templateId root="2.16.840.1.113883.10.20.24.2.2"/>
107
+ <!-- In this case the query is using an eMeasure -->
108
+ <!-- QRDA Category III Measure Section template -->
109
+ <templateId root="2.16.840.1.113883.10.20.27.2.1"/>
110
+ <code code="55186-1" codeSystem="2.16.840.1.113883.6.1"/>
111
+ <title>Measure Section</title>
112
+ <text>
113
+
114
+ </text>
115
+ <% measures.each do |measure| %>
116
+ <entry>
117
+ <organizer classCode="CLUSTER" moodCode="EVN">
118
+ <!-- Implied template Measure Reference templateId -->
119
+ <templateId root="2.16.840.1.113883.10.20.24.3.98"/>
120
+ <!-- SHALL 1..* (one for each referenced measure) Measure Reference and Results template -->
121
+ <templateId root="2.16.840.1.113883.10.20.27.3.1"/>
122
+ <statusCode code="completed"/>
123
+ <reference typeCode="REFR">
124
+ <externalDocument classCode="DOC" moodCode="EVN">
125
+ <!-- SHALL: required Id but not restricted to the eMeasure Document/Id-->
126
+ <!-- QualityMeasureDocument/id This is the version specific identifier for eMeasure -->
127
+ <id root="<%= measure['hqmf_id'] %>"/>
128
+
129
+ <!-- SHOULD This is the title of the eMeasure -->
130
+ <text><%= measure['name'] %></text>
131
+ <!-- SHOULD: setId is the eMeasure version neutral id -->
132
+ <setId root="<%= measure['hqmf_set_id'] %>"/>
133
+ <!-- This is the sequential eMeasure Version number -->
134
+ <versionNumber value="1"/>
135
+ </externalDocument>
136
+ </reference>
137
+
138
+ <% result = results[measure['hqmf_id']]
139
+ unless result.is_cv? || result.multiple_population_types?
140
+ -%>
141
+ <component>
142
+ <%== render :partial => 'performance_rate', :locals => {:aggregate_count => result} %>
143
+ </component>
144
+ <% end -%>
145
+ <% result.top_level_populations.each do |pop|
146
+ unless pop.type == 'OBSERV' -%>
147
+ <%== render :partial => 'measure_data', :locals => {:aggregate_count => result, :population_type => pop.type, :population_id => pop.id} %>
148
+ <% end
149
+ end -%>
150
+ </organizer>
151
+ </entry>
152
+ <% end %>
153
+ </section>
154
+ </component>
155
+ </structuredBody>
156
+ </component>
157
+ </ClinicalDocument>