uds_plus_test_kit 0.9.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uds_plus_test_kit/examples/condition.ndjson +1 -0
- data/lib/uds_plus_test_kit/examples/encounter.ndjson +1 -0
- data/lib/uds_plus_test_kit/examples/invalid_condition.ndjson +1 -0
- data/lib/uds_plus_test_kit/examples/invalid_encounter.ndjson +1 -0
- data/lib/uds_plus_test_kit/examples/invalid_patient.ndjson +2 -0
- data/lib/uds_plus_test_kit/examples/manifest.json +76 -14
- data/lib/uds_plus_test_kit/examples/observation.ndjson +3 -0
- data/lib/uds_plus_test_kit/examples/patient.ndjson +2 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_immunization_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_lab_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_med_request_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_med_statement_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_related_person_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_service_request_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/read_special_observation_test.rb +54 -0
- data/lib/uds_plus_test_kit/input_resource_tests/resource_group.rb +30 -2
- data/lib/uds_plus_test_kit/manifest_tests/invalid_type_test.rb +4 -1
- data/lib/uds_plus_test_kit/manifest_tests/uds_plus_test_group.rb +16 -2
- data/lib/uds_plus_test_kit/post_tests/post_group.rb +59 -0
- data/lib/uds_plus_test_kit/post_tests/post_manifest_test.rb +41 -0
- data/lib/uds_plus_test_kit/post_tests/read_post_test.rb +32 -0
- data/lib/uds_plus_test_kit/uds_plus_test_suite.rb +40 -0
- data/lib/uds_plus_test_kit/validate_immunization_test.rb +33 -0
- data/lib/uds_plus_test_kit/validate_income_test.rb +7 -10
- data/lib/uds_plus_test_kit/validate_lab_test.rb +65 -0
- data/lib/uds_plus_test_kit/validate_med_request_test.rb +33 -0
- data/lib/uds_plus_test_kit/validate_med_statement_test.rb +33 -0
- data/lib/uds_plus_test_kit/validate_related_person_test.rb +33 -0
- data/lib/uds_plus_test_kit/validate_service_request_test.rb +33 -0
- data/lib/uds_plus_test_kit/validate_sexual_orientation_test.rb +6 -9
- data/lib/uds_plus_test_kit/validate_special_observation_test.rb +65 -0
- data/lib/uds_plus_test_kit/version.rb +2 -2
- metadata +26 -4
- data/lib/uds_plus_test_kit/examples/manifest_2.json +0 -101
- data/lib/uds_plus_test_kit/examples/manifest_not_deidentified.json +0 -67
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative './version'
|
3
|
+
|
4
|
+
module UDSPlusTestKit
|
5
|
+
class ValidateSpecialObservationTest < Inferno::Test
|
6
|
+
id :uds_plus_validate_special_observation_test
|
7
|
+
title 'Validate UDS+ Special Observation Data'
|
8
|
+
description %(
|
9
|
+
Test takes the Special Observation resources identified
|
10
|
+
(such as uds-special-population-observation) by the import
|
11
|
+
manifest, and validates whether they conform to their
|
12
|
+
UDS+ Structure Definitions.
|
13
|
+
)
|
14
|
+
|
15
|
+
def data_scratch
|
16
|
+
scratch[:data_resources] ||= {}
|
17
|
+
end
|
18
|
+
|
19
|
+
def data_to_test
|
20
|
+
data_scratch['Observation'] ||= []
|
21
|
+
end
|
22
|
+
|
23
|
+
run do
|
24
|
+
omit_if data_to_test.empty?, "No data of this type was identified."
|
25
|
+
|
26
|
+
no_resource_of_this_type = true
|
27
|
+
identifier_fail_message = %(Resource.meta.profile should contain the HTTP location of the
|
28
|
+
resource's Structure Definition. Resource.meta.profile either does
|
29
|
+
not exist in this resource, or its contents do not point to a valid
|
30
|
+
location for type Observation. **NOTE:**
|
31
|
+
If this error occurs, it can trigger a fail for all observation-type tests,
|
32
|
+
regardless of whether both tests were meant to run.)
|
33
|
+
|
34
|
+
data_to_test.each do |resource|
|
35
|
+
# All these assertions are to differentaite Observation data between orientation types.
|
36
|
+
# A resource is skipped if it is one of the observation types with their own tests.
|
37
|
+
type_identifier = resource.to_hash
|
38
|
+
assert type_identifier['meta'].present?, identifier_fail_message
|
39
|
+
|
40
|
+
type_identifier = type_identifier['meta']
|
41
|
+
assert type_identifier.is_a?(Hash), identifier_fail_message
|
42
|
+
assert type_identifier['profile'].present?, identifier_fail_message
|
43
|
+
|
44
|
+
type_identifier = type_identifier['profile']
|
45
|
+
assert type_identifier.is_a?(Array), identifier_fail_message
|
46
|
+
assert !type_identifier.empty?, identifier_fail_message
|
47
|
+
|
48
|
+
|
49
|
+
type_identifier = type_identifier.first
|
50
|
+
assert type_identifier.is_a?(String), identifier_fail_message
|
51
|
+
if type_identifier.include?("income") || type_identifier.include?("sexual-orientation") || type_identifier.include?("-lab-")
|
52
|
+
next
|
53
|
+
else
|
54
|
+
assert type_identifier.downcase.include?("observation"), identifier_fail_message
|
55
|
+
end
|
56
|
+
|
57
|
+
no_resource_of_this_type = false
|
58
|
+
|
59
|
+
assert_valid_resource(resource: resource)
|
60
|
+
end
|
61
|
+
|
62
|
+
omit_if no_resource_of_this_type, "No data of this type was identified."
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uds_plus_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leap Orbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -89,31 +89,53 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- LICENSE
|
91
91
|
- lib/uds_plus_test_kit.rb
|
92
|
+
- lib/uds_plus_test_kit/examples/condition.ndjson
|
93
|
+
- lib/uds_plus_test_kit/examples/encounter.ndjson
|
94
|
+
- lib/uds_plus_test_kit/examples/invalid_condition.ndjson
|
95
|
+
- lib/uds_plus_test_kit/examples/invalid_encounter.ndjson
|
96
|
+
- lib/uds_plus_test_kit/examples/invalid_patient.ndjson
|
92
97
|
- lib/uds_plus_test_kit/examples/manifest.json
|
93
|
-
- lib/uds_plus_test_kit/examples/
|
94
|
-
- lib/uds_plus_test_kit/examples/
|
98
|
+
- lib/uds_plus_test_kit/examples/observation.ndjson
|
99
|
+
- lib/uds_plus_test_kit/examples/patient.ndjson
|
95
100
|
- lib/uds_plus_test_kit/input_resource_tests/read_coverage_test.rb
|
96
101
|
- lib/uds_plus_test_kit/input_resource_tests/read_diagnosis_test.rb
|
97
102
|
- lib/uds_plus_test_kit/input_resource_tests/read_encounter_test.rb
|
103
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_immunization_test.rb
|
98
104
|
- lib/uds_plus_test_kit/input_resource_tests/read_income_test.rb
|
105
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_lab_test.rb
|
99
106
|
- lib/uds_plus_test_kit/input_resource_tests/read_manifest_ind_test.rb
|
107
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_med_request_test.rb
|
108
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_med_statement_test.rb
|
100
109
|
- lib/uds_plus_test_kit/input_resource_tests/read_patient_test.rb
|
101
110
|
- lib/uds_plus_test_kit/input_resource_tests/read_procedure_test.rb
|
111
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_related_person_test.rb
|
112
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_service_request_test.rb
|
102
113
|
- lib/uds_plus_test_kit/input_resource_tests/read_sexual_orientation_test.rb
|
114
|
+
- lib/uds_plus_test_kit/input_resource_tests/read_special_observation_test.rb
|
103
115
|
- lib/uds_plus_test_kit/input_resource_tests/resource_group.rb
|
104
116
|
- lib/uds_plus_test_kit/manifest_tests/invalid_type_test.rb
|
105
117
|
- lib/uds_plus_test_kit/manifest_tests/read_data_test.rb
|
106
118
|
- lib/uds_plus_test_kit/manifest_tests/read_manifest_test.rb
|
107
119
|
- lib/uds_plus_test_kit/manifest_tests/uds_plus_test_group.rb
|
108
120
|
- lib/uds_plus_test_kit/manifest_tests/validate_manifest_test.rb
|
121
|
+
- lib/uds_plus_test_kit/post_tests/post_group.rb
|
122
|
+
- lib/uds_plus_test_kit/post_tests/post_manifest_test.rb
|
123
|
+
- lib/uds_plus_test_kit/post_tests/read_post_test.rb
|
109
124
|
- lib/uds_plus_test_kit/uds_plus_test_suite.rb
|
110
125
|
- lib/uds_plus_test_kit/validate_coverage_test.rb
|
111
126
|
- lib/uds_plus_test_kit/validate_diagnosis_test.rb
|
112
127
|
- lib/uds_plus_test_kit/validate_encounter_test.rb
|
128
|
+
- lib/uds_plus_test_kit/validate_immunization_test.rb
|
113
129
|
- lib/uds_plus_test_kit/validate_income_test.rb
|
130
|
+
- lib/uds_plus_test_kit/validate_lab_test.rb
|
131
|
+
- lib/uds_plus_test_kit/validate_med_request_test.rb
|
132
|
+
- lib/uds_plus_test_kit/validate_med_statement_test.rb
|
114
133
|
- lib/uds_plus_test_kit/validate_patient_test.rb
|
115
134
|
- lib/uds_plus_test_kit/validate_procedure_test.rb
|
135
|
+
- lib/uds_plus_test_kit/validate_related_person_test.rb
|
136
|
+
- lib/uds_plus_test_kit/validate_service_request_test.rb
|
116
137
|
- lib/uds_plus_test_kit/validate_sexual_orientation_test.rb
|
138
|
+
- lib/uds_plus_test_kit/validate_special_observation_test.rb
|
117
139
|
- lib/uds_plus_test_kit/version.rb
|
118
140
|
homepage: https://github.com/inferno-framework/uds-plus-test-kit
|
119
141
|
licenses:
|
@@ -1,101 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"resourceType": "Parameters",
|
3
|
-
"id": "example",
|
4
|
-
"meta": {
|
5
|
-
"extension": [
|
6
|
-
{
|
7
|
-
"url": "http://hl7.org/fhir/StructureDefinition/instance-name",
|
8
|
-
"valueString": "UDS+ Manifest File Example"
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"url": "http://hl7.org/fhir/StructureDefinition/instance-description",
|
12
|
-
"valueMarkdown": "This is an example of a Manifest file submitted as a parameter to the UDS+ $import operation."
|
13
|
-
}
|
14
|
-
],
|
15
|
-
"profile": [
|
16
|
-
"http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-import-manifest"
|
17
|
-
]
|
18
|
-
},
|
19
|
-
"parameter": [
|
20
|
-
{
|
21
|
-
"name": "inputFormat",
|
22
|
-
"valueCode": "application/ndjson"
|
23
|
-
},
|
24
|
-
{
|
25
|
-
"name": "inputSource",
|
26
|
-
"valueUrl": "http://localhost:4567/"
|
27
|
-
},
|
28
|
-
{
|
29
|
-
"name": "storageDetail",
|
30
|
-
"valueCode": "https"
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"name": "udsData",
|
34
|
-
"part": [
|
35
|
-
{
|
36
|
-
"name": "type",
|
37
|
-
"valueCode": "Patient"
|
38
|
-
},
|
39
|
-
{
|
40
|
-
"name": "url",
|
41
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/patient"
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"name": "expirationTime",
|
45
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
46
|
-
}
|
47
|
-
]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"name": "udsData",
|
51
|
-
"part": [
|
52
|
-
{
|
53
|
-
"name": "type",
|
54
|
-
"valueCode": "Condition"
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"name": "url",
|
58
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/condition"
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"name": "expirationTime",
|
62
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
63
|
-
}
|
64
|
-
]
|
65
|
-
},
|
66
|
-
{
|
67
|
-
"name": "udsData",
|
68
|
-
"part": [
|
69
|
-
{
|
70
|
-
"name": "type",
|
71
|
-
"valueCode": "Encounter"
|
72
|
-
},
|
73
|
-
{
|
74
|
-
"name": "url",
|
75
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/encounter"
|
76
|
-
},
|
77
|
-
{
|
78
|
-
"name": "expirationTime",
|
79
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
80
|
-
}
|
81
|
-
]
|
82
|
-
},
|
83
|
-
{
|
84
|
-
"name": "udsData",
|
85
|
-
"part": [
|
86
|
-
{
|
87
|
-
"name": "type",
|
88
|
-
"valueCode": "Condition"
|
89
|
-
},
|
90
|
-
{
|
91
|
-
"name": "url",
|
92
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/condition"
|
93
|
-
},
|
94
|
-
{
|
95
|
-
"name": "expirationTime",
|
96
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
97
|
-
}
|
98
|
-
]
|
99
|
-
}
|
100
|
-
]
|
101
|
-
}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"resourceType": "Parameters",
|
3
|
-
"id": "example",
|
4
|
-
"meta": {
|
5
|
-
"extension": [
|
6
|
-
{
|
7
|
-
"url": "http://hl7.org/fhir/StructureDefinition/instance-name",
|
8
|
-
"valueString": "UDS+ Manifest File Example"
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"url": "http://hl7.org/fhir/StructureDefinition/instance-description",
|
12
|
-
"valueMarkdown": "This is an example of a Manifest file submitted as a parameter to the UDS+ $import operation."
|
13
|
-
}
|
14
|
-
],
|
15
|
-
"profile": [
|
16
|
-
"http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-import-manifest"
|
17
|
-
]
|
18
|
-
},
|
19
|
-
"parameter": [
|
20
|
-
{
|
21
|
-
"name": "inputFormat",
|
22
|
-
"valueCode": "application/ndjson"
|
23
|
-
},
|
24
|
-
{
|
25
|
-
"name": "inputSource",
|
26
|
-
"valueUrl": "http://localhost:4567/"
|
27
|
-
},
|
28
|
-
{
|
29
|
-
"name": "storageDetail",
|
30
|
-
"valueCode": "https"
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"name": "udsData",
|
34
|
-
"part": [
|
35
|
-
{
|
36
|
-
"name": "type",
|
37
|
-
"valueCode": "Patient"
|
38
|
-
},
|
39
|
-
{
|
40
|
-
"name": "url",
|
41
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/invalid_patient"
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"name": "expirationTime",
|
45
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
46
|
-
}
|
47
|
-
]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"name": "udsData",
|
51
|
-
"part": [
|
52
|
-
{
|
53
|
-
"name": "type",
|
54
|
-
"valueCode": "Condition"
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"name": "url",
|
58
|
-
"valueUrl": "http://localhost:4567/custom/uds_plus/examples/invalid_condition"
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"name": "expirationTime",
|
62
|
-
"valueDateTime": "2022-12-14T07:15:07-08:00"
|
63
|
-
}
|
64
|
-
]
|
65
|
-
}
|
66
|
-
]
|
67
|
-
}
|