health-data-standards 3.5.3 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -3
  3. data/README.md +10 -2
  4. data/lib/health-data-standards.rb +5 -28
  5. data/lib/health-data-standards/export/cat_1.rb +3 -2
  6. data/lib/health-data-standards/export/cat_1_r2.rb +11 -0
  7. data/lib/health-data-standards/ext/node.rb +1 -2
  8. data/lib/health-data-standards/import/bulk_record_importer.rb +4 -4
  9. data/lib/health-data-standards/import/bundle/importer.rb +62 -0
  10. data/lib/health-data-standards/import/c32/insurance_provider_importer.rb +10 -8
  11. data/lib/health-data-standards/import/cat1/patient_importer.rb +3 -3
  12. data/lib/health-data-standards/import/cat1/procedure_importer.rb +42 -0
  13. data/lib/health-data-standards/import/cda/medication_importer.rb +11 -11
  14. data/lib/health-data-standards/import/cda/section_importer.rb +13 -7
  15. data/lib/health-data-standards/models/cqm/aggregate_objects.rb +5 -1
  16. data/lib/health-data-standards/models/cqm/bundle.rb +5 -3
  17. data/lib/health-data-standards/models/cqm/measure.rb +1 -1
  18. data/lib/health-data-standards/models/entry.rb +5 -1
  19. data/lib/health-data-standards/models/record.rb +10 -0
  20. data/lib/health-data-standards/models/reference.rb +23 -0
  21. data/lib/health-data-standards/models/svs/value_set.rb +4 -3
  22. data/lib/health-data-standards/railtie.rb +1 -1
  23. data/lib/health-data-standards/tasks.rb +1 -0
  24. data/lib/health-data-standards/tasks/bundle.rake +84 -2
  25. data/lib/health-data-standards/util/vs_api.rb +40 -7
  26. data/lib/health-data-standards/validate/base_validator.rb +23 -0
  27. data/lib/health-data-standards/validate/data_validator.rb +85 -0
  28. data/lib/health-data-standards/validate/measure_validator.rb +127 -0
  29. data/lib/health-data-standards/validate/performance_rate_validator.rb +94 -0
  30. data/lib/health-data-standards/validate/reported_result_extractor.rb +170 -0
  31. data/lib/health-data-standards/validate/schema_validator.rb +24 -0
  32. data/lib/health-data-standards/validate/schematron/c_processor.rb +28 -0
  33. data/lib/health-data-standards/validate/schematron/java_processor.rb +93 -0
  34. data/lib/health-data-standards/validate/schematron_validator.rb +34 -0
  35. data/lib/health-data-standards/validate/validation_error.rb +10 -0
  36. data/lib/health-data-standards/validate/validators.rb +80 -0
  37. data/lib/hqmf-generator/fulfills.xml.erb +7 -0
  38. data/lib/hqmf-generator/hqmf-generator.rb +8 -3
  39. data/lib/hqmf-model/data_criteria.rb +3 -0
  40. data/lib/hqmf-model/types.rb +29 -0
  41. data/lib/hqmf-parser/2.0/data_criteria.rb +7 -0
  42. data/lib/hqmf-parser/2.0/types.rb +24 -0
  43. data/resources/schema/infrastructure/cda/CDA_SDTC.xsd +44 -0
  44. data/resources/schema/infrastructure/cda/POCD_MT000040_SDTC.xsd +1500 -0
  45. data/resources/schema/infrastructure/cda/SDTC.xsd +210 -0
  46. data/resources/schema/processable/coreschemas/NarrativeBlock.xsd +557 -0
  47. data/resources/schema/processable/coreschemas/datatypes-base_SDTC.xsd +1850 -0
  48. data/resources/schema/processable/coreschemas/datatypes.xsd +1375 -0
  49. data/resources/schema/processable/coreschemas/infrastructureRoot.xsd +27 -0
  50. data/resources/schema/processable/coreschemas/voc.xsd +2124 -0
  51. data/resources/schematron/iso-schematron-xslt1/ExtractSchFromRNG.xsl +75 -0
  52. data/resources/schematron/iso-schematron-xslt1/ExtractSchFromXSD.xsl +77 -0
  53. data/resources/schematron/iso-schematron-xslt1/iso_abstract_expand.xsl +297 -0
  54. data/resources/schematron/iso-schematron-xslt1/iso_dsdl_include.xsl +1509 -0
  55. data/resources/schematron/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  56. data/resources/schematron/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1844 -0
  57. data/resources/schematron/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +605 -0
  58. data/resources/schematron/iso-schematron-xslt1/readme.txt +101 -0
  59. data/resources/schematron/iso-schematron-xslt1/schematron-skeleton-api.htm +723 -0
  60. data/resources/schematron/iso-schematron-xslt2/ExtractSchFromRNG-2.xsl +75 -0
  61. data/resources/schematron/iso-schematron-xslt2/ExtractSchFromXSD-2.xsl +77 -0
  62. data/resources/schematron/iso-schematron-xslt2/iso_abstract_expand.xsl +297 -0
  63. data/resources/schematron/iso-schematron-xslt2/iso_dsdl_include.xsl +1508 -0
  64. data/resources/schematron/iso-schematron-xslt2/iso_schematron_message_xslt2.xsl +55 -0
  65. data/resources/schematron/iso-schematron-xslt2/iso_schematron_skeleton_for_saxon.xsl +2299 -0
  66. data/resources/schematron/iso-schematron-xslt2/iso_svrl_for_xslt2.xsl +684 -0
  67. data/resources/schematron/iso-schematron-xslt2/readme.txt +100 -0
  68. data/resources/schematron/iso-schematron-xslt2/sch-messages-cs.xhtml +56 -0
  69. data/resources/schematron/iso-schematron-xslt2/sch-messages-de.xhtml +57 -0
  70. data/resources/schematron/iso-schematron-xslt2/sch-messages-en.xhtml +57 -0
  71. data/resources/schematron/iso-schematron-xslt2/sch-messages-fr.xhtml +54 -0
  72. data/resources/schematron/iso-schematron-xslt2/sch-messages-nl.xhtml +58 -0
  73. data/resources/schematron/iso-schematron-xslt2/schematron-skeleton-api.htm +723 -0
  74. data/resources/schematron/qrda/cat_1/CDAR2_QRDA_I_R1_D3_2015MAY_Schematron.sch +4676 -0
  75. data/resources/schematron/qrda/cat_1/voc.xml +1177 -0
  76. data/resources/schematron/qrda/cat_1_r2/QRDA Category I Release 2.sch +4069 -0
  77. data/resources/schematron/qrda/cat_1_r2/voc.xml +1065 -0
  78. data/resources/schematron/qrda/cat_3/QRDA Category III.sch +675 -0
  79. data/resources/schematron/qrda/cat_3/voc.xml +21 -0
  80. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +18 -0
  81. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +4 -0
  82. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +5 -1
  83. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +1 -0
  84. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +20 -0
  85. data/templates/cat1/_fulfills.cat1.erb +14 -0
  86. data/templates/cat1/_organization.cat1.erb +2 -1
  87. data/templates/cat1/_patient_data.cat1.erb +1 -1
  88. data/templates/cat1/show.cat1.erb +5 -4
  89. data/templates/cat3/_performance_rate.cat3.erb +5 -1
  90. data/templates/cat3/show.cat3.erb +1 -1
  91. metadata +128 -109
  92. data/lib/health-data-standards/export/ccr.rb +0 -417
  93. data/lib/health-data-standards/export/green_c32/entry.rb +0 -18
  94. data/lib/health-data-standards/export/green_c32/export_generator.rb +0 -23
  95. data/lib/health-data-standards/export/green_c32/record.rb +0 -18
  96. data/lib/health-data-standards/export/helper/gc32_view_helper.rb +0 -39
  97. data/lib/health-data-standards/import/ccr/patient_importer.rb +0 -238
  98. data/lib/health-data-standards/import/ccr/product_importer.rb +0 -60
  99. data/lib/health-data-standards/import/ccr/provider_importer.rb +0 -49
  100. data/lib/health-data-standards/import/ccr/result_importer.rb +0 -49
  101. data/lib/health-data-standards/import/ccr/section_importer.rb +0 -135
  102. data/lib/health-data-standards/import/ccr/simple_importer.rb +0 -30
  103. data/lib/health-data-standards/import/green_c32/advance_directive_importer.rb +0 -14
  104. data/lib/health-data-standards/import/green_c32/allergy_importer.rb +0 -20
  105. data/lib/health-data-standards/import/green_c32/care_goal_importer.rb +0 -26
  106. data/lib/health-data-standards/import/green_c32/condition_importer.rb +0 -38
  107. data/lib/health-data-standards/import/green_c32/encounter_importer.rb +0 -33
  108. data/lib/health-data-standards/import/green_c32/immunization_importer.rb +0 -23
  109. data/lib/health-data-standards/import/green_c32/medical_equipment_importer.rb +0 -24
  110. data/lib/health-data-standards/import/green_c32/medication_importer.rb +0 -68
  111. data/lib/health-data-standards/import/green_c32/patient_importer.rb +0 -14
  112. data/lib/health-data-standards/import/green_c32/procedure_importer.rb +0 -27
  113. data/lib/health-data-standards/import/green_c32/result_importer.rb +0 -43
  114. data/lib/health-data-standards/import/green_c32/section_importer.rb +0 -186
  115. data/lib/health-data-standards/import/green_c32/social_history_importer.rb +0 -13
  116. data/lib/health-data-standards/import/green_c32/support_importer.rb +0 -22
  117. data/lib/health-data-standards/import/green_c32/vital_sign_importer.rb +0 -21
  118. data/templates/gc32/_address.gc32.erb +0 -9
  119. data/templates/gc32/_advance_directive.gc32.erb +0 -5
  120. data/templates/gc32/_allergy.gc32.erb +0 -12
  121. data/templates/gc32/_care_goal.gc32.erb +0 -8
  122. data/templates/gc32/_condition.gc32.erb +0 -10
  123. data/templates/gc32/_encounter.gc32.erb +0 -28
  124. data/templates/gc32/_entry.gc32.erb +0 -3
  125. data/templates/gc32/_entry_attributes.gc32.erb +0 -10
  126. data/templates/gc32/_immunization.gc32.erb +0 -9
  127. data/templates/gc32/_insurance_provider.gc32.erb +0 -28
  128. data/templates/gc32/_medical_equipment.gc32.erb +0 -6
  129. data/templates/gc32/_medication.gc32.erb +0 -91
  130. data/templates/gc32/_name.gc32.erb +0 -11
  131. data/templates/gc32/_organization.gc32.erb +0 -10
  132. data/templates/gc32/_person_attributes.gc32.erb +0 -7
  133. data/templates/gc32/_procedure.gc32.erb +0 -9
  134. data/templates/gc32/_provider.gc32.erb +0 -9
  135. data/templates/gc32/_result.gc32.erb +0 -12
  136. data/templates/gc32/_social_history.gc32.erb +0 -6
  137. data/templates/gc32/_support.gc32.erb +0 -15
  138. data/templates/gc32/_telecom.gc32.erb +0 -1
  139. data/templates/gc32/_vital_sign.gc32.erb +0 -4
  140. data/templates/gc32/record.gc32.erb +0 -97
@@ -1,11 +0,0 @@
1
- <name>
2
- <% if person.title %>
3
- <title><% person.title %></title>
4
- <% end %>
5
- <% if person.given_name %>
6
- <givenName><%= person.given_name%></givenName>
7
- <% end %>
8
- <% if person.family_name %>
9
- <familyName><%= person.family_name%></familyName>
10
- <% end %>
11
- </name>
@@ -1,10 +0,0 @@
1
- <% tag_name ||= "organization"%>
2
- <<%=tag_name%> id="<%=organization.id%>">
3
- <name><%= organization.name%></name>
4
- <% organization.addresses.each do |addr| %>
5
- <%== render :partial => "address", locals: {address: addr} %>
6
- <% end %>
7
- <% organization.telecoms.each do |tele| %>
8
- <%== render :partial => "telecom", locals: {telecom: tele} %>
9
- <% end %>
10
- </organization>
@@ -1,7 +0,0 @@
1
- <%== render partial: 'name', locals: {person: person} %>
2
- <% person.addresses.each do |addr| %>
3
- <%== render :partial => "address", locals: {address: addr} %>
4
- <% end %>
5
- <% person.telecoms.each do |tele| %>
6
- <%== render :partial => "telecom", locals: {telecom: tele} %>
7
- <% end %>
@@ -1,9 +0,0 @@
1
- <procedure xmlns="urn:hl7-org:greencda:c32" id="<%=procedure.id%>">
2
- <%== render partial: "entry_attributes", locals: {entry: procedure, code_sets: ['CPT', 'ICD-9-CM', 'ICD-10-CM', 'HCPCS', 'SNOMED-CT']}%>
3
- <% if procedure.site %>
4
- <%== gc32_code_display procedure, "tag_name" => "site", "attribute" => "site", "preferred_code_sets" => ["SNOMED-CT"] %>
5
- <% end %>
6
- <% if procedure.performer %>
7
- <%== render partial: 'provider', locals: {provider: procedure.performer} %>
8
- <% end %>
9
- </procedure>
@@ -1,9 +0,0 @@
1
- <% tag_name ||= "provider" %>
2
- <<%=tag_name%> id="<%= provider.id%>">
3
- <%== render :partial => 'person_attributes', locals: {person: provider} %>
4
- <npi>1234567890</npi>
5
- <specialty></specialty>
6
- <% if provider.organization %>
7
- <%== render :partial => "organization", locals: { organization: provider.organization } %>
8
- <% end %>
9
- </<%=tag_name%>>
@@ -1,12 +0,0 @@
1
- <result xmlns="urn:hl7-org:greencda:c32" id="<%= result.id %>">
2
- <%== render partial: "entry_attributes", locals: {entry: result, code_sets: ["SNOMED-CT", "LOINC"]}%>
3
- <% if result.values.first %>
4
- <%== quantity_display result.values.first %>
5
- <% end %>
6
- <% if result.interpretation%>
7
- <%= gc32_code_display(result, "tag_name" => "interpretation", "attribute" => "interpretation", 'preferred_code_sets' => ["HL7 Observation Interpretation"]) %>
8
- <% end %>
9
- <% if result.reference_range %>
10
- <referenceRange><%= result.reference_range %></referenceRange>
11
- <% end %>
12
- </result>
@@ -1,6 +0,0 @@
1
- <socialHistory xmlns="urn:hl7-org:greencda:c32" id="<%= social_history.id%>">
2
- <%== render partial: "entry_attributes", locals: {entry: social_history, code_sets: ["SNOMED-CT"]}%>
3
- <% if social_history.values.first %>
4
- <%== quantity_display social_history.values.first %>
5
- <% end %>
6
- </socialHistory>
@@ -1,15 +0,0 @@
1
- <support xmlns="urn:hl7-org:greencda:c32">
2
- <%== render partial: 'name', locals: {person: support}%>
3
- <%== render partial: 'address', locals: {address: support.address} %>
4
- <%== render partial: 'telecom', locals: {telecom: support.telecom} %>
5
- <% if support.mothers_maiden_name%>
6
- <mothersMaidenName><%= support.mothers_maiden_name %></mothersMaidenName>
7
- <% end %>
8
- <% if support.type %>
9
- <type><%= support.type %></type>
10
- <% end %>
11
- <% if support.relationship %>
12
- <relationship><%= support.relationship %></relationship>
13
- <% end %>
14
-
15
- </support>
@@ -1 +0,0 @@
1
- <telecom <% if telecom.use %>use="<%= telecom.use%>"<% end %> <% if telecom.value %>value="<%= telecom.value %>"<% end %> <% if telecom.preferred %>preferred="<%= telecom.preferred %>"<% end %> />
@@ -1,4 +0,0 @@
1
- <vitalSign xmlns="urn:hl7-org:greencda:c32" id="<%= vital_sign.id %>">
2
- <%== render partial: "entry_attributes", locals: {entry: vital_sign, code_sets: ["SNOMED-CT", "ICD-9-CM", "ICD-10-CM ","LOINC"]}%>
3
- <%== quantity_display vital_sign.values.first %>
4
- </vitalSign>
@@ -1,97 +0,0 @@
1
- <record xmlns="urn:hl7-org:greencda:c32">
2
- <patientInformation id="<%=record.medical_record_number%>">
3
- <name>
4
- <title><%= record.title %></title>
5
- <givenName><%= record.first %></givenName>
6
- <familyName><%= record.last %></familyName>
7
- </name>
8
- <% record.addresses.each do |address| %>
9
- <%== render partial: "address", locals: {address: address} %>
10
- <% end %>
11
- <% record.telecoms.each do |tele| %>
12
- <%== render partial: "telecom", locals: {telecom: tele} %>
13
- <% end %>
14
- <gender code="<%= record.gender %>" codeSystem="2.16.840.1.113883.5.1" />
15
- <dateOfBirth><%= time_if_not_nil(record.birthdate) %></dateOfBirth>
16
- <% if record.deathdate %>
17
- <dateOfDeath><%= time_if_not_nil(record.deathdate) %></dateOfDeath>
18
- <% end %>
19
- <% if record.marital_status && record.marital_status[:code] %>
20
- <maritalStatus code="<%=record.marital_status[:code] %>" codeSystem="2.16.840.1.113883.5.2" />
21
- <% end %>
22
- <% if record.religious_affiliation && record.religious_affiliation[:code] %>
23
- <religiousAffiliation code="<%= record.religious_affiliation[:code] %>" codeSystem="2.16.840.1.113883.5.1076" />
24
- <% end %>
25
- <% if record.race && record.race[:code] %>
26
- <race code="<%=record.race[:code]%>" codeSystem="2.16.840.1.113883.6.238" />
27
- <% end %>
28
- <% if record.ethnicity && record.race[:code] %>
29
- <ethnicity code="<%=record.ethnicity[:code]%>" codeSystem="2.16.840.1.113883.6.238" />
30
- <% end %>
31
- <languagesSpoken>
32
- <% record.languages.each do |l| %>
33
- <language><%=l%></language>
34
- <% end%>
35
- </languagesSpoken>
36
- </patientInformation>
37
- <allergies>
38
- <% record.allergies.each do |a| %>
39
- <%== render partial: "allergy", locals: {allergy: a} %>
40
- <% end %>
41
- </allergies>
42
- <conditions>
43
- <% record.conditions.each do |c| %>
44
- <%== render partial: "condition", locals: {condition: c} %>
45
- <% end %>
46
- </conditions>
47
- <encounters>
48
- <% record.encounters.each do |e| %>
49
- <%== render partial: 'encounter', locals: {encounter: e} %>
50
- <% end %>
51
- </encounters>
52
- <immunizations>
53
- <% record.immunizations.each do |i| %>
54
- <%== render partial: "immunization", locals: {immunization: i} %>
55
- <% end %>
56
- </immunizations>
57
- <insuranceProviders>
58
- <% record.insurance_providers.each do |ip| %>
59
- <%== render partial: "insurance_provider", locals: {insurance_provider: ip} %>
60
- <% end %>
61
- </insuranceProviders>
62
- <medicalEquipment>
63
- <% record.medical_equipment.each do |me| %>
64
- <%== render partial: "medical_equipment", locals: {medical_equipment: me} %>
65
- <% end %>
66
- </medicalEquipment>
67
- <medications>
68
- <% record.medications.each do |m| %>
69
- <%== render partial: "medication", locals: {medication: m} %>
70
- <% end %>
71
- </medications>
72
- <procedures>
73
- <% record.procedures.each do |pr| %>
74
- <%== render partial: "procedure", locals: {procedure: pr} %>
75
- <% end %>
76
- </procedures>
77
- <results>
78
- <% record.results.each do |r| %>
79
- <%== render partial: "result", locals: {result: r} %>
80
- <% end %>
81
- </results>
82
- <socialHistory>
83
- <% record.social_history.each do |sh| %>
84
- <%== render partial: "social_history", locals: {social_history: sh} %>
85
- <% end %>
86
- </socialHistory>
87
- <support>
88
- <% record.support.each do |s| %>
89
- <%== render partial: "support", locals: {support: s}%>
90
- <% end %>
91
- </support>
92
- <vitalSigns>
93
- <% record.vital_signs.each do |vs| %>
94
- <%== render partial: "vital_sign", locals: {vital_sign: vs} %>
95
- <% end %>
96
- </vitalSigns>
97
- </record>