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

: AU Core Sex Assigned at Birth extension — presence & profile conformance - XML Representation

Active as of 2026-10-23

Raw xml | Download


<TestScript xmlns="http://hl7.org/fhir">
  <id value="au-core-sexassignedab"/>
  <url
       value="http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-sexassignedab"/>
  <version value="0.1.0"/>
  <name value="AUCoreSexAssignedAtBirth"/>
  <title
         value="AU Core Sex Assigned at Birth extension — presence &amp; profile conformance"/>
  <status value="active"/>
  <date value="2026-10-23T03:11:59+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 AU Core Sex Assigned at Birth extension (au-core-rsg-sexassignedab, 2.0.0) requirements identified in fhirfrog/au-core-compiler#25 (AUC-026). Correction to the issue's own framing, discovered while authoring this TestScript: au-core-rsg-sexassignedab is a *content-level* refinement of the generic individual-recordedSexOrGender extension, not a separately-URL'd one - its own snapshot fixes Extension.url to the base extension's canonical URL (http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender), not its own. au-core-patient DOES inherit a Patient.extension:recordedSexOrGender slot from its au-patient (AU Base) baseDefinition (visible only in the snapshot, not the differential - which is why the original gap-analysis missed it), typed generically against individual-recordedSexOrGender rather than specifically against au-core-rsg-sexassignedab. So the real, narrower gap is: nothing distinguishes/tests the 'sex assigned at birth' flavour specifically (identified only by the fixed SNOMED 1515311000168102 'Sex assigned at birth' value on its extension:type sub-extension) from other uses of that same generic slot. Covers presence of both must-support sub-extensions (extension:value - biological sex, extensible-bound to the AU THS biological-sex-1 ValueSet; extension:type - fixed to the SNOMED code identifying this specific flavour) via a generic FHIRPath probe against a fetched Patient, exactly as the issue itself suggested was possible without any new engine capability. ProfileValidation runs validateProfileId against au-core-patient to confirm the whole resource - extension included, now correctly url'd to match the inherited slot - remains profile-conformant."/>
  <fixture id="sexassignedab-patient-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-patient-sexassignedab"/>
    </resource>
  </fixture>
  <variable>
    <name value="patientId"/>
    <path value="Patient.id"/>
    <sourceId value="sexassignedab-patient-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="Patient"/>
        <encodeRequestUrl value="true"/>
        <params value="/${patientId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="ExtensionPresence"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Patient"/>
        <encodeRequestUrl value="true"/>
        <params value="/${patientId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <expression
                    value="Patient.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Patient.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender').extension.where(url = 'value').value.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Patient.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender').extension.where(url = 'type').value.coding.code.where($this = '1515311000168102').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="Patient"/>
        <encodeRequestUrl value="true"/>
        <params value="/${patientId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <validateProfileId
                           value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-patient"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>