davinci_crd_test_kit 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/davinci_crd_test_kit/card_responses/propose_alternate_request.json +2 -52
  3. data/lib/davinci_crd_test_kit/card_responses/request_form_completion.json +46 -31
  4. data/lib/davinci_crd_test_kit/cards_validation.rb +8 -4
  5. data/lib/davinci_crd_test_kit/client_hooks_group.rb +22 -660
  6. data/lib/davinci_crd_test_kit/client_tests/appointment_book_receive_request_test.rb +17 -6
  7. data/lib/davinci_crd_test_kit/client_tests/client_appointment_book_group.rb +70 -0
  8. data/lib/davinci_crd_test_kit/client_tests/client_encounter_discharge_group.rb +71 -0
  9. data/lib/davinci_crd_test_kit/client_tests/client_encounter_start_group.rb +70 -0
  10. data/lib/davinci_crd_test_kit/client_tests/client_order_dispatch_group.rb +70 -0
  11. data/lib/davinci_crd_test_kit/client_tests/client_order_select_group.rb +72 -0
  12. data/lib/davinci_crd_test_kit/client_tests/client_order_sign_group.rb +71 -0
  13. data/lib/davinci_crd_test_kit/client_tests/decode_auth_token_test.rb +43 -23
  14. data/lib/davinci_crd_test_kit/client_tests/encounter_discharge_receive_request_test.rb +19 -6
  15. data/lib/davinci_crd_test_kit/client_tests/encounter_start_receive_request_test.rb +18 -6
  16. data/lib/davinci_crd_test_kit/client_tests/hook_request_optional_fields_test.rb +26 -10
  17. data/lib/davinci_crd_test_kit/client_tests/hook_request_required_fields_test.rb +20 -11
  18. data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_context_test.rb +14 -10
  19. data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_prefetch_test.rb +27 -110
  20. data/lib/davinci_crd_test_kit/client_tests/order_dispatch_receive_request_test.rb +18 -6
  21. data/lib/davinci_crd_test_kit/client_tests/order_select_receive_request_test.rb +18 -6
  22. data/lib/davinci_crd_test_kit/client_tests/order_sign_receive_request_test.rb +18 -6
  23. data/lib/davinci_crd_test_kit/client_tests/retrieve_jwks_test.rb +66 -29
  24. data/lib/davinci_crd_test_kit/client_tests/submitted_response_validation.rb +44 -0
  25. data/lib/davinci_crd_test_kit/client_tests/token_header_test.rb +45 -14
  26. data/lib/davinci_crd_test_kit/client_tests/token_payload_test.rb +43 -26
  27. data/lib/davinci_crd_test_kit/crd_client_suite.rb +0 -4
  28. data/lib/davinci_crd_test_kit/hook_request_field_validation.rb +240 -50
  29. data/lib/davinci_crd_test_kit/mock_service_response.rb +134 -120
  30. data/lib/davinci_crd_test_kit/routes/hook_request_endpoint.rb +26 -42
  31. data/lib/davinci_crd_test_kit/server_encounter_discharge_group.rb +24 -0
  32. data/lib/davinci_crd_test_kit/server_encounter_start_group.rb +24 -0
  33. data/lib/davinci_crd_test_kit/server_order_select_group.rb +24 -0
  34. data/lib/davinci_crd_test_kit/server_tests/coverage_information_system_action_received_test.rb +4 -1
  35. data/lib/davinci_crd_test_kit/server_tests/service_request_optional_fields_validation_test.rb +8 -10
  36. data/lib/davinci_crd_test_kit/server_tests/service_request_required_fields_validation_test.rb +5 -10
  37. data/lib/davinci_crd_test_kit/tags.rb +6 -6
  38. data/lib/davinci_crd_test_kit/version.rb +1 -1
  39. metadata +9 -2
@@ -7,10 +7,11 @@ module DaVinciCRDTestKit
7
7
  id :crd_encounter_start_request
8
8
  title 'Request received for encounter-start hook'
9
9
  description %(
10
- This test waits for an incoming [encounter-start](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#encounter-start)
11
- hook request and responds to the client with the response types selected as an input.
10
+ This test waits for multiple incoming [encounter-start](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#encounter-start)
11
+ hook requests and responds to the client with the response types selected as an input.
12
12
  )
13
- receives_request :encounter_start
13
+
14
+ config options: { accepts_multiple_requests: true }
14
15
 
15
16
  input :iss
16
17
  input :encounter_start_selected_response_types,
@@ -20,7 +21,8 @@ module DaVinciCRDTestKit
20
21
  response type that will be returned for this hook is the `Instructions` card type.
21
22
  ),
22
23
  type: 'checkbox',
23
- default: ['instructions'],
24
+ default: ['coverage_information', 'external_reference', 'instructions'],
25
+ optional: true,
24
26
  options: {
25
27
  list_options: [
26
28
  {
@@ -49,6 +51,14 @@ module DaVinciCRDTestKit
49
51
  }
50
52
  ]
51
53
  }
54
+ input :encounter_start_custom_response,
55
+ title: 'Custom response for encounter-start hook requests',
56
+ description: %(
57
+ A JSON string may be provided here to replace the normal response
58
+ from the hook request endpoint
59
+ ),
60
+ type: 'textarea',
61
+ optional: true
52
62
 
53
63
  run do
54
64
  wait(
@@ -56,11 +66,13 @@ module DaVinciCRDTestKit
56
66
  message: %(
57
67
  **Encounter Start CDS Service Test**:
58
68
 
59
- Invoke the encounter-start hook and send a request to:
69
+ Invoke the encounter-start hook and send requests to:
60
70
 
61
71
  `#{encounter_start_url}`
62
72
 
63
- Inferno will process the request and return CDS cards if successful.
73
+ Inferno will process the requests and return CDS cards if successful.
74
+
75
+ [Click here](#{resume_pass_url}?token=enounter-start%20#{iss}) when you have finished submitting requests.
64
76
  )
65
77
  )
66
78
  end
@@ -2,7 +2,8 @@ require_relative '../client_hook_request_validation'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  class HookRequestOptionalFieldsTest < Inferno::Test
5
- include DaVinciCRDTestKit::ClientHookRequestValidation
5
+ include ClientHookRequestValidation
6
+ include URLs
6
7
 
7
8
  id :crd_hook_request_optional_fields
8
9
  title 'Hook request contains optional fields'
@@ -22,20 +23,35 @@ module DaVinciCRDTestKit
22
23
  )
23
24
  optional
24
25
 
26
+ def hook_name
27
+ config.options[:hook_name]
28
+ end
29
+
25
30
  output :client_fhir_server
26
31
  output :client_access_token,
27
32
  optional: true
28
33
 
29
- uses_request :hook_request
30
-
31
34
  run do
32
- assert_valid_json(request.request_body)
33
- request_body = JSON.parse(request.request_body)
34
-
35
- client_fhir_server = hook_request_optional_fields_check(request_body)
36
-
37
- output client_fhir_server: client_fhir_server[:fhir_server_uri],
38
- client_access_token: client_fhir_server[:fhir_access_token]
35
+ load_tagged_requests(hook_name)
36
+ skip_if requests.empty?, "No #{hook_name} requests were made in a previous test as expected."
37
+ client_fhir_server = nil
38
+ requests.each_with_index do |request, index|
39
+ @request_number = index + 1
40
+ request_body = json_parse(request.request_body)
41
+ if request_body.blank?
42
+ add_message('error', "#{request_number}Hook request body cannot be empty.")
43
+ next
44
+ end
45
+
46
+ fhir_server_info = hook_request_optional_fields_check(request_body)
47
+ client_fhir_server ||= fhir_server_info
48
+ end
49
+
50
+ unless client_fhir_server.nil?
51
+ output client_fhir_server: client_fhir_server[:fhir_server_uri],
52
+ client_access_token: client_fhir_server[:fhir_access_token]
53
+ end
54
+ no_error_validation('Some service requests contain invalid optional fields.')
39
55
  end
40
56
  end
41
57
  end
@@ -2,7 +2,7 @@ require_relative '../client_hook_request_validation'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  class HookRequestRequiredFieldsTest < Inferno::Test
5
- include DaVinciCRDTestKit::ClientHookRequestValidation
5
+ include ClientHookRequestValidation
6
6
  include URLs
7
7
 
8
8
  id :crd_hook_request_required_fields
@@ -20,21 +20,30 @@ module DaVinciCRDTestKit
20
20
  a request for
21
21
  )
22
22
 
23
- uses_request :hook_request
24
-
25
- def hook_url
26
- base_url + config.options[:hook_path]
27
- end
28
-
29
23
  def hook_name
30
24
  config.options[:hook_name]
31
25
  end
32
26
 
33
- run do
34
- assert_valid_json(request.request_body)
35
- request_body = JSON.parse(request.request_body)
27
+ output :contexts, :prefetches
36
28
 
37
- hook_request_required_fields_check(request_body, hook_name)
29
+ run do
30
+ load_tagged_requests(hook_name)
31
+ skip_if requests.empty?, "No #{hook_name} requests were made in a previous test as expected."
32
+ contexts = []
33
+ prefetches = []
34
+ requests.each_with_index do |request, index|
35
+ @request_number = index + 1
36
+ request_body = json_parse(request.request_body)
37
+ next if request_body.blank?
38
+
39
+ contexts << request_body['context'] if request_body['context'].is_a?(Hash)
40
+ prefetches << request_body['prefetch'] if request_body['prefetch'].is_a?(Hash)
41
+ hook_request_required_fields_check(request_body, hook_name)
42
+ end
43
+
44
+ output contexts: contexts.to_json,
45
+ prefetches: prefetches.to_json
46
+ no_error_validation('Some service requests made are not valid.')
38
47
  end
39
48
  end
40
49
  end
@@ -1,4 +1,5 @@
1
1
  require_relative '../client_hook_request_validation'
2
+
2
3
  module DaVinciCRDTestKit
3
4
  class HookRequestValidContextTest < Inferno::Test
4
5
  include URLs
@@ -33,9 +34,8 @@ module DaVinciCRDTestKit
33
34
  The client must provide its FHIR server URL and access token in the hook request in order to run
34
35
  this test.
35
36
  )
36
- uses_request :hook_request
37
37
 
38
- input :client_fhir_server
38
+ input :contexts, :client_fhir_server
39
39
  input :client_access_token,
40
40
  optional: true
41
41
 
@@ -49,14 +49,18 @@ module DaVinciCRDTestKit
49
49
  end
50
50
 
51
51
  run do
52
- assert_valid_json(request.request_body)
53
- request_body = JSON.parse(request.request_body)
54
-
55
- hook_context = request_body['context']
56
-
57
- assert(hook_context, 'Hook request does not contain required `context` field')
58
-
59
- hook_request_context_check(hook_context, hook_name)
52
+ hook_contexts = json_parse(contexts)
53
+ if hook_contexts
54
+ skip_if(hook_contexts.none?(&:present?), "No #{hook_name} requests contained the `context` field.")
55
+ hook_contexts.each_with_index do |context, index|
56
+ @request_number = index + 1
57
+ if context.blank?
58
+ add_message('error', "#{request_number}Missing required context field.")
59
+ next
60
+ end
61
+ hook_request_context_check(context, hook_name)
62
+ end
63
+ end
60
64
  no_error_validation('Context is not valid.')
61
65
  end
62
66
  end
@@ -1,7 +1,8 @@
1
- require_relative '../urls'
1
+ require_relative '../client_hook_request_validation'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  class HookRequestValidPrefetchTest < Inferno::Test
5
+ include ClientHookRequestValidation
5
6
  include URLs
6
7
 
7
8
  id :crd_hook_request_valid_prefetch
@@ -19,7 +20,7 @@ module DaVinciCRDTestKit
19
20
  )
20
21
  optional
21
22
 
22
- uses_request :hook_request
23
+ input :contexts, :prefetches
23
24
 
24
25
  def hook_name
25
26
  config.options[:hook_name]
@@ -31,121 +32,37 @@ module DaVinciCRDTestKit
31
32
  )))['services']
32
33
  end
33
34
 
34
- def structure_definition_map
35
- {
36
- 'Practitioner' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-practitioner',
37
- 'PractitionerRole' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole',
38
- 'Patient' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-patient',
39
- 'Coverage' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-coverage',
40
- 'RelatedPerson' => 'http://hl7.org/fhir/StructureDefinition/RelatedPerson',
41
- 'Encounter' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-encounter',
42
- 'DeviceRequest' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-devicerequest',
43
- 'MedicationRequest' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-medicationrequest',
44
- 'NutritionOrder' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-nutritionorder',
45
- 'ServiceRequest' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-servicerequest',
46
- 'VisionPrescription' => 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-visionprescription'
47
- }
48
- end
49
-
50
- def validate_prefetch_coverage(received_resource, advertised_prefetch_key,
51
- received_context_patient_id, advertised_status)
52
- assert_resource_type('Bundle', resource: received_resource)
53
- assert(received_resource.entry.any?, 'Bundle of coverage resources received from prefetch is empty')
54
- coverage_resource = received_resource.entry.first.resource
55
- assert_resource_type('Coverage', resource: coverage_resource)
56
- assert_valid_resource(resource: coverage_resource,
57
- profile_url: structure_definition_map['Coverage'])
58
-
59
- coverage_beneficiary_reference = coverage_resource.beneficiary
60
- coverage_beneficiary_patient_id = coverage_beneficiary_reference.reference_id
61
- assert(coverage_beneficiary_patient_id.present?,
62
- "Could not get beneficiary reference id from `#{advertised_prefetch_key}` field's Coverage resource")
63
-
64
- assert(coverage_beneficiary_patient_id == received_context_patient_id,
65
- %(Expected `#{advertised_prefetch_key}` field's Coverage resource to have a `beneficiary` reference id of
66
- '#{received_context_patient_id}', instead was '#{coverage_beneficiary_patient_id}'))
67
-
68
- coverage_status = coverage_resource.status
69
- assert(coverage_status == advertised_status,
70
- %(Expected `#{advertised_prefetch_key}` field's Coverage resource to have a `status` of
71
- '#{advertised_status}', instead was '#{coverage_status}'))
72
- end
73
-
74
- def validate_prefetch_resource(received_resource, advertised_prefetch_key, context_field_resource_type,
75
- context_field_id)
76
- assert_resource_type(context_field_resource_type, resource: received_resource)
77
-
78
- if hook_name == 'order-dispatch'
79
- assert_valid_resource(resource: received_resource)
80
- else
81
- assert_valid_resource(resource: received_resource,
82
- profile_url: structure_definition_map[context_field_resource_type])
83
- end
84
-
85
- received_prefetch_resource_id = received_resource.id
86
- assert(received_prefetch_resource_id.present?,
87
- "`#{advertised_prefetch_key}` field's FHIR resource does not contain the `id` field")
88
- assert(received_prefetch_resource_id == context_field_id,
89
- %(Expected `#{advertised_prefetch_key}` field's FHIR resource to have an `id` of '#{context_field_id}',
90
- instead was '#{received_prefetch_resource_id}'))
35
+ def advertised_prefetch_fields
36
+ advertised_hook_service = cds_services_json.find { |service| service['hook'] == hook_name }
37
+ advertised_hook_service['prefetch']
91
38
  end
92
39
 
93
40
  run do
94
- assert_valid_json(request.request_body)
95
- request_body = JSON.parse(request.request_body)
96
-
97
- received_prefetch = request_body['prefetch']
98
- received_context = request_body['context']
99
-
100
- skip_if received_prefetch.blank?, 'Received hook request does not contain the `prefetch` field.'
101
- skip_if received_context.blank?,
102
- %(Received hook request does not contain the `context` field which is needed to validate the `prefetch`
103
- field)
104
-
105
- advertised_hook_service = cds_services_json.find { |service| service['hook'] == hook_name }
106
-
107
- advertised_prefetch_fields = advertised_hook_service['prefetch']
108
-
109
- advertised_prefetch_fields.each do |advertised_prefetch_key, advertised_prefetch_template|
110
- next unless received_prefetch[advertised_prefetch_key].present?
111
-
112
- assert(received_prefetch[advertised_prefetch_key].is_a?(Hash),
113
- "Prefetch field `#{advertised_prefetch_key}` is not of type `Hash`.")
114
-
115
- received_prefetch_resource = FHIR.from_contents(received_prefetch[advertised_prefetch_key].to_json)
116
-
117
- if advertised_prefetch_template.include?('?')
118
- advertised_prefetch_fhir_search = advertised_prefetch_template.gsub(/{|}/, '').split('?')
119
- advertised_prefetch_resource_type = advertised_prefetch_fhir_search.first
120
-
121
- if advertised_prefetch_resource_type == 'Coverage'
122
- advertised_coverage_query_params = Rack::Utils.parse_nested_query(advertised_prefetch_fhir_search.last)
123
-
124
- advertised_patient_token = advertised_coverage_query_params['patient']
125
- advertised_context_patient_id_key = advertised_patient_token.split('.').last
126
- received_context_patient_id = received_context[advertised_context_patient_id_key]
127
-
128
- advertised_status_param = advertised_coverage_query_params['status']
129
-
130
- validate_prefetch_coverage(received_prefetch_resource, advertised_prefetch_key, received_context_patient_id,
131
- advertised_status_param)
41
+ hook_contexts = json_parse(contexts)
42
+ hook_prefetches = json_parse(prefetches)
43
+
44
+ if hook_contexts && hook_prefetches
45
+ skip_if(hook_prefetches.none? do |prefetch|
46
+ prefetch_index = hook_prefetches.find_index(prefetch)
47
+ prefetch.present? && hook_contexts[prefetch_index].present?
48
+ end, "No #{hook_name} requests contained both the `context` and `prefetch` field.")
49
+
50
+ hook_prefetches.each_with_index do |prefetch, index|
51
+ @request_number = index + 1
52
+ context = hook_contexts[index]
53
+
54
+ info "#{request_number}Received hook request does not contain the `prefetch` field." if prefetch.blank?
55
+ if context.blank?
56
+ info %(#{request_number}Received hook request does not contain the `context` field
57
+ which is needed to validate the `prefetch` field)
132
58
  end
133
- else
134
- advertised_prefetch_token = advertised_prefetch_template.gsub(/{|}/, '').split('/')
135
- advertised_context_id = advertised_prefetch_token.last.split('.').last
136
59
 
137
- if advertised_prefetch_token.length == 1
138
- received_context_reference = FHIR::Reference.new(reference: received_context[advertised_context_id])
139
- received_context_resource_type = received_context_reference.resource_type
140
- received_context_id = received_context_reference.reference_id
141
- else
142
- received_context_id = received_context[advertised_context_id]
143
- received_context_resource_type = advertised_prefetch_token.first
144
- end
145
- validate_prefetch_resource(received_prefetch_resource, advertised_prefetch_key,
146
- received_context_resource_type, received_context_id)
60
+ next if prefetch.blank? || context.blank?
61
+
62
+ hook_request_prefetch_check(advertised_prefetch_fields, prefetch, context)
147
63
  end
148
64
  end
65
+ no_error_validation('Prefetch is not valid.')
149
66
  end
150
67
  end
151
68
  end
@@ -7,13 +7,14 @@ module DaVinciCRDTestKit
7
7
  id :crd_order_dispatch_request
8
8
  title 'Request received for order-dispatch hook'
9
9
  description %(
10
- This test waits for an incoming [order-dispatch](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-dispatch)
11
- hook request and responds to the client with the response types selected as an input. This hook is a 'primary'
10
+ This test waits for multiple incoming [order-dispatch](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-dispatch)
11
+ hook requests and responds to the client with the response types selected as an input. This hook is a 'primary'
12
12
  hook, meaning that CRD Servers SHALL, at minimum, return a [Coverage Information](https://hl7.org/fhir/us/davinci-crd/STU2/StructureDefinition-ext-coverage-information.html)
13
13
  system action for these hooks, even if the response indicates that further information is needed or that the
14
14
  level of detail provided is insufficient to determine coverage.
15
15
  )
16
- receives_request :order_dispatch
16
+
17
+ config options: { accepts_multiple_requests: true }
17
18
 
18
19
  input :iss
19
20
  input :order_dispatch_selected_response_types,
@@ -23,7 +24,8 @@ module DaVinciCRDTestKit
23
24
  response type that will be returned for this hook is the `Coverage Information` card type.
24
25
  ),
25
26
  type: 'checkbox',
26
- default: ['coverage_information'],
27
+ default: ['coverage_information', 'external_reference', 'instructions'],
28
+ optional: true,
27
29
  options: {
28
30
  list_options: [
29
31
  {
@@ -60,6 +62,14 @@ module DaVinciCRDTestKit
60
62
  }
61
63
  ]
62
64
  }
65
+ input :order_dispatch_custom_response,
66
+ title: 'Custom response for order-dispatch hook requests',
67
+ description: %(
68
+ A JSON string may be provided here to replace the normal response
69
+ from the hook request endpoint
70
+ ),
71
+ type: 'textarea',
72
+ optional: true
63
73
 
64
74
  run do
65
75
  wait(
@@ -67,11 +77,13 @@ module DaVinciCRDTestKit
67
77
  message: %(
68
78
  **Order Dispatch CDS Service Test**:
69
79
 
70
- Invoke the order-dispatch hook and send a request to:
80
+ Invoke the order-dispatch hook and send requests to:
71
81
 
72
82
  `#{order_dispatch_url}`
73
83
 
74
- Inferno will process the request and return CDS cards if successful.
84
+ Inferno will process the requests and return CDS cards if successful.
85
+
86
+ [Click here](#{resume_pass_url}?token=order-dispatch%20#{iss}) when you have finished submitting requests.
75
87
  )
76
88
  )
77
89
  end
@@ -7,10 +7,11 @@ module DaVinciCRDTestKit
7
7
  id :crd_order_select_request
8
8
  title 'Request received for order-select hook'
9
9
  description %(
10
- This test waits for an incoming [order-select](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-select)
11
- hook request and responds to the client with the response types selected as an input.
10
+ This test waits for multiple incoming [order-select](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-select)
11
+ hook requests and responds to the client with the response types selected as an input.
12
12
  )
13
- receives_request :order_select
13
+
14
+ config options: { accepts_multiple_requests: true }
14
15
 
15
16
  input :iss
16
17
  input :order_select_selected_response_types,
@@ -20,7 +21,8 @@ module DaVinciCRDTestKit
20
21
  response type that will be returned for this hook is the `Instructions` card type.
21
22
  ),
22
23
  type: 'checkbox',
23
- default: ['instructions'],
24
+ default: ['coverage_information', 'external_reference', 'instructions'],
25
+ optional: true,
24
26
  options: {
25
27
  list_options: [
26
28
  {
@@ -57,6 +59,14 @@ module DaVinciCRDTestKit
57
59
  }
58
60
  ]
59
61
  }
62
+ input :order_select_custom_response,
63
+ title: 'Custom response for order-select hook requests',
64
+ description: %(
65
+ A JSON string may be provided here to replace the normal response
66
+ from the hook request endpoint
67
+ ),
68
+ type: 'textarea',
69
+ optional: true
60
70
 
61
71
  run do
62
72
  wait(
@@ -64,11 +74,13 @@ module DaVinciCRDTestKit
64
74
  message: %(
65
75
  **Order Select CDS Service Test**:
66
76
 
67
- Invoke the order-select hook and send a request to:
77
+ Invoke the order-select hook and send requests to:
68
78
 
69
79
  `#{order_select_url}`
70
80
 
71
- Inferno will process the request and return CDS cards if successful.
81
+ Inferno will process the requests and return CDS cards if successful.
82
+
83
+ [Click here](#{resume_pass_url}?token=order-select%20#{iss}) when you have finished submitting requests.
72
84
  )
73
85
  )
74
86
  end
@@ -7,13 +7,14 @@ module DaVinciCRDTestKit
7
7
  id :crd_order_sign_request
8
8
  title 'Request received for order-sign hook'
9
9
  description %(
10
- This test waits for an incoming [order-sign](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-sign)
11
- hook request and responds to the client with the response types selected as an input. This hook is a 'primary'
10
+ This test waits for multiple incoming [order-sign](https://hl7.org/fhir/us/davinci-crd/STU2/hooks.html#order-sign)
11
+ hook requests and responds to the client with the response types selected as an input. This hook is a 'primary'
12
12
  hook, meaning that CRD Servers SHALL, at minimum, return a [Coverage Information](https://hl7.org/fhir/us/davinci-crd/STU2/StructureDefinition-ext-coverage-information.html)
13
13
  system action for these hooks, even if the response indicates that further information is needed or that the
14
14
  level of detail provided is insufficient to determine coverage.
15
15
  )
16
- receives_request :order_sign
16
+
17
+ config options: { accepts_multiple_requests: true }
17
18
 
18
19
  input :iss
19
20
  input :order_sign_selected_response_types,
@@ -23,7 +24,8 @@ module DaVinciCRDTestKit
23
24
  response type that will be returned for this hook is the `Coverage Information` card type.
24
25
  ),
25
26
  type: 'checkbox',
26
- default: ['coverage_information'],
27
+ default: ['coverage_information', 'external_reference', 'instructions'],
28
+ optional: true,
27
29
  options: {
28
30
  list_options: [
29
31
  {
@@ -60,6 +62,14 @@ module DaVinciCRDTestKit
60
62
  }
61
63
  ]
62
64
  }
65
+ input :order_sign_custom_response,
66
+ title: 'Custom response for order-sign hook requests',
67
+ description: %(
68
+ A JSON string may be provided here to replace the normal response
69
+ from the hook request endpoint
70
+ ),
71
+ type: 'textarea',
72
+ optional: true
63
73
 
64
74
  run do
65
75
  wait(
@@ -67,11 +77,13 @@ module DaVinciCRDTestKit
67
77
  message: %(
68
78
  **Order Sign CDS Service Test**:
69
79
 
70
- Invoke the order-sign hook and send a request to:
80
+ Invoke the order-sign hook and send requests to:
71
81
 
72
82
  `#{order_sign_url}`
73
83
 
74
- Inferno will process the request and return CDS cards if successful.
84
+ Inferno will process the requests and return CDS cards if successful.
85
+
86
+ [Click here](#{resume_pass_url}?token=order-sign%20#{iss}) when you have finished submitting requests.
75
87
  )
76
88
  )
77
89
  end