davinci_pdex_test_kit 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/presets/pdex_payer_client_postman_preset.json.erb +67 -0
- data/config/presets/pdex_payer_server_fhir_foundry_ri_preset.json +2 -2
- data/config/presets/pdex_payer_server_inferno_ri_preset.json +2 -2
- data/lib/davinci_pdex_test_kit/docs/payer_client_suite_description_v200.md +124 -32
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_auth_smart_alca_group.rb +32 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_auth_smart_alcs_group.rb +32 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_auth_smart_alp_group.rb +32 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_auth_udap_group.rb +31 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_validation_test.rb +7 -6
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_registration/configuration_display_smart_test.rb +38 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_registration/configuration_display_udap_test.rb +38 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_registration_group.rb +67 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb +10 -2
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_workflow_interaction_test.rb +43 -12
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/allergyintolerance_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careplan_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careteam_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/condition_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/device_clinical_data_request_test.rb +1 -2
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/diagnosticreport_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/documentreference_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/encounter_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/explanationofbenefit_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/goal_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/immunization_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/location_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationdispense_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationrequest_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/observation_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/organization_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/patient_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitioner_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitionerrole_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/procedure_clinical_data_request_test.rb +0 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/export_endpoint.rb +1 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/export_status_endpoint.rb +1 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/next_page_endpoint.rb +9 -2
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/patient_endpoint.rb +1 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb +15 -6
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/resource_read_endpoint.rb +1 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/resource_search_endpoint.rb +1 -1
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server.rb +28 -2
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_udap_smart_server/authorization_endpoint.rb +53 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_udap_smart_server/token_endpoint.rb +85 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/pdex_client_options.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/tags.rb +8 -9
- data/lib/davinci_pdex_test_kit/pdex_payer_client/urls.rb +17 -9
- data/lib/davinci_pdex_test_kit/pdex_payer_client_suite.rb +57 -10
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_must_support_test.rb +50 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_search_test.rb +68 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_type_search_test.rb +54 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/{explanation_of_benefit/explanation_of_benefit_provenance_revinclude_search_test.rb → device/device_provenance_revinclude_search_test.rb} +7 -7
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_read_test.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_reference_resolution_test.rb +42 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_validation_test.rb +39 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device/metadata.yml +154 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/device_group.rb +88 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_id_search_test.rb +7 -24
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_identifier_search_test.rb +10 -24
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_must_support_test.rb +37 -5
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_lastupdated_search_test.rb +48 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_search_test.rb +62 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test.rb +7 -23
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_type_search_test.rb +6 -23
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_reference_resolution_test.rb +7 -4
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_validation_test.rb +9 -10
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/metadata.yml +276 -264
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit_group.rb +62 -64
- data/lib/davinci_pdex_test_kit/pdex_payer_server/export_patient_group.rb +8 -9
- data/lib/davinci_pdex_test_kit/pdex_payer_server/export_validation_group.rb +1 -2
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_must_support_test.rb +42 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_search_test.rb +64 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_search_test.rb +54 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_type_search_test.rb +55 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_provenance_revinclude_search_test.rb +54 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_read_test.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_reference_resolution_test.rb +42 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_validation_test.rb +39 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/metadata.yml +206 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense_group.rb +69 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/multiple_member_matches_group.rb +36 -36
- data/lib/davinci_pdex_test_kit/pdex_payer_server/no_member_matches_group.rb +30 -30
- data/lib/davinci_pdex_test_kit/pdex_payer_server/patient_operation_in_capability_statement_validation.rb +15 -13
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/metadata.yml +173 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_must_support_test.rb +51 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_read_test.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_reference_resolution_test.rb +46 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_validation_test.rb +39 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance_group.rb +59 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_clinical_data_group.rb +22 -11
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_everything_group.rb +19 -6
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_export_group.rb +24 -16
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_member_match_group.rb +44 -25
- data/lib/davinci_pdex_test_kit/pdex_payer_server_suite.rb +123 -110
- data/lib/davinci_pdex_test_kit/pdex_provider_client_suite.rb +8 -8
- data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_out_of_scope_requirements.csv +1 -0
- data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_requirements.csv +66 -0
- data/lib/davinci_pdex_test_kit/requirements/generated/davinci-pdex-test-kit_requirements_coverage.csv +66 -0
- data/lib/davinci_pdex_test_kit/version.rb +2 -2
- data/lib/davinci_pdex_test_kit.rb +1 -0
- data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
- data/lib/inferno_requirements_tools/rake/rakefile_template +19 -0
- data/lib/inferno_requirements_tools/tasks/collect_requirements.rb +228 -0
- data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
- data/lib/requirements_config.yaml +17 -0
- metadata +96 -13
- data/config/presets/pdex_payer_client_postman_preset.json +0 -12
- data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/token_endpoint.rb +0 -27
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test.rb +0 -64
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_use_search_test.rb +0 -69
@@ -4,12 +4,10 @@ module DaVinciPDexTestKit
|
|
4
4
|
module PDexPayerClient
|
5
5
|
|
6
6
|
module URLs
|
7
|
-
BASE_PATH = "#{Inferno::Application['base_url']}/custom/pdex_payer_client"
|
8
|
-
TOKEN_PATH = '/mock_auth/token'
|
9
7
|
PATIENT_PATH = '/fhir/Patient'
|
8
|
+
PATIENT_INSTANCE_PATH = '/fhir/Patient/:patient'
|
10
9
|
RESOURCE_PATH = '/fhir/:endpoint'
|
11
10
|
INSTANCE_PATH = '/fhir/:endpoint/:id'
|
12
|
-
SUBMIT_PATH = '/fhir/:endpoint' # FIXME duplicate
|
13
11
|
BINARY_PATH = '/fhir/Binary/:id'
|
14
12
|
METADATA_PATH = '/fhir/metadata'
|
15
13
|
EVERYTHING_PATH = '/fhir/Patient/:patient/$everything'
|
@@ -19,7 +17,9 @@ module DaVinciPDexTestKit
|
|
19
17
|
BASE_FHIR_PATH = '/fhir'
|
20
18
|
RESUME_PASS_PATH = '/resume_pass'
|
21
19
|
RESUME_CLINICAL_DATA_PATH = '/resume_clinical_data'
|
22
|
-
RESUME_FAIL_PATH = '/resume_fail'
|
20
|
+
RESUME_FAIL_PATH = '/resume_fail'
|
21
|
+
AUTHORIZATION_PATH = '/auth/authorization'
|
22
|
+
TOKEN_PATH = '/auth/token'
|
23
23
|
|
24
24
|
constants.each do |path_constant|
|
25
25
|
# For each constant X_PATH, define x_path()
|
@@ -29,20 +29,28 @@ module DaVinciPDexTestKit
|
|
29
29
|
|
30
30
|
# For each constant X_PATH, define x_url(), which includes base
|
31
31
|
define_method(path_constant.to_s.downcase.gsub(/_path$/, '_url')) do
|
32
|
-
|
32
|
+
base_url + URLs.const_get(path_constant)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def suite_id
|
37
|
+
PDexPayerClientSuite.id
|
38
|
+
end
|
39
|
+
|
36
40
|
# overwrite base_url which is irregular
|
37
41
|
def base_url
|
38
|
-
|
42
|
+
@base_url ||= "#{Inferno::Application['base_url']}/custom/#{suite_id}"
|
39
43
|
end
|
40
44
|
|
41
|
-
# overwrite
|
42
|
-
def
|
43
|
-
|
45
|
+
# overwrite fhir_base_url which is irregular
|
46
|
+
def fhir_base_url
|
47
|
+
base_url + BASE_FHIR_PATH
|
44
48
|
end
|
45
49
|
|
50
|
+
# alias for smart and udap tests
|
51
|
+
def client_fhir_base_url
|
52
|
+
fhir_base_url
|
53
|
+
end
|
46
54
|
end
|
47
55
|
|
48
56
|
# Add all constants and dynamically defined methods to PDexPayerClient namespace
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative 'pdex_payer_client/pdex_client_options'
|
2
2
|
require_relative 'pdex_payer_client/urls'
|
3
3
|
require_relative 'pdex_payer_client/tags'
|
4
4
|
require_relative 'pdex_payer_client/collection'
|
@@ -6,6 +6,11 @@ require_relative 'pdex_payer_client/mock_server'
|
|
6
6
|
# require_relative 'must_support_test'
|
7
7
|
# require_relative 'pdex_payer_client/client_validation_test'
|
8
8
|
|
9
|
+
require_relative 'pdex_payer_client/client_registration_group'
|
10
|
+
require_relative 'pdex_payer_client/client_auth_smart_alca_group'
|
11
|
+
require_relative 'pdex_payer_client/client_auth_smart_alcs_group'
|
12
|
+
require_relative 'pdex_payer_client/client_auth_smart_alp_group'
|
13
|
+
require_relative 'pdex_payer_client/client_auth_udap_group'
|
9
14
|
require_relative 'pdex_payer_client/client_workflow_interaction_test'
|
10
15
|
require_relative 'pdex_payer_client/client_member_match_tests/client_member_match_validation_test'
|
11
16
|
|
@@ -41,7 +46,7 @@ module DaVinciPDexTestKit
|
|
41
46
|
id :pdex_payer_client
|
42
47
|
title 'Da Vinci PDex Payer Client Test Suite'
|
43
48
|
description File.read(File.join(__dir__, 'docs', 'payer_client_suite_description_v200.md'))
|
44
|
-
|
49
|
+
|
45
50
|
links [
|
46
51
|
{
|
47
52
|
label: 'Report Issue',
|
@@ -71,6 +76,27 @@ module DaVinciPDexTestKit
|
|
71
76
|
end
|
72
77
|
end
|
73
78
|
|
79
|
+
suite_option :client_type,
|
80
|
+
title: 'Client Security Type',
|
81
|
+
list_options: [
|
82
|
+
{
|
83
|
+
label: 'SMART App Launch Public Client',
|
84
|
+
value: PDexClientOptions::SMART_APP_LAUNCH_PUBLIC
|
85
|
+
},
|
86
|
+
{
|
87
|
+
label: 'SMART App Launch Confidential Symmetric Client',
|
88
|
+
value: PDexClientOptions::SMART_APP_LAUNCH_CONFIDENTIAL_SYMMETRIC
|
89
|
+
},
|
90
|
+
{
|
91
|
+
label: 'SMART App Launch Confidential Asymmetric Client',
|
92
|
+
value: PDexClientOptions::SMART_APP_LAUNCH_CONFIDENTIAL_ASYMMETRIC
|
93
|
+
},
|
94
|
+
{
|
95
|
+
label: 'UDAP Authorization Code Client',
|
96
|
+
value: PDexClientOptions::UDAP_AUTHORIZATION_CODE
|
97
|
+
}
|
98
|
+
]
|
99
|
+
|
74
100
|
resume_test_route :get, RESUME_PASS_PATH do |request|
|
75
101
|
PDexPayerClientSuite.extract_token_from_query_params(request)
|
76
102
|
end
|
@@ -78,32 +104,51 @@ module DaVinciPDexTestKit
|
|
78
104
|
resume_test_route :get, RESUME_CLINICAL_DATA_PATH do |request|
|
79
105
|
PDexPayerClientSuite.extract_token_from_query_params(request)
|
80
106
|
end
|
81
|
-
|
107
|
+
|
82
108
|
resume_test_route :get, RESUME_FAIL_PATH, result: 'fail' do |request|
|
83
109
|
PDexPayerClientSuite.extract_token_from_query_params(request)
|
84
110
|
end
|
85
111
|
|
112
|
+
group from: :pdex_client_registration
|
113
|
+
|
86
114
|
group do
|
87
115
|
run_as_group
|
88
|
-
title
|
116
|
+
title 'Verify PDex Data Access'
|
89
117
|
id :payer_to_payer_workflow
|
90
118
|
|
91
119
|
group do
|
92
|
-
title
|
93
|
-
id :
|
120
|
+
title 'Interaction Tests'
|
121
|
+
id :pdex_client_workflow_interaction
|
94
122
|
|
95
123
|
test from: :pdex_client_workflow_interaction
|
96
124
|
end
|
97
125
|
|
126
|
+
group from: :pdex_client_auth_smart_alca,
|
127
|
+
required_suite_options: {
|
128
|
+
client_type: PDexClientOptions::SMART_APP_LAUNCH_CONFIDENTIAL_ASYMMETRIC
|
129
|
+
}
|
130
|
+
group from: :pdex_client_auth_smart_alcs,
|
131
|
+
required_suite_options: {
|
132
|
+
client_type: PDexClientOptions::SMART_APP_LAUNCH_CONFIDENTIAL_SYMMETRIC
|
133
|
+
}
|
134
|
+
group from: :pdex_client_auth_smart_alp,
|
135
|
+
required_suite_options: {
|
136
|
+
client_type: PDexClientOptions::SMART_APP_LAUNCH_PUBLIC
|
137
|
+
}
|
138
|
+
group from: :pdex_client_auth_udap,
|
139
|
+
required_suite_options: {
|
140
|
+
client_type: PDexClientOptions::UDAP_AUTHORIZATION_CODE
|
141
|
+
}
|
142
|
+
|
98
143
|
group do
|
99
|
-
title
|
144
|
+
title '$member-match validation'
|
100
145
|
id :member_match_validation
|
101
146
|
|
102
147
|
test from: :pdex_initial_member_match_validation
|
103
148
|
end
|
104
149
|
|
105
150
|
group do
|
106
|
-
title
|
151
|
+
title 'Clinical data request validation'
|
107
152
|
id :clinical_data_validation
|
108
153
|
|
109
154
|
test from: :pdex_clinical_data_request_check
|
@@ -130,8 +175,11 @@ module DaVinciPDexTestKit
|
|
130
175
|
test from: :pdex_procedure_clinical_data_request
|
131
176
|
end
|
132
177
|
end
|
178
|
+
|
179
|
+
|
180
|
+
# TODO: must support validation
|
181
|
+
|
133
182
|
|
134
|
-
# TODO must support validation
|
135
183
|
|
136
184
|
private
|
137
185
|
|
@@ -140,4 +188,3 @@ module DaVinciPDexTestKit
|
|
140
188
|
end
|
141
189
|
end
|
142
190
|
end
|
143
|
-
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'us_core_test_kit/must_support_test'
|
2
|
+
require 'us_core_test_kit/generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciPDexTestKit
|
5
|
+
module PDexPayerServer
|
6
|
+
class DeviceMustSupportTest < Inferno::Test
|
7
|
+
include USCoreTestKit::MustSupportTest
|
8
|
+
|
9
|
+
title 'All must support elements are provided in the Device resources returned'
|
10
|
+
description %(
|
11
|
+
PDex Responders SHALL be capable of populating all data elements as
|
12
|
+
part of the query results as specified by the PDex Server Capability
|
13
|
+
Statement. This test will look through the Device resources
|
14
|
+
found previously for the following must support elements:
|
15
|
+
|
16
|
+
* Device.distinctIdentifier
|
17
|
+
* Device.expirationDate
|
18
|
+
* Device.lotNumber
|
19
|
+
* Device.patient
|
20
|
+
* Device.serialNumber
|
21
|
+
* Device.status
|
22
|
+
* Device.type
|
23
|
+
* Device.udiCarrier
|
24
|
+
* Device.udiCarrier.carrierAIDC
|
25
|
+
* Device.udiCarrier.carrierHRF
|
26
|
+
* Device.udiCarrier.deviceIdentifier
|
27
|
+
* Device.url
|
28
|
+
)
|
29
|
+
|
30
|
+
id :pdex_device_must_support
|
31
|
+
|
32
|
+
def resource_type
|
33
|
+
'Device'
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.metadata
|
37
|
+
@metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
|
38
|
+
aliases: true))
|
39
|
+
end
|
40
|
+
|
41
|
+
def scratch_resources
|
42
|
+
scratch[:device_resources] ||= {}
|
43
|
+
end
|
44
|
+
|
45
|
+
run do
|
46
|
+
perform_must_support_test(all_scratch_resources)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'us_core_test_kit/search_test'
|
2
|
+
require 'us_core_test_kit/search_test_properties'
|
3
|
+
require 'us_core_test_kit/generator/group_metadata'
|
4
|
+
|
5
|
+
module DaVinciPDexTestKit
|
6
|
+
module PDexPayerServer
|
7
|
+
class DevicePatientSearchTest < Inferno::Test
|
8
|
+
include USCoreTestKit::SearchTest
|
9
|
+
|
10
|
+
title 'Server returns valid results for Device search by patient'
|
11
|
+
description %(
|
12
|
+
A server SHALL support searching by
|
13
|
+
patient on the Device resource. This test
|
14
|
+
will pass if resources are returned and match the search criteria. If
|
15
|
+
none are returned, the test is skipped.
|
16
|
+
|
17
|
+
This test verifies that the server supports searching by reference using
|
18
|
+
the form `patient=[id]` as well as `patient=Patient/[id]`. The two
|
19
|
+
different forms are expected to return the same number of results. US
|
20
|
+
Core requires that both forms are supported by PDex responders.
|
21
|
+
|
22
|
+
Because this is the first search of the sequence, resources in the
|
23
|
+
response will be used for subsequent tests.
|
24
|
+
|
25
|
+
Additionally, this test will check that GET and POST search methods
|
26
|
+
return the same number of results. Search by POST is required by the
|
27
|
+
FHIR R4 specification, and these tests interpret search by GET as a
|
28
|
+
requirement of PDex v2.0.0.
|
29
|
+
|
30
|
+
[PDex Server CapabilityStatement](https://hl7.org/fhir/us/davinci-pdex/STU2/CapabilityStatement-pdex-server.html)
|
31
|
+
)
|
32
|
+
|
33
|
+
id :pdex_device_patient_search
|
34
|
+
input :patient_ids,
|
35
|
+
title: 'Patient IDs',
|
36
|
+
description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
|
37
|
+
|
38
|
+
input :implantable_device_codes,
|
39
|
+
title: 'Implantable Device Type Code',
|
40
|
+
description: 'Enter the code for an Implantable Device type, or multiple codes separated by commas. ' \
|
41
|
+
'If blank, Inferno will validate all Device resources against the Implantable Device profile',
|
42
|
+
optional: true
|
43
|
+
|
44
|
+
def self.properties
|
45
|
+
@properties ||= USCoreTestKit::SearchTestProperties.new(
|
46
|
+
first_search: true,
|
47
|
+
resource_type: 'Device',
|
48
|
+
search_param_names: ['patient'],
|
49
|
+
test_reference_variants: true,
|
50
|
+
test_post_search: true
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.metadata
|
55
|
+
@metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
|
56
|
+
aliases: true))
|
57
|
+
end
|
58
|
+
|
59
|
+
def scratch_resources
|
60
|
+
scratch[:device_resources] ||= {}
|
61
|
+
end
|
62
|
+
|
63
|
+
run do
|
64
|
+
run_search_test
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'us_core_test_kit/search_test'
|
2
|
+
require 'us_core_test_kit/generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciPDexTestKit
|
5
|
+
module PDexPayerServer
|
6
|
+
class DevicePatientTypeSearchTest < Inferno::Test
|
7
|
+
include USCoreTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Device search by patient + type'
|
10
|
+
description %(
|
11
|
+
A server SHOULD support searching by
|
12
|
+
patient + type on the Device resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[PDex Server CapabilityStatement](https://hl7.org/fhir/us/davinci-pdex/STU2/CapabilityStatement-pdex-server.html)
|
17
|
+
)
|
18
|
+
|
19
|
+
id :pdex_device_patient_type_search
|
20
|
+
optional
|
21
|
+
|
22
|
+
input :patient_ids,
|
23
|
+
title: 'Patient IDs',
|
24
|
+
description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
|
25
|
+
|
26
|
+
input :implantable_device_codes,
|
27
|
+
title: 'Implantable Device Type Code',
|
28
|
+
description: 'Enter the code for an Implantable Device type, or multiple codes separated by commas. ' \
|
29
|
+
'If blank, Inferno will validate all Device resources against the Implantable Device profile',
|
30
|
+
optional: true
|
31
|
+
|
32
|
+
def self.properties
|
33
|
+
@properties ||= USCoreTestKit::SearchTestProperties.new(
|
34
|
+
resource_type: 'Device',
|
35
|
+
search_param_names: ['patient', 'type'],
|
36
|
+
token_search_params: ['type']
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.metadata
|
41
|
+
@metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
|
42
|
+
aliases: true))
|
43
|
+
end
|
44
|
+
|
45
|
+
def scratch_resources
|
46
|
+
scratch[:device_resources] ||= {}
|
47
|
+
end
|
48
|
+
|
49
|
+
run do
|
50
|
+
run_search_test
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -2,12 +2,12 @@ require 'us_core_test_kit/search_test'
|
|
2
2
|
require 'us_core_test_kit/search_test_properties'
|
3
3
|
require 'us_core_test_kit/generator/group_metadata'
|
4
4
|
|
5
|
-
module
|
6
|
-
module
|
7
|
-
class
|
5
|
+
module DaVinciPDexTestKit
|
6
|
+
module PDexPayerServer
|
7
|
+
class DeviceProvenanceRevincludeSearchTest < Inferno::Test
|
8
8
|
include USCoreTestKit::SearchTest
|
9
9
|
|
10
|
-
title 'Server returns Provenance resources from
|
10
|
+
title 'Server returns Provenance resources from Device search by patient + revInclude:Provenance:target'
|
11
11
|
description %(
|
12
12
|
A server SHALL be capable of supporting _revIncludes:Provenance:target.
|
13
13
|
|
@@ -15,7 +15,7 @@ module USCoreTestKit
|
|
15
15
|
will pass if a Provenance resource is found in the response.
|
16
16
|
%)
|
17
17
|
|
18
|
-
id :
|
18
|
+
id :pdex_device_provenance_revinclude_search
|
19
19
|
|
20
20
|
input :patient_ids,
|
21
21
|
title: 'Patient IDs',
|
@@ -23,7 +23,7 @@ module USCoreTestKit
|
|
23
23
|
|
24
24
|
def properties
|
25
25
|
@properties ||= USCoreTestKit::SearchTestProperties.new(
|
26
|
-
resource_type: '
|
26
|
+
resource_type: 'Device',
|
27
27
|
search_param_names: ['patient']
|
28
28
|
)
|
29
29
|
end
|
@@ -40,7 +40,7 @@ module USCoreTestKit
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def scratch_resources
|
43
|
-
scratch[:
|
43
|
+
scratch[:device_resources] ||= {}
|
44
44
|
end
|
45
45
|
|
46
46
|
def scratch_provenance_resources
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'us_core_test_kit/read_test'
|
2
|
+
|
3
|
+
module DaVinciPDexTestKit
|
4
|
+
module PDexPayerServer
|
5
|
+
class DeviceReadTest < Inferno::Test
|
6
|
+
include USCoreTestKit::ReadTest
|
7
|
+
|
8
|
+
title 'Server returns correct Device resource from Device read interaction'
|
9
|
+
description 'A server SHALL support the Device read interaction.'
|
10
|
+
|
11
|
+
id :pdex_device_read
|
12
|
+
|
13
|
+
def resource_type
|
14
|
+
'Device'
|
15
|
+
end
|
16
|
+
|
17
|
+
def scratch_resources
|
18
|
+
scratch[:device_resources] ||= {}
|
19
|
+
end
|
20
|
+
|
21
|
+
run do
|
22
|
+
perform_read_test(all_scratch_resources)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'us_core_test_kit/reference_resolution_test'
|
2
|
+
require 'us_core_test_kit/generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciPDexTestKit
|
5
|
+
module PDexPayerServer
|
6
|
+
class DeviceReferenceResolutionTest < Inferno::Test
|
7
|
+
include USCoreTestKit::ReferenceResolutionTest
|
8
|
+
|
9
|
+
title 'MustSupport references within Device resources are valid'
|
10
|
+
description %(
|
11
|
+
This test will attempt to read external references provided within elements
|
12
|
+
marked as 'MustSupport', if any are available.
|
13
|
+
|
14
|
+
It verifies that at least one external reference for each MustSupport Reference element
|
15
|
+
can be accessed by the test client, and conforms to corresponding PDex profile.
|
16
|
+
|
17
|
+
Elements which may provide external references include:
|
18
|
+
|
19
|
+
* Device.patient
|
20
|
+
)
|
21
|
+
|
22
|
+
id :pdex_device_ref_resolution
|
23
|
+
|
24
|
+
def resource_type
|
25
|
+
'Device'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.metadata
|
29
|
+
@metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
|
30
|
+
aliases: true))
|
31
|
+
end
|
32
|
+
|
33
|
+
def scratch_resources
|
34
|
+
scratch[:device_resources] ||= {}
|
35
|
+
end
|
36
|
+
|
37
|
+
run do
|
38
|
+
perform_reference_resolution_test(scratch_resources[:all])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'us_core_test_kit/validation_test'
|
2
|
+
|
3
|
+
module DaVinciPDexTestKit
|
4
|
+
module PDexPayerServer
|
5
|
+
class DeviceValidationTest < Inferno::Test
|
6
|
+
include USCoreTestKit::ValidationTest
|
7
|
+
|
8
|
+
id :pdex_device_validation
|
9
|
+
title 'Device resources returned during previous tests conform to the PDex Device'
|
10
|
+
description %(
|
11
|
+
This test verifies resources returned from the first search conform to
|
12
|
+
the [PDex Device](http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-device).
|
13
|
+
Systems must demonstrate at least one valid example in order to pass this test.
|
14
|
+
|
15
|
+
It verifies the presence of mandatory elements and that elements with
|
16
|
+
required bindings contain appropriate values. CodeableConcept element
|
17
|
+
bindings will fail if none of their codings have a code/system belonging
|
18
|
+
to the bound ValueSet. Quantity, Coding, and code element bindings will
|
19
|
+
fail if their code/system are not found in the valueset.
|
20
|
+
)
|
21
|
+
output :dar_code_found, :dar_extension_found
|
22
|
+
|
23
|
+
def resource_type
|
24
|
+
'Device'
|
25
|
+
end
|
26
|
+
|
27
|
+
def scratch_resources
|
28
|
+
scratch[:device_resources] ||= {}
|
29
|
+
end
|
30
|
+
|
31
|
+
run do
|
32
|
+
perform_validation_test(scratch_resources[:all] || [],
|
33
|
+
'http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-device',
|
34
|
+
'2.0.0',
|
35
|
+
skip_if_empty: true)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,154 @@
|
|
1
|
+
---
|
2
|
+
:name: pdex_device
|
3
|
+
:class_name: PdexDeviceSequence
|
4
|
+
:version: v2.0.0
|
5
|
+
:reformatted_version: v200
|
6
|
+
:resource: Device
|
7
|
+
:profile_url: http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-device
|
8
|
+
:profile_name: PDex Device
|
9
|
+
:profile_version: 2.0.0
|
10
|
+
:title: PDex Device
|
11
|
+
:short_description: Verify support for the server capabilities required by the PDex
|
12
|
+
Device.
|
13
|
+
:is_delayed: false
|
14
|
+
:interactions:
|
15
|
+
- :code: search-type
|
16
|
+
:expectation: SHALL
|
17
|
+
- :code: read
|
18
|
+
:expectation: SHALL
|
19
|
+
- :code: vread
|
20
|
+
:expectation: SHOULD
|
21
|
+
- :code: history-instance
|
22
|
+
:expectation: SHOULD
|
23
|
+
- :code: history-type
|
24
|
+
:expectation: MAY
|
25
|
+
:operations: []
|
26
|
+
:searches:
|
27
|
+
- :names:
|
28
|
+
- patient
|
29
|
+
:expectation: SHALL
|
30
|
+
:names_not_must_support_or_mandatory: []
|
31
|
+
:must_support_or_mandatory: true
|
32
|
+
- :expectation: SHOULD
|
33
|
+
:names:
|
34
|
+
- patient
|
35
|
+
- type
|
36
|
+
:names_not_must_support_or_mandatory: []
|
37
|
+
:must_support_or_mandatory: true
|
38
|
+
- :expectation: SHOULD
|
39
|
+
:names:
|
40
|
+
- patient
|
41
|
+
- status
|
42
|
+
:names_not_must_support_or_mandatory: []
|
43
|
+
:must_support_or_mandatory: true
|
44
|
+
:search_definitions:
|
45
|
+
:patient:
|
46
|
+
:paths:
|
47
|
+
- patient
|
48
|
+
:full_paths:
|
49
|
+
- Device.patient
|
50
|
+
:comparators: {}
|
51
|
+
:values: []
|
52
|
+
:type: Reference
|
53
|
+
:contains_multiple: false
|
54
|
+
:multiple_or: MAY
|
55
|
+
:type:
|
56
|
+
:paths:
|
57
|
+
- type
|
58
|
+
:full_paths:
|
59
|
+
- Device.type
|
60
|
+
:comparators: {}
|
61
|
+
:values: []
|
62
|
+
:type: CodeableConcept
|
63
|
+
:contains_multiple: false
|
64
|
+
:multiple_or: MAY
|
65
|
+
:status:
|
66
|
+
:paths:
|
67
|
+
- status
|
68
|
+
:full_paths:
|
69
|
+
- Device.status
|
70
|
+
:comparators: {}
|
71
|
+
:values: []
|
72
|
+
:type: CodeableConcept
|
73
|
+
:contains_multiple: false
|
74
|
+
:multiple_or: MAY
|
75
|
+
:include_params: []
|
76
|
+
:revincludes:
|
77
|
+
- Provenance:target
|
78
|
+
:required_concepts: []
|
79
|
+
:must_supports:
|
80
|
+
:extensions: []
|
81
|
+
:slices: []
|
82
|
+
:elements:
|
83
|
+
- :path: udiCarrier
|
84
|
+
- :path: udiCarrier.deviceIdentifier
|
85
|
+
- :path: udiCarrier.carrierAIDC
|
86
|
+
- :path: udiCarrier.carrierHRF
|
87
|
+
- :path: status
|
88
|
+
- :path: distinctIdentifier
|
89
|
+
- :path: expirationDate
|
90
|
+
- :path: lotNumber
|
91
|
+
- :path: serialNumber
|
92
|
+
- :path: type
|
93
|
+
- :path: patient
|
94
|
+
:types:
|
95
|
+
- Reference
|
96
|
+
:target_profiles:
|
97
|
+
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
|
98
|
+
- :path: url
|
99
|
+
:mandatory_elements:
|
100
|
+
- Device.udiCarrier.deviceIdentifier
|
101
|
+
- Device.deviceName.name
|
102
|
+
- Device.deviceName.type
|
103
|
+
- Device.type
|
104
|
+
- Device.specialization.systemType
|
105
|
+
- Device.version.value
|
106
|
+
- Device.property.type
|
107
|
+
- Device.patient
|
108
|
+
:bindings:
|
109
|
+
- :type: code
|
110
|
+
:strength: required
|
111
|
+
:system: http://hl7.org/fhir/ValueSet/udi-entry-type
|
112
|
+
:path: udiCarrier.entryType
|
113
|
+
- :type: code
|
114
|
+
:strength: required
|
115
|
+
:system: http://hl7.org/fhir/ValueSet/device-status
|
116
|
+
:path: status
|
117
|
+
- :type: code
|
118
|
+
:strength: required
|
119
|
+
:system: http://hl7.org/fhir/ValueSet/device-nametype
|
120
|
+
:path: deviceName.type
|
121
|
+
:references:
|
122
|
+
- :path: Device.definition
|
123
|
+
:profiles:
|
124
|
+
- http://hl7.org/fhir/StructureDefinition/DeviceDefinition
|
125
|
+
- :path: Device.patient
|
126
|
+
:profiles:
|
127
|
+
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
|
128
|
+
- :path: Device.owner
|
129
|
+
:profiles:
|
130
|
+
- http://hl7.org/fhir/StructureDefinition/Organization
|
131
|
+
- :path: Device.location
|
132
|
+
:profiles:
|
133
|
+
- http://hl7.org/fhir/StructureDefinition/Location
|
134
|
+
- :path: Device.parent
|
135
|
+
:profiles:
|
136
|
+
- http://hl7.org/fhir/StructureDefinition/Device
|
137
|
+
:tests:
|
138
|
+
- :id: pdex_device_patient_search
|
139
|
+
:file_name: device_patient_search_test.rb
|
140
|
+
- :id: pdex_device_patient_type_search
|
141
|
+
:file_name: device_patient_type_search_test.rb
|
142
|
+
- :id: pdex_device_read
|
143
|
+
:file_name: device_read_test.rb
|
144
|
+
- :id: pdex_device_provenance_revinclude_search
|
145
|
+
:file_name: device_provenance_revinclude_search_test.rb
|
146
|
+
- :id: pdex_device_validation
|
147
|
+
:file_name: device_validation_test.rb
|
148
|
+
- :id: pdex_device_must_support
|
149
|
+
:file_name: device_must_support_test.rb
|
150
|
+
- :id: pdex_device_ref_resolution
|
151
|
+
:file_name: device_reference_resolution_test.rb
|
152
|
+
:id: pdex_device
|
153
|
+
:file_name: device_group.rb
|
154
|
+
:delayed_references: []
|