davinci_crd_test_kit 0.9.0 → 0.9.1.rc

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
@@ -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
 
@@ -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
- assert_valid_json(request.request_body)
29
- request_body = JSON.parse(request.request_body)
30
- hook_request_optional_fields_check(request_body)
31
- rescue Inferno::Exceptions::AssertionException => e
32
- error_messages << "Request #{index + 1}: #{e.message}"
33
- end
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
- error_messages.each do |msg|
36
- messages << { type: 'error', message: msg }
34
+ hook_request_optional_fields_check(request_body)
37
35
  end
38
- assert error_messages.empty?, 'Some service requests have invalid optional fields.'
36
+ no_error_validation('Some service requests have invalid optional fields.')
39
37
  end
40
38
  end
41
39
  end
@@ -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
- assert_valid_json(request.request_body)
28
- request_body = JSON.parse(request.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
- error_messages.each do |msg|
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 = 'crd_appointment_book'.freeze
3
- ENCOUNTER_START_TAG = 'crd_encounter_start'.freeze
4
- ENCOUNTER_DISCHARGE_TAG = 'crd_encounter_discharge'.freeze
5
- ORDER_DISPATCH_TAG = 'crd_order_dispatch'.freeze
6
- ORDER_SELECT_TAG = 'crd_order_select'.freeze
7
- ORDER_SIGN_TAG = 'crd_order_sign'.freeze
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
@@ -1,3 +1,3 @@
1
1
  module DaVinciCRDTestKit
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.1.rc'.freeze
3
3
  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.0
4
+ version: 0.9.1.rc
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-06-07 00:00:00.000000000 Z
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