davinci_pdex_test_kit 0.11.0 → 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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/pdex_payer_server_fhir_foundry_ri_preset.json +2 -2
  3. data/config/presets/pdex_payer_server_inferno_ri_preset.json +2 -2
  4. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_member_match_tests/client_member_match_validation_test.rb +7 -5
  5. data/lib/davinci_pdex_test_kit/pdex_payer_client/client_workflow_interaction_test.rb +8 -7
  6. data/lib/davinci_pdex_test_kit/pdex_payer_client_suite.rb +8 -10
  7. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_must_support_test.rb +50 -0
  8. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_search_test.rb +68 -0
  9. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_patient_type_search_test.rb +54 -0
  10. 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} +7 -7
  11. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_read_test.rb +26 -0
  12. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_reference_resolution_test.rb +42 -0
  13. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/device_validation_test.rb +39 -0
  14. data/lib/davinci_pdex_test_kit/pdex_payer_server/device/metadata.yml +154 -0
  15. data/lib/davinci_pdex_test_kit/pdex_payer_server/device_group.rb +88 -0
  16. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_id_search_test.rb +7 -24
  17. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_identifier_search_test.rb +10 -24
  18. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_must_support_test.rb +37 -5
  19. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_lastupdated_search_test.rb +48 -0
  20. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_search_test.rb +62 -0
  21. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_service_date_search_test.rb +7 -23
  22. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_type_search_test.rb +6 -23
  23. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_reference_resolution_test.rb +7 -4
  24. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_validation_test.rb +9 -10
  25. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/metadata.yml +276 -264
  26. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit_group.rb +62 -64
  27. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_patient_group.rb +8 -9
  28. data/lib/davinci_pdex_test_kit/pdex_payer_server/export_validation_group.rb +1 -2
  29. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_must_support_test.rb +42 -0
  30. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_search_test.rb +64 -0
  31. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_search_test.rb +54 -0
  32. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_patient_status_type_search_test.rb +55 -0
  33. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_provenance_revinclude_search_test.rb +54 -0
  34. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_read_test.rb +26 -0
  35. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_reference_resolution_test.rb +42 -0
  36. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/medication_dispense_validation_test.rb +39 -0
  37. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense/metadata.yml +206 -0
  38. data/lib/davinci_pdex_test_kit/pdex_payer_server/medication_dispense_group.rb +69 -0
  39. data/lib/davinci_pdex_test_kit/pdex_payer_server/multiple_member_matches_group.rb +36 -36
  40. data/lib/davinci_pdex_test_kit/pdex_payer_server/no_member_matches_group.rb +30 -30
  41. data/lib/davinci_pdex_test_kit/pdex_payer_server/patient_operation_in_capability_statement_validation.rb +15 -13
  42. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/metadata.yml +173 -0
  43. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_must_support_test.rb +51 -0
  44. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_read_test.rb +26 -0
  45. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_reference_resolution_test.rb +46 -0
  46. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance/provenance_validation_test.rb +39 -0
  47. data/lib/davinci_pdex_test_kit/pdex_payer_server/provenance_group.rb +59 -0
  48. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_clinical_data_group.rb +22 -11
  49. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_everything_group.rb +19 -6
  50. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_export_group.rb +22 -16
  51. data/lib/davinci_pdex_test_kit/pdex_payer_server/workflow_member_match_group.rb +44 -25
  52. data/lib/davinci_pdex_test_kit/pdex_payer_server_suite.rb +123 -110
  53. data/lib/davinci_pdex_test_kit/pdex_provider_client_suite.rb +8 -8
  54. data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_out_of_scope_requirements.csv +1 -0
  55. data/lib/davinci_pdex_test_kit/requirements/davinci-pdex-test-kit_requirements.csv +64 -0
  56. data/lib/davinci_pdex_test_kit/requirements/generated/davinci-pdex-test-kit_requirements_coverage.csv +64 -0
  57. data/lib/davinci_pdex_test_kit/version.rb +2 -2
  58. data/lib/davinci_pdex_test_kit.rb +1 -0
  59. data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
  60. data/lib/inferno_requirements_tools/rake/rakefile_template +19 -0
  61. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
  62. data/lib/requirements_config.yaml +17 -0
  63. metadata +56 -11
  64. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_last_updated_search_test.rb +0 -64
  65. data/lib/davinci_pdex_test_kit/pdex_payer_server/explanation_of_benefit/explanation_of_benefit_patient_use_search_test.rb +0 -69
@@ -0,0 +1,206 @@
1
+ ---
2
+ :name: pdex_medicationdispense
3
+ :class_name: PdexMedicationdispenseSequence
4
+ :version: v2.0.0
5
+ :reformatted_version: v200
6
+ :resource: MedicationDispense
7
+ :profile_url: http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-medicationdispense
8
+ :profile_name: PDex MedicationDispense
9
+ :profile_version: 2.0.0
10
+ :title: PDex MedicationDispense
11
+ :short_description: Verify support for the server capabilities required by the PDex
12
+ MedicationDispense.
13
+ :is_delayed: true
14
+ :interactions:
15
+ - :code: search-type
16
+ :expectation: SHALL
17
+ - :code: read
18
+ :expectation: SHALL
19
+ - :code: vread
20
+ :expectation: SHOULD
21
+ - :code: history-instance
22
+ :expectation: SHOULD
23
+ - :code: history-type
24
+ :expectation: MAY
25
+ :operations: []
26
+ :searches:
27
+ - :names:
28
+ - patient
29
+ :expectation: SHALL
30
+ :names_not_must_support_or_mandatory: []
31
+ :must_support_or_mandatory: true
32
+ - :expectation: SHOULD
33
+ :names:
34
+ - patient
35
+ - status
36
+ :names_not_must_support_or_mandatory: []
37
+ :must_support_or_mandatory: true
38
+ - :expectation: SHOULD
39
+ :names:
40
+ - patient
41
+ - status
42
+ - type
43
+ :names_not_must_support_or_mandatory:
44
+ - type
45
+ :must_support_or_mandatory: false
46
+ :search_definitions:
47
+ :patient:
48
+ :paths:
49
+ - subject
50
+ :full_paths:
51
+ - MedicationDispense.subject
52
+ :comparators: {}
53
+ :values: []
54
+ :type: Reference
55
+ :contains_multiple: false
56
+ :multiple_or: MAY
57
+ :status:
58
+ :paths:
59
+ - status
60
+ :full_paths:
61
+ - MedicationDispense.status
62
+ :comparators: {}
63
+ :values:
64
+ - preparation
65
+ - in-progress
66
+ - cancelled
67
+ - on-hold
68
+ - completed
69
+ - entered-in-error
70
+ - stopped
71
+ - declined
72
+ - unknown
73
+ :type: code
74
+ :contains_multiple: false
75
+ :multiple_or: SHALL
76
+ :type:
77
+ :paths:
78
+ - type
79
+ :full_paths:
80
+ - MedicationDispense.type
81
+ :comparators: {}
82
+ :values:
83
+ - DF
84
+ - EM
85
+ - SO
86
+ - FF
87
+ - FFC
88
+ - FFP
89
+ - FFSS
90
+ - TF
91
+ - FS
92
+ - MS
93
+ - RF
94
+ - UD
95
+ - RFC
96
+ - RFCS
97
+ - RFF
98
+ - RFFS
99
+ - RFP
100
+ - RFPS
101
+ - RFS
102
+ - TB
103
+ - TBS
104
+ - UDE
105
+ :type: CodeableConcept
106
+ :contains_multiple: false
107
+ :multiple_or: SHALL
108
+ :include_params:
109
+ - MedicationDispense:medication
110
+ :revincludes:
111
+ - Provenance:target
112
+ :required_concepts:
113
+ - category
114
+ - medicationCodeableConcept
115
+ :must_supports:
116
+ :extensions: []
117
+ :slices: []
118
+ :elements:
119
+ - :path: status
120
+ - :path: subject
121
+ :types:
122
+ - Reference
123
+ :target_profiles:
124
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
125
+ - :path: substitution
126
+ - :path: substitution.wasSubstituted
127
+ :mandatory_elements:
128
+ - MedicationDispense.status
129
+ - MedicationDispense.medication[x]
130
+ - MedicationDispense.subject
131
+ - MedicationDispense.performer.actor
132
+ - MedicationDispense.substitution.wasSubstituted
133
+ :bindings:
134
+ - :type: code
135
+ :strength: required
136
+ :system: http://hl7.org/fhir/ValueSet/medicationdispense-status
137
+ :path: status
138
+ - :type: CodeableConcept
139
+ :strength: required
140
+ :system: http://hl7.org/fhir/ValueSet/medicationdispense-category
141
+ :path: category
142
+ - :type: CodeableConcept
143
+ :strength: required
144
+ :system: http://hl7.org/fhir/us/davinci-pdex/ValueSet/FDANationalDrugCode
145
+ :path: medication
146
+ :required_binding_slice: true
147
+ :references:
148
+ - :path: MedicationDispense.partOf
149
+ :profiles:
150
+ - http://hl7.org/fhir/StructureDefinition/Procedure
151
+ - :path: MedicationDispense.subject
152
+ :profiles:
153
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
154
+ - :path: MedicationDispense.context
155
+ :profiles:
156
+ - http://hl7.org/fhir/StructureDefinition/Encounter
157
+ - http://hl7.org/fhir/StructureDefinition/EpisodeOfCare
158
+ - :path: MedicationDispense.supportingInformation
159
+ :profiles:
160
+ - http://hl7.org/fhir/StructureDefinition/Resource
161
+ - :path: MedicationDispense.performer.actor
162
+ :profiles:
163
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
164
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole
165
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
166
+ - :path: MedicationDispense.location
167
+ :profiles:
168
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-location
169
+ - :path: MedicationDispense.authorizingPrescription
170
+ :profiles:
171
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
172
+ - :path: MedicationDispense.destination
173
+ :profiles:
174
+ - http://hl7.org/fhir/StructureDefinition/Location
175
+ - :path: MedicationDispense.receiver
176
+ :profiles:
177
+ - http://hl7.org/fhir/StructureDefinition/Patient
178
+ - http://hl7.org/fhir/StructureDefinition/Practitioner
179
+ - :path: MedicationDispense.substitution.responsibleParty
180
+ :profiles:
181
+ - http://hl7.org/fhir/StructureDefinition/Practitioner
182
+ - http://hl7.org/fhir/StructureDefinition/PractitionerRole
183
+ - :path: MedicationDispense.detectedIssue
184
+ :profiles:
185
+ - http://hl7.org/fhir/StructureDefinition/DetectedIssue
186
+ - :path: MedicationDispense.eventHistory
187
+ :profiles:
188
+ - http://hl7.org/fhir/StructureDefinition/Provenance
189
+ :tests:
190
+ - :id: pdex_medication_dispense_read
191
+ :file_name: medication_dispense_read_test.rb
192
+ - :id: pdex_medication_dispense_patient_status_search
193
+ :file_name: medication_dispense_patient_status_search_test.rb
194
+ - :id: pdex_medication_dispense_patient_status_type_search
195
+ :file_name: medication_dispense_patient_status_type_search_test.rb
196
+ - :id: pdex_medication_dispense_provenance_revinclude_search
197
+ :file_name: medication_dispense_provenance_revinclude_search_test.rb
198
+ - :id: pdex_medication_dispense_validation
199
+ :file_name: medication_dispense_validation_test.rb
200
+ - :id: pdex_medication_dispense_must_support
201
+ :file_name: medication_dispense_must_support_test.rb
202
+ - :id: pdex_medication_dispense_ref_resolution
203
+ :file_name: medication_dispense_reference_resolution_test.rb
204
+ :id: pdex_medication_dispense
205
+ :file_name: medication_dispense_group.rb
206
+ :delayed_references: []
@@ -0,0 +1,69 @@
1
+ require_relative 'medication_dispense/medication_dispense_patient_search_test'
2
+ require_relative 'medication_dispense/medication_dispense_read_test'
3
+ require_relative 'medication_dispense/medication_dispense_patient_status_search_test'
4
+ require_relative 'medication_dispense/medication_dispense_patient_status_type_search_test'
5
+ require_relative 'medication_dispense/medication_dispense_provenance_revinclude_search_test'
6
+ require_relative 'medication_dispense/medication_dispense_validation_test'
7
+ require_relative 'medication_dispense/medication_dispense_must_support_test'
8
+ require_relative 'medication_dispense/medication_dispense_reference_resolution_test'
9
+
10
+ module DaVinciPDexTestKit
11
+ module PDexPayerServer
12
+ class MedicationDispenseGroup < Inferno::TestGroup
13
+ title 'PDex MedicationDispense Tests'
14
+ short_description 'Verify support for the server capabilities required by the PDex MedicationDispense.'
15
+ description %(
16
+ # Background
17
+
18
+ The PDex MedicationDispense sequence verifies that the system under test is
19
+ able to provide correct responses for MedicationDispense queries. These queries
20
+ must contain resources conforming to the PDex MedicationDispense as
21
+ specified in the PDex v2.0.0 Implementation Guide.
22
+
23
+ # Testing Methodology
24
+
25
+
26
+ ## Must Support
27
+ Each profile contains elements marked as "must support". This test
28
+ sequence expects to see each of these elements at least once. If at
29
+ least one cannot be found, the test will fail. The test will look
30
+ through the MedicationDispense resources found in the first test for these
31
+ elements.
32
+
33
+ ## Profile Validation
34
+ Each resource returned from the first search is expected to conform to
35
+ the [PDex MedicationDispense](http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-medicationdispense). Each element is checked against
36
+ teminology binding and cardinality requirements.
37
+
38
+ Elements with a required binding are validated against their bound
39
+ ValueSet. If the code/system in the element is not part of the ValueSet,
40
+ then the test will fail.
41
+
42
+ ## Reference Validation
43
+ At least one instance of each external reference in elements marked as
44
+ "must support" within the resources provided by the system must resolve.
45
+ The test will attempt to read each reference found and will fail if no
46
+ read succeeds.
47
+ )
48
+
49
+ id :pdex_medication_dispense
50
+ run_as_group
51
+
52
+ def self.metadata
53
+ @metadata ||= USCoreTestKit::USCoreTestKit::Generator::GroupMetadata.new(YAML.load_file(
54
+ File.join(__dir__, 'medication_dispense',
55
+ 'metadata.yml'), aliases: true
56
+ ))
57
+ end
58
+
59
+ test from: :pdex_medication_dispense_patient_search
60
+ test from: :pdex_medication_dispense_patient_status_search
61
+ test from: :pdex_medication_dispense_patient_status_type_search
62
+ test from: :pdex_medication_dispense_read
63
+ test from: :pdex_medication_dispense_provenance_revinclude_search
64
+ test from: :pdex_medication_dispense_validation
65
+ test from: :pdex_medication_dispense_must_support
66
+ test from: :pdex_medication_dispense_ref_resolution
67
+ end
68
+ end
69
+ end
@@ -6,57 +6,57 @@ require_relative 'coverage_to_link_must_support_validation'
6
6
  module DaVinciPDexTestKit
7
7
  module PDexPayerServer
8
8
  class MultipleMemberMatchesGroup < Inferno::TestGroup
9
+ id :pdex_multiple_member_matches
10
+ title '$member-match with multiple matches'
9
11
 
10
- id :pdex_multiple_member_matches
11
- title '$member-match with multiple matches'
12
+ run_as_group
12
13
 
13
- run_as_group
14
+ input :multiple_member_match_request,
15
+ title: 'Member Match Request for multiple matches',
16
+ description: "A JSON payload for server's $member-match endpoint that has **more than one match**",
17
+ type: 'textarea',
18
+ optional: true
14
19
 
15
- input :multiple_member_match_request,
16
- title: 'Member Match Request for multiple matches',
17
- description: "A JSON payload for server's $member-match endpoint that has **more than one match**",
18
- type: 'textarea',
19
- optional: true
20
+ group_config = { inputs: { member_match_request: { name: :multiple_member_match_request } } }
20
21
 
21
- group_config = { inputs: { member_match_request: { name: :multiple_member_match_request } } }
22
-
23
- test from: :pdex_member_match_profile_validation do
24
- id :pdex_multiple_match_profile_validation
25
- config(group_config)
26
- title '[USER INPUT VALIDATION] Member match request for multiple matches is valid'
27
- description %{
22
+ test from: :pdex_member_match_profile_validation do
23
+ id :pdex_multiple_match_profile_validation
24
+ config(group_config)
25
+ title '[USER INPUT VALIDATION] Member match request for multiple matches is valid'
26
+ description %{
28
27
  This test validates the conformity of the user input to the
29
28
  [HRex Member Match Request Profile](https://hl7.org/fhir/us/davinci-hrex/STU1/StructureDefinition-hrex-parameters-member-match-in.html),
30
29
  ensuring subsequent tests can accurately simulate content. It also checks conformance to the [Parameters Resource](https://hl7.org/fhir/R4/parameters.html),
31
30
  mandatory elements, and terminology. It also checks that the Patient reference with the Consent and CoverageToMatch parameters are local references.
32
31
  }
33
32
 
34
- # Inherits
35
- end
33
+ # Inherits
34
+ end
35
+
36
+ test from: :pdex_member_match_local_ref_validation, config: group_config
36
37
 
37
- test from: :pdex_member_match_local_ref_validation, config: group_config
38
-
39
- test from: :pdex_coverage_to_link_minimal_validation, config: group_config
40
- test from: :pdex_coverage_to_link_ms_validation, config: group_config
38
+ test from: :pdex_coverage_to_link_minimal_validation, config: group_config
39
+ test from: :pdex_coverage_to_link_ms_validation, config: group_config
41
40
 
42
- test do
43
- id :pdex_member_match_has_multiple_matches
44
- title 'Server $member-match operation returns 422 Unprocessable Content if multiple matches are found'
45
- description %{
41
+ test do
42
+ id :pdex_member_match_has_multiple_matches
43
+ title 'Server $member-match operation returns 422 Unprocessable Content if multiple matches are found'
44
+ description %{
46
45
  See [member matching logic](https://hl7.org/fhir/us/davinci-hrex/STU1/OperationDefinition-member-match.html#member-matching-logic)
47
46
  for specification.
48
- }
49
-
50
- run do
51
- skip_if !multiple_member_match_request, "No member match request inputted for multiple-match tests."
52
-
53
- member_match_request_resource = FHIR.from_contents(multiple_member_match_request)
54
-
55
- fhir_operation('/Patient/$member-match', body: member_match_request_resource)
56
- assert_response_status(422)
57
- end
58
- end
47
+ }
59
48
 
49
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@37'
50
+
51
+ run do
52
+ skip_if !multiple_member_match_request, 'No member match request inputted for multiple-match tests.'
53
+
54
+ member_match_request_resource = FHIR.from_contents(multiple_member_match_request)
55
+
56
+ fhir_operation('/Patient/$member-match', body: member_match_request_resource)
57
+ assert_response_status(422)
58
+ end
59
+ end
60
60
  end
61
61
  end
62
62
  end
@@ -6,42 +6,41 @@ require_relative 'coverage_to_link_must_support_validation'
6
6
  module DaVinciPDexTestKit
7
7
  module PDexPayerServer
8
8
  class NoMemberMatchesGroup < Inferno::TestGroup
9
- id :pdex_no_member_matches
10
- title '$member-match with no matches'
9
+ id :pdex_no_member_matches
10
+ title '$member-match with no matches'
11
11
 
12
- run_as_group
12
+ run_as_group
13
13
 
14
- input :no_member_match_request,
15
- title: 'Member Match Request for no matches',
16
- description: "A JSON payload for server's $member-match endpoint that has **no matches**",
17
- type: 'textarea',
18
- optional: true
14
+ input :no_member_match_request,
15
+ title: 'Member Match Request for no matches',
16
+ description: "A JSON payload for server's $member-match endpoint that has **no matches**",
17
+ type: 'textarea',
18
+ optional: true
19
19
 
20
- group_config = { inputs: { member_match_request: { name: :no_member_match_request } } }
20
+ group_config = { inputs: { member_match_request: { name: :no_member_match_request } } }
21
21
 
22
- test from: :pdex_member_match_profile_validation do
23
- id :pdex_no_match_profile_validation
24
- config(group_config)
22
+ test from: :pdex_member_match_profile_validation do
23
+ id :pdex_no_match_profile_validation
24
+ config(group_config)
25
25
 
26
- title '[USER INPUT VALIDATION] Member match request for no matches is valid'
27
- description %{
26
+ title '[USER INPUT VALIDATION] Member match request for no matches is valid'
27
+ description %{
28
28
  Regardless of having no intended matches, this test validates the conformity of the user input to the
29
29
  [HRex Member Match Request Profile](https://hl7.org/fhir/us/davinci-hrex/STU1/StructureDefinition-hrex-parameters-member-match-in.html),
30
30
  ensuring subsequent tests can accurately simulate content. It also checks conformance to the [Parameters Resource](https://hl7.org/fhir/R4/parameters.html),
31
31
  mandatory elements, and terminology. It also checks that the Patient reference with the Consent and CoverageToMatch parameters are local references.
32
32
  }
33
- end
34
-
35
- test from: :pdex_member_match_local_ref_validation, config: group_config
33
+ end
36
34
 
37
- test from: :pdex_coverage_to_link_minimal_validation, config: group_config
38
- test from: :pdex_coverage_to_link_ms_validation, config: group_config
35
+ test from: :pdex_member_match_local_ref_validation, config: group_config
39
36
 
37
+ test from: :pdex_coverage_to_link_minimal_validation, config: group_config
38
+ test from: :pdex_coverage_to_link_ms_validation, config: group_config
40
39
 
41
- test do
42
- id :pdex_member_match_has_no_matches
43
- title 'Server $member-match operation returns 422 Unprocessable Content if no matches are found'
44
- description %{
40
+ test do
41
+ id :pdex_member_match_has_no_matches
42
+ title 'Server $member-match operation returns 422 Unprocessable Content if no matches are found'
43
+ description %{
45
44
  See [member matching logic](https://hl7.org/fhir/us/davinci-hrex/STU1/OperationDefinition-member-match.html#member-matching-logic)
46
45
  for specification.
47
46
 
@@ -49,15 +48,16 @@ module DaVinciPDexTestKit
49
48
  is expected to return 422.
50
49
  }
51
50
 
52
- run do
53
- skip_if !no_member_match_request, "No member match request inputted for no-match tests."
54
- member_match_request_resource = FHIR.from_contents(no_member_match_request)
51
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@36'
55
52
 
56
- fhir_operation('/Patient/$member-match', body: member_match_request_resource)
57
- assert_response_status(422)
58
- end
59
- end
53
+ run do
54
+ skip_if !no_member_match_request, 'No member match request inputted for no-match tests.'
55
+ member_match_request_resource = FHIR.from_contents(no_member_match_request)
60
56
 
57
+ fhir_operation('/Patient/$member-match', body: member_match_request_resource)
58
+ assert_response_status(422)
59
+ end
60
+ end
61
61
  end
62
62
  end
63
63
  end
@@ -15,7 +15,7 @@ module DaVinciPDexTestKit
15
15
  # options:
16
16
  # operation_name: operation to check for, i.e: 'member-match'
17
17
  # operation_url: operation definition canonical URL
18
- #
18
+ # client: fhir client name, default: :default
19
19
  # ==== Required Scratch
20
20
  #
21
21
  # (none)
@@ -36,21 +36,23 @@ module DaVinciPDexTestKit
36
36
  The operation shall only be declared in one object in the `rest` array.
37
37
  }
38
38
 
39
+ verifies_requirements 'hl7.fhir.us.davinci-pdex_2.0.0@30'
40
+
39
41
  run do
40
- fhir_get_capability_statement
42
+ fhir_get_capability_statement(client: config.options.fetch(:client, :default))
41
43
 
42
- assert_response_status(200)
43
- assert_resource_type(:capability_statement)
44
+ assert_response_status(200)
45
+ assert_resource_type(:capability_statement)
44
46
 
45
- assert(
46
- resource.rest&.one? do |rest_metadata|
47
- rest_metadata.resource&.find{|resource_metadata| resource_metadata.type == 'Patient'}
48
- &.operation&.any? do |operation_metadata|
49
- operation_metadata.name == config.options[:operation_name] &&
50
- operation_metadata.definition == config.options[:operation_url]
51
- end
52
- end
53
- )
47
+ assert(
48
+ resource.rest&.one? do |rest_metadata|
49
+ rest_metadata.resource&.find { |resource_metadata| resource_metadata.type == 'Patient' }
50
+ &.operation&.any? do |operation_metadata|
51
+ operation_metadata.name == config.options[:operation_name] &&
52
+ operation_metadata.definition == config.options[:operation_url]
53
+ end
54
+ end
55
+ )
54
56
  end
55
57
  end
56
58
  end
@@ -0,0 +1,173 @@
1
+ ---
2
+ :name: pdex_provenance
3
+ :class_name: PdexProvenanceSequence
4
+ :version: v2.0.0
5
+ :reformatted_version: v200
6
+ :resource: Provenance
7
+ :profile_url: http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-provenance
8
+ :profile_name: PDex Provenance
9
+ :profile_version: 2.0.0
10
+ :title: PDex Provenance
11
+ :short_description: Verify support for the server capabilities required by the PDex
12
+ Provenance.
13
+ :is_delayed: true
14
+ :interactions:
15
+ - :code: search-type
16
+ :expectation: MAY
17
+ - :code: read
18
+ :expectation: SHALL
19
+ - :code: vread
20
+ :expectation: SHOULD
21
+ - :code: patch
22
+ :expectation: MAY
23
+ - :code: history-instance
24
+ :expectation: SHOULD
25
+ - :code: history-type
26
+ :expectation: MAY
27
+ :operations: []
28
+ :searches: []
29
+ :search_definitions: {}
30
+ :include_params: []
31
+ :revincludes: []
32
+ :required_concepts:
33
+ - agent.type
34
+ - entity.extension.valueCodeableConcept
35
+ :must_supports:
36
+ :extensions:
37
+ - :id: Provenance.entity.extension:sourceFormat
38
+ :path: entity.extension
39
+ :url: http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/ProvenanceSourceFrom
40
+ :slices:
41
+ - :slice_id: Provenance.agent:ProvenanceAuthor
42
+ :slice_name: ProvenanceAuthor
43
+ :path: agent
44
+ :discriminator:
45
+ :type: patternCodeableConcept
46
+ :path: type
47
+ :code: author
48
+ :system: http://terminology.hl7.org/CodeSystem/provenance-participant-type
49
+ - :slice_id: Provenance.agent:ProvenanceTransmitter
50
+ :slice_name: ProvenanceTransmitter
51
+ :path: agent
52
+ :discriminator:
53
+ :type: patternCodeableConcept
54
+ :path: type
55
+ :code: transmitter
56
+ :system: http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type
57
+ :elements:
58
+ - :path: target
59
+ :types:
60
+ - Reference
61
+ - :path: recorded
62
+ - :path: agent
63
+ - :path: agent.type
64
+ - :path: agent.who
65
+ :types:
66
+ - Reference
67
+ :target_profiles:
68
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
69
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
70
+ - :path: agent.onBehalfOf
71
+ :types:
72
+ - Reference
73
+ :target_profiles:
74
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
75
+ - :path: agent:ProvenanceAuthor.type
76
+ - :path: agent:ProvenanceAuthor.who
77
+ :types:
78
+ - Reference
79
+ :target_profiles:
80
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
81
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
82
+ - :path: agent:ProvenanceTransmitter.type
83
+ - :path: agent:ProvenanceTransmitter.who
84
+ :types:
85
+ - Reference
86
+ :target_profiles:
87
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
88
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
89
+ :mandatory_elements:
90
+ - Provenance.target
91
+ - Provenance.recorded
92
+ - Provenance.agent
93
+ - Provenance.agent.who
94
+ - Provenance.agent.type
95
+ - Provenance.entity.extension.url
96
+ - Provenance.entity.role
97
+ - Provenance.entity.what
98
+ :bindings:
99
+ - :type: CodeableConcept
100
+ :strength: required
101
+ :system: http://hl7.org/fhir/us/core/ValueSet/us-core-provenance-participant-type
102
+ :path: agent.type
103
+ - :type: CodeableConcept
104
+ :strength: required
105
+ :system: http://hl7.org/fhir/us/davinci-pdex/ValueSet/ProvenanceAgentType
106
+ :path: agent:ProvenanceAuthor.type
107
+ - :type: CodeableConcept
108
+ :strength: required
109
+ :system: http://hl7.org/fhir/us/davinci-pdex/ValueSet/ProvenancePayerSourceFormat
110
+ :path: entity.extension:sourceFormat.value
111
+ - :type: code
112
+ :strength: required
113
+ :system: http://hl7.org/fhir/ValueSet/provenance-entity-role
114
+ :path: entity.role
115
+ - :type: CodeableConcept
116
+ :strength: extensible
117
+ :system: http://hl7.org/fhir/us/davinci-pdex/ValueSet/ProvenancePayerSourceFormat
118
+ :path: value
119
+ :extensions:
120
+ - http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/ProvenanceSourceFrom
121
+ :references:
122
+ - :path: Provenance.target
123
+ :profiles:
124
+ - http://hl7.org/fhir/StructureDefinition/Resource
125
+ - :path: Provenance.location
126
+ :profiles:
127
+ - http://hl7.org/fhir/StructureDefinition/Location
128
+ - :path: Provenance.agent.who
129
+ :profiles:
130
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
131
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
132
+ - :path: Provenance.agent.onBehalfOf
133
+ :profiles:
134
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
135
+ - :path: Provenance.agent:ProvenanceAuthor.who
136
+ :profiles:
137
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
138
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
139
+ - :path: Provenance.agent:ProvenanceAuthor.onBehalfOf
140
+ :profiles:
141
+ - http://hl7.org/fhir/StructureDefinition/Practitioner
142
+ - http://hl7.org/fhir/StructureDefinition/PractitionerRole
143
+ - http://hl7.org/fhir/StructureDefinition/RelatedPerson
144
+ - http://hl7.org/fhir/StructureDefinition/Patient
145
+ - http://hl7.org/fhir/StructureDefinition/Device
146
+ - http://hl7.org/fhir/StructureDefinition/Organization
147
+ - :path: Provenance.agent:ProvenanceTransmitter.who
148
+ :profiles:
149
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
150
+ - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
151
+ - :path: Provenance.agent:ProvenanceTransmitter.onBehalfOf
152
+ :profiles:
153
+ - http://hl7.org/fhir/StructureDefinition/Practitioner
154
+ - http://hl7.org/fhir/StructureDefinition/PractitionerRole
155
+ - http://hl7.org/fhir/StructureDefinition/RelatedPerson
156
+ - http://hl7.org/fhir/StructureDefinition/Patient
157
+ - http://hl7.org/fhir/StructureDefinition/Device
158
+ - http://hl7.org/fhir/StructureDefinition/Organization
159
+ - :path: Provenance.entity.what
160
+ :profiles:
161
+ - http://hl7.org/fhir/StructureDefinition/Resource
162
+ :tests:
163
+ - :id: pdex_provenance_read
164
+ :file_name: provenance_read_test.rb
165
+ - :id: pdex_provenance_validation
166
+ :file_name: provenance_validation_test.rb
167
+ - :id: pdex_provenance_must_support
168
+ :file_name: provenance_must_support_test.rb
169
+ - :id: pdex_provenance_ref_resolution
170
+ :file_name: provenance_reference_resolution_test.rb
171
+ :id: pdex_provenance
172
+ :file_name: provenance_group.rb
173
+ :delayed_references: []