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,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  require_relative 'member_match_request_profile_validation'
3
2
  require_relative 'member_match_request_local_references_validation'
4
3
  require_relative 'coverage_to_link_minimal_data_validation'
@@ -11,7 +10,7 @@ module DaVinciPDexTestKit
11
10
  class WorkflowMemberMatchGroup < Inferno::TestGroup
12
11
  title 'Server can return a matching member in response to $member-match request'
13
12
  short_title '$member-match'
14
- id :pdex_workflow_member_match_group
13
+ id :pdex_workflow_member_match
15
14
  description %{
16
15
  # Background
17
16
 
@@ -20,11 +19,11 @@ module DaVinciPDexTestKit
20
19
  [required by the PDex Implementation Guide](https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent).
21
20
 
22
21
  # Testing Methodology
23
-
22
+
24
23
  The developer must supply JSON FHIR input parameter conforming to the
25
24
  [member match request profile](https://hl7.org/fhir/us/davinci-hrex/STU1/StructureDefinition-hrex-parameters-member-match-in.html). This
26
25
  test sequence will:
27
-
26
+
28
27
  1. Request the server's capability statement and verify that it asserts support for the $member-match operation
29
28
  2. Validate user's member match request input
30
29
  + validate Parameters profile conformance
@@ -33,25 +32,35 @@ module DaVinciPDexTestKit
33
32
  + optional: validate minimal data on CoverageToLink parameter
34
33
  3. POST request to server and validate HTTP 200 response status
35
34
  4. validate memeber match response conforms to profile
36
- 5. use member identifier from response to query for patient id
35
+ 5. use member identifier from response to query for patient id
37
36
  }
38
37
 
39
38
  run_as_group
40
39
 
41
40
  input :member_match_request,
42
- title: 'Member Match Request for one match',
43
- description: "A JSON payload for server's $member-match endpoint that has **exactly one match**",
44
- type: 'textarea'
41
+ title: 'Member Match Request for one match',
42
+ description: "A JSON payload for server's $member-match endpoint that has **exactly one match**",
43
+ type: 'textarea'
44
+
45
+ input :smart_auth_info,
46
+ title: 'OAuth Credentials',
47
+ type: :auth_info,
48
+ optional: true
49
+
50
+ fhir_client do
51
+ url :url
52
+ auth_info :smart_auth_info
53
+ end
45
54
 
46
- test from: :patient_operation_in_capability_statement_validation,
47
- id: :member_match_operation_in_capability_statement_test,
55
+ test from: :pdex_patient_operation_in_cap_stmt_validation,
56
+ id: :pdex_member_match_operation_in_cap_stmt,
48
57
  title: 'Server declares support for Patient member match operation in CapabilityStatement',
49
58
  config: {
50
59
  options: { operation_name: 'member-match', operation_url: 'http://hl7.org/fhir/us/davinci-hrex/OperationDefinition/member-match' }
51
60
  }
52
61
 
53
- test from: :pdex_member_match_request_profile_validation do
54
- id :member_match_request_profile_test
62
+ test from: :pdex_member_match_profile_validation do
63
+ id :pdex_one_match_profile_validation
55
64
  title '[USER INPUT VALIDATION] Member match request for exactly one match is valid'
56
65
  description %{
57
66
  This test validates the conformity of the user input to the
@@ -61,31 +70,31 @@ module DaVinciPDexTestKit
61
70
  }
62
71
  end
63
72
 
64
- test from: :pdex_member_match_request_local_references_validation do
65
- id :member_match_request_local_references_test
73
+ test from: :pdex_member_match_local_ref_validation do
74
+ id :pdex_member_match_local_ref
66
75
  title '[USER INPUT VALIDATION] Member match request only uses local references'
67
76
  end
68
77
 
69
- test from: :pdex_coverage_to_link_minimal_data_validation
70
- test from: :pdex_coverage_to_link_must_support_validation
71
-
78
+ test from: :pdex_coverage_to_link_minimal_validation
79
+ test from: :pdex_coverage_to_link_ms_validation
80
+
72
81
  test do
73
- id :member_match_on_server_test
82
+ id :pdex_member_match_on_server
74
83
  title 'Server handles $member-match operation successfully'
75
84
  description 'Server receives request `POST [baseURL]/Patient/$member-match` and returns 200'
76
-
85
+
77
86
  input :member_match_request
78
-
87
+
79
88
  makes_request :member_match
80
-
89
+
81
90
  run do
82
91
  fhir_operation('/Patient/$member-match', body: FHIR.from_contents(member_match_request), name: :member_match)
83
92
  assert_response_status(200)
84
93
  end
85
94
  end
86
-
95
+
87
96
  test do
88
- id :member_match_response_profile_test
97
+ id :pdex_member_match_response_profile
89
98
  title 'Server $member-match response conforms to profile'
90
99
  description %{
91
100
  The response body from the previous POST request to $member-match must be valid FHIR JSON conforming to
@@ -93,7 +102,7 @@ module DaVinciPDexTestKit
93
102
  }
94
103
 
95
104
  output :member_identifier
96
- output :member_identifier_system
105
+ output :member_identifier_system
97
106
 
98
107
  uses_request :member_match
99
108
 
@@ -103,17 +112,19 @@ module DaVinciPDexTestKit
103
112
  assert_resource_type('Parameters')
104
113
 
105
114
  # We should save the output before validating every detail of the payload
106
- output member_identifier: resource.parameter.find{|p| p.name=='MemberIdentifier'}&.valueIdentifier&.value
107
- output member_identifier_system: resource.parameter.find{|p| p.name=='MemberIdentifier'}&.valueIdentifier&.system
115
+ output member_identifier: resource.parameter.find { |p| p.name == 'MemberIdentifier' }&.valueIdentifier&.value
116
+ output member_identifier_system: resource.parameter.find { |p|
117
+ p.name == 'MemberIdentifier'
118
+ }&.valueIdentifier&.system
108
119
 
109
120
  assert_valid_resource(profile_url: 'http://hl7.org/fhir/us/davinci-hrex/StructureDefinition/hrex-parameters-member-match-out')
110
121
  end
111
122
  end
112
-
123
+
113
124
  test do
114
- id :member_match_identifier_to_id
125
+ id :pdex_member_match_identifier_to_id
115
126
  title 'Server member identifier from $member-match yields logical Patient id'
116
- description %Q{
127
+ description %(
117
128
  The $member-match operation returns a Member Identifier, and subsequent clinical queries and operations
118
129
  are only required to support logical Patient FHIR ID. Hence server must be able to provide a Patient
119
130
  FHIR ID from Member Identifier.
@@ -121,15 +132,17 @@ module DaVinciPDexTestKit
121
132
  Server receives request `GET [baseURL]/Patient?identifier=[member_identifier]`
122
133
  and returns 200 and a Bundle with a single FHIR Patient. The `[member_identifier]` is from Member Match Response
123
134
  `Parameters.parameter:MemberIdentifier.valueIdentifier.value`.
124
- }
135
+ )
136
+
137
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@35'
125
138
 
126
139
  input :member_identifier
127
140
  input :member_identifier_system, optional: true
128
141
  output :patient_id
129
142
 
130
143
  run do
131
- skip_if !member_identifier, "No member identifier obtained from $member-match request"
132
-
144
+ skip_if !member_identifier, 'No member identifier obtained from $member-match request'
145
+
133
146
  # We only query by identifier.value, and preset information happens to return a value with a system within it
134
147
  # which may be a bug.
135
148
  # Other options are to query by system|value or type-of:
@@ -140,19 +153,24 @@ module DaVinciPDexTestKit
140
153
  assert_valid_json(response[:body])
141
154
  assert_resource_type('Bundle')
142
155
 
143
- assert resource.entry.find{ |entry| entry.resource&.resourceType == 'Patient' }, "Bundle has no Patient resource."
156
+ assert resource.entry.find { |entry|
157
+ entry.resource&.resourceType == 'Patient'
158
+ }, 'Bundle has no Patient resource.'
144
159
 
145
- patient_id = resource.entry.reverse_each.find{ |entry| entry.resource&.resourceType == 'Patient' }&.resource&.id
146
- assert patient_id, "Patient resource in Bundle has no logical resource id"
160
+ patient_id = resource.entry.reverse_each.find do |entry|
161
+ entry.resource&.resourceType == 'Patient'
162
+ end&.resource&.id
163
+ assert patient_id, 'Patient resource in Bundle has no logical resource id'
147
164
 
148
- info "Multiple patients found, using the last patient id." if resource.entry.select{ |entry| entry.resource&.resourceType == 'Patient' }.length > 1
165
+ info 'Multiple patients found, using the last patient id.' if resource.entry.select do |entry|
166
+ entry.resource&.resourceType == 'Patient'
167
+ end.length > 1
149
168
 
150
- output :patient_id => patient_id
169
+ output patient_id: patient_id
151
170
 
152
171
  assert_valid_resource
153
172
  end
154
173
  end
155
-
156
174
  end
157
175
  end
158
176
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ require 'us_core_test_kit/generated/v3.1.1/us_core_test_suite'
2
2
 
3
3
  require_relative 'pdex_payer_server/workflow_member_match_group'
4
4
  require_relative 'pdex_payer_server/workflow_clinical_data_group'
@@ -9,96 +9,89 @@ require_relative 'pdex_payer_server/no_member_matches_group'
9
9
  require_relative 'pdex_payer_server/multiple_member_matches_group'
10
10
 
11
11
  require_relative 'pdex_payer_server/explanation_of_benefit_group'
12
+ require_relative 'pdex_payer_server/device_group'
13
+ require_relative 'pdex_payer_server/medication_dispense_group'
14
+ require_relative 'pdex_payer_server/provenance_group'
12
15
 
13
16
  module DaVinciPDexTestKit
14
- class PDexPayerServerSuite < Inferno::TestSuite
15
- id :pdex_payer_server
16
- title 'Da Vinci PDex Payer Server Test Suite'
17
- description File.read(File.join(__dir__, 'docs', 'payer_server_suite_description_v200.md'))
18
-
19
- links [
20
- {
21
- label: 'Report Issue',
22
- url: 'https://github.com/inferno-framework/davinci-pdex-test-kit/issues'
23
- },
24
- {
25
- label: 'Open Source',
26
- url: 'https://github.com/inferno-framework/davinci-pdex-test-kit'
27
- },
28
- {
29
- label: 'Download',
30
- url: 'https://github.com/inferno-framework/davinci-pdex-test-kit/releases'
31
- },
32
- {
33
- label: 'Implementation Guide',
34
- url: 'https://hl7.org/fhir/us/davinci-pdex/STU2/'
35
- }
36
- ]
37
-
38
- input :url,
39
- title: 'FHIR Server Base Url'
40
-
41
- input :credentials,
42
- title: 'OAuth Credentials',
43
- type: :oauth_credentials,
44
- optional: true
45
-
46
- fhir_client do
47
- url :url
48
- oauth_credentials :credentials
49
- end
50
-
51
- VALIDATION_MESSAGE_FILTERS = [
52
- /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
53
- /\A\S+: \S+: URL value '.*' does not resolve/
54
- ].freeze
55
-
56
- VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
57
-
58
- # Hl7 Validator Wrapper:
59
- fhir_resource_validator do
60
- igs 'hl7.fhir.us.davinci-pdex#2.0.0'
61
- # hrex 1.0.0 and other dependencies will auto-load
62
-
63
- # Copy messages limit from Bulk Data Export tests
64
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
65
-
66
- $num_messages = 0
67
- $capped_message = false
68
- $num_errors = 0
69
- $capped_errors = false
70
-
71
- exclude_message do |message|
72
- matches_filter = message_filters.any? { |filter| filter.match? message.message }
73
-
74
- unless matches_filter
75
- if message.type != 'error'
76
- $num_messages += 1
77
- else
78
- $num_errors += 1
79
- end
17
+ class PDexPayerServerSuite < Inferno::TestSuite
18
+ id :pdex_payer_server
19
+ title 'Da Vinci PDex Payer Server Test Suite'
20
+ description File.read(File.join(__dir__, 'docs', 'payer_server_suite_description_v200.md'))
21
+
22
+ links [
23
+ {
24
+ label: 'Report Issue',
25
+ url: 'https://github.com/inferno-framework/davinci-pdex-test-kit/issues'
26
+ },
27
+ {
28
+ label: 'Open Source',
29
+ url: 'https://github.com/inferno-framework/davinci-pdex-test-kit'
30
+ },
31
+ {
32
+ label: 'Download',
33
+ url: 'https://github.com/inferno-framework/davinci-pdex-test-kit/releases'
34
+ },
35
+ {
36
+ label: 'Implementation Guide',
37
+ url: 'https://hl7.org/fhir/us/davinci-pdex/STU2/'
38
+ }
39
+ ]
40
+
41
+ input :url,
42
+ title: 'FHIR Server Base Url'
43
+
44
+ VALIDATION_MESSAGE_FILTERS = [
45
+ /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
46
+ /\A\S+: \S+: URL value '.*' does not resolve/
47
+ ].freeze
48
+
49
+ VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
50
+
51
+ # Hl7 Validator Wrapper:
52
+ fhir_resource_validator do
53
+ igs 'hl7.fhir.us.davinci-pdex#2.0.0'
54
+ # hrex 1.0.0 and other dependencies will auto-load
55
+
56
+ # Copy messages limit from Bulk Data Export tests
57
+ message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
58
+
59
+ $num_messages = 0
60
+ $capped_message = false
61
+ $num_errors = 0
62
+ $capped_errors = false
63
+
64
+ exclude_message do |message|
65
+ matches_filter = message_filters.any? { |filter| filter.match? message.message }
66
+
67
+ unless matches_filter
68
+ if message.type == 'error'
69
+ $num_errors += 1
70
+ else
71
+ $num_messages += 1
80
72
  end
81
-
82
- matches_filter ||
83
- (message.type != 'error' && $num_messages > 50 && !message.message.include?('Inferno is only showing the first')) ||
84
- (message.type == 'error' && $num_errors > 20 && !message.message.include?('Inferno is only showing the first'))
85
73
  end
86
74
 
87
- perform_additional_validation do
88
- if $num_messages > 50 && !$capped_message
89
- $capped_message = true
90
- { type: 'info', message: 'Inferno is only showing the first 50 validation info and warning messages.' }
91
- elsif $num_errors > 20 && !$capped_errors
92
- $capped_errors = true
93
- { type: 'error', message: 'Inferno is only showing the first 20 validation error messages.' }
94
- end
75
+ matches_filter ||
76
+ (message.type != 'error' && $num_messages > 50 && !message.message.include?('Inferno is only showing the first')) ||
77
+ (message.type == 'error' && $num_errors > 20 && !message.message.include?('Inferno is only showing the first'))
78
+ end
79
+
80
+ perform_additional_validation do
81
+ if $num_messages > 50 && !$capped_message
82
+ $capped_message = true
83
+ { type: 'info', message: 'Inferno is only showing the first 50 validation info and warning messages.' }
84
+ elsif $num_errors > 20 && !$capped_errors
85
+ $capped_errors = true
86
+ { type: 'error', message: 'Inferno is only showing the first 20 validation error messages.' }
95
87
  end
96
88
  end
89
+ end
97
90
 
98
- group do
99
- title 'Payer to Payer Workflow'
100
- id :payer_to_payer_workflow
101
- description %(
91
+ group do
92
+ title 'Payer to Payer Workflow'
93
+ id :payer_to_payer_workflow
94
+ description %(
102
95
  # Background
103
96
 
104
97
  This Payer to Payer Workflow test sequence is designed to simulate a realistic use case for
@@ -125,22 +118,34 @@ module DaVinciPDexTestKit
125
118
  See the corresponding test group's description for the testing methodology of each part.
126
119
  )
127
120
 
128
- group from: :pdex_workflow_member_match_group
129
- group from: :pdex_workflow_clinical_data_group
130
- group from: :pdex_workflow_everything_group
131
- group from: :pdex_workflow_export_group
121
+ group from: :pdex_workflow_member_match
122
+ group from: :pdex_workflow_clinical_data
123
+ group from: :pdex_workflow_everything
124
+ group from: :pdex_workflow_export
125
+ end
126
+
127
+ group do
128
+ title 'API Capability and Must Support Coverage'
129
+ id :api_and_ms_coverage
130
+
131
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@9', 'hl7.fhir.us.davinci-pdex_2.0.0@14'
132
+
133
+ input :smart_auth_info,
134
+ title: 'OAuth Credentials',
135
+ type: :auth_info,
136
+ optional: true
137
+
138
+ fhir_client do
139
+ url :url
140
+ auth_info :smart_auth_info
132
141
  end
133
142
 
134
143
  group do
135
- title 'API Capability and Must Support Coverage'
136
- id :api_and_must_support_coverage
137
-
138
- group do
139
- title '$member-match failure cases'
140
- id :member_match_failure_cases
141
- description %{
144
+ title '$member-match failure cases'
145
+ id :member_match_failure_cases
146
+ description %{
142
147
  # Background
143
-
148
+
144
149
  This test sequence is for the negative results specification in
145
150
  [member matching logic](http://hl7.org/fhir/us/davinci-hrex/STU1/OperationDefinition-member-match.html#member-matching-logic)
146
151
  from HRex 1.0.0 Implementation Guide, and is required by the PDex 2.0.0 Implementation Guide.
@@ -155,26 +160,33 @@ module DaVinciPDexTestKit
155
160
  + POST request to server and validiate HTTP 422 response status
156
161
  }
157
162
 
158
- input_order :url, :credentials, :no_member_match_request, :multiple_member_match_request
159
-
160
- group from: :pdex_no_member_matches_group
161
- group from: :pdex_multiple_member_matches_group
162
- end
163
-
164
- group do
165
- title 'PDEX Search and Read API (US Core plus additional PDex resource types)'
166
- id :search_and_read_api_coverage
167
-
168
- group from: :pdex_explanation_of_benefit_group
163
+ input_order :url, :smart_auth_info, :no_member_match_request, :multiple_member_match_request
169
164
 
170
- # Import all US Core v3.1.1 groups without the Suite
171
- Dir.glob(File.join($LOAD_PATH.find { |x| x.match? "us_core_test_kit" }, 'us_core_test_kit/generated/v3.1.1/*_group.rb')).each do |test_group_path|
172
- require_relative test_group_path
165
+ group from: :pdex_no_member_matches
166
+ group from: :pdex_multiple_member_matches
167
+ end
173
168
 
174
- group from: "us_core_v311_#{File.basename(test_group_path).gsub('_group.rb','')}".to_sym
175
- end
169
+ group do
170
+ title 'PDEX Search and Read API (US Core plus additional PDex resource types)'
171
+ id :pdex_fhir_api_coverage
172
+
173
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@3', 'hl7.fhir.us.davinci-pdex_2.0.0@7',
174
+ 'hl7.fhir.us.davinci-pdex_2.0.0@16', 'hl7.fhir.us.davinci-pdex_2.0.0@43',
175
+ 'hl7.fhir.us.davinci-pdex_2.0.0@48', 'hl7.fhir.us.davinci-pdex_2.0.0@49',
176
+ 'hl7.fhir.us.davinci-pdex_2.0.0@50', 'hl7.fhir.us.davinci-pdex_2.0.0@51',
177
+ 'hl7.fhir.us.davinci-pdex_2.0.0@52'
178
+
179
+ group from: :pdex_eob
180
+ group from: :pdex_device
181
+ group from: :pdex_medication_dispense
182
+ group from: :pdex_provenance
183
+
184
+ # Import all US Core v3.1.1 groups without the Suite
185
+ USCoreTestKit::USCoreV311::USCoreTestSuite.groups[1].groups.each do |group|
186
+ # This prevents a second OAuth credentials box from appearing in UI
187
+ group(from: group.ancestors[1].id, id: group.ancestors[1].id.delete_prefix('us_core_v311_'))
176
188
  end
177
189
  end
178
-
179
190
  end
191
+ end
180
192
  end
@@ -8,7 +8,7 @@ module DaVinciPDexTestKit
8
8
  This suite validates that a provider system can act as a client
9
9
  retrieving patient data from a payer system using
10
10
  the APIs described in the PDex implementation
11
- guide. Inferno will act as a payer server that the
11
+ guide. Inferno will act as a payer server that the
12
12
  system under test will connect to and retrieve data from.
13
13
  )
14
14
 
@@ -30,22 +30,22 @@ module DaVinciPDexTestKit
30
30
  url: 'https://hl7.org/fhir/us/davinci-pdex/STU2/'
31
31
  }
32
32
  ]
33
-
33
+
34
34
  # These inputs will be available to all tests in this suite
35
35
  input :url,
36
36
  title: 'FHIR Server Base Url'
37
-
38
- input :credentials,
37
+
38
+ input :smart_auth_info,
39
39
  title: 'OAuth Credentials',
40
- type: :oauth_credentials,
40
+ type: :auth_info,
41
41
  optional: true
42
-
42
+
43
43
  # All FHIR requests in this suite will use this FHIR client
44
44
  fhir_client do
45
45
  url :url
46
- oauth_credentials :credentials
46
+ auth_info :smart_auth_info
47
47
  end
48
-
48
+
49
49
  # Hl7 Validator Wrapper:
50
50
  fhir_resource_validator do
51
51
  igs 'hl7.fhir.us.davinci-pdex#2.0.0'
@@ -0,0 +1,64 @@
1
+ Req Set,ID,URL,Requirement,Conformance,Actor,Sub-Requirement(s),Conditionality
2
+ hl7.fhir.us.davinci-pdex_2.0.0,1,https://hl7.org/fhir/us/davinci-pdex/STU2/#intellectual-property,Implementers ... of this specification SHALL abide by the license requirements for each terminology content artifact utilized within a functioning implementation.,SHALL,Server,,false
3
+ hl7.fhir.us.davinci-pdex_2.0.0,2,https://hl7.org/fhir/us/davinci-pdex/STU2/#intellectual-property,Terminology licenses SHALL be obtained from the Third-Party IP owner for each code system and/or other specified artifact used.,SHALL,Server,,false
4
+ hl7.fhir.us.davinci-pdex_2.0.0,3,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"For profiles defined in [US Core and referenced by PDex], the meaning of Must Support [for Servers] is established in [the US Core IG].",SHALL,Server,"hl7.fhir.us.core_3.1.1@75,77,78,80",false
5
+ hl7.fhir.us.davinci-pdex_2.0.0,4,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"For profiles defined in [US Core and referenced by PDex], the meaning of Must Support [for Clients] is established in [the US Core IG].",SHALL,Client,"hl7.fhir.us.core_3.1.1@76,79",false
6
+ hl7.fhir.us.davinci-pdex_2.0.0,5,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"For profiles defined in [DaVinci HRex and referenced by PDex], the meaning of Must Support [for Servers] is established in [the HRex IG].",SHALL,Server,"hl7.fhir.us.davinci-hrex_1.0.0@21,22,24,25,27",false
7
+ hl7.fhir.us.davinci-pdex_2.0.0,6,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"For profiles defined in [DaVinci HRex and referenced by PDex], the meaning of Must Support [for Clients] is established in [the HRex IG].",SHALL,Client,"hl7.fhir.us.davinci-hrex_1.0.0@23,26,28",false
8
+ hl7.fhir.us.davinci-pdex_2.0.0,7,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"[For profiles defined in the PDex IG, Servers SHALL follow] Must Support requirements … [from] the US Core Implementation Guide.",SHALL,Server,"hl7.fhir.us.core_3.1.1@75,77,78,80",false
9
+ hl7.fhir.us.davinci-pdex_2.0.0,8,https://hl7.org/fhir/us/davinci-pdex/STU2/index.html#must-support,"[For profiles defined in the PDex IG, Clients SHALL follow] Must Support requirements … [from] the US Core Implementation Guide.",SHALL,Client,"hl7.fhir.us.core_3.1.1@76,79",false
10
+ hl7.fhir.us.davinci-pdex_2.0.0,9,https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#overview,All data exchanged by Health Plans using the interactions covered in this IG SHALL be transformed to FHIR R4 resources.,SHALL,Server,,false
11
+ hl7.fhir.us.davinci-pdex_2.0.0,10,"https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#oauth20-or-smart-on-fhir-member-authorized-exchange,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.html,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api",The member SHALL authenticate using [and the server SHALL accept only] credentials that have been issued by or are recognized and accepted by the Health Plan. These are typically the member’s customer portal credentials for accessing the health plan.,SHALL,Client,,false
12
+ hl7.fhir.us.davinci-pdex_2.0.0,11,https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#patient-everything-exchange-via-alternate-secure-transport,The use of the Bulk FHIR specification for transmission of member data SHALL honor jurisdictional and personal privacy restrictions that are relevant to a member’s health record.,SHALL,Server,,false
13
+ hl7.fhir.us.davinci-pdex_2.0.0,12,https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#provenance,Health Plans SHALL incorporate provenance records that they receive as part of any exchange of FHIR data.,SHALL,Server,,false
14
+ hl7.fhir.us.davinci-pdex_2.0.0,13,https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#provenance,"Health Plans SHALL provide Provenance records [for each non-Provenance instance] that, at a minimum, indicate that they are playing the role of Transmitter of the data in any PDex information exchange.",SHALL,Server,,false
15
+ hl7.fhir.us.davinci-pdex_2.0.0,14,https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#implementation-hierarchy-and-priorities,"[F]or profiles and APIs identified in this IG, the FHIR R4 version SHALL be used.",SHALL,Server,,false
16
+ hl7.fhir.us.davinci-pdex_2.0.0,15,https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#pdex-data-payloads,All resources available via a FHIR API endpoint SHALL be declared in a FHIR CapabilityStatement.,SHALL,Server,,false
17
+ hl7.fhir.us.davinci-pdex_2.0.0,16,https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#pdex-data-payloads,The Read and Search Operations SHALL be supported for the FHIR Profiles [that are part of the member health history].,SHALL,Server,,false
18
+ hl7.fhir.us.davinci-pdex_2.0.0,17,https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#capabilitystatement,The Read ... Operation... SHALL be supported for … Resource Type … Coverage [using the [HRex Coverage](https://hl7.org/fhir/us/davinci-hrex/STU1/StructureDefinition-hrex-coverage.html) profile].,SHALL,Server,,false
19
+ hl7.fhir.us.davinci-pdex_2.0.0,18,https://hl7.org/fhir/us/davinci-pdex/STU2/introduction.html#capabilitystatement,The ... Search Operation... SHALL be supported for … Resource Type … Coverage [using the [HRex Coverage](https://hl7.org/fhir/us/davinci-hrex/STU1/StructureDefinition-hrex-coverage.html) profile].,SHALL,Server,,false
20
+ hl7.fhir.us.davinci-pdex_2.0.0,19,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#data-payloads,All resources and operations available via a FHIR API endpoint SHALL be declared in a FHIR CapabilityStatement.,SHALL,Server,,false
21
+ hl7.fhir.us.davinci-pdex_2.0.0,20,"https://hl7.org/fhir/us/davinci-pdex/STU2/overview.html#oauth20-or-smart-on-fhir-member-authorized-exchange,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.html,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api","[When a payer allows their member to authorize information sharing, a]fter authenticating to the (source) Health Plan’s authorization server, the Member SHALL be presented with an Authorization screen that enables them to approve the sharing of information with their intended application, service or (target) Health Plan.",SHALL,Server,,false
22
+ hl7.fhir.us.davinci-pdex_2.0.0,21,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,"For this authorization [of data sharing by a member] to occur the Application, service or (target) Health Plan will require OAuth 2.0 client application credentials, which ... the (source) Health Plan [SHALL issue during client] register[ation]",SHALL,Server,,false
23
+ hl7.fhir.us.davinci-pdex_2.0.0,22,"https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.htm","The Authorization process [of data sharing by a member], in accordance with applicable privacy policy, SHALL provide a mechanism to support current regulations allowing members the right to decide what information is permitted to be exchanged.",SHALL,Server,,false
24
+ hl7.fhir.us.davinci-pdex_2.0.0,23,"https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.htm","After successfully authorizing [data sharing with] an application [on behalf of the Member,] an Access Token ... SHALL be returned to the requesting application.",SHALL,Server,,false
25
+ hl7.fhir.us.davinci-pdex_2.0.0,24,"https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.htm","After successfully authorizing [data sharing with] an application [on behalf of the Member,] an … Optional Refresh Token ... [MAY] be returned to the requesting application.",MAY,Server,,false
26
+ hl7.fhir.us.davinci-pdex_2.0.0,25,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,The scopes of the access token [returned by the server for data sharing on behalf of a member] SHALL be restricted to the authorizing Member’s information and the scopes approved.,SHALL,Server,,false
27
+ hl7.fhir.us.davinci-pdex_2.0.0,26,https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,Any subsequent Access Token [returned by the server for data sharing on behalf of the member] issued based on the Refresh Token SHALL be restricted (at least) to the same restrictions.,SHALL,Server,,false
28
+ hl7.fhir.us.davinci-pdex_2.0.0,27,"https://hl7.org/fhir/us/davinci-pdex/STU2/pdeximplementationactorsinteractionsdatapayloadsandmethods.html#oauth20-and-fhir-api,https://hl7.org/fhir/us/davinci-pdex/STU2/member-authorizedoauth2exchange.htm",The requesting application [authorized to access member information] SHALL use the access token to access the Health Plan’s secure FHIR API to download the information that the Application is allowed to access.,SHALL,Client,,false
29
+ hl7.fhir.us.davinci-pdex_2.0.0,28,https://hl7.org/fhir/us/davinci-pdex/STU2/handlingdataprovenance.html#handling-data-provenance,Health Plans SHALL accept and retain Provenance records received with data based on Member-authorized Payer-to-Payer exchange.,SHALL,Client,,false
30
+ hl7.fhir.us.davinci-pdex_2.0.0,29,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,Each [data] retrieval ... SHALL be preceded by the use of the ... [HRex [$member-match](https://hl7.org/fhir/us/davinci-hrex/STU1/OperationDefinition-member-match.html)] interaction to match a member and provide consent.,SHALL,Client,"hl7.fhir.us.davinci-hrex_1.0.0@34,37,38,40,46,47",false
31
+ hl7.fhir.us.davinci-pdex_2.0.0,30,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,Health Plans SHALL support the $member-match operation.,SHALL,Server,"hl7.fhir.us.davinci-hrex_1.0.0@35,36,39,41-45,48",false
32
+ hl7.fhir.us.davinci-pdex_2.0.0,31,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,"[Before allowing a $member-match operation, Servers SHALL e]stablish a secure connection [with the client payer] via mTLS.",SHALL,Server,,false
33
+ hl7.fhir.us.davinci-pdex_2.0.0,32,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,[Servers SHALL allow clients to u]se mTLS secure connection to perform OAuth2.0 Dynamic Client Registration to acquire OAuth2.0 client credentials,SHALL,Server,,false
34
+ hl7.fhir.us.davinci-pdex_2.0.0,33,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,[Servers SHALL allow clients to u]se Client Credentials to acquire OAuth2.0 token to perform $member-match operation,SHALL,Server,,false
35
+ hl7.fhir.us.davinci-pdex_2.0.0,34,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#member-match-with-consent,"If a Patient ID is returned from $member-match, [Servers SHALL allow clients to make] a request for an OAuth2.0 Access Token that is scoped to the identified shared member",SHALL,Server,,false
36
+ hl7.fhir.us.davinci-pdex_2.0.0,35,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#the-member-match-operation,In the case where a [member] match is confirmed the receiving payer will: … [r]eturn a Unique Patient Identifier (Patient FHIR ID) in the $member-match Operation Response.,SHALL,Server,,true
37
+ hl7.fhir.us.davinci-pdex_2.0.0,36,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#the-member-match-operation,When no [member] match is found ... a 422 Unprocessable entity status code will be returned [by the receiving payer].,SHALL,Server,,true
38
+ hl7.fhir.us.davinci-pdex_2.0.0,37,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#the-member-match-operation,"When … multiple matches are found, a 422 Unprocessable entity status code will be returned [by the receiving payer].",SHALL,Server,,true
39
+ hl7.fhir.us.davinci-pdex_2.0.0,38,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#the-member-match-operation,"If the receiving payer matches to a unique member but is unable to comply with the consent request, a Patient ID SHALL NOT be returned in the $member-match response",SHALL NOT,Server,,true
40
+ hl7.fhir.us.davinci-pdex_2.0.0,39,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#the-member-match-operation,"If the receiving payer matches to a unique member but is unable to comply with the consent request [e.g., because they do not support the requested data segmentation policy], … a 422 status code SHALL be returned with an Operation Outcome that indicates that the consent request could not be complied with.",SHALL,Server,,true
41
+ hl7.fhir.us.davinci-pdex_2.0.0,40,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#evaluation-of-consent,"[Servers SHALL consider consent requirements to be met only if]
42
+ - Member Identity is matched
43
+ - Consent Policy (Everything or only Non-Sensitive data) matches the data release segmentation capabilities of the receiving payer
44
+ - Date period for consent is valid
45
+ - Payer requesting retrieval of data is matched.",SHALL,Server,,false
46
+ hl7.fhir.us.davinci-pdex_2.0.0,41,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#data-retrieval-methods,"Once Health Plans have completed the Member Access stage of the Exchange the requesting Health Plan SHALL utilize the access token returned from the Member Access step to request/retrieve data using one of the following three methods:
47
+ - Query all clinical resource individually
48
+ - $patient-everything operation
49
+ - Bulk FHIR Asynchronous protocols.",SHALL,Client,,false
50
+ hl7.fhir.us.davinci-pdex_2.0.0,42,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#data-retrieval-methods,"Each of the above methods[, query all clinical resource individually, $everything, and $export,] SHALL support the retrieval of the profiles and resources [in the scope of the member health history, defined in the Server CapabilityStatement]",SHALL,Server,,false
51
+ hl7.fhir.us.davinci-pdex_2.0.0,43,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#query-all-clinical-resources-individually,Health Plans SHALL support search of a member’s clinical data.,SHALL,Server,,false
52
+ hl7.fhir.us.davinci-pdex_2.0.0,44,,[Servers SHALL support] the _revInclude and _include parameters to ... retrieve the associated Provenance and supporting records.,SHALL,Server,,false
53
+ hl7.fhir.us.davinci-pdex_2.0.0,45,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#constraining-data-based-upon-permissions-of-the-requestor,The FHIR Server SHALL constrain the data returned from the server to a requester based upon the access permissions of the requester.,SHALL,Server,,false
54
+ hl7.fhir.us.davinci-pdex_2.0.0,46,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#everything-operation,Health Plans SHOULD support the use of the $everything operation… defined in the FHIR R4 specification here: https://www.hl7.org/fhir/operation-patient-everything.html,SHOULD,Server,fhir_4.0.1,false
55
+ hl7.fhir.us.davinci-pdex_2.0.0,47,https://hl7.org/fhir/us/davinci-pdex/STU2/payertopayerexchange.html#bulk-fhir-asynchronous-protocols,"Payer-to-Payer Data Exchange SHOULD support the use of Bulk FHIR methods, as defined in the HL7 FHIR [Bulk Data Access Implementation Guide](https://hl7.org/fhir/uv/bulkdata/authorization/).",SHOULD,Server,hl7.fhir.uv.bulkdata_2.0.0,false
56
+ hl7.fhir.us.davinci-pdex_2.0.0,48,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#data-mapping,Health Plans SHALL map claims and clinical information for a member to US Core v3.1.1 FHIR Resources based on R4.,SHALL,Server,hl7.fhir.us.core_3.1.1,false
57
+ hl7.fhir.us.davinci-pdex_2.0.0,49,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#data-mapping,"Where a US Core FHIR R4 Resource is not defined Health Plans SHALL map claims and clinical information to FHIR Profiles defined in this IG, or the Da Vinci HRex IG.",SHALL,Server,hl7.fhir.us.davinci-hrex_1.0.0,true
58
+ hl7.fhir.us.davinci-pdex_2.0.0,50,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#providing-data-in-sub-element-fields,"If a field is marked as required (cardinality n.., where n>0) the Health Plan SHALL populate the field.",SHALL,Server,,true
59
+ hl7.fhir.us.davinci-pdex_2.0.0,51,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#providing-data-in-sub-element-fields,"For a field specified as MUST SUPPORT and the cardinality is 0.., the Health Plan SHALL be capable of populating the field and do so if the relevant data exists.",SHALL,Server,,true
60
+ hl7.fhir.us.davinci-pdex_2.0.0,52,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#providing-data-in-sub-element-fields,"For a field specified as MUST SUPPORT and the cardinality is 0.., the Health Plan SHALL … [populate] the field ... if the relevant data exists.",SHALL,Server,,true
61
+ hl7.fhir.us.davinci-pdex_2.0.0,53,https://hl7.org/fhir/us/davinci-pdex/STU2/datamapping.html#providing-data-in-sub-element-fields,"If a field is marked as MUST SUPPORT the receiver must be able to consume it without generating an error, unless the field is a sub-element of another field where that parent field does NOT have a minimum cardinality of 1 [or a Must Support Flag]. For example, if the parent field has a cardinality of “0..1” or “0..*” the sub-element field does not need to be populated.",SHALL,Client,,true
62
+ hl7.fhir.us.davinci-pdex_2.0.0,54,https://hl7.org/fhir/us/davinci-pdex/STU2/usecasescenarios.html#versioning-of-fhir-data,"If a payer chooses to support FHIR resource data versioning of related resource references, the referring resource **SHALL** use the vread format of reference: `[type]/[id]/_history/[vid]`",SHALL,Server,,true
63
+ hl7.fhir.us.davinci-pdex_2.0.0,55,https://hl7.org/fhir/us/davinci-pdex/STU2/usecasescenarios.html#versioning-of-fhir-data,Supporting versioning of FHIR data implies supporting the [vread](https://www.hl7.org/fhir/http.html#vread) and [history](https://www.hl7.org/fhir/http.html#history) interactions in the FHIR specification.,SHALL,Server,,true
64
+ hl7.fhir.us.davinci-pdex_2.0.0,56,https://hl7.org/fhir/us/davinci-pdex/STU2/StructureDefinition-pdex-priorauthorization.html,"Payers SHALL make available pending and active prior authorization decisions and related clinical documentation and forms for items and services, not including prescription drugs, including the date the prior authorization was approved, the date the authorization ends, as well as the units and services approved and those used to date, no later than one (1) business day after a provider initiates a prior authorization for the beneficiary or there is a change of status for the prior authorization.",SHALL,Server,,false