fhir_models 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +1 -0
  3. data/.rubocop_todo.yml +2 -2
  4. data/.travis.yml +1 -1
  5. data/fhir_models.gemspec +1 -1
  6. data/lib/fhir_models/bootstrap/hashable.rb +3 -3
  7. data/lib/fhir_models/bootstrap/model.rb +2 -2
  8. data/lib/fhir_models/definitions/schema/fhir-xhtml.xsd +0 -0
  9. data/lib/fhir_models/definitions/schema/xml.xsd +0 -0
  10. data/lib/fhir_models/definitions/schema/xmldsig-core-schema.xsd +0 -0
  11. data/lib/fhir_models/examples/json/appointmentresponse-example-req.json +0 -0
  12. data/lib/fhir_models/examples/json/appointmentresponse-example.json +0 -0
  13. data/lib/fhir_models/examples/json/basic-example-narrative.json +0 -0
  14. data/lib/fhir_models/examples/json/basic-example2.json +0 -0
  15. data/lib/fhir_models/examples/json/capabilitystatement-example.json +1 -1
  16. data/lib/fhir_models/examples/json/capabilitystatement-phr-example.json +0 -0
  17. data/lib/fhir_models/examples/json/claim-example-oral-contained-identifier.json +1 -1
  18. data/lib/fhir_models/examples/json/claim-example-oral-identifier.json +0 -0
  19. data/lib/fhir_models/examples/json/claim-example-pharmacy.json +0 -0
  20. data/lib/fhir_models/examples/json/claim-example-professional.json +0 -0
  21. data/lib/fhir_models/examples/json/claim-example-vision.json +0 -0
  22. data/lib/fhir_models/examples/json/claim-example.json +0 -0
  23. data/lib/fhir_models/examples/json/condition-example-stroke.json +0 -0
  24. data/lib/fhir_models/examples/json/condition-example.json +0 -0
  25. data/lib/fhir_models/examples/json/coverage-example-ehic.json +0 -0
  26. data/lib/fhir_models/examples/json/coverage-example-selfpay.json +0 -0
  27. data/lib/fhir_models/examples/json/dataelement-example.json +1 -1
  28. data/lib/fhir_models/examples/json/device-example-ihe-pcd.json +0 -0
  29. data/lib/fhir_models/examples/json/device-example-pacemaker.json +0 -0
  30. data/lib/fhir_models/examples/json/device-example-software.json +0 -0
  31. data/lib/fhir_models/examples/json/eligibilityrequest-example.json +0 -0
  32. data/lib/fhir_models/examples/json/endpoint-examples-general-template.json +9 -9
  33. data/lib/fhir_models/examples/json/enrollmentrequest-example.json +0 -0
  34. data/lib/fhir_models/examples/json/group-example-member.json +0 -0
  35. data/lib/fhir_models/examples/json/immunizationrecommendation-example.json +0 -0
  36. data/lib/fhir_models/examples/json/list-example-allergies.json +0 -0
  37. data/lib/fhir_models/examples/json/list-example-empty.json +0 -0
  38. data/lib/fhir_models/examples/json/list-example-medlist.json +0 -0
  39. data/lib/fhir_models/examples/json/list-example-simple-empty.json +0 -0
  40. data/lib/fhir_models/examples/json/list-example.json +0 -0
  41. data/lib/fhir_models/examples/json/location-example-ambulance.json +0 -0
  42. data/lib/fhir_models/examples/json/location-example-hl7hq.json +0 -0
  43. data/lib/fhir_models/examples/json/location-example-patients-home.json +0 -0
  44. data/lib/fhir_models/examples/json/location-example-ukpharmacy.json +0 -0
  45. data/lib/fhir_models/examples/json/location-example.json +0 -0
  46. data/lib/fhir_models/examples/json/media-example-sound.json +0 -0
  47. data/lib/fhir_models/examples/json/medicationexample1.json +0 -0
  48. data/lib/fhir_models/examples/json/namingsystem-example-id.json +0 -0
  49. data/lib/fhir_models/examples/json/namingsystem-example-replaced.json +0 -0
  50. data/lib/fhir_models/examples/json/namingsystem-example.json +0 -0
  51. data/lib/fhir_models/examples/json/operationoutcome-example-allok.json +0 -0
  52. data/lib/fhir_models/examples/json/operationoutcome-example-exception.json +0 -0
  53. data/lib/fhir_models/examples/json/operationoutcome-example-searchfail.json +0 -0
  54. data/lib/fhir_models/examples/json/organization-example-gastro.json +0 -0
  55. data/lib/fhir_models/examples/json/organization-example-good-health-care.json +0 -0
  56. data/lib/fhir_models/examples/json/organization-example-insurer.json +0 -0
  57. data/lib/fhir_models/examples/json/organization-example-lab.json +0 -0
  58. data/lib/fhir_models/examples/json/organization-example-mmanu.json +0 -0
  59. data/lib/fhir_models/examples/json/organization-example.json +0 -0
  60. data/lib/fhir_models/examples/json/parameters-example.json +0 -0
  61. data/lib/fhir_models/examples/json/patient-example-b.json +0 -0
  62. data/lib/fhir_models/examples/json/patient-example-c.json +0 -0
  63. data/lib/fhir_models/examples/json/patient-example-dicom.json +0 -0
  64. data/lib/fhir_models/examples/json/patient-example-ihe-pcd.json +0 -0
  65. data/lib/fhir_models/examples/json/patient-example-xcda.json +0 -0
  66. data/lib/fhir_models/examples/json/patient-example-xds.json +0 -0
  67. data/lib/fhir_models/examples/json/patient-examples-cypress-template.json +0 -0
  68. data/lib/fhir_models/examples/json/patient-examples-general.json +0 -0
  69. data/lib/fhir_models/examples/json/patient-genetics-example1.json +0 -0
  70. data/lib/fhir_models/examples/json/patient-glossy-example.json +0 -0
  71. data/lib/fhir_models/examples/json/person-example-f002-ariadne.json +0 -0
  72. data/lib/fhir_models/examples/json/person-example.json +0 -0
  73. data/lib/fhir_models/examples/json/practitioner-example-xcda-author.json +0 -0
  74. data/lib/fhir_models/examples/json/processrequest-example-poll-eob.json +0 -0
  75. data/lib/fhir_models/examples/json/processrequest-example-poll-exclusive.json +0 -0
  76. data/lib/fhir_models/examples/json/processrequest-example-poll-inclusive.json +0 -0
  77. data/lib/fhir_models/examples/json/processrequest-example-poll-payrec.json +0 -0
  78. data/lib/fhir_models/examples/json/processrequest-example-reprocess.json +0 -0
  79. data/lib/fhir_models/examples/json/processrequest-example-reverse.json +0 -0
  80. data/lib/fhir_models/examples/json/processrequest-example-status.json +0 -0
  81. data/lib/fhir_models/examples/json/processrequest-example.json +0 -0
  82. data/lib/fhir_models/examples/json/processresponse-example.json +0 -0
  83. data/lib/fhir_models/examples/json/provenance-example-sig.json +1 -1
  84. data/lib/fhir_models/examples/json/relatedperson-example-f001-sarah.json +0 -0
  85. data/lib/fhir_models/examples/json/relatedperson-example-f002-ariadne.json +0 -0
  86. data/lib/fhir_models/examples/json/researchstudy-example.json +0 -0
  87. data/lib/fhir_models/examples/json/researchsubject-example.json +0 -0
  88. data/lib/fhir_models/examples/json/riskassessment-example-population.json +0 -0
  89. data/lib/fhir_models/examples/json/searchparameter-example-extension.json +0 -0
  90. data/lib/fhir_models/examples/json/slot-example-busy.json +0 -0
  91. data/lib/fhir_models/examples/json/slot-example-tentative.json +0 -0
  92. data/lib/fhir_models/examples/json/slot-example-unavailable.json +0 -0
  93. data/lib/fhir_models/examples/json/valueset-example-yesnodontknow.json +0 -0
  94. data/lib/fhir_models/examples/xml/appointment-example-request.xml +0 -0
  95. data/lib/fhir_models/examples/xml/appointmentresponse-example-req.xml +0 -0
  96. data/lib/fhir_models/examples/xml/appointmentresponse-example.xml +0 -0
  97. data/lib/fhir_models/examples/xml/basic-example-narrative.xml +0 -0
  98. data/lib/fhir_models/examples/xml/basic-example2.xml +0 -0
  99. data/lib/fhir_models/examples/xml/capabilitystatement-example.xml +1 -1
  100. data/lib/fhir_models/examples/xml/capabilitystatement-phr-example.xml +0 -0
  101. data/lib/fhir_models/examples/xml/claim-example-oral-contained-identifier.xml +1 -1
  102. data/lib/fhir_models/examples/xml/claim-example-oral-identifier.xml +0 -0
  103. data/lib/fhir_models/examples/xml/claim-example-pharmacy.xml +0 -0
  104. data/lib/fhir_models/examples/xml/claim-example-professional.xml +0 -0
  105. data/lib/fhir_models/examples/xml/claim-example-vision.xml +0 -0
  106. data/lib/fhir_models/examples/xml/claim-example.xml +0 -0
  107. data/lib/fhir_models/examples/xml/condition-example-stroke.xml +0 -0
  108. data/lib/fhir_models/examples/xml/condition-example.xml +0 -0
  109. data/lib/fhir_models/examples/xml/coverage-example-ehic.xml +0 -0
  110. data/lib/fhir_models/examples/xml/coverage-example-selfpay.xml +0 -0
  111. data/lib/fhir_models/examples/xml/dataelement-example.xml +1 -1
  112. data/lib/fhir_models/examples/xml/device-example-ihe-pcd.xml +0 -0
  113. data/lib/fhir_models/examples/xml/device-example-pacemaker.xml +0 -0
  114. data/lib/fhir_models/examples/xml/device-example-software.xml +0 -0
  115. data/lib/fhir_models/examples/xml/eligibilityrequest-example.xml +0 -0
  116. data/lib/fhir_models/examples/xml/endpoint-examples-general-template.xml +9 -9
  117. data/lib/fhir_models/examples/xml/enrollmentrequest-example.xml +0 -0
  118. data/lib/fhir_models/examples/xml/group-example-member.xml +0 -0
  119. data/lib/fhir_models/examples/xml/immunizationrecommendation-example.xml +0 -0
  120. data/lib/fhir_models/examples/xml/list-example-allergies.xml +0 -0
  121. data/lib/fhir_models/examples/xml/list-example-empty.xml +0 -0
  122. data/lib/fhir_models/examples/xml/list-example-medlist.xml +0 -0
  123. data/lib/fhir_models/examples/xml/list-example-simple-empty.xml +0 -0
  124. data/lib/fhir_models/examples/xml/list-example.xml +0 -0
  125. data/lib/fhir_models/examples/xml/location-example-ambulance.xml +0 -0
  126. data/lib/fhir_models/examples/xml/location-example-hl7hq.xml +0 -0
  127. data/lib/fhir_models/examples/xml/location-example-patients-home.xml +0 -0
  128. data/lib/fhir_models/examples/xml/location-example-ukpharmacy.xml +0 -0
  129. data/lib/fhir_models/examples/xml/location-example.xml +0 -0
  130. data/lib/fhir_models/examples/xml/media-example-sound.xml +0 -0
  131. data/lib/fhir_models/examples/xml/medicationexample1.xml +0 -0
  132. data/lib/fhir_models/examples/xml/namingsystem-example-id.xml +0 -0
  133. data/lib/fhir_models/examples/xml/namingsystem-example-replaced.xml +0 -0
  134. data/lib/fhir_models/examples/xml/namingsystem-example.xml +0 -0
  135. data/lib/fhir_models/examples/xml/operationoutcome-example-allok.xml +0 -0
  136. data/lib/fhir_models/examples/xml/operationoutcome-example-exception.xml +0 -0
  137. data/lib/fhir_models/examples/xml/operationoutcome-example-searchfail.xml +0 -0
  138. data/lib/fhir_models/examples/xml/organization-example-f001-burgers.xml +0 -0
  139. data/lib/fhir_models/examples/xml/organization-example-f002-burgers-card.xml +0 -0
  140. data/lib/fhir_models/examples/xml/organization-example-f003-burgers-ENT.xml +0 -0
  141. data/lib/fhir_models/examples/xml/organization-example-gastro.xml +0 -0
  142. data/lib/fhir_models/examples/xml/organization-example-good-health-care.xml +0 -0
  143. data/lib/fhir_models/examples/xml/organization-example-insurer.xml +0 -0
  144. data/lib/fhir_models/examples/xml/organization-example-lab.xml +0 -0
  145. data/lib/fhir_models/examples/xml/organization-example-mmanu.xml +0 -0
  146. data/lib/fhir_models/examples/xml/organization-example.xml +0 -0
  147. data/lib/fhir_models/examples/xml/parameters-example.xml +0 -0
  148. data/lib/fhir_models/examples/xml/patient-example-b.xml +0 -0
  149. data/lib/fhir_models/examples/xml/patient-example-c.xml +0 -0
  150. data/lib/fhir_models/examples/xml/patient-example-dicom.xml +0 -0
  151. data/lib/fhir_models/examples/xml/patient-example-ihe-pcd.xml +0 -0
  152. data/lib/fhir_models/examples/xml/patient-example-xcda.xml +0 -0
  153. data/lib/fhir_models/examples/xml/patient-example-xds.xml +0 -0
  154. data/lib/fhir_models/examples/xml/patient-examples-cypress-template.xml +0 -0
  155. data/lib/fhir_models/examples/xml/patient-examples-general.xml +0 -0
  156. data/lib/fhir_models/examples/xml/patient-genetics-example1.xml +0 -0
  157. data/lib/fhir_models/examples/xml/patient-glossy-example.xml +0 -0
  158. data/lib/fhir_models/examples/xml/person-example-f002-ariadne.xml +0 -0
  159. data/lib/fhir_models/examples/xml/person-example.xml +0 -0
  160. data/lib/fhir_models/examples/xml/practitioner-example-xcda-author.xml +0 -0
  161. data/lib/fhir_models/examples/xml/processrequest-example-poll-eob.xml +0 -0
  162. data/lib/fhir_models/examples/xml/processrequest-example-poll-exclusive.xml +0 -0
  163. data/lib/fhir_models/examples/xml/processrequest-example-poll-inclusive.xml +0 -0
  164. data/lib/fhir_models/examples/xml/processrequest-example-poll-payrec.xml +0 -0
  165. data/lib/fhir_models/examples/xml/processrequest-example-reprocess.xml +0 -0
  166. data/lib/fhir_models/examples/xml/processrequest-example-reverse.xml +0 -0
  167. data/lib/fhir_models/examples/xml/processrequest-example-status.xml +0 -0
  168. data/lib/fhir_models/examples/xml/processrequest-example.xml +0 -0
  169. data/lib/fhir_models/examples/xml/processresponse-example.xml +0 -0
  170. data/lib/fhir_models/examples/xml/provenance-example-sig.xml +1 -1
  171. data/lib/fhir_models/examples/xml/relatedperson-example-f001-sarah.xml +0 -0
  172. data/lib/fhir_models/examples/xml/relatedperson-example-f002-ariadne.xml +0 -0
  173. data/lib/fhir_models/examples/xml/researchstudy-example.xml +0 -0
  174. data/lib/fhir_models/examples/xml/researchsubject-example.xml +0 -0
  175. data/lib/fhir_models/examples/xml/riskassessment-example-population.xml +0 -0
  176. data/lib/fhir_models/examples/xml/schedule-example.xml +0 -0
  177. data/lib/fhir_models/examples/xml/searchparameter-example-extension.xml +0 -0
  178. data/lib/fhir_models/examples/xml/slot-example-busy.xml +0 -0
  179. data/lib/fhir_models/examples/xml/slot-example-tentative.xml +0 -0
  180. data/lib/fhir_models/examples/xml/slot-example-unavailable.xml +0 -0
  181. data/lib/fhir_models/examples/xml/valueset-example-yesnodontknow.xml +0 -0
  182. data/lib/fhir_models/fhir_ext/structure_definition.rb +51 -2
  183. data/lib/fhir_models/tasks/tasks.rake +48 -0
  184. data/lib/fhir_models/version.rb +1 -1
  185. metadata +5 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c3fdfeb04eb8924b4a590995cdbe08778b332a33
4
- data.tar.gz: b35c0d5269b9395a79f811030f0dce515c1d827f
2
+ SHA256:
3
+ metadata.gz: a066b68471cc4a3c0a992618366b6079428e3d8fa6446d079cc7dd05d77edbf6
4
+ data.tar.gz: 61b0ae3ef6638cd5faed92bd479a63923bf2bda53ec8cddb522bc766044bbe47
5
5
  SHA512:
6
- metadata.gz: 18d279a2b1b6835f17a2f4e7aef462acf480885a505e0baf0abc06bdce6a2f8fc75d998bf1e3c644c569daa64d445bc5b90d93311e3a643f9c34bc92f8c55697
7
- data.tar.gz: 04480769af209854c5d75d1d7a2c4e5ff1ef2790f66033f087ace3f1e292cc347ce4c6451bd205ddaa8fcf201609837d7b9e751e9e13f099f0e7dbdbb78a9656
6
+ metadata.gz: a0bd4ab336564cfceb8bd562199e439d496504d0b0b69096f3921530e01eda72f5dcdca51f40485eec4a98c644e9b9359900613285c1643ea808132a30f7f539
7
+ data.tar.gz: 780033deebc6af7ec05eb092b9279f5512f97b660fbe91320b9aa73060e0a4e09062c74f37e081189d75a7db2db0d52eb4e9d1616c6c4f66bd352c2602d3e182
@@ -6,6 +6,7 @@ AllCops:
6
6
  - 'spec/**/*'
7
7
  - 'lib/fhir_models/fhir/**/*'
8
8
  - 'lib/fhir_models/fluentpath/evaluate.rb'
9
+ - 'lib/**/*.rake'
9
10
  - 'tmp/**/*'
10
11
  - '*.gemspec'
11
12
  - 'bin/*'
@@ -27,7 +27,7 @@ Metrics/BlockLength:
27
27
  # Offense count: 1
28
28
  # Configuration parameters: CountBlocks.
29
29
  Metrics/BlockNesting:
30
- Max: 4
30
+ Max: 8
31
31
 
32
32
  # Offense count: 5
33
33
  # Configuration parameters: CountComments.
@@ -41,7 +41,7 @@ Metrics/CyclomaticComplexity:
41
41
  # Offense count: 40
42
42
  # Configuration parameters: CountComments.
43
43
  Metrics/MethodLength:
44
- Max: 109
44
+ Max: 150
45
45
 
46
46
  # Offense count: 1
47
47
  # Configuration parameters: CountComments.
@@ -2,10 +2,10 @@ language: ruby
2
2
  env:
3
3
  - TESTMEMORY=0 GCDELAY=2.0
4
4
  rvm:
5
- - 2.2
6
5
  - 2.3
7
6
  - 2.4
8
7
  - 2.5
8
+ - 2.6
9
9
  script:
10
10
  - bundle exec rake
11
11
  - bundle exec codeclimate-test-reporter
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'nokogiri', '>= 1.8.2'
24
24
  spec.add_dependency 'date_time_precision', '>= 0.8'
25
25
  spec.add_dependency 'bcp47', '>= 0.3'
26
- spec.add_dependency 'mime-types', '>= 1.16', '< 3'
26
+ spec.add_dependency 'mime-types', '>= 3.0'
27
27
 
28
28
  spec.add_development_dependency 'bundler'
29
29
  spec.add_development_dependency 'rake'
@@ -51,7 +51,7 @@ module FHIR
51
51
  if !klass.nil? && !value.nil?
52
52
  # handle array of objects
53
53
  if value.is_a?(Array)
54
- value.map! do |child|
54
+ value = value.map do |child|
55
55
  obj = child
56
56
  unless [FHIR::RESOURCES, FHIR::TYPES].flatten.include? child.class.name.gsub('FHIR::', '')
57
57
  obj = make_child(child, klass)
@@ -68,7 +68,7 @@ module FHIR
68
68
  FHIR.logger.error("Unhandled and unrecognized class/type: #{meta['type']}")
69
69
  elsif value.is_a?(Array)
70
70
  # array of primitives
71
- value.map! { |child| convert_primitive(child, meta) }
71
+ value = value.map { |child| convert_primitive(child, meta) }
72
72
  instance_variable_set("@#{local_name}", value)
73
73
  else
74
74
  # single primitive
@@ -111,7 +111,7 @@ module FHIR
111
111
  elsif FHIR::PRIMITIVES.include?(meta['type'])
112
112
  primitive_meta = FHIR::PRIMITIVES[meta['type']]
113
113
  if primitive_meta['type'] == 'number'
114
- rval = BigDecimal.new(value.to_s)
114
+ rval = BigDecimal(value.to_s)
115
115
  rval = rval.frac.zero? ? rval.to_i : rval.to_f
116
116
  end # primitive is number
117
117
  end # boolean else
@@ -200,8 +200,8 @@ module FHIR
200
200
  else
201
201
  errors[field] << "#{meta['path']}: expected Reference, found #{klassname}"
202
202
  end
203
- # if the data type is a particular resource or complex type
204
- elsif FHIR::RESOURCES.include?(datatype) || FHIR::TYPES.include?(datatype)
203
+ # if the data type is a particular resource or complex type or BackBone element within this resource
204
+ elsif FHIR::RESOURCES.include?(datatype) || FHIR::TYPES.include?(datatype) || v.class.name.start_with?(self.class.name)
205
205
  if datatype == klassname
206
206
  validation = v.validate(contained_here)
207
207
  errors[field] << validation unless validation.empty?
@@ -216,7 +216,7 @@
216
216
  "mode": "consumer",
217
217
  "documentation": "Basic rules for all documents in the EHR system",
218
218
  "profile": {
219
- "reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
219
+ "reference": "http://fhir.hl7.org/StructureDefinition/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
220
220
  }
221
221
  }
222
222
  ]
@@ -109,7 +109,7 @@
109
109
  "sequence": 1,
110
110
  "focal": true,
111
111
  "coverage": {
112
- "reference": "http://www.jurisdiction.com/nationalplan/123AB345"
112
+ "reference": "http://www.jurisdiction.com/Coverage/123AB345"
113
113
  }
114
114
  }
115
115
  ],
@@ -186,7 +186,7 @@
186
186
  "mapping": [
187
187
  {
188
188
  "identity": "fhir",
189
- "language": "application/xquery",
189
+ "language": "application/xml",
190
190
  "map": "return f:/Patient/f:gender"
191
191
  }
192
192
  ]
@@ -199,7 +199,7 @@
199
199
  }
200
200
  ],
201
201
  "payloadMimeType": [
202
- "PDF"
202
+ "application/pdf"
203
203
  ],
204
204
  "address": "https://sqlonfhir-dstu2.azurewebsites.net/fhir"
205
205
  }
@@ -232,7 +232,7 @@
232
232
  }
233
233
  ],
234
234
  "payloadMimeType": [
235
- "HL7v2"
235
+ "application/fhir+json"
236
236
  ],
237
237
  "address": "127.0.0.1"
238
238
  }
@@ -265,7 +265,7 @@
265
265
  }
266
266
  ],
267
267
  "payloadMimeType": [
268
- "XDA/XDS"
268
+ "application/xml"
269
269
  ],
270
270
  "address": "https://open.epic.com/Interface/XDS.b"
271
271
  }
@@ -298,7 +298,7 @@
298
298
  }
299
299
  ],
300
300
  "payloadMimeType": [
301
- "DICOM WADO-RS"
301
+ "application/dicom"
302
302
  ],
303
303
  "address": "https://pacs.hospital.org/dicomweb"
304
304
  }
@@ -331,7 +331,7 @@
331
331
  }
332
332
  ],
333
333
  "payloadMimeType": [
334
- "DICOM QIDO-RS"
334
+ "application/dicom"
335
335
  ],
336
336
  "address": "https://pacs.hospital.org/dicomweb"
337
337
  }
@@ -364,7 +364,7 @@
364
364
  }
365
365
  ],
366
366
  "payloadMimeType": [
367
- "DICOM STOW-RS"
367
+ "application/dicom"
368
368
  ],
369
369
  "address": "https://pacs.hospital.org/dicomweb"
370
370
  }
@@ -397,7 +397,7 @@
397
397
  }
398
398
  ],
399
399
  "payloadMimeType": [
400
- "DICOM STOW-RS"
400
+ "application/dicom"
401
401
  ],
402
402
  "address": "https://pacs.hospital.org/dicomweb"
403
403
  }
@@ -430,7 +430,7 @@
430
430
  }
431
431
  ],
432
432
  "payloadMimeType": [
433
- "DICOM WADO-URI"
433
+ "application/dicom"
434
434
  ],
435
435
  "address": "https://pacs.hospital.org/wadoUri"
436
436
  }
@@ -463,7 +463,7 @@
463
463
  }
464
464
  ],
465
465
  "payloadMimeType": [
466
- "IHE IID"
466
+ "application/dicom"
467
467
  ],
468
468
  "address": "https://pacs.hospital.org/IHEInvokeImageDisplay"
469
469
  }
@@ -35,7 +35,7 @@
35
35
  ]
36
36
  }
37
37
  ],
38
- "whoUri": "mailto://hhd@ssa.gov"
38
+ "whoUri": "mailto:hhd@ssa.gov"
39
39
  }
40
40
  ],
41
41
  "signature": [
@@ -211,7 +211,7 @@
211
211
  <!-- this is the important element: a reference to a published document profile
212
212
  note that this is a version specific reference. -->
213
213
  <profile>
214
- <reference value="http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"/>
214
+ <reference value="http://fhir.hl7.org/StructureDefinition/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"/>
215
215
  </profile>
216
216
  </document>
217
217
  </CapabilityStatement>
@@ -99,7 +99,7 @@
99
99
  <sequence value="1"/>
100
100
  <focal value="true"/>
101
101
  <coverage>
102
- <reference value="http://www.jurisdiction.com/nationalplan/123AB345"/>
102
+ <reference value="http://www.jurisdiction.com/Coverage/123AB345"/>
103
103
  </coverage>
104
104
  </insurance>
105
105
 
@@ -254,7 +254,7 @@
254
254
  </binding>
255
255
  <mapping>
256
256
  <identity value="fhir"/>
257
- <language value="application/xquery"/>
257
+ <language value="application/xml"/>
258
258
  <map value="return f:/Patient/f:gender"/>
259
259
  </mapping>
260
260
  </element>
@@ -209,7 +209,7 @@
209
209
  <code value="CDA-EventSummary"/>
210
210
  </coding>
211
211
  </payloadType>
212
- <payloadMimeType value="PDF"/>
212
+ <payloadMimeType value="application/pdf"/>
213
213
  <address value="https://sqlonfhir-dstu2.azurewebsites.net/fhir"/>
214
214
  </Endpoint>
215
215
  </resource>
@@ -244,7 +244,7 @@
244
244
  <code value="REF-I12"/>
245
245
  </coding>
246
246
  </payloadType>
247
- <payloadMimeType value="HL7v2"/>
247
+ <payloadMimeType value="application/fhir+json"/>
248
248
  <address value="127.0.0.1"/>
249
249
  </Endpoint>
250
250
  </resource>
@@ -279,7 +279,7 @@
279
279
  <code value="CDA-EventSummary"/>
280
280
  </coding>
281
281
  </payloadType>
282
- <payloadMimeType value="XDA/XDS"/>
282
+ <payloadMimeType value="application/xml"/>
283
283
  <address value="https://open.epic.com/Interface/XDS.b"/>
284
284
  </Endpoint>
285
285
  </resource>
@@ -314,7 +314,7 @@
314
314
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
315
315
  </coding>
316
316
  </payloadType>
317
- <payloadMimeType value="DICOM WADO-RS"/>
317
+ <payloadMimeType value="application/dicom"/>
318
318
  <address value="https://pacs.hospital.org/dicomweb"/>
319
319
  </Endpoint>
320
320
  </resource>
@@ -349,7 +349,7 @@
349
349
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
350
350
  </coding>
351
351
  </payloadType>
352
- <payloadMimeType value="DICOM QIDO-RS"/>
352
+ <payloadMimeType value="application/dicom"/>
353
353
  <address value="https://pacs.hospital.org/dicomweb"/>
354
354
  </Endpoint>
355
355
  </resource>
@@ -384,7 +384,7 @@
384
384
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
385
385
  </coding>
386
386
  </payloadType>
387
- <payloadMimeType value="DICOM STOW-RS"/>
387
+ <payloadMimeType value="application/dicom"/>
388
388
  <address value="https://pacs.hospital.org/dicomweb"/>
389
389
  </Endpoint>
390
390
  </resource>
@@ -419,7 +419,7 @@
419
419
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
420
420
  </coding>
421
421
  </payloadType>
422
- <payloadMimeType value="DICOM STOW-RS"/>
422
+ <payloadMimeType value="application/dicom"/>
423
423
  <address value="https://pacs.hospital.org/dicomweb"/>
424
424
  </Endpoint>
425
425
  </resource>
@@ -454,7 +454,7 @@
454
454
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
455
455
  </coding>
456
456
  </payloadType>
457
- <payloadMimeType value="DICOM WADO-URI"/>
457
+ <payloadMimeType value="application/dicom"/>
458
458
  <address value="https://pacs.hospital.org/wadoUri"/>
459
459
  </Endpoint>
460
460
  </resource>
@@ -489,7 +489,7 @@
489
489
  <code value="varies (application/dicom, application/dicom+xml, image/jpeg, and many more)"/>
490
490
  </coding>
491
491
  </payloadType>
492
- <payloadMimeType value="IHE IID"/>
492
+ <payloadMimeType value="application/dicom"/>
493
493
  <address value="https://pacs.hospital.org/IHEInvokeImageDisplay"/>
494
494
  </Endpoint>
495
495
  </resource>
@@ -36,7 +36,7 @@
36
36
  <!-- very often, the user won't have a known system - these aren't available
37
37
  for security system log ons. But where you can define it, you should.
38
38
  Most of the time the userId is fully qualfied such as an email address -->
39
- <whoUri value="mailto://hhd@ssa.gov"/>
39
+ <whoUri value="mailto:hhd@ssa.gov"/>
40
40
  </agent>
41
41
  <signature>
42
42
  <!-- verification signature -->
@@ -15,6 +15,20 @@ module FHIR
15
15
  # Profile Validation
16
16
  # -------------------------------------------------------------------------
17
17
 
18
+ class << self; attr_accessor :vs_validators end
19
+ @vs_validators = {}
20
+ def self.validates_vs(valueset_uri, &validator_fn)
21
+ @vs_validators[valueset_uri] = validator_fn
22
+ end
23
+
24
+ def self.clear_validates_vs(valueset_uri)
25
+ @vs_validators.delete valueset_uri
26
+ end
27
+
28
+ def self.clear_all_validates_vs
29
+ @vs_validators = {}
30
+ end
31
+
18
32
  def validates_resource?(resource)
19
33
  validate_resource(resource).empty?
20
34
  end
@@ -147,6 +161,7 @@ module FHIR
147
161
  if !element.type.empty? && element.path != id
148
162
  # element.type not being empty implies data_type_found != nil, for valid profiles
149
163
  codeable_concept_pattern = element.pattern && element.pattern.is_a?(FHIR::CodeableConcept)
164
+ codeable_concept_binding = element.binding
150
165
  matching_pattern = false
151
166
  nodes.each do |value|
152
167
  matching_type = 0
@@ -169,7 +184,7 @@ module FHIR
169
184
  temp_messages += @errors
170
185
  @errors = temp
171
186
  end
172
- if verified_extension || verified_data_type
187
+ if data_type_found && (verified_extension || verified_data_type)
173
188
  matching_type += 1
174
189
  if data_type_found == 'code' # then check the binding
175
190
  unless element.binding.nil?
@@ -183,11 +198,45 @@ module FHIR
183
198
  matching_pattern = true if vcoding.system == pcoding.system && vcoding.code == pcoding.code
184
199
  end
185
200
  end
201
+ elsif data_type_found == 'CodeableConcept' && codeable_concept_binding
202
+ binding_issues =
203
+ if element.binding.strength == 'extensible'
204
+ @warnings
205
+ elsif element.binding.strength == 'required'
206
+ @errors
207
+ else # e.g., example-strength or unspecified
208
+ [] # Drop issues errors on the floor, in throwaway array
209
+ end
210
+
211
+ valueset_uri = element.binding && element.binding.valueSetReference && element.binding.valueSetReference.reference
212
+ vcc = FHIR::CodeableConcept.new(value)
213
+ if valueset_uri && self.class.vs_validators[valueset_uri]
214
+ check_fn = self.class.vs_validators[valueset_uri]
215
+ has_valid_code = vcc.coding && vcc.coding.any? { |c| check_fn.call(c) }
216
+ unless has_valid_code
217
+ binding_issues << "#{describe_element(element)} has no codings from #{valueset_uri}. Codings evaluated: #{vcc.to_json}"
218
+ end
219
+ end
220
+
221
+ unless has_valid_code
222
+ vcc.coding.each do |c|
223
+ check_fn = self.class.vs_validators[c.system]
224
+ if check_fn && !check_fn.call(c)
225
+ binding_issues << "#{describe_element(element)} has no codings from it's specified system: #{c.system}. "\
226
+ "Codings evaluated: #{vcc.to_json}"
227
+ end
228
+ end
229
+ end
230
+
186
231
  elsif data_type_found == 'String' && !element.maxLength.nil? && (value.size > element.maxLength)
187
232
  @errors << "#{describe_element(element)} exceed maximum length of #{element.maxLength}: #{value}"
188
233
  end
189
- else
234
+ elsif data_type_found
190
235
  temp_messages << "#{describe_element(element)} is not a valid #{data_type_found}: '#{value}'"
236
+ else
237
+ # we don't know the data type... so we say "OK"
238
+ matching_type += 1
239
+ @warnings >> "Unable to guess data type for #{describe_element(element)}"
191
240
  end
192
241
 
193
242
  if matching_type <= 0
@@ -38,6 +38,54 @@ namespace :fhir do
38
38
  end
39
39
  end
40
40
 
41
+ desc 'shrink implementation guide'
42
+ task :shrinkig, [:file_path] do |_t, args|
43
+ file_path = args[:file_path]
44
+ files = Dir.glob(File.join(file_path, '*.json'))
45
+ files.each do |filename|
46
+ # Load each file
47
+ start = File.size(filename)
48
+ json = File.open(filename, 'r:UTF-8', &:read)
49
+ hash = JSON.parse(json)
50
+
51
+ # process each file
52
+ FHIR::Boot::Preprocess.pre_process_structuredefinition(hash) if 'StructureDefinition' == hash['resourceType']
53
+ FHIR::Boot::Preprocess.pre_process_valueset(hash) if 'ValueSet' == hash['resourceType']
54
+ FHIR::Boot::Preprocess.pre_process_codesystem(hash) if 'CodeSystem' == hash['resourceType']
55
+ FHIR::Boot::Preprocess.pre_process_searchparam(hash) if 'SearchParameter' == hash['resourceType']
56
+ FHIR::Boot::Preprocess.remove_fhir_comments(hash)
57
+
58
+ # if BlueButton, fix URLs
59
+ if 'StructureDefinition' == hash['resourceType']
60
+ # hash['url'].gsub!('http://hl7.org/fhir/StructureDefinition/','https://bluebutton.cms.gov/assets/ig/StructureDefinition-')
61
+ fix_blue_button_urls(hash)
62
+ end
63
+
64
+ # Output the post processed file
65
+ f = File.open(filename, 'w:UTF-8')
66
+ f.write(JSON.pretty_unparse(hash))
67
+ f.close
68
+ finish = File.size(filename)
69
+ puts " Removed #{(start - finish) / 1024} KB" if start != finish
70
+ end
71
+ end
72
+
73
+ def self.fix_blue_button_urls(hash)
74
+ hash.each do |key, value|
75
+ if value.is_a?(String)
76
+ if value.start_with?('http://hl7.org/fhir/StructureDefinition/bluebutton')
77
+ hash[key] = value.gsub('http://hl7.org/fhir/StructureDefinition/bluebutton', 'https://bluebutton.cms.gov/assets/ig/StructureDefinition-bluebutton')
78
+ end
79
+ elsif value.is_a?(Hash)
80
+ fix_blue_button_urls(value)
81
+ elsif value.is_a?(Array)
82
+ value.each do |v|
83
+ fix_blue_button_urls(v) if v.is_a?(Hash)
84
+ end
85
+ end
86
+ end
87
+ end
88
+
41
89
  desc 'copy artifacts from FHIR build'
42
90
  task :update, [:fhir_build_path] do |_t, args|
43
91
  fhir_build_path = args[:fhir_build_path]
@@ -1,5 +1,5 @@
1
1
  module FHIR
2
2
  module Models
3
- VERSION = '3.0.3'.freeze
3
+ VERSION = '3.0.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fhir_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Walonoski
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2018-05-01 00:00:00.000000000 Z
14
+ date: 2019-02-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri
@@ -61,20 +61,14 @@ dependencies:
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: '1.16'
65
- - - "<"
66
- - !ruby/object:Gem::Version
67
- version: '3'
64
+ version: '3.0'
68
65
  type: :runtime
69
66
  prerelease: false
70
67
  version_requirements: !ruby/object:Gem::Requirement
71
68
  requirements:
72
69
  - - ">="
73
70
  - !ruby/object:Gem::Version
74
- version: '1.16'
75
- - - "<"
76
- - !ruby/object:Gem::Version
77
- version: '3'
71
+ version: '3.0'
78
72
  - !ruby/object:Gem::Dependency
79
73
  name: bundler
80
74
  requirement: !ruby/object:Gem::Requirement
@@ -1634,7 +1628,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1634
1628
  version: '0'
1635
1629
  requirements: []
1636
1630
  rubyforge_project:
1637
- rubygems_version: 2.6.12
1631
+ rubygems_version: 2.7.7
1638
1632
  signing_key:
1639
1633
  specification_version: 4
1640
1634
  summary: A Gem for handling FHIR models in ruby