au-imagingresult
type: TestScript
node role: treeRoot
resource.id:
  value: au-imagingresult
domain resource.text:
  narrative.status:
    value: generated
  narrative.div: Generated Narrative: TestScript au-imagingresult 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, OptionalElementsPr…
test script.url:
  value: http://fhirfrog.org/fhir/au-core-tests/TestScript/au-imagingresult
test script.version:
  value: 0.1.0
test script.name:
  value: AUImagingResult
test script.title:
  value: AU Imaging Result Observation — optionality discovery template
test script.status:
  value: active
test script.date:
  value: 2026-08-16T05:55:37+00:00
test script.publisher:
  value: FHIR Frog
test script.contact:
  index: 0
  contact detail.name:
    value: FHIR Frog
  contact detail.telecom:
    index: 0
    contact point.system:
      value: url
    contact point.value:
      value: https://gitlab.com/fhirfrog
test script.description:
  value: 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 -…
test script.fixture:
  index: 0
  element.id:
    value: patient-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-core-patient-conformant
test script.fixture:
  index: 1
  element.id:
    value: imagingresult-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-imagingresult-conformant
test script.fixture:
  index: 2
  element.id:
    value: imagingresult-minimal-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-imagingresult-minimal
test script.variable:
  index: 0
  test script.variable.name:
    value: patientId
  test script.variable.path:
    value: Patient.id
  test script.variable.source id:
    value: patient-fixture
test script.variable:
  index: 1
  test script.variable.name:
    value: imagingResultId
  test script.variable.path:
    value: Observation.id
  test script.variable.source id:
    value: imagingresult-fixture
test script.variable:
  index: 2
  test script.variable.name:
    value: imagingResultMinimalId
  test script.variable.path:
    value: Observation.id
  test script.variable.source id:
    value: imagingresult-minimal-fixture
test script.test:
  index: 0
  test script.test.name:
    value: Read
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: Observation
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: /${imagingResultId}
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 1
  test script.test.name:
    value: SearchByPatientCategory
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: Observation
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|imaging
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'imaging').exists()
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 2
  test script.test.name:
    value: SearchByPatientCode
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: Observation
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?patient=Patient/${patientId}&code=http://snomed.info/sct|399208008
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '399208008').exists()
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 3
  test script.test.name:
    value: OptionalElementsProbeGenerous
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: Observation
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: /${imagingResultId}
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Observation.category.coding.code.where($this = 'imaging').exists()
      test script.setup.action.assert.warning only:
        value: true
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Observation.category.where(coding.system = 'http://snomed.info/sct').exists()
      test script.setup.action.assert.warning only:
        value: true
  test script.test.action:
    index: 3
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()
      test script.setup.action.assert.warning only:
        value: true
  test script.test.action:
    index: 4
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Observation.value.exists()

value: read

value: search

value: search

value: read

value: true

index: 5
test script.test.action.assert:
  test script.setup.action.assert.expression:
    value: Observation.dataAbsentReason.exists()
  test script.setup.action.assert.warning only:
    value: true

index: 6
test script.test.action.assert:
  test script.setup.action.assert.expression:
    value: Observation.bodySite.exists()
  test script.setup.action.assert.warning only:
    value: true

index: 7
test script.test.action.assert:
  test script.setup.action.assert.expression:
    value: Observation.component.exists()
  test script.setup.action.assert.warning only:
    value: true

index: 8
test script.test.action.assert:
  test script.setup.action.assert.expression:
    value: Observation.hasMember.exists()
  test script.setup.action.assert.warning only:
    value: true

index: 4
test script.test.name:
  value: OptionalElementsProbeMinimal
test script.test.action:
  index: 0
  test script.test.action.operation:
    test script.setup.action.operation.type:
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/testscript-operation-codes
      coding.code:
        value: read
    test script.setup.action.operation.resource:
      value: Observation
    test script.setup.action.operation.encode request url:
      value: true
    test script.setup.action.operation.params:
      value: /${imagingResultMinimalId}
test script.test.action:
  index: 1
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.category.where(coding.system = 'http://snomed.info/sct').exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 2
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 3
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.value.exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 4
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.dataAbsentReason.exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 5
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.bodySite.exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 6
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.component.exists()
    test script.setup.action.assert.warning only:
      value: true
test script.test.action:
  index: 7
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: Observation.hasMember.exists()
    test script.setup.action.assert.warning only:
      value: true

index: 5
test script.test.name:
  value: ProfileValidation
test script.test.action:
  index: 0
  test script.test.action.operation:
    test script.setup.action.operation.type:
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/testscript-operation-codes
      coding.code:
        value: read
    test script.setup.action.operation.resource:
      value: Observation
    test script.setup.action.operation.encode request url:
      value: true
    test script.setup.action.operation.params:
      value: /${imagingResultId}
test script.test.action:
  index: 1
  test script.test.action.assert:
    test script.setup.action.assert.validate profile id:
      value: http://hl7.org.au/fhir/StructureDefinition/au-imagingresult
    test script.setup.action.assert.warning only:
      value: false

index: 6
test script.test.name:
  value: ProfileValidationMinimal
test script.test.action:
  index: 0
  test script.test.action.operation:
    test script.setup.action.operation.type:
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/testscript-operation-codes
      coding.code:
        value: read
    test script.setup.action.operation.resource:
      value: Observation
    test script.setup.action.operation.encode request url:
      value: true
    test script.setup.action.operation.params:
      value: /${imagingResultMinimalId}
test script.test.action:
  index: 1
  test script.test.action.assert:
    test script.setup.action.assert.validate profile id:
      value: http://hl7.org.au/fhir/StructureDefinition/au-imagingresult
    test script.setup.action.assert.warning only:
      value: false