FHIR Frog AU Core Conformance Tests
0.1.0 - draft

FHIR Frog AU Core Conformance Tests, published by FHIR Frog. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jgsuess/au-core-tests/ and changes regularly. See the Directory of published versions

TestScript: AU Imaging Result Observation — optionality discovery template

Official URL: http://fhirfrog.org/fhir/au-core-tests/TestScript/au-imagingresult Version: 0.1.0
Active as of 2026-08-16 Computable Name: AUImagingResult

Covers fhirfrog/au-core-compiler#23 (AUC-018): au-imagingresult (hl7.fhir.au.base, not a local au-core-* profile) has zero must-support elements of its own, and neither au-fhir-core-inferno (deliberately or not - couldn't confirm skip_generation for it specifically, see the issue's comment thread) nor fhir-frog test it today. Rather than a conventional must-support conformance gate (there's nothing profile-mandated to gate on), this is deliberately built as a discovery template: SHALL-level read/search-type interaction checks (the one real, resource-level requirement the CapabilityStatement does impose) run with warningOnly:false, while every element this profile merely allows (category:anatomicRegionOfInterest, extension:bodyStructure vs plain bodySite, value[x]/dataAbsentReason, component, hasMember) is probed with warningOnly:true against two fixtures - 'au-imagingresult-conformant' (a generous implementer) and 'au-imagingresult-minimal' (a bare-bones one). Building these two fixtures surfaced that 'zero must-support elements' does not mean unconstrained: au-imagingresult carries its own hard invariants not visible from the must-support list alone - inv-obs-0 (value, dataAbsentReason, or a child observation with either must be present - the minimal fixture needed a plain dataAbsentReason to satisfy this, it cannot be genuinely empty), inv-obs-1 (the bodyStructure Reference extension and the plain bodySite CodeableConcept are mutually exclusive, inherited from base Observation's own obs-7 rule about a component sharing its parent's code while both carry a value). Run against a real server, OptionalElementsProbeMinimal's warnings (not failures) are the point: they show which of the genuinely-optional elements that server does or doesn't populate. This only works because assert.warningOnly, though already required and set on every assertion since fhirfrog/fhir-frog's 'add required encodeRequestUrl/warningOnly fields' fix, was never actually read by PhaseExecutor - a failing warningOnly assertion still failed the whole test, identical to a hard one. Fixed alongside this TestScript (see fhirfrog/fhir-frog's PhaseExecutor commit): a failing warningOnly assertion now reports as TestReport's own WARNING result code instead of FAIL, and no longer fails the enclosing test/setup phase - proven by OptionalElementsProbeMinimal genuinely failing several of its own probe assertions against the minimal fixture while the TestScript as a whole still reports PASS.

url: TestScript AU Imaging Result Observation — optionality discovery template

version: 0.1.0

name: AUImagingResult

title: AU Imaging Result Observation — optionality discovery template

status: Active

date: 2026-08-16 05:55:37+0000

publisher: FHIR Frog

contact: FHIR Frog: https://gitlab.com/fhirfrog

description:

Covers fhirfrog/au-core-compiler#23 (AUC-018): au-imagingresult (hl7.fhir.au.base, not a local au-core-* profile) has zero must-support elements of its own, and neither au-fhir-core-inferno (deliberately or not - couldn't confirm skip_generation for it specifically, see the issue's comment thread) nor fhir-frog test it today. Rather than a conventional must-support conformance gate (there's nothing profile-mandated to gate on), this is deliberately built as a discovery template: SHALL-level read/search-type interaction checks (the one real, resource-level requirement the CapabilityStatement does impose) run with warningOnly:false, while every element this profile merely allows (category:anatomicRegionOfInterest, extension:bodyStructure vs plain bodySite, value[x]/dataAbsentReason, component, hasMember) is probed with warningOnly:true against two fixtures - 'au-imagingresult-conformant' (a generous implementer) and 'au-imagingresult-minimal' (a bare-bones one). Building these two fixtures surfaced that 'zero must-support elements' does not mean unconstrained: au-imagingresult carries its own hard invariants not visible from the must-support list alone - inv-obs-0 (value, dataAbsentReason, or a child observation with either must be present - the minimal fixture needed a plain dataAbsentReason to satisfy this, it cannot be genuinely empty), inv-obs-1 (the bodyStructure Reference extension and the plain bodySite CodeableConcept are mutually exclusive, inherited from base Observation's own obs-7 rule about a component sharing its parent's code while both carry a value). Run against a real server, OptionalElementsProbeMinimal's warnings (not failures) are the point: they show which of the genuinely-optional elements that server does or doesn't populate. This only works because assert.warningOnly, though already required and set on every assertion since fhirfrog/fhir-frog's 'add required encodeRequestUrl/warningOnly fields' fix, was never actually read by PhaseExecutor - a failing warningOnly assertion still failed the whole test, identical to a hard one. Fixed alongside this TestScript (see fhirfrog/fhir-frog's PhaseExecutor commit): a failing warningOnly assertion now reports as TestReport's own WARNING result code instead of FAIL, and no longer fails the enclosing test/setup phase - proven by OptionalElementsProbeMinimal genuinely failing several of its own probe assertions against the minimal fixture while the TestScript as a whole still reports PASS.

fixture

id

patient-fixture

autocreate: true

autodelete: true

resource: au-core-patient-conformant

fixture

id

imagingresult-fixture

autocreate: true

autodelete: true

resource: au-imagingresult-conformant

fixture

id

imagingresult-minimal-fixture

autocreate: true

autodelete: true

resource: au-imagingresult-minimal

variable

name: patientId

path: Patient.id

sourceId: patient-fixture

variable

name: imagingResultId

path: Observation.id

sourceId: imagingresult-fixture

variable

name: imagingResultMinimalId

path: Observation.id

sourceId: imagingresult-minimal-fixture

test

name: Read

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${imagingResultId}

action

Asserts

-ResponseWarningOnly
*okayfalse

test

name: SearchByPatientCategory

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)Observationtrue?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|imaging

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'imaging').exists()false

test

name: SearchByPatientCode

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)Observationtrue?patient=Patient/${patientId}&code=http://snomed.info/sct|399208008

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '399208008').exists()false

test

name: OptionalElementsProbeGenerous

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${imagingResultId}

action

Asserts

-ExpressionWarningOnly
*Observation.category.coding.code.where($this = 'imaging').exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.category.where(coding.system = 'http://snomed.info/sct').exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.value.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.dataAbsentReason.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.bodySite.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.component.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.hasMember.exists()true

test

name: OptionalElementsProbeMinimal

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${imagingResultMinimalId}

action

Asserts

-ExpressionWarningOnly
*Observation.category.where(coding.system = 'http://snomed.info/sct').exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.value.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.dataAbsentReason.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.bodySite.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.component.exists()true

action

Asserts

-ExpressionWarningOnly
*Observation.hasMember.exists()true

test

name: ProfileValidation

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${imagingResultId}

action

Asserts

-ValidateProfileIdWarningOnly
*http://hl7.org.au/fhir/StructureDefinition/au-imagingresultfalse

test

name: ProfileValidationMinimal

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${imagingResultMinimalId}

action

Asserts

-ValidateProfileIdWarningOnly
*http://hl7.org.au/fhir/StructureDefinition/au-imagingresultfalse