us_core_test_kit 0.4.5 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/us_core_test_kit/fhir_resource_navigation.rb +9 -3
- data/lib/us_core_test_kit/generated/v3.1.1/metadata.yml +9 -1
- data/lib/us_core_test_kit/generated/v3.1.1/patient/metadata.yml +9 -1
- data/lib/us_core_test_kit/generated/v3.1.1/patient/patient_must_support_test.rb +5 -1
- data/lib/us_core_test_kit/generated/v4.0.0/device/metadata.yml +0 -2
- data/lib/us_core_test_kit/generated/v4.0.0/device_group.rb +0 -2
- data/lib/us_core_test_kit/generated/v4.0.0/medication_request/medication_request_reference_resolution_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/medication_request/metadata.yml +1 -1
- data/lib/us_core_test_kit/generated/v4.0.0/metadata.yml +10 -4
- data/lib/us_core_test_kit/generated/v4.0.0/patient/metadata.yml +9 -3
- data/lib/us_core_test_kit/generated/v4.0.0/patient/patient_must_support_test.rb +2 -2
- data/lib/us_core_test_kit/generated/v5.0.1/condition_encounter_diagnosis/metadata.yml +4 -4
- data/lib/us_core_test_kit/generated/v5.0.1/condition_problems_health_concerns/metadata.yml +4 -4
- data/lib/us_core_test_kit/generated/v5.0.1/device/metadata.yml +0 -2
- data/lib/us_core_test_kit/generated/v5.0.1/device_group.rb +0 -2
- data/lib/us_core_test_kit/generated/v5.0.1/medication_request/medication_request_reference_resolution_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v5.0.1/medication_request/metadata.yml +1 -1
- data/lib/us_core_test_kit/generated/v5.0.1/metadata.yml +23 -12
- data/lib/us_core_test_kit/generated/v5.0.1/patient/metadata.yml +9 -3
- data/lib/us_core_test_kit/generated/v5.0.1/patient/patient_must_support_test.rb +2 -4
- data/lib/us_core_test_kit/generated/v5.0.1/service_request/metadata.yml +5 -0
- data/lib/us_core_test_kit/generator/group_generator.rb +0 -5
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor.rb +7 -167
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_3.rb +62 -0
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_4.rb +110 -0
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_5.rb +113 -0
- data/lib/us_core_test_kit/generator/search_definition_metadata_extractor.rb +52 -4
- data/lib/us_core_test_kit/generator.rb +1 -1
- data/lib/us_core_test_kit/igs/us_core_501/StructureDefinition-condition-assertedDate.json +280 -0
- data/lib/us_core_test_kit/search_test.rb +1 -1
- data/lib/us_core_test_kit/version.rb +1 -1
- data/lib/us_core_test_kit.rb +0 -1
- metadata +6 -4
- data/lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb +0 -40
- data/lib/us_core_test_kit/ext/fhir_models.rb +0 -59
@@ -0,0 +1,280 @@
|
|
1
|
+
{
|
2
|
+
"resourceType": "StructureDefinition",
|
3
|
+
"id": "condition-assertedDate",
|
4
|
+
"extension": [
|
5
|
+
{
|
6
|
+
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
|
7
|
+
"valueCode": "pc"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
|
11
|
+
"valueInteger": 1
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate",
|
15
|
+
"version": "4.0.1",
|
16
|
+
"name": "assertedDate",
|
17
|
+
"title": "assertedDate",
|
18
|
+
"status": "draft",
|
19
|
+
"date": "2015-02-21",
|
20
|
+
"publisher": "Health Level Seven, Inc. - FHIR WG",
|
21
|
+
"contact": [
|
22
|
+
{
|
23
|
+
"telecom": [
|
24
|
+
{
|
25
|
+
"system": "url",
|
26
|
+
"value": "HL7"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
],
|
31
|
+
"description": "The date on which the existence of the Condition was first asserted or acknowledged.",
|
32
|
+
"fhirVersion": "4.0.1",
|
33
|
+
"mapping": [
|
34
|
+
{
|
35
|
+
"identity": "rim",
|
36
|
+
"uri": "http://hl7.org/v3",
|
37
|
+
"name": "RIM Mapping"
|
38
|
+
}
|
39
|
+
],
|
40
|
+
"kind": "complex-type",
|
41
|
+
"abstract": false,
|
42
|
+
"context": [
|
43
|
+
{
|
44
|
+
"type": "element",
|
45
|
+
"expression": "Condition"
|
46
|
+
}
|
47
|
+
],
|
48
|
+
"type": "Extension",
|
49
|
+
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
|
50
|
+
"derivation": "constraint",
|
51
|
+
"snapshot": {
|
52
|
+
"element": [
|
53
|
+
{
|
54
|
+
"id": "Extension",
|
55
|
+
"path": "Extension",
|
56
|
+
"short": "Date the condition was first asserted",
|
57
|
+
"definition": "The date on which the existence of the Condition was first asserted or acknowledged.",
|
58
|
+
"comment": "The assertedDate is in the context of the recording practitioner and might not be the same as the recordedDate.",
|
59
|
+
"min": 0,
|
60
|
+
"max": "1",
|
61
|
+
"base": {
|
62
|
+
"path": "Extension",
|
63
|
+
"min": 0,
|
64
|
+
"max": "*"
|
65
|
+
},
|
66
|
+
"condition": [
|
67
|
+
"ele-1"
|
68
|
+
],
|
69
|
+
"constraint": [
|
70
|
+
{
|
71
|
+
"key": "ele-1",
|
72
|
+
"severity": "error",
|
73
|
+
"human": "All FHIR elements must have a @value or children",
|
74
|
+
"expression": "hasValue() or (children().count() > id.count())",
|
75
|
+
"xpath": "@value|f:*|h:div",
|
76
|
+
"source": "http://hl7.org/fhir/StructureDefinition/Element"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"key": "ext-1",
|
80
|
+
"severity": "error",
|
81
|
+
"human": "Must have either extensions or value[x], not both",
|
82
|
+
"expression": "extension.exists() != value.exists()",
|
83
|
+
"xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])",
|
84
|
+
"source": "http://hl7.org/fhir/StructureDefinition/Extension"
|
85
|
+
}
|
86
|
+
],
|
87
|
+
"isModifier": false
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"id": "Extension.id",
|
91
|
+
"path": "Extension.id",
|
92
|
+
"representation": [
|
93
|
+
"xmlAttr"
|
94
|
+
],
|
95
|
+
"short": "Unique id for inter-element referencing",
|
96
|
+
"definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
|
97
|
+
"min": 0,
|
98
|
+
"max": "1",
|
99
|
+
"base": {
|
100
|
+
"path": "Element.id",
|
101
|
+
"min": 0,
|
102
|
+
"max": "1"
|
103
|
+
},
|
104
|
+
"type": [
|
105
|
+
{
|
106
|
+
"extension": [
|
107
|
+
{
|
108
|
+
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
|
109
|
+
"valueUrl": "string"
|
110
|
+
}
|
111
|
+
],
|
112
|
+
"code": "http://hl7.org/fhirpath/System.String"
|
113
|
+
}
|
114
|
+
],
|
115
|
+
"isModifier": false,
|
116
|
+
"isSummary": false,
|
117
|
+
"mapping": [
|
118
|
+
{
|
119
|
+
"identity": "rim",
|
120
|
+
"map": "n/a"
|
121
|
+
}
|
122
|
+
]
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"id": "Extension.extension",
|
126
|
+
"path": "Extension.extension",
|
127
|
+
"slicing": {
|
128
|
+
"discriminator": [
|
129
|
+
{
|
130
|
+
"type": "value",
|
131
|
+
"path": "url"
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"description": "Extensions are always sliced by (at least) url",
|
135
|
+
"rules": "open"
|
136
|
+
},
|
137
|
+
"short": "Extension",
|
138
|
+
"definition": "An Extension",
|
139
|
+
"min": 0,
|
140
|
+
"max": "0",
|
141
|
+
"base": {
|
142
|
+
"path": "Element.extension",
|
143
|
+
"min": 0,
|
144
|
+
"max": "*"
|
145
|
+
},
|
146
|
+
"type": [
|
147
|
+
{
|
148
|
+
"code": "Extension"
|
149
|
+
}
|
150
|
+
],
|
151
|
+
"constraint": [
|
152
|
+
{
|
153
|
+
"key": "ele-1",
|
154
|
+
"severity": "error",
|
155
|
+
"human": "All FHIR elements must have a @value or children",
|
156
|
+
"expression": "hasValue() or (children().count() > id.count())",
|
157
|
+
"xpath": "@value|f:*|h:div",
|
158
|
+
"source": "http://hl7.org/fhir/StructureDefinition/Element"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
"key": "ext-1",
|
162
|
+
"severity": "error",
|
163
|
+
"human": "Must have either extensions or value[x], not both",
|
164
|
+
"expression": "extension.exists() != value.exists()",
|
165
|
+
"xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
|
166
|
+
"source": "http://hl7.org/fhir/StructureDefinition/Extension"
|
167
|
+
}
|
168
|
+
],
|
169
|
+
"isModifier": false,
|
170
|
+
"isSummary": false
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"id": "Extension.url",
|
174
|
+
"path": "Extension.url",
|
175
|
+
"representation": [
|
176
|
+
"xmlAttr"
|
177
|
+
],
|
178
|
+
"short": "identifies the meaning of the extension",
|
179
|
+
"definition": "Source of the definition for the extension code - a logical name or a URL.",
|
180
|
+
"comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
|
181
|
+
"min": 1,
|
182
|
+
"max": "1",
|
183
|
+
"base": {
|
184
|
+
"path": "Extension.url",
|
185
|
+
"min": 1,
|
186
|
+
"max": "1"
|
187
|
+
},
|
188
|
+
"type": [
|
189
|
+
{
|
190
|
+
"extension": [
|
191
|
+
{
|
192
|
+
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
|
193
|
+
"valueUrl": "uri"
|
194
|
+
}
|
195
|
+
],
|
196
|
+
"code": "http://hl7.org/fhirpath/System.String"
|
197
|
+
}
|
198
|
+
],
|
199
|
+
"fixedUri": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate",
|
200
|
+
"isModifier": false,
|
201
|
+
"isSummary": false,
|
202
|
+
"mapping": [
|
203
|
+
{
|
204
|
+
"identity": "rim",
|
205
|
+
"map": "N/A"
|
206
|
+
}
|
207
|
+
]
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"id": "Extension.value[x]",
|
211
|
+
"path": "Extension.value[x]",
|
212
|
+
"short": "Value of extension",
|
213
|
+
"definition": "Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/extensibility.html) for a list).",
|
214
|
+
"min": 1,
|
215
|
+
"max": "1",
|
216
|
+
"base": {
|
217
|
+
"path": "Extension.value[x]",
|
218
|
+
"min": 0,
|
219
|
+
"max": "1"
|
220
|
+
},
|
221
|
+
"type": [
|
222
|
+
{
|
223
|
+
"code": "dateTime"
|
224
|
+
}
|
225
|
+
],
|
226
|
+
"constraint": [
|
227
|
+
{
|
228
|
+
"key": "ele-1",
|
229
|
+
"severity": "error",
|
230
|
+
"human": "All FHIR elements must have a @value or children",
|
231
|
+
"expression": "hasValue() or (children().count() > id.count())",
|
232
|
+
"xpath": "@value|f:*|h:div",
|
233
|
+
"source": "http://hl7.org/fhir/StructureDefinition/Element"
|
234
|
+
}
|
235
|
+
],
|
236
|
+
"isModifier": false,
|
237
|
+
"isSummary": false,
|
238
|
+
"mapping": [
|
239
|
+
{
|
240
|
+
"identity": "rim",
|
241
|
+
"map": "N/A"
|
242
|
+
}
|
243
|
+
]
|
244
|
+
}
|
245
|
+
]
|
246
|
+
},
|
247
|
+
"differential": {
|
248
|
+
"element": [
|
249
|
+
{
|
250
|
+
"id": "Extension",
|
251
|
+
"path": "Extension",
|
252
|
+
"short": "Date the condition was first asserted",
|
253
|
+
"definition": "The date on which the existence of the Condition was first asserted or acknowledged.",
|
254
|
+
"comment": "The assertedDate is in the context of the recording practitioner and might not be the same as the recordedDate.",
|
255
|
+
"min": 0,
|
256
|
+
"max": "1"
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"id": "Extension.extension",
|
260
|
+
"path": "Extension.extension",
|
261
|
+
"max": "0"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"id": "Extension.url",
|
265
|
+
"path": "Extension.url",
|
266
|
+
"fixedUri": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"id": "Extension.value[x]",
|
270
|
+
"path": "Extension.value[x]",
|
271
|
+
"min": 1,
|
272
|
+
"type": [
|
273
|
+
{
|
274
|
+
"code": "dateTime"
|
275
|
+
}
|
276
|
+
]
|
277
|
+
}
|
278
|
+
]
|
279
|
+
}
|
280
|
+
}
|
data/lib/us_core_test_kit.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: us_core_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -115,11 +115,9 @@ files:
|
|
115
115
|
- lib/us_core_test_kit/custom_groups/v3.1.1/clinical_notes_guidance_group.rb
|
116
116
|
- lib/us_core_test_kit/custom_groups/v4.0.0/capability_statement_group.rb
|
117
117
|
- lib/us_core_test_kit/custom_groups/v4.0.0/clinical_notes_guidance_group.rb
|
118
|
-
- lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
|
119
118
|
- lib/us_core_test_kit/custom_groups/v4.0.0/document_reference_custodian_test.rb
|
120
119
|
- lib/us_core_test_kit/custom_groups/v5.0.1/capability_statement_group.rb
|
121
120
|
- lib/us_core_test_kit/date_search_validation.rb
|
122
|
-
- lib/us_core_test_kit/ext/fhir_models.rb
|
123
121
|
- lib/us_core_test_kit/fhir_resource_navigation.rb
|
124
122
|
- lib/us_core_test_kit/generated/v3.1.1/allergy_intolerance/allergy_intolerance_must_support_test.rb
|
125
123
|
- lib/us_core_test_kit/generated/v3.1.1/allergy_intolerance/allergy_intolerance_patient_clinical_status_search_test.rb
|
@@ -1279,6 +1277,9 @@ files:
|
|
1279
1277
|
- lib/us_core_test_kit/generator/ig_metadata_extractor.rb
|
1280
1278
|
- lib/us_core_test_kit/generator/ig_resources.rb
|
1281
1279
|
- lib/us_core_test_kit/generator/must_support_metadata_extractor.rb
|
1280
|
+
- lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_3.rb
|
1281
|
+
- lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_4.rb
|
1282
|
+
- lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_5.rb
|
1282
1283
|
- lib/us_core_test_kit/generator/must_support_test_generator.rb
|
1283
1284
|
- lib/us_core_test_kit/generator/naming.rb
|
1284
1285
|
- lib/us_core_test_kit/generator/provenance_revinclude_search_test_generator.rb
|
@@ -1302,6 +1303,7 @@ files:
|
|
1302
1303
|
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-resprate.json
|
1303
1304
|
- lib/us_core_test_kit/igs/us_core_400.tgz
|
1304
1305
|
- lib/us_core_test_kit/igs/us_core_501.tgz
|
1306
|
+
- lib/us_core_test_kit/igs/us_core_501/StructureDefinition-condition-assertedDate.json
|
1305
1307
|
- lib/us_core_test_kit/must_support_test.rb
|
1306
1308
|
- lib/us_core_test_kit/provenance_validator.rb
|
1307
1309
|
- lib/us_core_test_kit/read_test.rb
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module USCoreTestKit
|
2
|
-
module USCoreV400
|
3
|
-
class DeviceUdiPiTest < Inferno::Test
|
4
|
-
id :us_core_v400_device_udi_pi_test
|
5
|
-
title 'Device resources returned during previous tests have UDI-PI elements'
|
6
|
-
description %(
|
7
|
-
This test verifies implantable medical devices that have UDI information represent all of the UDI-PI elements that are present in the UDI code
|
8
|
-
in the corresponding US Core Implantable Device Profile element.
|
9
|
-
)
|
10
|
-
|
11
|
-
def scratch_resources
|
12
|
-
scratch[:device_resources] ||= {}
|
13
|
-
end
|
14
|
-
|
15
|
-
run do
|
16
|
-
resources = scratch_resources[:all] || []
|
17
|
-
|
18
|
-
skip_if resources.blank?,
|
19
|
-
'No Devices resources appear to be available. ' \
|
20
|
-
'Please use patients with more information.'
|
21
|
-
|
22
|
-
resources.each do |device|
|
23
|
-
if device.udiCarrier&.first&.carrierHRF.present? &&
|
24
|
-
!(
|
25
|
-
device.manufactureDate.present? ||
|
26
|
-
device.expirationDate.present? ||
|
27
|
-
device.lotNumber.present? ||
|
28
|
-
device.serialNumber.present? ||
|
29
|
-
device.distinctIdentifier.present?
|
30
|
-
)
|
31
|
-
add_message('error',
|
32
|
-
"Device/#{device.id} has UDI information but does not have any UDI-PI elements presented")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
assert messages.blank?, "Resource has UDI information but does not have any UDI-PI elements presented"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
# Extension to FHIR::Model. Prepending this into FHIR::Model (done below)
|
4
|
-
# allows us to call super() on initialize when we overriding it,
|
5
|
-
# while also defining new methods and attributes
|
6
|
-
module InfernoFHIRModelExtensions
|
7
|
-
attr_accessor :source_hash, :source_text
|
8
|
-
|
9
|
-
def initialize(hash = {})
|
10
|
-
super(hash)
|
11
|
-
@source_hash = hash
|
12
|
-
end
|
13
|
-
|
14
|
-
def source_contents
|
15
|
-
@source_text || JSON.generate(@source_hash)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
module FHIR
|
20
|
-
class Model
|
21
|
-
prepend ::InfernoFHIRModelExtensions
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# Extension to FHIR::Json. Prepending this into FHIR::Json (done below)
|
26
|
-
# allows us to call super() on from_json
|
27
|
-
module InfernoJson
|
28
|
-
def from_json(json)
|
29
|
-
resource = super(json)
|
30
|
-
resource.source_text = json
|
31
|
-
resource
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Extension to FHIR::Xml. Prepending this into FHIR::Xml (done below)
|
36
|
-
# allows us to call super() on from_xml
|
37
|
-
module InfernoXml
|
38
|
-
def from_xml(xml)
|
39
|
-
resource = super(xml)
|
40
|
-
resource.source_text = xml
|
41
|
-
resource
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
module FHIR
|
46
|
-
module Json
|
47
|
-
class << self
|
48
|
-
prepend InfernoJson
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
module FHIR
|
54
|
-
module Xml
|
55
|
-
class << self
|
56
|
-
prepend InfernoXml
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|