From 304806260eb90e1abc5ec2cc11b54f03652077c8 Mon Sep 17 00:00:00 2001 From: Pavel R Date: Tue, 19 Mar 2024 13:51:08 +0100 Subject: [PATCH] WIP: Temporary remove specimen checks --- .../diagnosticresult_path_must_support_test.rb | 1 - .../diagnosticresult_path_reference_resolution_test.rb | 1 - .../v0.3.0-ballot/diagnosticresult_path/metadata.yml | 5 ----- .../generated/v0.3.0-ballot/metadata.yml | 5 ----- .../generator/must_support_metadata_extractor.rb | 9 +++++++++ lib/au_core_test_kit/reference_resolution_test.rb | 5 ----- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_must_support_test.rb b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_must_support_test.rb index ef882fa4..1df7eae3 100644 --- a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_must_support_test.rb +++ b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_must_support_test.rb @@ -28,7 +28,6 @@ class DiagnosticresultPathMustSupportTest < Inferno::Test * Observation.referenceRange.low * Observation.referenceRange.text * Observation.referenceRange.type - * Observation.specimen * Observation.status * Observation.subject * Observation.value[x] diff --git a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_reference_resolution_test.rb b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_reference_resolution_test.rb index 8517bdca..90729670 100644 --- a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_reference_resolution_test.rb +++ b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/diagnosticresult_path_reference_resolution_test.rb @@ -17,7 +17,6 @@ class DiagnosticresultPathReferenceResolutionTest < Inferno::Test * Observation.hasMember * Observation.performer - * Observation.specimen * Observation.subject ) diff --git a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/metadata.yml b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/metadata.yml index acf1aec3..086f3334 100644 --- a/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/metadata.yml +++ b/lib/au_core_test_kit/generated/v0.3.0-ballot/diagnosticresult_path/metadata.yml @@ -171,11 +171,6 @@ - :path: value[x] - :path: interpretation - :path: note - - :path: specimen - :types: - - Reference - :target_profiles: - - http://hl7.org.au/fhir/StructureDefinition/au-specimen - :path: referenceRange - :path: referenceRange.low - :path: referenceRange.high diff --git a/lib/au_core_test_kit/generated/v0.3.0-ballot/metadata.yml b/lib/au_core_test_kit/generated/v0.3.0-ballot/metadata.yml index 74fdb9a1..95f02ccf 100644 --- a/lib/au_core_test_kit/generated/v0.3.0-ballot/metadata.yml +++ b/lib/au_core_test_kit/generated/v0.3.0-ballot/metadata.yml @@ -1076,11 +1076,6 @@ - :path: value[x] - :path: interpretation - :path: note - - :path: specimen - :types: - - Reference - :target_profiles: - - http://hl7.org.au/fhir/StructureDefinition/au-specimen - :path: referenceRange - :path: referenceRange.low - :path: referenceRange.high diff --git a/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb b/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb index 4b1a18bb..5c1978b1 100644 --- a/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb +++ b/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb @@ -335,6 +335,7 @@ def handle_special_cases remove_observation_method_attribute remove_observation_value_attribute remove_lipid_result_attributes + remove_specimen_attribute case profile.version when '3.1.1' @@ -350,6 +351,14 @@ def handle_special_cases end end + def remove_specimen_attribute + # TODO: Temporary solution https://github.com/hl7au/au-fhir-core-inferno/issues/18 + if profile.id == 'au-core-diagnosticresult-path' + @must_supports[:elements].delete_if do |element| + ['specimen'].include? element[:path] + end + end + end def remove_lipid_result_attributes # TODO: This code block should be discussed. # We need to understand why there are a lot of extra attributes diff --git a/lib/au_core_test_kit/reference_resolution_test.rb b/lib/au_core_test_kit/reference_resolution_test.rb index eedbee1b..ffa0f5fc 100644 --- a/lib/au_core_test_kit/reference_resolution_test.rb +++ b/lib/au_core_test_kit/reference_resolution_test.rb @@ -159,11 +159,6 @@ def validate_reference_resolution(resource, reference, target_profile) def resource_is_valid_with_target_profile?(resource, target_profile) return true if target_profile.blank? - # NOTE: Special case: terminology server don't have a specimen v0.3.0 - if metadata.profile_version == "0.3.0" && target_profile == "http://hl7.org.au/fhir/StructureDefinition/au-specimen" - target_profile = "#{target_profile}|4.1.0" - end - # Only need to know if the resource is valid. # Calling resource_is_valid? causes validation errors to be logged. validator = find_validator(:default)