davinci_pdex_test_kit 0.9.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 +7 -0
- data/LICENSE +201 -0
- data/lib/davinci_pdex_test_kit/docs/payer_client_suite_description_v200.md +91 -0
- data/lib/davinci_pdex_test_kit/docs/payer_server_suite_description_v200.md +119 -0
- data/lib/davinci_pdex_test_kit/ext/inferno_core/record_response_route.rb +98 -0
- data/lib/davinci_pdex_test_kit/ext/inferno_core/request.rb +19 -0
- data/lib/davinci_pdex_test_kit/ext/inferno_core/runnable.rb +18 -0
- data/lib/davinci_pdex_test_kit/fhir_resource_navigation.rb +154 -0
- data/lib/davinci_pdex_test_kit/group_metadata.rb +109 -0
- data/lib/davinci_pdex_test_kit/metadata/mock_capability_statement.json +1052 -0
- data/lib/davinci_pdex_test_kit/metadata/mock_operation_outcome_resource.json +16 -0
- data/lib/davinci_pdex_test_kit/mock_server.rb +247 -0
- data/lib/davinci_pdex_test_kit/must_support_test.rb +252 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_submit_test.rb +24 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_validation_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_submit_test.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_validation_test.rb +32 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb +94 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/allergyintolerance_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careplan_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careteam_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/condition_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/device_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/diagnosticreport_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/documentreference_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/encounter_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/explanationofbenefit_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/goal_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/immunization_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_scratch_storing.rb +34 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_wait_test.rb +28 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/location_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationdispense_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationrequest_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/observation_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/organization_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/patient_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitioner_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitionerrole_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/procedure_clinical_data_request_test.rb +23 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client/collection.rb +46 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_client_suite.rb +152 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/abstract_member_match_request_conformance_test.rb +33 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/abstract_member_match_request_local_references_test.rb +35 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/coverage_to_link_has_minimal_data_test.rb +52 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/coverage_to_link_must_support_test.rb +28 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_id_search_test.rb +58 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_identifier_search_test.rb +58 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_must_support_test.rb +40 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test.rb +63 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test.rb +63 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_type_search_test.rb +63 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_use_search_test.rb +68 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_provenance_revinclude_search_test.rb +52 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_read_test.rb +26 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_reference_resolution_test.rb +43 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_validation_test.rb +40 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit_group.rb +105 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/export_patient_group.rb +103 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/export_validation_group.rb +59 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/multiple_member_matches_group.rb +66 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/no_member_matches_group.rb +69 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_clinical_data.rb +66 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_everything.rb +184 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_export.rb +67 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_member_match.rb +171 -0
- data/lib/davinci_pdex_test_kit/pdex_payer_server_suite.rb +158 -0
- data/lib/davinci_pdex_test_kit/pdex_provider_client_suite.rb +36 -0
- data/lib/davinci_pdex_test_kit/tags.rb +9 -0
- data/lib/davinci_pdex_test_kit/urls.rb +67 -0
- data/lib/davinci_pdex_test_kit/user_input_response.rb +32 -0
- data/lib/davinci_pdex_test_kit/version.rb +5 -0
- data/lib/davinci_pdex_test_kit.rb +8 -0
- metadata +218 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
module DaVinciPDexTestKit
|
|
2
|
+
module ClientValidationTest
|
|
3
|
+
|
|
4
|
+
def previous_clinical_data_request_resources
|
|
5
|
+
hash = Hash.new { |hash, key| hash[key] = [] }
|
|
6
|
+
previous_clinical_data_requests.each_with_object(hash) do |request, request_resource_hash|
|
|
7
|
+
request_resources =
|
|
8
|
+
if request.status == 200
|
|
9
|
+
request.resource.entry.map(&:resource)
|
|
10
|
+
else
|
|
11
|
+
[]
|
|
12
|
+
end
|
|
13
|
+
request_resource_hash[request].concat(request_resources)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# def collect_export_resources
|
|
18
|
+
# export_payload = collect_export_payload
|
|
19
|
+
# if export_payload
|
|
20
|
+
# ndjson_list = JSON.parse(export_payload)
|
|
21
|
+
# request_resources = ndjson_list['output'].map do |resource_binary|
|
|
22
|
+
# retrieved_resources = Faraday.new(
|
|
23
|
+
# url: resource_binary['url'],
|
|
24
|
+
# headers: {'Content-Type' => 'application/json',
|
|
25
|
+
# 'Authorization' => 'Bearer SAMPLE_TOKEN'}
|
|
26
|
+
# ).get
|
|
27
|
+
# connect_bundle(retrieved_resources.env.response_body)
|
|
28
|
+
# end
|
|
29
|
+
# puts request_resources
|
|
30
|
+
# request_resources.flatten
|
|
31
|
+
# else
|
|
32
|
+
# nil
|
|
33
|
+
# end
|
|
34
|
+
# end
|
|
35
|
+
|
|
36
|
+
# def connect_bundle(export_binary)
|
|
37
|
+
# export_binary.split(/(?<=}\n)(?={)/).map { |str| FHIR.from_contents(str)}
|
|
38
|
+
# end
|
|
39
|
+
|
|
40
|
+
# def collect_export_payload
|
|
41
|
+
# url = export_request&.response_header('content-location')&.value
|
|
42
|
+
# attempts = 0
|
|
43
|
+
# return nil if url.nil?
|
|
44
|
+
# while attempts < 5
|
|
45
|
+
# request_attempt = Faraday.new(
|
|
46
|
+
# url: url,
|
|
47
|
+
# headers: {'Content-Type' => 'application/json',
|
|
48
|
+
# 'Authorization' => 'Bearer SAMPLE_TOKEN',
|
|
49
|
+
# 'Prefer' => 'respond-async',
|
|
50
|
+
# 'Accept' => 'application/fhir+json'}
|
|
51
|
+
# ).get
|
|
52
|
+
# if request_attempt.status != 200
|
|
53
|
+
# attempts += 1
|
|
54
|
+
# sleep(2)
|
|
55
|
+
# else
|
|
56
|
+
# return request_attempt.env.response_body
|
|
57
|
+
# end
|
|
58
|
+
# end
|
|
59
|
+
# return nil
|
|
60
|
+
# end
|
|
61
|
+
|
|
62
|
+
# def export_resources
|
|
63
|
+
# @export_resources ||= collect_export_resources
|
|
64
|
+
# end
|
|
65
|
+
|
|
66
|
+
def previous_clinical_data_requests
|
|
67
|
+
@previous_clinical_data_requests ||= load_tagged_requests(SUBMIT_TAG) + [everything_request].compact
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def everything_request
|
|
71
|
+
@everything_request ||= load_tagged_requests(EVERYTHING_TAG).first
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def member_match_request
|
|
75
|
+
@member_match_request ||= load_tagged_requests(MEMBER_MATCH_TAG).first
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# def export_request
|
|
79
|
+
# @export_request ||= load_tagged_requests(EXPORT_TAG).first
|
|
80
|
+
# end
|
|
81
|
+
|
|
82
|
+
# def patient_id_from_match_request
|
|
83
|
+
# @patient_id_from_match_request ||= member_match_request ? "999" : nil #TODO: Change from static response
|
|
84
|
+
# end
|
|
85
|
+
|
|
86
|
+
def all_member_match_requests
|
|
87
|
+
@all_member_match_requests ||= load_tagged_requests(MEMBER_MATCH_TAG)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def flattened_all_resources
|
|
91
|
+
@flattened_all_resources ||= previous_clinical_data_request_resources.values.flatten
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientAllergyIntoleranceSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :allergyintolerance_clinical_data_request_test
|
|
10
|
+
title 'AllergyIntolerance resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned AllergyIntolerance resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:AllergyIntolerance].nil?, "No requests made for AllergyIntolerance resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:AllergyIntolerance].any? {|resource| resource.id == 'pdex-AllergyIntolerance'}, "Unable to find expected resource: pdex-AllergyIntolerance"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientCarePlanSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :careplan_clinical_data_request_test
|
|
10
|
+
title 'CarePlan resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned CarePlan resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:CarePlan].nil?, "No requests made for CarePlan resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:CarePlan].any? {|resource| resource.id == 'pdex-CarePlan'}, "Unable to find expected resource: pdex-CarePlan"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientCareTeamSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :careteam_clinical_data_request_test
|
|
10
|
+
title 'CareTeam resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned CareTeam resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:CareTeam].nil?, "No requests made for CareTeam resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:CareTeam].any? {|resource| resource.id == 'pdex-CareTeam'}, "Unable to find expected resource: pdex-CareTeam"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientConditionSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :condition_clinical_data_request_test
|
|
10
|
+
title 'Condition resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Condition resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Condition].nil?, "No requests made for Condition resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Condition].any? {|resource| resource.id == 'pdex-Condition'}, "Unable to find expected resource: pdex-Condition"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientDeviceSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :device_clinical_data_request_test
|
|
10
|
+
title 'Device resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Device resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Device].nil?, "No requests made for Device resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Device].any? {|resource| resource.id == 'pdex-Device'}, "Unable to find expected resource: pdex-Device"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientDiagnosticReportSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :diagnosticreport_clinical_data_request_test
|
|
10
|
+
title 'DiagnosticReport resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned DiagnosticReport resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:DiagnosticReport].nil?, "No requests made for DiagnosticReport resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:DiagnosticReport].any? {|resource| resource.id == 'pdex-DiagnosticReport'}, "Unable to find expected resource: pdex-DiagnosticReport"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientDocumentReferenceSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :documentreference_clinical_data_request_test
|
|
10
|
+
title 'DocumentReference resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned DocumentReference resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:DocumentReference].nil?, "No requests made for DocumentReference resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:DocumentReference].any? {|resource| resource.id == 'pdex-DocumentReference'}, "Unable to find expected resource: pdex-DocumentReference"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientEncounterSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :encounter_clinical_data_request_test
|
|
10
|
+
title 'Encounter resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Encounter resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Encounter].nil?, "No requests made for Encounter resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Encounter].any? {|resource| resource.id == 'pdex-Encounter'}, "Unable to find expected resource: pdex-Encounter"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientExplanationOfBenefitSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :explanationofbenefit_clinical_data_request_test
|
|
10
|
+
title 'ExplanationOfBenefit resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned ExplanationOfBenefit resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:ExplanationOfBenefit].nil?, "No requests made for ExplanationOfBenefit resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:ExplanationOfBenefit].any? {|resource| resource.id == 'pdex-ExplanationOfBenefit'}, "Unable to find expected resource: pdex-ExplanationOfBenefit"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientGoalSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :goal_clinical_data_request_test
|
|
10
|
+
title 'Goal resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Goal resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Goal].nil?, "No requests made for Goal resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Goal].any? {|resource| resource.id == 'pdex-Goal'}, "Unable to find expected resource: pdex-Goal"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientImmunizationSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :immunization_clinical_data_request_test
|
|
10
|
+
title 'Immunization resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Immunization resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Immunization].nil?, "No requests made for Immunization resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Immunization].any? {|resource| resource.id == 'pdex-Immunization'}, "Unable to find expected resource: pdex-Immunization"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require_relative '../client_validation_test.rb'
|
|
2
|
+
module DaVinciPDexTestKit
|
|
3
|
+
class PDexClientScratchStorage < Inferno::Test
|
|
4
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
5
|
+
|
|
6
|
+
id :initial_scratch_storing
|
|
7
|
+
title 'Client makes clinical data requests that capture an entire patient'
|
|
8
|
+
description %(
|
|
9
|
+
This test organizes the received requests in order to validate all expected specific resources were returned
|
|
10
|
+
)
|
|
11
|
+
input :access_token
|
|
12
|
+
|
|
13
|
+
run do
|
|
14
|
+
previous_clinical_data_request_resources.each do |request, resources|
|
|
15
|
+
resources.each do |resource|
|
|
16
|
+
scratch[resource.resourceType.to_sym] ||= []
|
|
17
|
+
scratch[resource.resourceType.to_sym] |= [resource]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
# if export_resources
|
|
21
|
+
# info "Attempted an $export request"
|
|
22
|
+
# export_resources.each do |resource|
|
|
23
|
+
# scratch[resource.resourceType.to_sym] ||= []
|
|
24
|
+
# scratch[resource.resourceType.to_sym] |= [resource]
|
|
25
|
+
# end
|
|
26
|
+
# elsif export_request
|
|
27
|
+
# info "Found an $export request, but no resources found. It may not have had enough time to build"
|
|
28
|
+
# end
|
|
29
|
+
if everything_request
|
|
30
|
+
info "Attempted an $everything request"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_wait_test.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
module DaVinciPDexTestKit
|
|
3
|
+
class PDexClientSubmitMustSupportTest < Inferno::Test
|
|
4
|
+
include URLs
|
|
5
|
+
|
|
6
|
+
id :initial_wait_test
|
|
7
|
+
title 'Client makes clinical data requests'
|
|
8
|
+
description %(
|
|
9
|
+
This test will receive clinical data requests until the user confirms they are done.
|
|
10
|
+
)
|
|
11
|
+
input :access_token
|
|
12
|
+
config options: { accepts_multiple_requests: true }
|
|
13
|
+
|
|
14
|
+
run do
|
|
15
|
+
wait(
|
|
16
|
+
identifier: access_token,
|
|
17
|
+
message: %(
|
|
18
|
+
Access Token: #{access_token} \n
|
|
19
|
+
Submit PDex requests via at least one of the following methods:
|
|
20
|
+
* Single Resource API: `#{submit_url}`, with `:endpoint` replaced with the endpoint you want to reach
|
|
21
|
+
* $everything method: `#{everything_url}`, with `:patient` replaced with the patient you are matching
|
|
22
|
+
|
|
23
|
+
and [click here](#{resume_clinical_data_url}?token=#{access_token}) when done.
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientLocationSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :location_clinical_data_request_test
|
|
10
|
+
title 'Location resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Location resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Location].nil?, "No requests made for Location resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Location].any? {|resource| resource.id == 'pdex-Location'}, "Unable to find expected resource: pdex-Location"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientMedicationDispenseSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :medicationdispense_clinical_data_request_test
|
|
10
|
+
title 'MedicationDispense resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned MedicationDispense resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:MedicationDispense].nil?, "No requests made for MedicationDispense resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:MedicationDispense].any? {|resource| resource.id == 'pdex-MedicationDispense'}, "Unable to find expected resource: pdex-MedicationDispense"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientMedicationRequestSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :medicationrequest_clinical_data_request_test
|
|
10
|
+
title 'MedicationRequest resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned MedicationRequest resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:MedicationRequest].nil?, "No requests made for MedicationRequest resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:MedicationRequest].any? {|resource| resource.id == 'pdex-MedicationRequest'}, "Unable to find expected resource: pdex-MedicationRequest"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientObservationSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :observation_clinical_data_request_test
|
|
10
|
+
title 'Observation resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Observation resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Observation].nil?, "No requests made for Observation resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Observation].any? {|resource| resource.id == 'pdex-Observation'}, "Unable to find expected resource: pdex-Observation"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientOrganizationSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :organization_clinical_data_request_test
|
|
10
|
+
title 'Organization resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Organization resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Organization].nil?, "No requests made for Organization resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Organization].any? {|resource| resource.id == 'pdex-Organization'}, "Unable to find expected resource: pdex-Organization"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientPatientSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :patient_clinical_data_request_test
|
|
10
|
+
title 'Patient resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Patient resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Patient].nil?, "No requests made for Patient resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Patient].any? {|resource| resource.id == 'pdex-Patient'}, "Unable to find expected resource: 999"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientPractitionerSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :practitioner_clinical_data_request_test
|
|
10
|
+
title 'Practitioner resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Practitioner resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Practitioner].nil?, "No requests made for Practitioner resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Practitioner].any? {|resource| resource.id == 'pdex-Practitioner'}, "Unable to find expected resource: pdex-Practitioner"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientPractitionerRoleSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :practitionerrole_clinical_data_request_test
|
|
10
|
+
title 'PractitionerRole resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned PractitionerRole resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:PractitionerRole].nil?, "No requests made for PractitionerRole resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:PractitionerRole].any? {|resource| resource.id == 'pdex-PractitionerRole'}, "Unable to find expected resource: pdex-PractitionerRole"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
require_relative '../client_validation_test.rb'
|
|
3
|
+
|
|
4
|
+
module DaVinciPDexTestKit
|
|
5
|
+
class PDexClientProcedureSubmitClinicalDataRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
include DaVinciPDexTestKit::ClientValidationTest
|
|
8
|
+
|
|
9
|
+
id :procedure_clinical_data_request_test
|
|
10
|
+
title 'Procedure resources related to the patient matched are gathered'
|
|
11
|
+
description %(
|
|
12
|
+
This test will look through all returned Procedure resources for a specific expected resource related to the matched patient.
|
|
13
|
+
)
|
|
14
|
+
input :access_token
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
run do
|
|
18
|
+
skip_if scratch[:Procedure].nil?, "No requests made for Procedure resources"
|
|
19
|
+
|
|
20
|
+
assert scratch[:Procedure].any? {|resource| resource.id == 'pdex-Procedure'}, "Unable to find expected resource: pdex-Procedure"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|