Class: DaVinciCRDTestKit::V221::BaseHookInvocationReceiveRequestTest
- Inherits:
-
Inferno::Test
- Object
- Inferno::Test
- DaVinciCRDTestKit::V221::BaseHookInvocationReceiveRequestTest
show all
- Includes:
- ClientURLs
- Defined in:
- lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb
Constant Summary
collapse
- RESPONSE_TYPE_OPTIONS =
[
{
label: 'External Reference (card)',
value: 'external_reference'
},
{
label: 'Instructions (card)',
value: 'instructions'
},
{
label: 'Coverage Information (systemAction)',
value: 'coverage_information'
},
{
label: 'Request Form Completion (card)',
value: 'request_form_completion'
},
{
label: 'Create/Update Coverage Information (card)',
value: 'create_update_coverage_info'
},
{
label: 'Launch SMART Application (card)',
value: 'launch_smart_app'
}
].freeze
- ORDER_RESPONSE_TYPE_OPTIONS =
(RESPONSE_TYPE_OPTIONS + [
{
label: 'Propose Alternate Request (card)',
value: 'propose_alternate_request'
},
{
label: 'Additional Orders as Companions/Prerequisites (card)',
value: 'companions_prerequisites'
}
]).freeze
Constants included
from ClientURLs
ClientURLs::SUITE_ID
Instance Method Summary
collapse
Methods included from ClientURLs
base_url, discovery_url, prefetch_subset_discovery_url, #suite_id
#appointment_book_prefetch_subset_url, #appointment_book_url, #discovery_url, #encounter_discharge_prefetch_subset_url, #encounter_discharge_url, #encounter_start_prefetch_subset_url, #encounter_start_url, #order_dispatch_prefetch_subset_url, #order_dispatch_url, #order_select_prefetch_subset_url, #order_select_url, #order_sign_prefetch_subset_url, #order_sign_url, #prefetch_subset_discovery_url
Methods included from BaseURLs
#inferno_base_url, #resume_fail_url, #resume_pass_url
Instance Method Details
#complete_prefetch_url ⇒ Object
128
129
130
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 128
def complete_prefetch_url
send(:"#{hook_key}_url")
end
|
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 79
def configured_response_details
if response_approach == 'custom'
'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
"from the **Custom response template for #{hook_slug} hook requests** input " \
'against the incoming request to create a response.'
else
'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
'the following response types using the incoming request: ' \
"\n - #{selected_response_types_string}"
end
end
|
111
112
113
114
115
116
117
118
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 111
def format_responded_response_types(response_types)
response_types
.map do |response_type|
DaVinciCRDTestKit::CardsIdentification.humanize_response_type(response_type)
.sub('Card', '(card)')
.sub('Action', '(systemAction)')
end.join("\n - ")
end
|
#hook_key ⇒ Object
59
60
61
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 59
def hook_key
raise NotImplementedError, "#{self.class} must implement #hook_key"
end
|
#hook_slug ⇒ Object
67
68
69
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 67
def hook_slug
hook_key.to_s.tr('_', '-')
end
|
#invoke_heading ⇒ Object
120
121
122
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 120
def invoke_heading
"Invoke the `#{hook_slug}` hook"
end
|
#invoke_intro ⇒ Object
124
125
126
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 124
def invoke_intro
"Invoke #{hook_slug} hook by sending requests to one or both of the two Inferno simulated CRD servers:"
end
|
#primary_hook? ⇒ Boolean
63
64
65
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 63
def primary_hook?
raise NotImplementedError, "#{self.class} must implement #primary_hook?"
end
|
#response_approach ⇒ Object
71
72
73
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 71
def response_approach
send(:"#{hook_key}_response_approach")
end
|
#selected_response_types ⇒ Object
75
76
77
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 75
def selected_response_types
send(:"#{hook_key}_selected_response_types")
end
|
#selected_response_types_string ⇒ Object
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 93
def selected_response_types_string
response_types =
if selected_response_types.present?
selected_response_types
else
primary_hook? ? [DaVinciCRDTestKit::CardsIdentification::COVERAGE_INFORMATION_RESPONSE_TYPE] : [DaVinciCRDTestKit::CardsIdentification::INSTRUCTIONS_RESPONSE_TYPE]
end.map do |response_type|
if response_type == DaVinciCRDTestKit::CardsIdentification::COVERAGE_INFORMATION_RESPONSE_TYPE
"#{response_type}_action"
else
"#{response_type}_card"
end
end
format_responded_response_types(response_types)
end
|
#subset_prefetch_url ⇒ Object
132
133
134
|
# File 'lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb', line 132
def subset_prefetch_url
send(:"#{hook_key}_prefetch_subset_url")
end
|