FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagefhirfrog.au-core-tests
Resource TypeTestScript
IdTestScript-au-imagingresult.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/jgsuess/au-core-tests/TestScript-au-imagingresult.html
URLhttp://fhirfrog.org/fhir/au-core-tests/TestScript/au-imagingresult
Version0.1.0
Statusactive
Date2026-08-16T05:55:37+00:00
NameAUImagingResult
TitleAU Imaging Result Observation — optionality discovery template
DescriptionCovers 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.

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

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, 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

Source1

{
  "resourceType": "TestScript",
  "id": "au-imagingresult",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://fhirfrog.org/fhir/au-core-tests/TestScript/au-imagingresult",
  "version": "0.1.0",
  "name": "AUImagingResult",
  "title": "AU Imaging Result Observation — optionality discovery template",
  "status": "active",
  "date": "2026-08-16T05:55:37+00:00",
  "publisher": "FHIR Frog",
  "contact": [
    {
      "name": "FHIR Frog",
      "telecom": [
        {
          "system": "url",
          "value": "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": {
        "reference": "au-core-patient-conformant"
      }
    },
    {
      "id": "imagingresult-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-imagingresult-conformant"
      }
    },
    {
      "id": "imagingresult-minimal-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-imagingresult-minimal"
      }
    }
  ],
  "variable": [
    {
      "name": "patientId",
      "path": "Patient.id",
      "sourceId": "patient-fixture"
    },
    {
      "name": "imagingResultId",
      "path": "Observation.id",
      "sourceId": "imagingresult-fixture"
    },
    {
      "name": "imagingResultMinimalId",
      "path": "Observation.id",
      "sourceId": "imagingresult-minimal-fixture"
    }
  ],
  "test": [
    {
      "name": "Read",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${imagingResultId}"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatientCategory",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|imaging"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'imaging').exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatientCode",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "?patient=Patient/${patientId}&code=http://snomed.info/sct|399208008"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '399208008').exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "OptionalElementsProbeGenerous",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${imagingResultId}"
          }
        },
        {
          "assert": {
            "expression": "Observation.category.coding.code.where($this = 'imaging').exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.category.where(coding.system = 'http://snomed.info/sct').exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.value.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.dataAbsentReason.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.bodySite.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.component.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.hasMember.exists()",
            "warningOnly": true
          }
        }
      ]
    },
    {
      "name": "OptionalElementsProbeMinimal",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${imagingResultMinimalId}"
          }
        },
        {
          "assert": {
            "expression": "Observation.category.where(coding.system = 'http://snomed.info/sct').exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/bodySite').exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.value.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.dataAbsentReason.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.bodySite.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.component.exists()",
            "warningOnly": true
          }
        },
        {
          "assert": {
            "expression": "Observation.hasMember.exists()",
            "warningOnly": true
          }
        }
      ]
    },
    {
      "name": "ProfileValidation",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${imagingResultId}"
          }
        },
        {
          "assert": {
            "validateProfileId": "http://hl7.org.au/fhir/StructureDefinition/au-imagingresult",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "ProfileValidationMinimal",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${imagingResultMinimalId}"
          }
        },
        {
          "assert": {
            "validateProfileId": "http://hl7.org.au/fhir/StructureDefinition/au-imagingresult",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}