davinci_pas_test_kit 0.13.0 → 0.13.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcd1fe3d909acb2221969db4b45584b4ae3f2561b4e08cb312862f577ce80c4b
4
- data.tar.gz: a6c61fe356af3382dc1b9f6da2c7c512a02840e94b55a69ae492c7945b60e8d3
3
+ metadata.gz: b36c102526c99da6d1220766f4b5213d30497f8369271c68e2b41370296b874c
4
+ data.tar.gz: 2a8a894dcf8c6fab84e41ffa5f626b0499b6d3aa554f88bfb8b3e41495000e92
5
5
  SHA512:
6
- metadata.gz: d52966e92c12af47546cb76ea555d3c1ba293d050cd261519401547c332d9749cceb62ce9df47d57a85b32bd85034b2475615ace06ccaa09e4ca6d54b7c0c1fc
7
- data.tar.gz: 896f31d121de68770e0a13350a378d4e1a665346c2e18b7f555b61d2d2e4c3a3b99669a55058fc27fa54fc89b0c7abac4282ad7eb8e4ba72e39dc005ee09037b
6
+ metadata.gz: '07862eba661759fcae73127b68026deeb106ff203f84ed3a503b641de2d03d1fccd24d05b94a86e5dff88500e5e199b0b1284326b83d4fcbc8407ec7c7c35da5'
7
+ data.tar.gz: 5f78a7193457b07a74159f37dc2357b48173ffc9a7fbc40474d6c16c3881ce6ed981f1ce496e55d64dfca28609943a5e7ad83a3821dfe6f15622e6ee6a912df5
@@ -1,91 +1,42 @@
1
- # require 'securerandom' //used for attestation experiment - see below
2
- # require_relative '../../../urls' // used for attestation experiment - see below
3
-
4
1
  module DaVinciPASTestKit
5
2
  module DaVinciPASV201
6
3
  class PasClaimResponseDecisionTest < Inferno::Test
7
- # include URLs // used for attestation experiment - see below
4
+ X12_ADJUDICATION_CODES = {
5
+ approval: 'A1',
6
+ denial: 'A3',
7
+ pended: 'A4'
8
+ }.freeze
8
9
 
9
10
  id :prior_auth_claim_response_decision_validation
10
11
  title 'Server response includes the expected decision code in the ClaimResponse instance'
11
12
  description %(
12
- This test aims to confirm that the decision in the returned ClaimResponse matches
13
+ This test checks that the decision in the returned ClaimResponse matches
13
14
  the decision code required for the workflow under examination.
14
- This test is not yet implemented due to limitations in the IG (see details
15
- [here](https://github.com/inferno-framework/davinci-pas-test-kit/blob/main/lib/davinci_pas_test_kit/docs/server_suite_description_v201.md#testing-limitations)).
16
- It is currently optional and will always be skipped, but will be implemented in the future.
17
15
  )
18
16
  uses_request :pa_submit
19
- optional # optional and skipped until implemented
20
17
 
21
- def status
22
- if use_case == 'approval'
23
- 'approved'
24
- else
25
- use_case == 'denial' ? 'denied' : 'pended'
18
+ run do
19
+ adjudication_code_present = resource&.resourceType == 'Bundle' && resource.entry.any? do |entry|
20
+ entry.resource&.resourceType == 'ClaimResponse' && entry.resource.item.any? do |item|
21
+ item.adjudication.any? do |adjudication|
22
+ adjudication.extension.any? do |adjudication_ext|
23
+ next unless adjudication_ext.url == 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-reviewAction'
24
+
25
+ adjudication_ext.extension.any? do |review_action_ext|
26
+ next unless review_action_ext.url == 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-reviewActionCode'
27
+
28
+ review_action_ext.valueCodeableConcept&.coding&.any? do |coding|
29
+ coding.system == 'https://codesystem.x12.org/005010/306' &&
30
+ coding.code == X12_ADJUDICATION_CODES[use_case.to_sym]
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
26
36
  end
27
- end
28
37
 
29
- run do
30
- skip
31
- # Experiment with extraction of statuses and use in an attestation
32
- # Not used due to the following problems:
33
- # - no real clients to test with
34
- # - how to express the location we're looking for? The spec never mentions it explicitly.
35
- #
36
- # # Extract the response status
37
- # status_values = []
38
- # if resource.resourceType == 'Bundle'
39
- # resource.entry.each do |one_entry|
40
- # next unless one_entry.resource.resourceType == 'ClaimResponse'
41
- #
42
- # one_entry.resource.item.each do |one_item|
43
- # one_item.adjudication.each do |one_adjudication|
44
- # one_adjudication.extension
45
- # .select { |ext| ext.url == 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-reviewAction' }
46
- # .each do |review_action_ext|
47
- # review_action_ext.extension.select { |ext| ext.url == 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-reviewActionCode' }
48
- # .each do |review_action_code_ext|
49
- # review_action_code_ext.valueCodeableConcept.coding.select { |coding| coding.system == 'https://codesystem.x12.org/005010/306' }
50
- # .each do |one_code|
51
- # if one_code.code
52
- # status_values << "#{one_code.code}#{one_code.display ? " (#{one_code.display})" : ''}"
53
- # end
54
- # end
55
- # end
56
- # end
57
- # end
58
- # end
59
- # end
60
- # end
61
- #
62
- # assert !status_values.empty?, 'No status values found **where??**'
63
- #
64
- # # Attestation
65
- # attestation_key = SecureRandom.uuid
66
- # status_display = status_values.reduce('') { |result, status| result + "- #{status}\n" }
67
- # wait(
68
- # identifier: attestation_key,
69
- # message: %(
70
- # **Status Validation for `#{status}`**:
71
- #
72
- # The following adjudication status
73
- # #{status_values.length > 1 ? 'values were' : 'value was'}
74
- # found in the response **where??**:
75
- #
76
- # #{status_display}
77
- #
78
- # I attest that
79
- # #{status_values.length > 1 ? 'one of the status values' : 'the status value'}
80
- # returned by the server indicates that the request was #{status}
81
- #
82
- # [Click here](#{resume_pass_url}?token=#{attestation_key}) if the above statement is **true**.
83
- #
84
- # [Click here](#{resume_fail_url}?token=#{attestation_key}) if the above statement is **false**.
85
- # )
86
- # )
87
- #
88
- # end of experiment with attestation code
38
+ assert adjudication_code_present, 'Claim Response did not contain expected adjudication status ' \
39
+ "code '#{X12_ADJUDICATION_CODES[use_case.to_sym]}'"
89
40
  end
90
41
  end
91
42
  end
@@ -248,7 +248,7 @@ session is created with the selected Client Security Type option, which determin
248
248
  what details the tester needs to provide during the Client Registration tests:
249
249
 
250
250
  - **SMART Backend Services**: the system under test will manually register
251
- with Inferno and request access token used to access FHIR endpoints
251
+ with Inferno and request access tokens for use when accessing FHIR endpoints
252
252
  as per the SMART Backend Services specification. It requires the
253
253
  **SMART JSON Web Key Set (JWKS)** input to be populated with either a URL that resolves
254
254
  to a JWKS or a raw JWKS in JSON format. Additionally, testers may provide
@@ -88,7 +88,7 @@ module DaVinciPASTestKit
88
88
 
89
89
  def update_result
90
90
  if UDAPSecurityTestKit::MockUDAPServer.request_has_expired_token?(request)
91
- UDAPSecurityTestKit::MockUDAPServer.update_response_for_expired_token(response)
91
+ UDAPSecurityTestKit::MockUDAPServer.update_response_for_expired_token(response, 'Bearer token')
92
92
  return
93
93
  end
94
94
 
@@ -16,7 +16,7 @@ module DaVinciPASTestKit
16
16
 
17
17
  def make_response
18
18
  if UDAPSecurityTestKit::MockUDAPServer.request_has_expired_token?(request)
19
- update_response_for_expired_token(response)
19
+ UDAPSecurityTestKit::MockUDAPServer.update_response_for_expired_token(response, 'Bearer token')
20
20
  return
21
21
  end
22
22
 
@@ -16,7 +16,7 @@ module DaVinciPASTestKit
16
16
 
17
17
  def make_response
18
18
  if UDAPSecurityTestKit::MockUDAPServer.request_has_expired_token?(request)
19
- update_response_for_expired_token(response)
19
+ UDAPSecurityTestKit::MockUDAPServer.update_response_for_expired_token(response)
20
20
  return
21
21
  end
22
22
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaVinciPASTestKit
4
- VERSION = '0.13.0'
5
- LAST_UPDATED = '2025-05-06'
4
+ VERSION = '0.13.1'
5
+ LAST_UPDATED = '2025-05-13'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: davinci_pas_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inferno Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-06 00:00:00.000000000 Z
11
+ date: 2025-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core