fhir_dstu2_models 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/fhir_dstu2_models/bootstrap/hashable.rb +3 -3
- data/lib/fhir_dstu2_models/bootstrap/model.rb +2 -2
- data/lib/fhir_dstu2_models/examples/json/appointment-example-request.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/appointment-example.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example-institutional.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example-oral-average.json +5 -5
- data/lib/fhir_dstu2_models/examples/json/claim-example-oral-contained.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example-oral-orthoplan.json +4 -4
- data/lib/fhir_dstu2_models/examples/json/claim-example-pharmacy.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example-professional.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example-vision-glasses.json +4 -4
- data/lib/fhir_dstu2_models/examples/json/claim-example-vision.json +1 -1
- data/lib/fhir_dstu2_models/examples/json/claim-example.json +1 -1
- data/lib/fhir_dstu2_models/examples/xml/appointment-example(example).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/appointment-example-request(examplereq).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example(100150).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-institutional(960150).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-oral-average(100151).xml +5 -5
- data/lib/fhir_dstu2_models/examples/xml/claim-example-oral-contained(100152).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-oral-orthoplan(100153).xml +4 -4
- data/lib/fhir_dstu2_models/examples/xml/claim-example-pharmacy(760150).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-professional(860150).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-vision(660150).xml +1 -1
- data/lib/fhir_dstu2_models/examples/xml/claim-example-vision-glasses(660151).xml +4 -4
- data/lib/fhir_dstu2_models/examples/xml/dataelement-sdc-profile-example(dataelement-sdc-profile-example).xml +0 -1
- data/lib/fhir_dstu2_models/fhir_ext/structure_definition.rb +17 -4
- data/lib/fhir_dstu2_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c22d19c33c6fd72cefbe2aea9b999e17ebd054d5126bbdbb9ce2b4b8b4a49b5
|
4
|
+
data.tar.gz: f0f268df74f53918d47e8781ef48eb4b5f5b967668363aaa2cdab1eaba9afe6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe3ed2a3c9164617dac497b0e0b04fcbe8041300b2833a6edcbf317b7a81c0e4acff8339187502dd83a0f9000110bb7dca742d353519f190e4d9cc004f867be
|
7
|
+
data.tar.gz: a618f6baf40efd7e9d3a94f52280f7238dfcffa0595577c8e4b753ffd5064d2e1be21bc09695fa76b19ccf1b3ed47e5ac00010cde00d1eccd93b3da5e39ed6e4
|
data/.travis.yml
CHANGED
@@ -52,7 +52,7 @@ module FHIR
|
|
52
52
|
if !klass.nil? && !value.nil?
|
53
53
|
# handle array of objects
|
54
54
|
if value.is_a?(Array)
|
55
|
-
value.map
|
55
|
+
value = value.map do |child|
|
56
56
|
obj = child
|
57
57
|
unless [FHIR::DSTU2::RESOURCES, FHIR::DSTU2::TYPES].flatten.include? child.class.name.gsub('FHIR::DSTU2::', '')
|
58
58
|
obj = make_child(child, klass)
|
@@ -69,7 +69,7 @@ module FHIR
|
|
69
69
|
FHIR::DSTU2.logger.error("Unhandled and unrecognized class/type: #{meta['type']}")
|
70
70
|
elsif value.is_a?(Array)
|
71
71
|
# array of primitives
|
72
|
-
value.map
|
72
|
+
value = value.map { |child| convert_primitive(child, meta) }
|
73
73
|
instance_variable_set("@#{local_name}", value)
|
74
74
|
else
|
75
75
|
# single primitive
|
@@ -110,7 +110,7 @@ module FHIR
|
|
110
110
|
elsif FHIR::DSTU2::PRIMITIVES.include?(meta['type'])
|
111
111
|
primitive_meta = FHIR::DSTU2::PRIMITIVES[meta['type']]
|
112
112
|
if primitive_meta['type'] == 'number'
|
113
|
-
rval = BigDecimal
|
113
|
+
rval = BigDecimal(value.to_s)
|
114
114
|
rval = rval.frac.zero? ? rval.to_i : rval.to_f
|
115
115
|
end # primitive is number
|
116
116
|
end # boolean else
|
@@ -209,8 +209,8 @@ module FHIR
|
|
209
209
|
else
|
210
210
|
errors[field] << "#{meta['path']}: expected Reference, found #{klassname}"
|
211
211
|
end
|
212
|
-
# if the data type is a particular resource or complex type
|
213
|
-
elsif FHIR::DSTU2::RESOURCES.include?(datatype) || FHIR::DSTU2::TYPES.include?(datatype)
|
212
|
+
# if the data type is a particular resource or complex type or BackBone element within this resource
|
213
|
+
elsif FHIR::DSTU2::RESOURCES.include?(datatype) || FHIR::DSTU2::TYPES.include?(datatype) || v.class.name.start_with?(self.class.name)
|
214
214
|
if datatype == klassname
|
215
215
|
validation = v.validate(contained_here)
|
216
216
|
errors[field] << validation unless validation.empty?
|
@@ -55,7 +55,7 @@
|
|
55
55
|
{
|
56
56
|
"sequence": 1,
|
57
57
|
"type": {
|
58
|
-
"code": "
|
58
|
+
"code": "CSINV"
|
59
59
|
},
|
60
60
|
"provider": {
|
61
61
|
"reference": "Practitioner/example"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
{
|
80
80
|
"sequence": 2,
|
81
81
|
"type": {
|
82
|
-
"code": "
|
82
|
+
"code": "CSINV"
|
83
83
|
},
|
84
84
|
"provider": {
|
85
85
|
"reference": "Practitioner/example"
|
@@ -113,7 +113,7 @@
|
|
113
113
|
{
|
114
114
|
"sequence": 3,
|
115
115
|
"type": {
|
116
|
-
"code": "
|
116
|
+
"code": "CPNDDRGING"
|
117
117
|
},
|
118
118
|
"provider": {
|
119
119
|
"reference": "Practitioner/example"
|
@@ -141,7 +141,7 @@
|
|
141
141
|
{
|
142
142
|
"sequence": 1,
|
143
143
|
"type": {
|
144
|
-
"code": "
|
144
|
+
"code": "CSINV"
|
145
145
|
},
|
146
146
|
"service": {
|
147
147
|
"system": "http://hl7.org/fhir/oralservicecodes",
|
@@ -161,7 +161,7 @@
|
|
161
161
|
{
|
162
162
|
"sequence": 2,
|
163
163
|
"type": {
|
164
|
-
"code": "
|
164
|
+
"code": "CSINV"
|
165
165
|
},
|
166
166
|
"service": {
|
167
167
|
"system": "http://hl7.org/fhir/oralservicecodes",
|
@@ -213,7 +213,7 @@
|
|
213
213
|
{
|
214
214
|
"sequence": 2,
|
215
215
|
"type": {
|
216
|
-
"code": "
|
216
|
+
"code": "CSINV"
|
217
217
|
},
|
218
218
|
"provider": {
|
219
219
|
"reference": "Practitioner/example"
|
@@ -247,7 +247,7 @@
|
|
247
247
|
{
|
248
248
|
"sequence": 3,
|
249
249
|
"type": {
|
250
|
-
"code": "
|
250
|
+
"code": "CPNDDRGING"
|
251
251
|
},
|
252
252
|
"provider": {
|
253
253
|
"reference": "Practitioner/example"
|
@@ -275,7 +275,7 @@
|
|
275
275
|
{
|
276
276
|
"sequence": 1,
|
277
277
|
"type": {
|
278
|
-
"code": "
|
278
|
+
"code": "CSINV"
|
279
279
|
},
|
280
280
|
"service": {
|
281
281
|
"system": "http://hl7.org/fhir/oralservicecodes",
|
@@ -295,7 +295,7 @@
|
|
295
295
|
{
|
296
296
|
"sequence": 2,
|
297
297
|
"type": {
|
298
|
-
"code": "
|
298
|
+
"code": "CSINV"
|
299
299
|
},
|
300
300
|
"service": {
|
301
301
|
"system": "http://hl7.org/fhir/oralservicecodes",
|
@@ -58,7 +58,7 @@
|
|
58
58
|
{
|
59
59
|
"sequence": 1,
|
60
60
|
"type": {
|
61
|
-
"code": "
|
61
|
+
"code": "CPNDDRGING"
|
62
62
|
},
|
63
63
|
"provider": {
|
64
64
|
"reference": "Practitioner/example"
|
@@ -82,7 +82,7 @@
|
|
82
82
|
{
|
83
83
|
"sequence": 1,
|
84
84
|
"type": {
|
85
|
-
"code": "
|
85
|
+
"code": "CPINV"
|
86
86
|
},
|
87
87
|
"service": {
|
88
88
|
"system": "http://hl7.org/fhir/ex-visionservice",
|
@@ -102,7 +102,7 @@
|
|
102
102
|
{
|
103
103
|
"sequence": 2,
|
104
104
|
"type": {
|
105
|
-
"code": "
|
105
|
+
"code": "CPINV"
|
106
106
|
},
|
107
107
|
"service": {
|
108
108
|
"system": "http://hl7.org/fhir/ex-visionservice",
|
@@ -125,7 +125,7 @@
|
|
125
125
|
{
|
126
126
|
"sequence": 3,
|
127
127
|
"type": {
|
128
|
-
"code": "
|
128
|
+
"code": "VRXINV"
|
129
129
|
},
|
130
130
|
"service": {
|
131
131
|
"system": "http://hl7.org/fhir/ex-visionservice",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
<item>
|
61
61
|
<sequence value="1"/>
|
62
62
|
<type>
|
63
|
-
<code value="
|
63
|
+
<code value="CSINV"/>
|
64
64
|
</type>
|
65
65
|
<provider>
|
66
66
|
<reference value="Practitioner/example"/>
|
@@ -85,7 +85,7 @@
|
|
85
85
|
<item>
|
86
86
|
<sequence value="2"/>
|
87
87
|
<type>
|
88
|
-
<code value="
|
88
|
+
<code value="CSINV"/>
|
89
89
|
</type>
|
90
90
|
<provider>
|
91
91
|
<reference value="Practitioner/example"/>
|
@@ -118,7 +118,7 @@
|
|
118
118
|
<item>
|
119
119
|
<sequence value="3"/>
|
120
120
|
<type>
|
121
|
-
<code value="
|
121
|
+
<code value="DRUGING"/>
|
122
122
|
</type>
|
123
123
|
<provider>
|
124
124
|
<reference value="Practitioner/example"/>
|
@@ -145,7 +145,7 @@
|
|
145
145
|
<detail>
|
146
146
|
<sequence value="1"/>
|
147
147
|
<type>
|
148
|
-
<code value="
|
148
|
+
<code value="CSINV"/>
|
149
149
|
</type>
|
150
150
|
<service>
|
151
151
|
<system value="http://hl7.org/fhir/oralservicecodes"/>
|
@@ -165,7 +165,7 @@
|
|
165
165
|
<detail>
|
166
166
|
<sequence value="2"/>
|
167
167
|
<type>
|
168
|
-
<code value="
|
168
|
+
<code value="CSINV"/>
|
169
169
|
</type>
|
170
170
|
<service>
|
171
171
|
<system value="http://hl7.org/fhir/oralservicecodes"/>
|
@@ -189,7 +189,7 @@
|
|
189
189
|
<item>
|
190
190
|
<sequence value="2"/>
|
191
191
|
<type>
|
192
|
-
<code value="
|
192
|
+
<code value="CSINV"/>
|
193
193
|
</type>
|
194
194
|
<provider>
|
195
195
|
<reference value="Practitioner/example"/>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
<item>
|
223
223
|
<sequence value="3"/>
|
224
224
|
<type>
|
225
|
-
<code value="
|
225
|
+
<code value="DRUGING"/>
|
226
226
|
</type>
|
227
227
|
<provider>
|
228
228
|
<reference value="Practitioner/example"/>
|
@@ -249,7 +249,7 @@
|
|
249
249
|
<detail>
|
250
250
|
<sequence value="1"/>
|
251
251
|
<type>
|
252
|
-
<code value="
|
252
|
+
<code value="CSINV"/>
|
253
253
|
</type>
|
254
254
|
<service>
|
255
255
|
<system value="http://hl7.org/fhir/oralservicecodes"/>
|
@@ -269,7 +269,7 @@
|
|
269
269
|
<detail>
|
270
270
|
<sequence value="2"/>
|
271
271
|
<type>
|
272
|
-
<code value="
|
272
|
+
<code value="CSINV"/>
|
273
273
|
</type>
|
274
274
|
<service>
|
275
275
|
<system value="http://hl7.org/fhir/oralservicecodes"/>
|
@@ -64,7 +64,7 @@
|
|
64
64
|
<item>
|
65
65
|
<sequence value="1"/>
|
66
66
|
<type>
|
67
|
-
<code value="
|
67
|
+
<code value="DRUGING"/>
|
68
68
|
</type>
|
69
69
|
<provider>
|
70
70
|
<reference value="Practitioner/example"/>
|
@@ -87,7 +87,7 @@
|
|
87
87
|
<detail>
|
88
88
|
<sequence value="1"/>
|
89
89
|
<type>
|
90
|
-
<code value="
|
90
|
+
<code value="CPINV"/>
|
91
91
|
</type>
|
92
92
|
<service>
|
93
93
|
<system value="http://hl7.org/fhir/ex-visionservice"/>
|
@@ -107,7 +107,7 @@
|
|
107
107
|
<detail>
|
108
108
|
<sequence value="2"/>
|
109
109
|
<type>
|
110
|
-
<code value="
|
110
|
+
<code value="CPINV"/>
|
111
111
|
</type>
|
112
112
|
<service>
|
113
113
|
<system value="http://hl7.org/fhir/ex-visionservice"/>
|
@@ -130,7 +130,7 @@
|
|
130
130
|
<detail>
|
131
131
|
<sequence value="3"/>
|
132
132
|
<type>
|
133
|
-
<code value="
|
133
|
+
<code value="CPINV"/>
|
134
134
|
</type>
|
135
135
|
<service>
|
136
136
|
<system value="http://hl7.org/fhir/ex-visionservice"/>
|
@@ -26,6 +26,10 @@ module FHIR
|
|
26
26
|
@vs_validators.delete valueset_uri
|
27
27
|
end
|
28
28
|
|
29
|
+
def self.clear_all_validates_vs
|
30
|
+
@vs_validators = {}
|
31
|
+
end
|
32
|
+
|
29
33
|
def validates_resource?(resource)
|
30
34
|
validate_resource(resource).empty?
|
31
35
|
end
|
@@ -204,8 +208,7 @@ module FHIR
|
|
204
208
|
elsif data_type_found == 'CodeableConcept' && codeable_concept_binding
|
205
209
|
binding_issues =
|
206
210
|
if element.binding.strength == 'extensible'
|
207
|
-
|
208
|
-
@errors
|
211
|
+
@warnings
|
209
212
|
elsif element.binding.strength == 'required'
|
210
213
|
@errors
|
211
214
|
else # e.g., example-strength or unspecified
|
@@ -213,16 +216,26 @@ module FHIR
|
|
213
216
|
end
|
214
217
|
|
215
218
|
valueset_uri = element.binding && element.binding.valueSetReference && element.binding.valueSetReference.reference
|
219
|
+
vcc = FHIR::DSTU2::CodeableConcept.new(value)
|
216
220
|
if valueset_uri && self.class.vs_validators[valueset_uri]
|
217
221
|
check_fn = self.class.vs_validators[valueset_uri]
|
218
|
-
vcc = FHIR::DSTU2::CodeableConcept.new(value)
|
219
|
-
|
220
222
|
has_valid_code = vcc.coding && vcc.coding.any? { |c| check_fn.call(c) }
|
221
223
|
|
222
224
|
unless has_valid_code
|
223
225
|
binding_issues << "#{describe_element(element)} has no codings from #{valueset_uri}. Codings evaluated: #{vcc.to_json}"
|
224
226
|
end
|
225
227
|
end
|
228
|
+
|
229
|
+
unless has_valid_code
|
230
|
+
vcc.coding.each do |c|
|
231
|
+
check_fn = self.class.vs_validators[c.system]
|
232
|
+
if check_fn && check_fn.call(c)
|
233
|
+
binding_issues << "#{describe_element(element)} has no codings from it's specified system: #{c.system}. "\
|
234
|
+
"Codings evaluated: #{vcc.to_json}"
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
226
239
|
elsif data_type_found == 'String' && !element.maxLength.nil? && (value.size > element.maxLength)
|
227
240
|
@errors << "#{describe_element(element)} exceed maximum length of #{element.maxLength}: #{value}"
|
228
241
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fhir_dstu2_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
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: 2019-02-
|
14
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: nokogiri
|