davinci_pdex_test_kit 0.10.6 → 0.12.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 (131) 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 +21 -17
  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 +50 -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 +99 -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/device/device_must_support_test.rb +50 -0
  57. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_search_test.rb +68 -0
  58. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_type_search_test.rb +54 -0
  59. data/lib/davinci_pdex_test_kit/pdex_payer_server/{explanation_of_benefit/explanation_of_benefit_provenance_revinclude_search_test.rb → device/device_provenance_revinclude_search_test.rb} +16 -13
  60. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_read_test.rb +26 -0
  61. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_reference_resolution_test.rb +42 -0
  62. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_validation_test.rb +39 -0
  63. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/metadata.yml +154 -0
  64. data/lib/davinci_pdex_test_kit/pdex_payer_server/device_group.rb +88 -0
  65. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_id_search_test.rb +10 -26
  66. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_identifier_search_test.rb +13 -26
  67. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_must_support_test.rb +40 -7
  68. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_lastupdated_search_test.rb +48 -0
  69. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_search_test.rb +62 -0
  70. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test.rb +13 -28
  71. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_type_search_test.rb +12 -28
  72. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_read_test.rb +1 -1
  73. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_reference_resolution_test.rb +10 -6
  74. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_validation_test.rb +10 -11
  75. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/metadata.yml +285 -273
  76. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit_group.rb +69 -73
  77. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_patient_group.rb +11 -13
  78. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_validation_group.rb +3 -8
  79. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_must_support_test.rb +42 -0
  80. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_search_test.rb +64 -0
  81. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_search_test.rb +54 -0
  82. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_type_search_test.rb +55 -0
  83. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_provenance_revinclude_search_test.rb +54 -0
  84. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_read_test.rb +26 -0
  85. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_reference_resolution_test.rb +42 -0
  86. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_validation_test.rb +39 -0
  87. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/metadata.yml +206 -0
  88. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense_group.rb +69 -0
  89. data/lib/davinci_pdex_test_kit/pdex_payer_server/member_match_request_local_references_validation.rb +1 -1
  90. data/lib/davinci_pdex_test_kit/pdex_payer_server/member_match_request_profile_validation.rb +1 -3
  91. data/lib/davinci_pdex_test_kit/pdex_payer_server/multiple_member_matches_group.rb +36 -37
  92. data/lib/davinci_pdex_test_kit/pdex_payer_server/no_member_matches_group.rb +30 -31
  93. data/lib/davinci_pdex_test_kit/pdex_payer_server/patient_operation_in_capability_statement_validation.rb +16 -16
  94. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/metadata.yml +173 -0
  95. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_must_support_test.rb +51 -0
  96. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_read_test.rb +26 -0
  97. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_reference_resolution_test.rb +46 -0
  98. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_validation_test.rb +39 -0
  99. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance_group.rb +59 -0
  100. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_clinical_data_group.rb +25 -16
  101. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_everything_group.rb +21 -10
  102. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_export_group.rb +24 -20
  103. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_member_match_group.rb +56 -38
  104. data/lib/davinci_pdex_test_kit/pdex_payer_server_suite.rb +124 -112
  105. data/lib/davinci_pdex_test_kit/pdex_provider_client_suite.rb +8 -8
  106. data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_out_of_scope_requirements.csv +1 -0
  107. data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_requirements.csv +64 -0
  108. data/lib/davinci_pdex_test_kit/requirements/generated/davinci-pdex-test-kit_requirements_coverage.csv +64 -0
  109. data/lib/davinci_pdex_test_kit/version.rb +2 -3
  110. data/lib/davinci_pdex_test_kit.rb +2 -2
  111. data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
  112. data/lib/inferno_requirements_tools/rake/rakefile_template +19 -0
  113. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
  114. data/lib/requirements_config.yaml +17 -0
  115. metadata +113 -27
  116. data/lib/davinci_pdex_test_kit/ext/inferno_core/record_response_route.rb +0 -98
  117. data/lib/davinci_pdex_test_kit/ext/inferno_core/request.rb +0 -19
  118. data/lib/davinci_pdex_test_kit/ext/inferno_core/runnable.rb +0 -18
  119. data/lib/davinci_pdex_test_kit/mock_server.rb +0 -281
  120. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_submit_test.rb +0 -24
  121. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_submit_test.rb +0 -26
  122. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/client_member_match_must_support_validation_test.rb +0 -32
  123. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_must_support_tests/metadata.yml +0 -61
  124. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_scratch_storing.rb +0 -32
  125. data/lib/davinci_pdex_test_kit/pdex_payer_client/clinical_data_request_tests/initial_wait_test.rb +0 -31
  126. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test.rb +0 -63
  127. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_use_search_test.rb +0 -68
  128. data/lib/davinci_pdex_test_kit/tags.rb +0 -11
  129. data/lib/davinci_pdex_test_kit/urls.rb +0 -77
  130. /data/lib/davinci_pdex_test_kit/{metadata → pdex_payer_client/mock_server/resources}/mock_capability_statement.json +0 -0
  131. /data/lib/davinci_pdex_test_kit/{metadata → pdex_payer_client/mock_server/resources}/mock_operation_outcome_resource.json +0 -0
@@ -1,105 +1,101 @@
1
- # frozen_string_literal: true
2
-
3
- require 'us_core_test_kit/generator/group_metadata'
4
- require_relative 'explanation_of_benefit/explanation_of_benefit_patient_use_search_test'
1
+ require_relative 'explanation_of_benefit/explanation_of_benefit_patient_search_test'
5
2
  require_relative 'explanation_of_benefit/explanation_of_benefit_id_search_test'
6
- require_relative 'explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test'
7
- require_relative 'explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test'
3
+ require_relative 'explanation_of_benefit/explanation_of_benefit_patient_lastupdated_search_test'
8
4
  require_relative 'explanation_of_benefit/explanation_of_benefit_patient_type_search_test'
9
5
  require_relative 'explanation_of_benefit/explanation_of_benefit_identifier_search_test'
6
+ require_relative 'explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test'
10
7
  require_relative 'explanation_of_benefit/explanation_of_benefit_read_test'
11
- require_relative 'explanation_of_benefit/explanation_of_benefit_provenance_revinclude_search_test'
12
8
  require_relative 'explanation_of_benefit/explanation_of_benefit_validation_test'
13
9
  require_relative 'explanation_of_benefit/explanation_of_benefit_must_support_test'
14
10
  require_relative 'explanation_of_benefit/explanation_of_benefit_reference_resolution_test'
15
11
 
16
12
  module DaVinciPDexTestKit
17
13
  module PDexPayerServer
18
-
19
- # PDex PriorAuthorization Profile for ExplanationOfBenefit Resource Test Group
20
14
  class ExplanationOfBenefitGroup < Inferno::TestGroup
21
- id :pdex_explanation_of_benefit_group
22
15
  title 'PDex Prior Authorization Tests'
23
- short_description 'Verify support for the server capabilities required by the PDex Prior Authorization Profile.'
16
+ short_description 'Verify support for the server capabilities required by the PDex Prior Authorization.'
24
17
  description %(
25
- # Background
18
+ # Background
19
+
20
+ The PDex Prior Authorization sequence verifies that the system under test is
21
+ able to provide correct responses for ExplanationOfBenefit queries. These queries
22
+ must contain resources conforming to the PDex Prior Authorization as
23
+ specified in the PDex v2.0.0 Implementation Guide.
26
24
 
27
- The PDex Prior Authorization sequence verifies that the system under test is
28
- able to provide correct responses for ExplanationOfBenefit queries. These queries
29
- must contain resources conforming to the PDex Prior Authorization Profile as
30
- specified in the Da Vinci PDex v2.0.0 Implementation Guide.
25
+ # Testing Methodology
26
+ ## Searching
27
+ This test sequence will first perform each required search associated
28
+ with this resource. This sequence will perform searches with the
29
+ following parameters:
31
30
 
32
- # Testing Methodology
33
- ## Searching
34
- This test sequence will first perform each required search associated
35
- with this resource. This sequence will perform searches with the
36
- following parameters:
31
+ * patient
32
+ * _id
33
+ * patient + _lastUpdated
34
+ * patient + type
35
+ * identifier
36
+ * patient + service-date
37
37
 
38
- * patient + use
39
- * _id
40
- * patient + _lastUpdated
41
- * patient + service-date
42
- * patient + type
43
- * identifier
38
+ ### Search Parameters
39
+ The first search uses the selected patient(s) from the prior launch
40
+ sequence. Any subsequent searches will look for its parameter values
41
+ from the results of the first search. For example, the `identifier`
42
+ search in the patient sequence is performed by looking for an existing
43
+ `Patient.identifier` from any of the resources returned in the `_id`
44
+ search. If a value cannot be found this way, the search is skipped.
44
45
 
45
- ### Search Parameters
46
- The first search uses the selected patient(s) from the Patient Tests group.
47
- Any subsequent searches will look for its parameter values
48
- from the results of the first search. For example, the `provider`
49
- search in this sequence is performed by looking for an existing
50
- `ExplanationOfBenefit.provider` from any of the resources returned in the `patient`
51
- search. If a value cannot be found this way, the search is skipped.
46
+ ### Search Validation
47
+ Inferno will retrieve up to the first 20 bundle pages of the reply for
48
+ ExplanationOfBenefit resources and save them for subsequent tests. Each of
49
+ these resources is then checked to see if it matches the searched
50
+ parameters in accordance with [FHIR search
51
+ guidelines](https://www.hl7.org/fhir/search.html). The test will fail,
52
+ for example, if a Patient search for `gender=male` returns a `female`
53
+ patient.
52
54
 
53
- ### Search Validation
54
- Inferno will retrieve up to the first 20 bundle pages of the reply for
55
- ExplanationOfBenefit resources and save them for subsequent tests. Each of
56
- these resources is then checked to see if it matches the searched
57
- parameters in accordance with [FHIR search
58
- guidelines](https://www.hl7.org/fhir/search.html). The test will fail,
59
- for example, if a Patient search for `gender=male` returns a `female`
60
- patient.
61
55
 
62
- ## Must Support
63
- Each profile contains elements marked as "must support". This test
64
- sequence expects to see each of these elements at least once. If at
65
- least one cannot be found, the test will fail. The test will look
66
- through the ExplanationOfBenefit resources found in the first test for these
67
- elements.
56
+ ## Must Support
57
+ Each profile contains elements marked as "must support". This test
58
+ sequence expects to see each of these elements at least once. If at
59
+ least one cannot be found, the test will fail. The test will look
60
+ through the ExplanationOfBenefit resources found in the first test for these
61
+ elements.
68
62
 
69
- ## Profile Validation
70
- Each resource returned from the first search is expected to conform to
71
- the [PDex Prior Authorization Profile](http://hl7.org/fhir/us/davinci-pdex/StructureDefinition-pdex-priorauthorization.html).
72
- Each element is checked against teminology binding and cardinality requirements.
63
+ ## Profile Validation
64
+ Each resource returned from the first search is expected to conform to
65
+ the [PDex Prior Authorization](http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-priorauthorization). Each element is checked against
66
+ teminology binding and cardinality requirements.
73
67
 
74
- Elements with a required binding are validated against their bound
75
- ValueSet. If the code/system in the element is not part of the ValueSet,
76
- then the test will fail.
68
+ Elements with a required binding are validated against their bound
69
+ ValueSet. If the code/system in the element is not part of the ValueSet,
70
+ then the test will fail.
77
71
 
78
- ## Reference Validation
79
- At least one instance of each external reference in elements marked as
80
- "must support" within the resources provided by the system must resolve.
81
- The test will attempt to read each reference found and will fail if no
82
- read succeeds.
72
+ ## Reference Validation
73
+ At least one instance of each external reference in elements marked as
74
+ "must support" within the resources provided by the system must resolve.
75
+ The test will attempt to read each reference found and will fail if no
76
+ read succeeds.
83
77
  )
84
78
 
79
+ id :pdex_eob
85
80
  run_as_group
86
81
 
87
82
  def self.metadata
88
- # TODO: create metadata.yml to fit GroupMetadata OR circumvent metadata
89
- @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'explanation_of_benefit', 'metadata.yml')), aliases: true)
83
+ @metadata ||= USCoreTestKit::USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(
84
+ File.join(__dir__, 'explanation_of_benefit',
85
+ 'metadata.yml'), aliases: true
86
+ ))
90
87
  end
91
88
 
92
- test from: :pdex_explanation_of_benefit_patient_use_search_test
93
- test from: :pdex_explanation_of_benefit__id_search_test
94
- test from: :pdex_explanation_of_benefit_patient__last_updated_search_test
95
- test from: :pdex_explanation_of_benefit_patient_service_date_search_test
96
- test from: :pdex_explanation_of_benefit_patient_type_search_test
97
- test from: :pdex_explanation_of_benefit_identifier_search_test
98
- test from: :pdex_explanation_of_benefit_read_test
99
- test from: :pdex_explanation_of_benefit_provenance_revinclude_search_test
100
- test from: :pdex_explanation_of_benefit_validation_test
101
- test from: :pdex_explanation_of_benefit_must_support_test
102
- # test from: :pdex_explanation_of_benefit_reference_resolution_test
89
+ test from: :pdex_eob_patient_search
90
+ test from: :pdex_eob_id_search
91
+ test from: :pdex_eob_patient_last_updated_search
92
+ test from: :pdex_eob_patient_type_search
93
+ test from: :pdex_eob_identifier_search
94
+ test from: :pdex_eob_patient_service_date_search
95
+ test from: :pdex_eob_read
96
+ test from: :pdex_eob_validation
97
+ test from: :pdex_eob_must_support
98
+ test from: :pdex_eob_ref_resolution
103
99
  end
104
100
  end
105
101
  end
@@ -1,9 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'tls_test_kit'
4
2
 
5
- # require 'bulk_data_test_kit/v1.0.1/bulk_data_export_operation_support_test'
6
- require 'bulk_data_test_kit/v1.0.1/bulk_data_no_auth_test'
7
3
  require 'bulk_data_test_kit/v1.0.1/bulk_data_export_kick_off_test'
8
4
  require 'bulk_data_test_kit/v1.0.1/bulk_data_status_check_test'
9
5
  require 'bulk_data_test_kit/v1.0.1/bulk_data_output_check_test'
@@ -18,15 +14,13 @@ module DaVinciPDexTestKit
18
14
  description <<~DESCRIPTION
19
15
  Verify that patient level export on the Bulk Data server follow the Bulk Data Access Implementation Guide
20
16
  DESCRIPTION
21
- id :pdex_patient_export_group
17
+ id :pdex_patient_export
22
18
  optional
23
19
 
24
20
  run_as_group
25
21
 
26
- input :bearer_token,
27
- title: 'Bulk Data Authorization Bearer Token',
28
- description: 'The authorization bearer token for the Bulk FHIR server. If not required, leave blank.',
29
- optional: true
22
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@42'
23
+
30
24
  input :bulk_timeout,
31
25
  title: 'Export Times Out after (1-600)',
32
26
  description: <<~DESCRIPTION,
@@ -39,11 +33,13 @@ module DaVinciPDexTestKit
39
33
 
40
34
  output :patient_requires_access_token, :patient_status_output, :patient_bulk_download_url
41
35
 
42
- test from: :patient_operation_in_capability_statement_validation,
36
+ test from: :pdex_patient_operation_in_cap_stmt_validation,
37
+ id: :pdex_patient_export_in_cap_stmt,
43
38
  title: 'Bulk Data Server declares support for Patient export operation in CapabilityStatement',
44
39
  config: {
45
- options: { operation_name: 'export', operation_url: 'http://hl7.org/fhir/uv/bulkdata/OperationDefinition/patient-export' }
46
- }
40
+ options: { operation_name: 'export', operation_url: 'http://hl7.org/fhir/uv/bulkdata/OperationDefinition/patient-export', client: :bulk_server }
41
+ },
42
+ verifies_requirements: 'hl7.fhir.us.davinci-pdex_2.0.0@47'
47
43
 
48
44
  test from: :bulk_data_kick_off,
49
45
  id: :pdex_export_patient_kick_off,
@@ -55,7 +51,9 @@ module DaVinciPDexTestKit
55
51
  test from: :bulk_data_status_check,
56
52
  id: :pdex_export_patient_status_check,
57
53
  config: {
58
- inputs: { polling_url: { name: :patient_polling_url } },
54
+ inputs: {
55
+ polling_url: { name: :patient_polling_url },
56
+ },
59
57
  outputs: {
60
58
  status_response: { name: :patient_status_response },
61
59
  requires_access_token: { name: :patient_requires_access_token }
@@ -1,8 +1,3 @@
1
- # export_validation_group.rb
2
-
3
- # frozen_string_literal: true
4
-
5
- # require 'bulk_data_test_kit/v1.0.1/bulk_data_multiple_patients_test'
6
1
  require 'bulk_data_test_kit/v1.0.1/bulk_data_ndjson_download_test'
7
2
  require 'bulk_data_test_kit/v1.0.1/bulk_data_valid_resources_test'
8
3
 
@@ -17,7 +12,7 @@ module DaVinciPDexTestKit
17
12
 
18
13
  id :pdex_export_validation
19
14
 
20
- input :patient_status_output, :patient_requires_access_token, :bearer_token, :patient_bulk_download_url
15
+ input :patient_status_output, :patient_requires_access_token, :patient_bulk_download_url
21
16
  input :lines_to_validate,
22
17
  title: 'Limit validation to a maximum resource count',
23
18
  description: 'To validate all, leave blank.',
@@ -36,7 +31,7 @@ module DaVinciPDexTestKit
36
31
  server SHALL be secured using Transport Layer Security (TLS)
37
32
  Protocol Version 1.2 (RFC5246).
38
33
  DESCRIPTION
39
- id :bulk_file_server_tls_version
34
+ id :pdex_bulk_file_server_tls_version
40
35
 
41
36
  config(
42
37
  inputs: { url: { name: :patient_bulk_download_url } },
@@ -45,7 +40,7 @@ module DaVinciPDexTestKit
45
40
  end
46
41
 
47
42
  test from: :bulk_data_valid_resources,
48
- id: :bulk_data_patient_valid_resources,
43
+ id: :pdex_bulk_data_patient_valid_resources,
49
44
  config: {
50
45
  inputs: {
51
46
  status_output: { name: :patient_status_output },
@@ -0,0 +1,42 @@
1
+ require 'us_core_test_kit/must_support_test'
2
+ require 'us_core_test_kit/generator/group_metadata'
3
+
4
+ module DaVinciPDexTestKit
5
+ module PDexPayerServer
6
+ class MedicationDispenseMustSupportTest < Inferno::Test
7
+ include USCoreTestKit::MustSupportTest
8
+
9
+ title 'All must support elements are provided in the MedicationDispense resources returned'
10
+ description %(
11
+ PDex Responders SHALL be capable of populating all data elements as
12
+ part of the query results as specified by the PDex Server Capability
13
+ Statement. This test will look through the MedicationDispense resources
14
+ found previously for the following must support elements:
15
+
16
+ * MedicationDispense.status
17
+ * MedicationDispense.subject
18
+ * MedicationDispense.substitution
19
+ * MedicationDispense.substitution.wasSubstituted
20
+ )
21
+
22
+ id :pdex_medication_dispense_must_support
23
+
24
+ def resource_type
25
+ 'MedicationDispense'
26
+ end
27
+
28
+ def self.metadata
29
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
30
+ aliases: true))
31
+ end
32
+
33
+ def scratch_resources
34
+ scratch[:medication_dispense_resources] ||= {}
35
+ end
36
+
37
+ run do
38
+ perform_must_support_test(all_scratch_resources)
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,64 @@
1
+ require 'us_core_test_kit/search_test'
2
+ require 'us_core_test_kit/search_test_properties'
3
+ require 'us_core_test_kit/generator/group_metadata'
4
+
5
+ module DaVinciPDexTestKit
6
+ module PDexPayerServer
7
+ class MedicationDispensePatientSearchTest < Inferno::Test
8
+ include USCoreTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for MedicationDispense search by patient'
11
+ description %(
12
+ A server SHALL support searching by
13
+ patient on the MedicationDispense resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ This test verifies that the server supports searching by reference using
18
+ the form `patient=[id]` as well as `patient=Patient/[id]`. The two
19
+ different forms are expected to return the same number of results. US
20
+ Core requires that both forms are supported by PDex responders.
21
+
22
+ Because this is the first search of the sequence, resources in the
23
+ response will be used for subsequent tests.
24
+
25
+ Additionally, this test will check that GET and POST search methods
26
+ return the same number of results. Search by POST is required by the
27
+ FHIR R4 specification, and these tests interpret search by GET as a
28
+ requirement of PDex v2.0.0.
29
+
30
+ [PDex Server CapabilityStatement](https://hl7.org/fhir/us/davinci-pdex/STU2/CapabilityStatement-pdex-server.html)
31
+ )
32
+
33
+ id :pdex_medication_dispense_patient_search
34
+ input :patient_ids,
35
+ title: 'Patient IDs',
36
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
37
+
38
+ def self.properties
39
+ @properties ||= USCoreTestKit::SearchTestProperties.new(
40
+ first_search: true,
41
+ resource_type: 'MedicationDispense',
42
+ search_param_names: ['patient'],
43
+ test_medication_inclusion: true,
44
+ test_reference_variants: true,
45
+ multiple_or_search_params: ['status'],
46
+ test_post_search: true
47
+ )
48
+ end
49
+
50
+ def self.metadata
51
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
52
+ aliases: true))
53
+ end
54
+
55
+ def scratch_resources
56
+ scratch[:medication_dispense_resources] ||= {}
57
+ end
58
+
59
+ run do
60
+ run_search_test
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,54 @@
1
+ require 'us_core_test_kit/search_test'
2
+ require 'us_core_test_kit/search_test_properties'
3
+ require 'us_core_test_kit/generator/group_metadata'
4
+
5
+ module DaVinciPDexTestKit
6
+ module PDexPayerServer
7
+ class MedicationDispensePatientStatusSearchTest < Inferno::Test
8
+ include USCoreTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for MedicationDispense search by patient + status'
11
+ description %(
12
+ A server SHOULD support searching by
13
+ patient + status on the MedicationDispense resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ If any MedicationDispense resources use external references to
18
+ Medications, the search will be repeated with
19
+ `_include=MedicationDispense:medication`.
20
+
21
+ [PDex Server CapabilityStatement](https://hl7.org/fhir/us/davinci-pdex/STU2/CapabilityStatement-pdex-server.html)
22
+ )
23
+
24
+ id :pdex_medication_dispense_patient_status_search
25
+ optional
26
+
27
+ input :patient_ids,
28
+ title: 'Patient IDs',
29
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
30
+
31
+ def self.properties
32
+ @properties ||= USCoreTestKit::SearchTestProperties.new(
33
+ resource_type: 'MedicationDispense',
34
+ search_param_names: ['patient', 'status'],
35
+ test_medication_inclusion: true,
36
+ multiple_or_search_params: ['status']
37
+ )
38
+ end
39
+
40
+ def self.metadata
41
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
42
+ aliases: true))
43
+ end
44
+
45
+ def scratch_resources
46
+ scratch[:medication_dispense_resources] ||= {}
47
+ end
48
+
49
+ run do
50
+ run_search_test
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,55 @@
1
+ require 'us_core_test_kit/search_test'
2
+ require 'us_core_test_kit/search_test_properties'
3
+ require 'us_core_test_kit/generator/group_metadata'
4
+
5
+ module DaVinciPDexTestKit
6
+ module PDexPayerServer
7
+ class MedicationDispensePatientStatusTypeSearchTest < Inferno::Test
8
+ include USCoreTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for MedicationDispense search by patient + status + type'
11
+ description %(
12
+ A server SHOULD support searching by
13
+ patient + status + type on the MedicationDispense resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ If any MedicationDispense resources use external references to
18
+ Medications, the search will be repeated with
19
+ `_include=MedicationDispense:medication`.
20
+
21
+ [PDex Server CapabilityStatement](https://hl7.org/fhir/us/davinci-pdex/STU2/CapabilityStatement-pdex-server.html)
22
+ )
23
+
24
+ id :pdex_medication_dispense_patient_status_type_search
25
+ optional
26
+
27
+ input :patient_ids,
28
+ title: 'Patient IDs',
29
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
30
+
31
+ def self.properties
32
+ @properties ||= USCoreTestKit::SearchTestProperties.new(
33
+ resource_type: 'MedicationDispense',
34
+ search_param_names: ['patient', 'status', 'type'],
35
+ test_medication_inclusion: true,
36
+ token_search_params: ['type'],
37
+ multiple_or_search_params: ['status', 'type']
38
+ )
39
+ end
40
+
41
+ def self.metadata
42
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
43
+ aliases: true))
44
+ end
45
+
46
+ def scratch_resources
47
+ scratch[:medication_dispense_resources] ||= {}
48
+ end
49
+
50
+ run do
51
+ run_search_test
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,54 @@
1
+ require 'us_core_test_kit/search_test'
2
+ require 'us_core_test_kit/generator/group_metadata'
3
+
4
+ module DaVinciPDexTestKit
5
+ module PDexPayerServer
6
+ class MedicationDispenseProvenanceRevincludeSearchTest < Inferno::Test
7
+ include USCoreTestKit::SearchTest
8
+
9
+ title 'Server returns Provenance resources from MedicationDispense search by patient + status + revInclude:Provenance:target'
10
+ description %(
11
+ A server SHALL be capable of supporting _revIncludes:Provenance:target.
12
+
13
+ This test will perform a search by patient + status + revInclude:Provenance:target and
14
+ will pass if a Provenance resource is found in the response.
15
+ %)
16
+
17
+ id :pdex_medication_dispense_provenance_revinclude_search
18
+
19
+ input :patient_ids,
20
+ title: 'Patient IDs',
21
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
22
+
23
+ def properties
24
+ @properties ||= USCoreTestKit::SearchTestProperties.new(
25
+ resource_type: 'MedicationDispense',
26
+ search_param_names: ['patient', 'status']
27
+ )
28
+ end
29
+
30
+ def self.metadata
31
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml')))
32
+ end
33
+
34
+ def self.provenance_metadata
35
+ @provenance_metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(
36
+ File.join(__dir__, '..', 'provenance',
37
+ 'metadata.yml'), aliases: true
38
+ ))
39
+ end
40
+
41
+ def scratch_resources
42
+ scratch[:medication_dispense_resources] ||= {}
43
+ end
44
+
45
+ def scratch_provenance_resources
46
+ scratch[:provenance_resources] ||= {}
47
+ end
48
+
49
+ run do
50
+ run_provenance_revinclude_search_test
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,26 @@
1
+ require 'us_core_test_kit/read_test'
2
+
3
+ module DaVinciPDexTestKit
4
+ module PDexPayerServer
5
+ class MedicationDispenseReadTest < Inferno::Test
6
+ include USCoreTestKit::ReadTest
7
+
8
+ title 'Server returns correct MedicationDispense resource from MedicationDispense read interaction'
9
+ description 'A server SHALL support the MedicationDispense read interaction.'
10
+
11
+ id :pdex_medication_dispense_read
12
+
13
+ def resource_type
14
+ 'MedicationDispense'
15
+ end
16
+
17
+ def scratch_resources
18
+ scratch[:medication_dispense_resources] ||= {}
19
+ end
20
+
21
+ run do
22
+ perform_read_test(all_scratch_resources)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,42 @@
1
+ require 'us_core_test_kit/reference_resolution_test'
2
+ require 'us_core_test_kit/generator/group_metadata'
3
+
4
+ module DaVinciPDexTestKit
5
+ module PDexPayerServer
6
+ class MedicationDispenseReferenceResolutionTest < Inferno::Test
7
+ include USCoreTestKit::ReferenceResolutionTest
8
+
9
+ title 'MustSupport references within MedicationDispense resources are valid'
10
+ description %(
11
+ This test will attempt to read external references provided within elements
12
+ marked as 'MustSupport', if any are available.
13
+
14
+ It verifies that at least one external reference for each MustSupport Reference element
15
+ can be accessed by the test client, and conforms to corresponding PDex profile.
16
+
17
+ Elements which may provide external references include:
18
+
19
+ * MedicationDispense.subject
20
+ )
21
+
22
+ id :pdex_medication_dispense_ref_resolution
23
+
24
+ def resource_type
25
+ 'MedicationDispense'
26
+ end
27
+
28
+ def self.metadata
29
+ @metadata ||= USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'),
30
+ aliases: true))
31
+ end
32
+
33
+ def scratch_resources
34
+ scratch[:medication_dispense_resources] ||= {}
35
+ end
36
+
37
+ run do
38
+ perform_reference_resolution_test(scratch_resources[:all])
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,39 @@
1
+ require 'us_core_test_kit/validation_test'
2
+
3
+ module DaVinciPDexTestKit
4
+ module PDexPayerServer
5
+ class MedicationDispenseValidationTest < Inferno::Test
6
+ include USCoreTestKit::ValidationTest
7
+
8
+ id :pdex_medication_dispense_validation
9
+ title 'MedicationDispense resources returned during previous tests conform to the PDex MedicationDispense'
10
+ description %(
11
+ This test verifies resources returned from the first search conform to
12
+ the [PDex MedicationDispense](http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-medicationdispense).
13
+ Systems must demonstrate at least one valid example in order to pass this test.
14
+
15
+ It verifies the presence of mandatory elements and that elements with
16
+ required bindings contain appropriate values. CodeableConcept element
17
+ bindings will fail if none of their codings have a code/system belonging
18
+ to the bound ValueSet. Quantity, Coding, and code element bindings will
19
+ fail if their code/system are not found in the valueset.
20
+ )
21
+ output :dar_code_found, :dar_extension_found
22
+
23
+ def resource_type
24
+ 'MedicationDispense'
25
+ end
26
+
27
+ def scratch_resources
28
+ scratch[:medication_dispense_resources] ||= {}
29
+ end
30
+
31
+ run do
32
+ perform_validation_test(scratch_resources[:all] || [],
33
+ 'http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-medicationdispense',
34
+ '2.0.0',
35
+ skip_if_empty: true)
36
+ end
37
+ end
38
+ end
39
+ end