<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">
  <id value="au-core-immunization"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: TestScript au-core-immunization</b></p><a name="au-core-immunization"> </a><a name="hcau-core-immunization"> </a><p><b>url</b>: <a href="TestScript-au-core-immunization.html">TestScript AU Core Immunization — SHALL-level conformance plus vaccineCode slice coverage</a></p><p><b>version</b>: 0.1.0</p><p><b>name</b>: AUCoreImmunization</p><p><b>title</b>: AU Core Immunization — SHALL-level conformance plus vaccineCode slice coverage</p><p><b>status</b>: Active</p><p><b>date</b>: 2026-08-16 05:55:37+0000</p><p><b>publisher</b>: FHIR Frog</p><p><b>contact</b>: FHIR Frog: <a href="https://gitlab.com/fhirfrog">https://gitlab.com/fhirfrog</a></p><p><b>description</b>: </p><div><p>Covers the SHALL-level AU Core Immunization (2.0.0) requirements: read, search by patient, the SHALL search-combo patient+status, must-support element presence (including FHIRPath presence checks for the vaccineCode.coding:amtVaccineCode and vaccineCode.coding:airVaccineCode slices), and profile conformance validation. Reuses the shared au-core-patient-conformant fixture for the patient reference. Mirrors the SHALL subset of au-fhir-core-inferno's ImmunizationGroup (immunization_read_test, immunization_patient_search_test, immunization_patient_status_search_test, immunization_must_support_test, immunization_validation_test). Also includes standalone (MAY-level) SearchByDate and SearchByVaccineCode tests since date/status/vaccine-code/patient search were explicitly named in fhirfrog/au-core-compiler#11 — following the precedent set in #7/#8 of demonstrating an explicitly-called-out MAY/SHOULD-level mechanism alongside the SHALL-only core. The remaining SHOULD/MAY-level combinatorial coverage (patient+date, patient+vaccine-code, vaccine-code multiple-or, date multiple-and, the DVA/IHI/Medicare patient identifier chain searches, and the reference-resolution test) is not replicated here; see fhirfrog/au-core-compiler#6 for the original SHALL-only scope rationale. The amtVaccineCode and airVaccineCode slices are discriminated in the AU Core StructureDefinition by a pattern/$this rule bound to the amt-vaccine-1 and australian-immunisation-register-vaccine-1 ValueSets respectively rather than by a fixed coding.system element; in practice AMT codes are carried on the http://snomed.info/sct system and AIR codes on the https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats system (confirmed against the published au-core-immunization example Immunization-covid-1), so slice presence is asserted via a coding.where(system=...) FHIRPath check against those two systems.</p>
</div><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>patient-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-patient-conformant</code></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>immunization-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-immunization-conformant</code></p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: patientId</p><p><b>path</b>: Patient.id</p><p><b>sourceId</b>: patient-fixture</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: immunizationId</p><p><b>path</b>: Immunization.id</p><p><b>sourceId</b>: immunization-fixture</p></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: Read</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read">Test script operation code: read</a> (Read)</td><td>Immunization</td><td>true</td><td>/${immunizationId}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>okay</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByPatient</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-search">Test script operation code: search</a> (Search)</td><td>Immunization</td><td>true</td><td>?patient=${patientId}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>okay</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Bundle.entry.resource.ofType(Immunization).note.text.where($this.contains('Frog')).exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByPatientAndStatus</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-search">Test script operation code: search</a> (Search)</td><td>Immunization</td><td>true</td><td>?patient=${patientId}&amp;status=completed</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>okay</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Bundle.entry.resource.ofType(Immunization).status.where($this = 'completed').exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByDate</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-search">Test script operation code: search</a> (Search)</td><td>Immunization</td><td>true</td><td>?date=ge2020-01-01</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>okay</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Bundle.entry.resource.ofType(Immunization).note.text.exists($this.contains('Frog'))</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByVaccineCode</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-search">Test script operation code: search</a> (Search)</td><td>Immunization</td><td>true</td><td>?vaccine-code=https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats|COMIRN</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>okay</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Bundle.entry.resource.ofType(Immunization).vaccineCode.coding.where(code = 'COMIRN').exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: MustSupport</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read">Test script operation code: read</a> (Read)</td><td>Immunization</td><td>true</td><td>/${immunizationId}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.status.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.vaccineCode.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.vaccineCode.coding.where(system = 'http://snomed.info/sct').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.vaccineCode.coding.where(system = 'https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.patient.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.occurrence.ofType(dateTime).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.primarySource.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.lotNumber.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Immunization.note.exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: ProfileValidation</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.3.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read">Test script operation code: read</a> (Read)</td><td>Immunization</td><td>true</td><td>/${immunizationId}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>http://hl7.org.au/fhir/core/StructureDefinition/au-core-immunization</td><td>false</td></tr></table></blockquote></blockquote></div>
  </text>
  <url value="http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-immunization"/>
  <version value="0.1.0"/>
  <name value="AUCoreImmunization"/>
  <title value="AU Core Immunization — SHALL-level conformance plus vaccineCode slice coverage"/>
  <status value="active"/>
  <date value="2026-08-16T05:55:37+00:00"/>
  <publisher value="FHIR Frog"/>
  <contact>
    <name value="FHIR Frog"/>
    <telecom>
      <system value="url"/>
      <value value="https://gitlab.com/fhirfrog"/>
    </telecom>
  </contact>
  <description value="Covers the SHALL-level AU Core Immunization (2.0.0) requirements: read, search by patient, the SHALL search-combo patient+status, must-support element presence (including FHIRPath presence checks for the vaccineCode.coding:amtVaccineCode and vaccineCode.coding:airVaccineCode slices), and profile conformance validation. Reuses the shared au-core-patient-conformant fixture for the patient reference. Mirrors the SHALL subset of au-fhir-core-inferno's ImmunizationGroup (immunization_read_test, immunization_patient_search_test, immunization_patient_status_search_test, immunization_must_support_test, immunization_validation_test). Also includes standalone (MAY-level) SearchByDate and SearchByVaccineCode tests since date/status/vaccine-code/patient search were explicitly named in fhirfrog/au-core-compiler#11 — following the precedent set in #7/#8 of demonstrating an explicitly-called-out MAY/SHOULD-level mechanism alongside the SHALL-only core. The remaining SHOULD/MAY-level combinatorial coverage (patient+date, patient+vaccine-code, vaccine-code multiple-or, date multiple-and, the DVA/IHI/Medicare patient identifier chain searches, and the reference-resolution test) is not replicated here; see fhirfrog/au-core-compiler#6 for the original SHALL-only scope rationale. The amtVaccineCode and airVaccineCode slices are discriminated in the AU Core StructureDefinition by a pattern/$this rule bound to the amt-vaccine-1 and australian-immunisation-register-vaccine-1 ValueSets respectively rather than by a fixed coding.system element; in practice AMT codes are carried on the http://snomed.info/sct system and AIR codes on the https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats system (confirmed against the published au-core-immunization example Immunization-covid-1), so slice presence is asserted via a coding.where(system=...) FHIRPath check against those two systems."/>
  <fixture id="patient-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-patient-conformant"/>
    </resource>
  </fixture>
  <fixture id="immunization-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-immunization-conformant"/>
    </resource>
  </fixture>
  <variable>
    <name value="patientId"/>
    <path value="Patient.id"/>
    <sourceId value="patient-fixture"/>
  </variable>
  <variable>
    <name value="immunizationId"/>
    <path value="Immunization.id"/>
    <sourceId value="immunization-fixture"/>
  </variable>
  <test>
    <name value="Read"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="/${immunizationId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByPatient"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="?patient=${patientId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Bundle.entry.resource.ofType(Immunization).note.text.where($this.contains('Frog')).exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByPatientAndStatus"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="?patient=${patientId}&amp;status=completed"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Bundle.entry.resource.ofType(Immunization).status.where($this = 'completed').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByDate"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="?date=ge2020-01-01"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Bundle.entry.resource.ofType(Immunization).note.text.exists($this.contains('Frog'))"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByVaccineCode"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="?vaccine-code=https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats|COMIRN"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Bundle.entry.resource.ofType(Immunization).vaccineCode.coding.where(code = 'COMIRN').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="MustSupport"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="/${immunizationId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <expression value="Immunization.status.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.vaccineCode.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.vaccineCode.coding.where(system = 'http://snomed.info/sct').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.vaccineCode.coding.where(system = 'https://www.humanservices.gov.au/organisations/health-professionals/enablers/air-vaccine-code-formats').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.patient.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.occurrence.ofType(dateTime).exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.primarySource.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.lotNumber.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Immunization.note.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="ProfileValidation"/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Immunization"/>
        <encodeRequestUrl value="true"/>
        <params value="/${immunizationId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <validateProfileId value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-immunization"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>