davinci_pdex_test_kit 0.10.5 → 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,23 +1,25 @@
1
- require_relative '../../urls'
2
1
  require_relative '../client_validation_test.rb'
3
2
 
4
3
  module DaVinciPDexTestKit
5
- class PDexClientImmunizationSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientImmunizationSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_immunization_clinical_data_request
9
+ title 'Immunization resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Immunization
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Immunization
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 PDexClientLocationSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientLocationSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_location_clinical_data_request
9
+ title 'Location resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Location
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Location
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 PDexClientMedicationDispenseSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientMedicationDispenseSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_medicationdispense_clinical_data_request
9
+ title 'MedicationDispense resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type MedicationDispense
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :MedicationDispense
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 PDexClientMedicationRequestSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientMedicationRequestSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_medicationrequest_clinical_data_request
9
+ title 'MedicationRequest resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type MedicationRequest
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :MedicationRequest
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 PDexClientObservationSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientObservationSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_observation_clinical_data_request
9
+ title 'Observation resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Observation
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Observation
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 PDexClientOrganizationSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientOrganizationSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_organization_clinical_data_request
9
+ title 'Organization resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Organization
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Organization
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 PDexClientPatientSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientPatientSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_patient_clinical_data_request
9
+ title 'Patient resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Patient
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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 == '999'}, "Unable to find expected resource: 999"
16
+ def target_resource_type
17
+ :Patient
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,21 @@
1
+ require_relative '../client_validation_test.rb'
2
+
3
+ module DaVinciPDexTestKit
4
+ module PDexPayerClient
5
+ class PDexClientPatientIdSearchRequestCheckTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_patient_id_search_request_check
9
+ title 'Check for Patient Id Search'
10
+ description %(
11
+ This test will check that a Patient search was made to get the Patient's
12
+ resource `id` using the `identifier` returned by `$member-match`.
13
+ )
14
+
15
+ run do
16
+ assert all_patient_id_search_requests.length > 0,
17
+ 'Patient Id not requested using the identifier returned by `$member-match`.'
18
+ end
19
+ end
20
+ end
21
+ 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 PDexClientPractitionerSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientPractitionerSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_practitioner_clinical_data_request
9
+ title 'Practitioner resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Practitioner
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Practitioner
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 PDexClientPractitionerRoleSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientPractitionerRoleSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_practitionerrole_clinical_data_request
9
+ title 'PractitionerRole resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type PractitionerRole
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :PractitionerRole
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 PDexClientProcedureSubmitClinicalDataRequestTest < Inferno::Test
6
- include URLs
7
- include DaVinciPDexTestKit::ClientValidationTest
4
+ module PDexPayerClient
5
+ class PDexClientProcedureSubmitClinicalDataRequestTest < Inferno::Test
6
+ include ClientValidationTest
7
+
8
+ id :pdex_procedure_clinical_data_request
9
+ title 'Procedure resources related to the patient matched are gathered'
10
+ description %(
11
+ This test verify that the expected instances of resource type Procedure
12
+ were fetched by the client.
13
+ )
14
+ input :access_token
8
15
 
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"
16
+ def target_resource_type
17
+ :Procedure
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,46 +1,48 @@
1
1
  module DaVinciPDexTestKit
2
- SET_TO_BE_GATHERED = {AllergyIntolerance: ['pdex-AllergyIntolerance'],
3
- CarePlan: ['pdex-CarePlan'],
4
- CareTeam: ['pdex-CareTeam'],
5
- Condition: ['pdex-Condition'],
6
- Device: ['pdex-Device'],
7
- DiagnosticReport: ['pdex-DiagnosticReport'],
8
- DocumentReference: ['pdex-DocumentReference'],
9
- Encounter: ['pdex-Encounter'],
10
- ExplanationOfBenefit: ['pdex-ExplanationOfBenefit'],
11
- Goal: ['pdex-Goal'],
12
- Immunization: ['pdex-Immunization'],
13
- Location: ['pdex-Location'],
14
- MedicationDispense: ['pdex-MedicationDispense'],
15
- MedicationRequest: ['pdex-MedicationRequest'],
16
- Observation: ['pdex-Observation'],
17
- Organization: ['pdex-Organization'],
18
- Patient: ['999'],
19
- Practitioner: ['pdex-Practitioner'],
20
- PractitionerRole: ['pdex-PractitionerRole'],
21
- Procedure: ['pdex-Procedure']
22
- #TODO: What about Provenance?
23
- }
24
-
25
- SEARCHES_BY_PRIORITY = {AllergyIntolerance: [['patient']],
26
- CarePlan: [['category', 'patient']],
27
- CareTeam: [['patient', 'status']],
28
- Condition: [['category', 'patient'], ['patient']],
29
- Device: [['patient', 'type'], ['patient']],
30
- DiagnosticReport: [['category', 'date', 'patient'], ['code', 'patient'], ['category', 'patient'], ['patient']],
31
- DocumentReference: [['_id'], ['category', 'date', 'patient'], ['patient', 'type'], ['category', 'patient'], ['patient']],
32
- Encounter: [['_id'], ['date', 'patient'], ['patient']],
33
- ExplanationOfBenefit: [['_id'], ['patient'], ['identifier'], ['_lastUpdated'], ['service-date'], ['type']],
34
- Goal: [['patient']],
35
- Immunization: [['patient']],
36
- Location: [['name'], ['address']],
37
- MedicationDispense: [['patient']],
38
- MedicationRequest: [['intent', 'patient']],
39
- Observation: [['category', 'date', 'patient'], ['code', 'patient'], ['category', 'patient']],
40
- Organization: [['name'], ['address']],
41
- Patient: [['_id'], ['identifier'], ['birthdate', 'name'], ['gender', 'name'], ['name']],
42
- Practitioner: [['identifier'], ['name']],
43
- PractitionerRole: [['practitioner'], ['specialty']],
44
- Procedure: [['date', 'patient'], ['patient']],
2
+ module PDexPayerClient
3
+ SET_TO_BE_GATHERED = {AllergyIntolerance: ['pdex-AllergyIntolerance'],
4
+ CarePlan: ['pdex-CarePlan'],
5
+ CareTeam: ['pdex-CareTeam'],
6
+ Condition: ['pdex-Condition', 'pdex-Condition-2'],
7
+ Device: ['pdex-Device', 'pdex-implantable-Device'],
8
+ DiagnosticReport: ['pdex-DiagnosticReport'],
9
+ DocumentReference: ['pdex-DocumentReference'],
10
+ Encounter: ['pdex-Encounter'],
11
+ ExplanationOfBenefit: ['pdex-ExplanationOfBenefit'],
12
+ Goal: ['pdex-Goal'],
13
+ Immunization: ['pdex-Immunization'],
14
+ Location: ['pdex-Location'],
15
+ MedicationDispense: ['pdex-MedicationDispense'],
16
+ MedicationRequest: ['pdex-MedicationRequest'],
17
+ Observation: ['pdex-Observation', 'pdex-Vitals'],
18
+ Organization: ['pdex-Organization', 'pdex-Payor-Organization'],
19
+ Patient: ['999'],
20
+ Practitioner: ['pdex-Practitioner'],
21
+ PractitionerRole: ['pdex-PractitionerRole'],
22
+ Procedure: ['pdex-Procedure']
23
+ # TODO: What about Provenance?
45
24
  }
46
- end
25
+
26
+ SEARCHES_BY_PRIORITY = {AllergyIntolerance: [['patient']],
27
+ CarePlan: [['category', 'patient']],
28
+ CareTeam: [['patient', 'status']],
29
+ Condition: [['category', 'patient'], ['patient']],
30
+ Device: [['patient', 'type'], ['patient']],
31
+ DiagnosticReport: [['category', 'date', 'patient'], ['code', 'patient'], ['category', 'patient'], ['patient']],
32
+ DocumentReference: [['_id'], ['category', 'date', 'patient'], ['patient', 'type'], ['category', 'patient'], ['patient']],
33
+ Encounter: [['_id'], ['date', 'patient'], ['patient']],
34
+ ExplanationOfBenefit: [['_id'], ['patient'], ['identifier'], ['_lastUpdated'], ['service-date'], ['type']],
35
+ Goal: [['patient']],
36
+ Immunization: [['patient']],
37
+ Location: [['name'], ['address']],
38
+ MedicationDispense: [['patient']],
39
+ MedicationRequest: [['intent', 'patient']],
40
+ Observation: [['category', 'date', 'patient'], ['code', 'patient'], ['category', 'patient']],
41
+ Organization: [['name'], ['address']],
42
+ Patient: [['_id'], ['identifier'], ['birthdate', 'name'], ['gender', 'name'], ['name']],
43
+ Practitioner: [['identifier'], ['name']],
44
+ PractitionerRole: [['practitioner'], ['specialty']],
45
+ Procedure: [['date', 'patient'], ['patient']],
46
+ }
47
+ end
48
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../tags'
2
+ require_relative 'proxy_endpoint'
3
+
4
+ module DaVinciPDexTestKit
5
+ module PDexPayerClient
6
+ module MockServer
7
+ class BinaryEndpoint < ProxyEndpoint
8
+
9
+ def make_response
10
+ binary_id = request.url.split('/').last
11
+ server_response = server_proxy.get('Binary/'+binary_id) do |request|
12
+ request.headers['Accept'] = 'application/fhir+ndjson'
13
+ end
14
+ response.format = 'application/fhir+ndjson'
15
+ response.body = server_response.body
16
+ response.status = server_response.status
17
+ end
18
+
19
+ def tags
20
+ [BINARY_TAG]
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ require_relative '../tags'
2
+ require_relative '../urls'
3
+ require_relative 'proxy_endpoint'
4
+
5
+ module DaVinciPDexTestKit
6
+ module PDexPayerClient
7
+ module MockServer
8
+ class ExportEndpoint < ProxyEndpoint
9
+
10
+ include ::DaVinciPDexTestKit::PDexPayerClient::URLs
11
+
12
+ def make_response
13
+ http_headers_as_hash = request.env.select { |k,v| k.start_with? 'HTTP_'}.transform_keys { |k| k.sub(/^HTTP_/, '').split('_').map(&:capitalize).join('-') }
14
+ server_response = server_proxy.get do |req|
15
+ req.url 'Group/pdex-Group/$export' # TODO: change from static response
16
+ req.headers = http_headers_as_hash.merge(server_proxy.headers)
17
+ end
18
+ response.headers["content-location"] = server_response.headers["content-location"]&.gsub(/(.*)\?/, "#{base_fhir_url}/$export-poll-status?")
19
+ response.body = server_response.body
20
+ end
21
+
22
+ def tags
23
+ [EXPORT_TAG]
24
+ end
25
+
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,38 @@
1
+ require_relative '../tags'
2
+ require_relative '../urls'
3
+ require_relative 'proxy_endpoint'
4
+
5
+ module DaVinciPDexTestKit
6
+ module PDexPayerClient
7
+ module MockServer
8
+ class ExportStatusEndpoint < ProxyEndpoint
9
+
10
+ include ::DaVinciPDexTestKit::PDexPayerClient::URLs
11
+
12
+ def make_response
13
+ http_headers_as_hash = request.env.select { |k,v| k.start_with? 'HTTP_'}.transform_keys { |k| k.sub(/^HTTP_/, '').split('_').map(&:capitalize).join('-') }
14
+
15
+ server_response = server_proxy.get do |req|
16
+ req.url '$export-poll-status'
17
+ req.params = request.params
18
+ req.headers = http_headers_as_hash.merge(server_proxy.headers)
19
+ end
20
+
21
+ response.format = 'application/fhir+json'
22
+ response.body = (server_response.status.to_i == 200) ? replace_export_urls(JSON.parse(server_response.body)).to_json : server_response.body
23
+ end
24
+
25
+ def tags
26
+ [EXPORT_STATUS_TAG]
27
+ end
28
+
29
+ def replace_export_urls(export_status_output)
30
+ export_status_output['output'].map! { |binary| {type: binary["type"], url: binary["url"].gsub(fhir_reference_server, base_fhir_url)} }
31
+ export_status_output['request'] = export_url
32
+ export_status_output
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ end