au_core_test_kit 1.4.5 → 1.4.6

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: f6d2ee5f49e9e282292ab79cbe549cfc4d72fcd6f87526263cb8926c4aca56ba
4
- data.tar.gz: a8efff24fa1a53c877474c94009129e0d2233988a568a763076f98ff29f860f4
3
+ metadata.gz: 0053d2abc786969d0847c339b0669a85f533903c6abc0c4b43ea073908ea4103
4
+ data.tar.gz: '06419d79b97969cd9e930b4d0b21b44c3034d7d0e542a6f2cf7736629af948e4'
5
5
  SHA512:
6
- metadata.gz: 61d1c82308ee6f90efa8ec2e53ab1218efa37d32a556172a25e0f21f448372a3110b46ef0625533b73d9ca6be34fc9f07e8bd0c512c2862f4a96035d8db59911
7
- data.tar.gz: e5e74971407c1f7f000efd0aeafb2773eb7a60eb73dc984f1957ad9ab48981c2dc9ddb7c58f130281eb06b952e43d1b9f869692fec394e5ef96ee672440a8115
6
+ metadata.gz: fea955cf64f41903444427ad2a6dca4ebc6788d382d337b12671b5e59875b010362601cf1504b727eb1e6245465b89c937fe46d3c0959f33655cfc1698017982
7
+ data.tar.gz: b78a1748eea8a9057b177f0ef55790853d8cc414094ea91ff3ae5ea703d1c61b2b52bbd72cdbaf0b3dd15645af33c3cc39f16aaed60a50af21b3c20b287cc31c
@@ -45,6 +45,14 @@ module AUCoreTestKit
45
45
  )
46
46
  version VERSION
47
47
 
48
+ # `id` MUST be declared before `fhir_resource_validator`: the validator captures the
49
+ # suite id eagerly as its `test_suite_id` (Inferno keys validator sessions on it). If
50
+ # `id` comes after, the capture falls back to the base-class name
51
+ # "Inferno::Entities::TestSuite", which every affected suite then shares as one
52
+ # validator session — collapsing AU Core 1.0.0 and 2.0.0 onto a single validator
53
+ # engine and causing intermittent "Unable to resolve profile ...|<version>" errors.
54
+ id :au_core_v100
55
+
48
56
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
49
57
 
50
58
  def self.metadata
@@ -88,8 +96,6 @@ module AUCoreTestKit
88
96
  }
89
97
  ]
90
98
 
91
- id :au_core_v100
92
-
93
99
  input :url,
94
100
  title: 'FHIR Endpoint',
95
101
  description: 'URL of the FHIR endpoint',
@@ -46,6 +46,14 @@ module AUCoreTestKit
46
46
  )
47
47
  version VERSION
48
48
 
49
+ # `id` MUST be declared before `fhir_resource_validator`: the validator captures the
50
+ # suite id eagerly as its `test_suite_id` (Inferno keys validator sessions on it). If
51
+ # `id` comes after, the capture falls back to the base-class name
52
+ # "Inferno::Entities::TestSuite", which every affected suite then shares as one
53
+ # validator session — collapsing AU Core 1.0.0 and 2.0.0 onto a single validator
54
+ # engine and causing intermittent "Unable to resolve profile ...|<version>" errors.
55
+ id :au_core_v200
56
+
49
57
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
50
58
 
51
59
  def self.metadata
@@ -93,8 +101,6 @@ module AUCoreTestKit
93
101
  }
94
102
  ]
95
103
 
96
- id :au_core_v200
97
-
98
104
  input :url,
99
105
  title: 'FHIR Endpoint',
100
106
  description: 'URL of the FHIR endpoint',
@@ -169,22 +169,17 @@ module AUCoreTestKit
169
169
  def resource_is_valid_with_target_profile?(resource, target_profile)
170
170
  return true if target_profile.blank?
171
171
 
172
- # Only need to know if the resource is valid.
173
- # Calling resource_is_valid? causes validation errors to be logged.
174
172
  validator = find_validator(:default)
175
173
 
176
174
  target_profile_with_version = target_profile == "http://hl7.org.au/fhir/StructureDefinition/au-specimen" ? target_profile : "#{target_profile}|#{metadata.profile_version}"
177
175
 
178
- validator_response = validator.validate(resource, target_profile_with_version)
179
- outcome = validator.operation_outcome_from_hl7_wrapped_response(validator_response)
180
-
181
- message_hashes = outcome.issue&.map { |issue| validator.message_hash_from_issue(issue, resource) } || []
182
-
183
- message_hashes.concat(validator.additional_validation_messages(resource, target_profile_with_version))
184
-
185
- validator.filter_messages(message_hashes)
186
-
187
- message_hashes.none? { |message_hash| message_hash[:type] == 'error' }
176
+ # Only the boolean matters here, so add_messages_to_runnable is false: logging a
177
+ # validation message for every reference target would flood the test's messages.
178
+ # This is the supported way to validate without logging. The previous
179
+ # implementation hand-rolled the same thing out of Validator internals
180
+ # (operation_outcome_from_hl7_wrapped_response, message_hash_from_issue,
181
+ # filter_messages), all of which inferno_core removed in v1.1.0.
182
+ validator.resource_is_valid?(resource, target_profile_with_version, self, add_messages_to_runnable: false)
188
183
  end
189
184
  end
190
185
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AUCoreTestKit
4
- VERSION = '1.4.5'
4
+ VERSION = '1.4.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: au_core_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Beda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-08-04 00:00:00.000000000 Z
12
+ date: 2026-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: inferno_core