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.
- checksums.yaml +4 -4
- data/lib/davinci_crd_test_kit/card_responses/propose_alternate_request.json +2 -52
- data/lib/davinci_crd_test_kit/card_responses/request_form_completion.json +46 -31
- data/lib/davinci_crd_test_kit/cards_validation.rb +8 -4
- data/lib/davinci_crd_test_kit/client_hooks_group.rb +22 -660
- data/lib/davinci_crd_test_kit/client_tests/appointment_book_receive_request_test.rb +17 -6
- data/lib/davinci_crd_test_kit/client_tests/client_appointment_book_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_encounter_discharge_group.rb +71 -0
- data/lib/davinci_crd_test_kit/client_tests/client_encounter_start_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_dispatch_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_select_group.rb +72 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_sign_group.rb +71 -0
- data/lib/davinci_crd_test_kit/client_tests/decode_auth_token_test.rb +43 -23
- data/lib/davinci_crd_test_kit/client_tests/encounter_discharge_receive_request_test.rb +19 -6
- data/lib/davinci_crd_test_kit/client_tests/encounter_start_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/hook_request_optional_fields_test.rb +26 -10
- data/lib/davinci_crd_test_kit/client_tests/hook_request_required_fields_test.rb +20 -11
- data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_context_test.rb +14 -10
- data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_prefetch_test.rb +27 -110
- data/lib/davinci_crd_test_kit/client_tests/order_dispatch_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/order_select_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/order_sign_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/retrieve_jwks_test.rb +66 -29
- data/lib/davinci_crd_test_kit/client_tests/submitted_response_validation.rb +44 -0
- data/lib/davinci_crd_test_kit/client_tests/token_header_test.rb +45 -14
- data/lib/davinci_crd_test_kit/client_tests/token_payload_test.rb +43 -26
- data/lib/davinci_crd_test_kit/crd_client_suite.rb +0 -4
- data/lib/davinci_crd_test_kit/hook_request_field_validation.rb +240 -50
- data/lib/davinci_crd_test_kit/mock_service_response.rb +134 -120
- data/lib/davinci_crd_test_kit/routes/hook_request_endpoint.rb +26 -42
- data/lib/davinci_crd_test_kit/server_encounter_discharge_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_encounter_start_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_order_select_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_tests/coverage_information_system_action_received_test.rb +4 -1
- data/lib/davinci_crd_test_kit/server_tests/service_request_optional_fields_validation_test.rb +8 -10
- data/lib/davinci_crd_test_kit/server_tests/service_request_required_fields_validation_test.rb +5 -10
- data/lib/davinci_crd_test_kit/tags.rb +6 -6
- data/lib/davinci_crd_test_kit/version.rb +1 -1
- metadata +9 -2
data/lib/davinci_crd_test_kit/server_tests/coverage_information_system_action_received_test.rb
CHANGED
@@ -30,7 +30,10 @@ module DaVinciCRDTestKit
|
|
30
30
|
{
|
31
31
|
'appointment-book' => ['Appointment'],
|
32
32
|
'order-sign' => shared_resources,
|
33
|
-
'order-dispatch' => shared_resources
|
33
|
+
'order-dispatch' => shared_resources,
|
34
|
+
'order-select' => shared_resources,
|
35
|
+
'encounter-start' => ['Encounter'],
|
36
|
+
'encounter-discharge' => ['Encounter']
|
34
37
|
}
|
35
38
|
end
|
36
39
|
|
data/lib/davinci_crd_test_kit/server_tests/service_request_optional_fields_validation_test.rb
CHANGED
@@ -23,19 +23,17 @@ module DaVinciCRDTestKit
|
|
23
23
|
load_tagged_requests(hook_name)
|
24
24
|
skip_if requests.empty?, "No #{hook_name} request was made in a previous test as expected."
|
25
25
|
|
26
|
-
error_messages = []
|
27
26
|
requests.each_with_index do |request, index|
|
28
|
-
|
29
|
-
request_body =
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
@request_number = index + 1
|
28
|
+
request_body = json_parse(request.request_body)
|
29
|
+
if request_body.blank?
|
30
|
+
add_message('error', "#{request_number}Hook request body cannot be empty.")
|
31
|
+
next
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
messages << { type: 'error', message: msg }
|
34
|
+
hook_request_optional_fields_check(request_body)
|
37
35
|
end
|
38
|
-
|
36
|
+
no_error_validation('Some service requests have invalid optional fields.')
|
39
37
|
end
|
40
38
|
end
|
41
39
|
end
|
data/lib/davinci_crd_test_kit/server_tests/service_request_required_fields_validation_test.rb
CHANGED
@@ -20,24 +20,19 @@ module DaVinciCRDTestKit
|
|
20
20
|
run do
|
21
21
|
load_tagged_requests(hook_name)
|
22
22
|
skip_if requests.empty?, "No #{hook_name} request was made in a previous test as expected."
|
23
|
-
|
24
|
-
error_messages = []
|
25
23
|
contexts = []
|
26
24
|
requests.each_with_index do |request, index|
|
27
|
-
|
28
|
-
request_body =
|
25
|
+
@request_number = index + 1
|
26
|
+
request_body = json_parse(request.request_body)
|
27
|
+
next if request_body.blank?
|
28
|
+
|
29
29
|
contexts << request_body['context'] if request_body['context'].is_a?(Hash)
|
30
30
|
hook_request_required_fields_check(request_body, hook_name)
|
31
|
-
rescue Inferno::Exceptions::AssertionException => e
|
32
|
-
error_messages << "Request #{index + 1}: #{e.message}"
|
33
31
|
end
|
34
32
|
|
35
33
|
output contexts: contexts.to_json
|
36
34
|
|
37
|
-
|
38
|
-
messages << { type: 'error', message: msg }
|
39
|
-
end
|
40
|
-
assert error_messages.empty?, 'Some service requests made are not valid.'
|
35
|
+
no_error_validation('Some service requests made are not valid.')
|
41
36
|
end
|
42
37
|
end
|
43
38
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module DaVinciCRDTestKit
|
2
|
-
APPOINTMENT_BOOK_TAG = '
|
3
|
-
ENCOUNTER_START_TAG = '
|
4
|
-
ENCOUNTER_DISCHARGE_TAG = '
|
5
|
-
ORDER_DISPATCH_TAG = '
|
6
|
-
ORDER_SELECT_TAG = '
|
7
|
-
ORDER_SIGN_TAG = '
|
2
|
+
APPOINTMENT_BOOK_TAG = 'appointment-book'.freeze
|
3
|
+
ENCOUNTER_START_TAG = 'encounter-start'.freeze
|
4
|
+
ENCOUNTER_DISCHARGE_TAG = 'encounter-discharge'.freeze
|
5
|
+
ORDER_DISPATCH_TAG = 'order-dispatch'.freeze
|
6
|
+
ORDER_SELECT_TAG = 'order-select'.freeze
|
7
|
+
ORDER_SIGN_TAG = 'order-sign'.freeze
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davinci_crd_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: inferno_core
|
@@ -75,12 +75,18 @@ files:
|
|
75
75
|
- lib/davinci_crd_test_kit/client_hook_request_validation.rb
|
76
76
|
- lib/davinci_crd_test_kit/client_hooks_group.rb
|
77
77
|
- lib/davinci_crd_test_kit/client_tests/appointment_book_receive_request_test.rb
|
78
|
+
- lib/davinci_crd_test_kit/client_tests/client_appointment_book_group.rb
|
78
79
|
- lib/davinci_crd_test_kit/client_tests/client_display_cards_attest.rb
|
80
|
+
- lib/davinci_crd_test_kit/client_tests/client_encounter_discharge_group.rb
|
81
|
+
- lib/davinci_crd_test_kit/client_tests/client_encounter_start_group.rb
|
79
82
|
- lib/davinci_crd_test_kit/client_tests/client_fhir_api_create_test.rb
|
80
83
|
- lib/davinci_crd_test_kit/client_tests/client_fhir_api_read_test.rb
|
81
84
|
- lib/davinci_crd_test_kit/client_tests/client_fhir_api_search_test.rb
|
82
85
|
- lib/davinci_crd_test_kit/client_tests/client_fhir_api_update_test.rb
|
83
86
|
- lib/davinci_crd_test_kit/client_tests/client_fhir_api_validation_test.rb
|
87
|
+
- lib/davinci_crd_test_kit/client_tests/client_order_dispatch_group.rb
|
88
|
+
- lib/davinci_crd_test_kit/client_tests/client_order_select_group.rb
|
89
|
+
- lib/davinci_crd_test_kit/client_tests/client_order_sign_group.rb
|
84
90
|
- lib/davinci_crd_test_kit/client_tests/decode_auth_token_test.rb
|
85
91
|
- lib/davinci_crd_test_kit/client_tests/encounter_discharge_receive_request_test.rb
|
86
92
|
- lib/davinci_crd_test_kit/client_tests/encounter_start_receive_request_test.rb
|
@@ -92,6 +98,7 @@ files:
|
|
92
98
|
- lib/davinci_crd_test_kit/client_tests/order_select_receive_request_test.rb
|
93
99
|
- lib/davinci_crd_test_kit/client_tests/order_sign_receive_request_test.rb
|
94
100
|
- lib/davinci_crd_test_kit/client_tests/retrieve_jwks_test.rb
|
101
|
+
- lib/davinci_crd_test_kit/client_tests/submitted_response_validation.rb
|
95
102
|
- lib/davinci_crd_test_kit/client_tests/token_header_test.rb
|
96
103
|
- lib/davinci_crd_test_kit/client_tests/token_payload_test.rb
|
97
104
|
- lib/davinci_crd_test_kit/crd_client_suite.rb
|