davinci_pdex_test_kit 0.10.6 → 0.11.0

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.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/pdex_payer_client_postman_preset.json +12 -0
  3. data/config/presets/pdex_payer_server_fhir_foundry_ri_preset.json +96 -0
  4. data/config/presets/pdex_payer_server_inferno_ri_preset.json +96 -0
  5. data/lib/davinci_pdex_test_kit/docs/davinci_pdex_test_kit_description_v200.md +33 -0
  6. data/lib/davinci_pdex_test_kit/docs/payer_client_suite_description_v200.md +107 -17
  7. data/lib/davinci_pdex_test_kit/fhir_resource_navigation.rb +5 -1
  8. data/lib/davinci_pdex_test_kit/group_metadata.rb +5 -1
  9. data/lib/davinci_pdex_test_kit/igs/davinci-pdex-2.0.0.tgz +0 -0
  10. data/lib/davinci_pdex_test_kit/igs/us-core-3.1.1.tgz +0 -0
  11. data/lib/davinci_pdex_test_kit/metadata.rb +16 -0
  12. data/lib/davinci_pdex_test_kit/must_support_test.rb +3 -0
  13. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_validation_test.rb +20 -18
  14. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb +96 -43
  15. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_workflow_interaction_test.rb +49 -0
  16. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/allergyintolerance_clinical_data_request_test.rb +18 -16
  17. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careplan_clinical_data_request_test.rb +18 -16
  18. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/careteam_clinical_data_request_test.rb +18 -16
  19. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/clinical_data_request_check_test.rb +24 -0
  20. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/condition_clinical_data_request_test.rb +18 -16
  21. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/device_clinical_data_request_test.rb +19 -17
  22. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/diagnosticreport_clinical_data_request_test.rb +18 -16
  23. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/documentreference_clinical_data_request_test.rb +18 -16
  24. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/encounter_clinical_data_request_test.rb +18 -16
  25. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/explanationofbenefit_clinical_data_request_test.rb +18 -16
  26. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/goal_clinical_data_request_test.rb +18 -16
  27. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/immunization_clinical_data_request_test.rb +18 -16
  28. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/location_clinical_data_request_test.rb +18 -16
  29. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationdispense_clinical_data_request_test.rb +18 -16
  30. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/medicationrequest_clinical_data_request_test.rb +18 -16
  31. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/observation_clinical_data_request_test.rb +18 -16
  32. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/organization_clinical_data_request_test.rb +18 -16
  33. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/patient_clinical_data_request_test.rb +18 -16
  34. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/patient_id_search_request_check_test.rb +21 -0
  35. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitioner_clinical_data_request_test.rb +18 -16
  36. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/practitionerrole_clinical_data_request_test.rb +18 -16
  37. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/procedure_clinical_data_request_test.rb +18 -16
  38. data/lib/davinci_pdex_test_kit/pdex_payer_client/collection.rb +46 -44
  39. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/binary_endpoint.rb +26 -0
  40. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/export_endpoint.rb +29 -0
  41. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/export_status_endpoint.rb +38 -0
  42. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/member_match_endpoint.rb +51 -0
  43. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/next_page_endpoint.rb +23 -0
  44. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/patient_endpoint.rb +25 -0
  45. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/patient_everything_endpoint.rb +34 -0
  46. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb +178 -0
  47. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/resource_read_endpoint.rb +21 -0
  48. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/resource_search_endpoint.rb +22 -0
  49. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/token_endpoint.rb +27 -0
  50. data/lib/davinci_pdex_test_kit/pdex_payer_client/mock_server.rb +53 -0
  51. data/lib/davinci_pdex_test_kit/pdex_payer_client/tags.rb +15 -0
  52. data/lib/davinci_pdex_test_kit/pdex_payer_client/urls.rb +51 -0
  53. data/lib/davinci_pdex_test_kit/pdex_payer_client_suite.rb +101 -144
  54. data/lib/davinci_pdex_test_kit/pdex_payer_server/coverage_to_link_minimal_data_validation.rb +1 -1
  55. data/lib/davinci_pdex_test_kit/pdex_payer_server/coverage_to_link_must_support_validation.rb +1 -1
  56. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_id_search_test.rb +5 -4
  57. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_identifier_search_test.rb +5 -4
  58. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_must_support_test.rb +3 -2
  59. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test.rb +7 -6
  60. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test.rb +7 -6
  61. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_type_search_test.rb +7 -6
  62. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_use_search_test.rb +6 -5
  63. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_provenance_revinclude_search_test.rb +10 -7
  64. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_read_test.rb +1 -1
  65. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_reference_resolution_test.rb +3 -2
  66. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_validation_test.rb +1 -1
  67. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/metadata.yml +12 -12
  68. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit_group.rb +12 -14
  69. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_patient_group.rb +3 -4
  70. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_validation_group.rb +2 -6
  71. data/lib/davinci_pdex_test_kit/pdex_payer_server/member_match_request_local_references_validation.rb +1 -1
  72. data/lib/davinci_pdex_test_kit/pdex_payer_server/member_match_request_profile_validation.rb +1 -3
  73. data/lib/davinci_pdex_test_kit/pdex_payer_server/multiple_member_matches_group.rb +7 -8
  74. data/lib/davinci_pdex_test_kit/pdex_payer_server/no_member_matches_group.rb +7 -8
  75. data/lib/davinci_pdex_test_kit/pdex_payer_server/patient_operation_in_capability_statement_validation.rb +1 -3
  76. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_clinical_data_group.rb +3 -5
  77. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_everything_group.rb +2 -4
  78. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_export_group.rb +2 -4
  79. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_member_match_group.rb +12 -13
  80. data/lib/davinci_pdex_test_kit/pdex_payer_server_suite.rb +13 -14
  81. data/lib/davinci_pdex_test_kit/version.rb +2 -3
  82. data/lib/davinci_pdex_test_kit.rb +1 -2
  83. metadata +65 -24
  84. data/lib/davinci_pdex_test_kit/ext/inferno_core/record_response_route.rb +0 -98
  85. data/lib/davinci_pdex_test_kit/ext/inferno_core/request.rb +0 -19
  86. data/lib/davinci_pdex_test_kit/ext/inferno_core/runnable.rb +0 -18
  87. data/lib/davinci_pdex_test_kit/mock_server.rb +0 -281
  88. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_submit_test.rb +0 -24
  89. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_submit_test.rb +0 -26
  90. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_validation_test.rb +0 -32
  91. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/metadata.yml +0 -61
  92. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_scratch_storing.rb +0 -32
  93. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_wait_test.rb +0 -31
  94. data/lib/davinci_pdex_test_kit/tags.rb +0 -11
  95. data/lib/davinci_pdex_test_kit/urls.rb +0 -77
  96. /data/lib/davinci_pdex_test_kit/{metadata → pdex_payer_client/mock_server/resources}/mock_capability_statement.json +0 -0
  97. /data/lib/davinci_pdex_test_kit/{metadata → pdex_payer_client/mock_server/resources}/mock_operation_outcome_resource.json +0 -0
@@ -1,57 +1,110 @@
1
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)
2
+ module PDexPayerClient
3
+ # Common utilities for Clinical Data Request Tests
4
+ # This module will be included in Inferno::Entities::Test
5
+ module ClientValidationTest
6
+
7
+ def check_resource_type_fetched_instances(resource_type)
8
+ load_clinical_data_into_scratch
9
+
10
+ skip_if scratch[resource_type].nil?, "No requests made for #{resource_type.to_s} resources."
11
+
12
+ not_fetched = []
13
+ SET_TO_BE_GATHERED[resource_type].each do |target_id|
14
+ not_fetched << target_id unless scratch[resource_type].any? { |resource| resource.id == target_id }
15
+ end
16
+
17
+ assert not_fetched.length == 0,
18
+ "Expected #{resource_type.to_s} instances not fetched: #{not_fetched.join(', ')}."
14
19
  end
15
- end
16
20
 
17
- def connect_bundle(export_binary)
18
- export_binary.split(/(?<=}\n)(?={)/).map { |str| FHIR.from_contents(str)}
19
- end
21
+ # @return [Hash<Inferno::Entities::Request, Array<FHIR::Model>>]
22
+ def previous_clinical_data_request_resources
23
+ return_hash = Hash.new { |hash, key| hash[key] = [] }
20
24
 
21
- def export_resources
22
- @export_resources ||= (load_tagged_requests(BINARY_TAG).map { |binary_read| binary_read.response_body.split("\n") }.flatten).map { |resource_in_binary| FHIR.from_contents(resource_in_binary)}
23
- end
25
+ previous_clinical_data_requests.each_with_object(return_hash) do |request, request_resource_hash|
24
26
 
25
- def previous_clinical_data_requests
26
- @previous_clinical_data_requests ||= load_tagged_requests(SUBMIT_TAG) + [everything_request].compact
27
- end
27
+ request_resources = []
28
+ if (request.status == 200) && request.resource # XXX request.response_body ?
29
+ case request.resource.resourceType
30
+ when 'Bundle'
31
+ request_resources = request.resource.entry.map(&:resource)
32
+ # when '...' # TODO handle other special resources
33
+ else
34
+ request_resources = [request.resource]
35
+ end
36
+ end
28
37
 
29
- def everything_request
30
- @everything_request ||= load_tagged_requests(EVERYTHING_TAG).first
31
- end
38
+ request_resource_hash[request].concat(request_resources)
39
+ end
40
+ end
32
41
 
33
- def member_match_request
34
- @member_match_request ||= load_tagged_requests(MEMBER_MATCH_TAG).first
35
- end
42
+ def load_clinical_data_into_scratch
43
+ return if scratch['loaded'].present?
36
44
 
37
- def export_request
38
- @export_request ||= load_tagged_requests(EXPORT_TAG).first
39
- end
45
+ previous_clinical_data_request_resources.each do |request, resources|
46
+ resources.each do |resource|
47
+ scratch[resource.resourceType.to_sym] ||= []
48
+ scratch[resource.resourceType.to_sym] |= [resource]
49
+ end
50
+ end
40
51
 
41
- def export_status_request
42
- @export_status_request ||= load_tagged_requests(EXPORT_STATUS_TAG).first
43
- end
52
+ if !export_resources.empty?
53
+ info "Attempted an $export request"
54
+ export_resources.each do |resource|
55
+ scratch[resource.resourceType.to_sym] ||= []
56
+ scratch[resource.resourceType.to_sym] |= [resource]
57
+ end
58
+ end
44
59
 
45
- # def patient_id_from_match_request
46
- # @patient_id_from_match_request ||= member_match_request ? "999" : nil #TODO: Change from static response
47
- # end
60
+ scratch['loaded'] = true
61
+ end
48
62
 
49
- def all_member_match_requests
50
- @all_member_match_requests ||= load_tagged_requests(MEMBER_MATCH_TAG)
51
- end
63
+ # @return [Array<Inferno::Entities::Request>]
64
+ def previous_clinical_data_requests
65
+ [] + load_tagged_requests(RESOURCE_REQUEST_TAG) + load_tagged_requests(EVERYTHING_TAG) # TODO add export request
66
+ end
67
+
68
+ def everything_request
69
+ @everything_request ||= load_tagged_requests(EVERYTHING_TAG).first
70
+ end
71
+
72
+ def member_match_request
73
+ @member_match_request ||= load_tagged_requests(MEMBER_MATCH_TAG).first
74
+ end
75
+
76
+ def export_request
77
+ @export_request ||= load_tagged_requests(EXPORT_TAG).first
78
+ end
79
+
80
+ def export_status_request
81
+ @export_status_request ||= load_tagged_requests(EXPORT_STATUS_TAG).first
82
+ end
83
+
84
+ def connect_bundle(export_binary)
85
+ export_binary.split(/(?<=}\n)(?={)/).map { |str| FHIR.from_contents(str)}
86
+ end
87
+
88
+ def export_resources
89
+ @export_resources ||= (load_tagged_requests(BINARY_TAG).map { |binary_read| binary_read.response_body.split("\n") }.flatten).map { |resource_in_binary| FHIR.from_contents(resource_in_binary) }
90
+ end
52
91
 
53
- def flattened_all_resources
54
- @flattened_all_resources ||= previous_clinical_data_request_resources.values.flatten
92
+ # def patient_id_from_match_request
93
+ # @patient_id_from_match_request ||= member_match_request ? "999" : nil #TODO: Change from static response
94
+ # end
95
+
96
+
97
+ def all_patient_id_search_requests
98
+ @everything_request ||= load_tagged_requests(PATIENT_ID_REQUEST_TAG)
99
+ end
100
+
101
+ def all_member_match_requests
102
+ @all_member_match_requests ||= load_tagged_requests(MEMBER_MATCH_TAG)
103
+ end
104
+
105
+ def flattened_all_resources
106
+ @flattened_all_resources ||= previous_clinical_data_request_resources.values.flatten
107
+ end
55
108
  end
56
109
  end
57
- end
110
+ end
@@ -0,0 +1,49 @@
1
+ module DaVinciPDexTestKit
2
+ module PDexPayerClient
3
+ class PDexClientWorkflowInteractionTest < Inferno::Test
4
+
5
+ id :pdex_client_workflow_interaction
6
+ title 'Client makes requests to Inferno'
7
+ description %(
8
+ This test will await requests from the client under test to demonstrate
9
+ the payer to payer data access workflow, including
10
+ - $member-match requests
11
+ - clinical data requests, including resource read and searches, patient-level $everything,
12
+ and group-level $export.
13
+ )
14
+ input :access_token
15
+ config options: { accepts_multiple_requests: true }
16
+
17
+ run do
18
+ wait(
19
+ identifier: access_token,
20
+ message: %(
21
+ Submit PDex requests to find a matching member and retrieve clinical data covering the
22
+ complete scope of [member health history data defined by
23
+ PDex](https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#member-health-history).
24
+ Available APIs under the Inferno base FHIR include:
25
+ * Single patient $member-match: `#{member_match_url}`
26
+ * Single Resource read and search API: `#{submit_url}`, with `:endpoint` replaced with
27
+ the target resource type.
28
+ * Patient-level $everything: `#{everything_url}`, with `:patient` replaced with the
29
+ id for the target patient.
30
+ * All Patients $export: see workflow process at
31
+ the [Bulk Data IG](https://hl7.org/fhir/uv/bulkdata/STU2/export.html#sequence-overview)
32
+ * Kick-off requests: `#{export_url}`.
33
+ * Export status requests: `#{export_status_url}?_jobId=:job` as returned in the `content-location`
34
+ header of the kick-off request response.
35
+ * Retrieval file Requests: `#{binary_url}` with `:id` replaced with an actual id as indicated
36
+ in the JSON manifest returned with the export status request when the job is completed.
37
+ Note that the `Accept` header should be `application/fhir+ndjson` on these requests.
38
+
39
+ All requests must include the `Authorization` header with value `Bearer #{access_token}`.
40
+
41
+ [Click here](#{resume_clinical_data_url}?token=#{access_token}) when finished making requests
42
+ for Inferno to evaluate.
43
+ ),
44
+ timeout: 900
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientAllergyIntoleranceSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientAllergyIntoleranceSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_allergyintolerance_clinical_data_request
9
+ title 'AllergyIntolerance resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type AllergyIntollerance
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :AllergyIntolerance
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientCarePlanSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientCarePlanSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_careplan_clinical_data_request
9
+ title 'CarePlan resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type CarePlan
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :CarePlan
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientCareTeamSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientCareTeamSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_careteam_clinical_data_request
9
+ title 'CareTeam resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type CareTeam
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :CareTeam
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -0,0 +1,24 @@
1
+ require_relative '../client_validation_test.rb'
2
+
3
+ module DaVinciPDexTestKit
4
+ module PDexPayerClient
5
+ class PDexClientClinicalDataRequestCheckTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_clinical_data_request_check
9
+ title 'Check for Clinical Data Requests'
10
+ description %(
11
+ This test will check that clinical data requests were made and that
12
+ at least some of them returned data for evaluation.
13
+ )
14
+
15
+ run do
16
+ load_clinical_data_into_scratch
17
+
18
+ assert requests.length > 0, 'No clinical requests received by Inferno.'
19
+ assert scratch&.length > 0,
20
+ 'No clinical data requests made by the client returned any data.'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientConditionSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientConditionSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_condition_clinical_data_request
9
+ title 'Condition resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Condition
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Condition
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  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"
4
+ module PDexPayerClient
5
+ class PDexClientDeviceSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_device_clinical_data_request
9
+ title 'Device resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Device
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
15
+
16
+ def target_resource_type
17
+ :Device
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientDiagnosticReportSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientDiagnosticReportSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_diagnosticreport_clinical_data_request
9
+ title 'DiagnosticReport resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type DiagnosticReport
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :DiagnosticReport
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientDocumentReferenceSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientDocumentReferenceSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_documentreference_clinical_data_request
9
+ title 'DocumentReference resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type DocumentReference
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :DocumentReference
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientEncounterSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientEncounterSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_encounter_clinical_data_request
9
+ title 'Encounter resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Encounter
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Encounter
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientExplanationOfBenefitSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientExplanationOfBenefitSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_explanationofbenefit_clinical_data_request
9
+ title 'ExplanationOfBenefit resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type ExplanationOfBenefit
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :ExplanationOfBenefit
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientGoalSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientGoalSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_goal_clinical_data_request
9
+ title 'Goal resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Goal
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Goal
18
+ end
19
+
20
+ run do
21
+ check_resource_type_fetched_instances(target_resource_type)
22
+ end
21
23
  end
22
24
  end
23
25
  end