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 Smoking Status — SHALL-level conformance - XML Representation

Active as of 2026-10-23

Raw xml | Download


<TestScript xmlns="http://hl7.org/fhir">
  <id value="au-core-smokingstatus"/>
  <url
       value="http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-smokingstatus"/>
  <version value="0.1.0"/>
  <name value="AUCoreSmokingStatus"/>
  <title value="AU Core Smoking Status — SHALL-level 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 Smoking Status Observation (au-core-smokingstatus, 2.0.0) requirements identified in fhirfrog/au-core-compiler#24 (AUC-026): read, search by patient+code/patient+category/patient+category+date (mirroring au-fhir-core-inferno's smokingstatus group), must-support element presence across all 8 MS elements (status, category, category:socialHistory, code, subject, effective[x], value[x], dataAbsentReason), and profile conformance validation. Both category (fixed social-history) and code (fixed SNOMED 1747861000168109 'Tobacco smoking status') are pattern-constrained to a single value by the profile itself, so both fixtures share identical category/code - only value[x] vs dataAbsentReason differs between them, mirroring the profile's au-core-obs-01 condition on value[x] (value or dataAbsentReason must be present). Per issue #24's own scoping call, this profile has no obligation-extension or negative-testing complexity beyond that presence pairing - unlike fhirfrog/au-core-compiler#21/#22, no dedicated ObligationNoError/responseCode test is included here, matching the simpler pattern already established for fhirfrog/au-core-compiler#6-#20."/>
  <fixture id="patient-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-patient-conformant"/>
    </resource>
  </fixture>
  <fixture id="smokingstatus-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-smokingstatus-conformant"/>
    </resource>
  </fixture>
  <fixture id="smokingstatus-absent-fixture">
    <autocreate value="true"/>
    <autodelete value="true"/>
    <resource>
      <reference value="au-core-smokingstatus-absent"/>
    </resource>
  </fixture>
  <variable>
    <name value="patientId"/>
    <path value="Patient.id"/>
    <sourceId value="patient-fixture"/>
  </variable>
  <variable>
    <name value="smokingStatusId"/>
    <path value="Observation.id"/>
    <sourceId value="smokingstatus-fixture"/>
  </variable>
  <variable>
    <name value="smokingStatusAbsentId"/>
    <path value="Observation.id"/>
    <sourceId value="smokingstatus-absent-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="Observation"/>
        <encodeRequestUrl value="true"/>
        <params value="/${smokingStatusId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByPatientCode"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Observation"/>
        <encodeRequestUrl value="true"/>
        <params
                value="?patient=Patient/${patientId}&amp;code=http://snomed.info/sct|1747861000168109"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByPatientCategory"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Observation"/>
        <encodeRequestUrl value="true"/>
        <params
                value="?patient=Patient/${patientId}&amp;category=http://terminology.hl7.org/CodeSystem/observation-category|social-history"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'social-history').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="SearchByPatientCategoryDate"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="search"/>
        </type>
        <resource value="Observation"/>
        <encodeRequestUrl value="true"/>
        <params
                value="?patient=Patient/${patientId}&amp;category=http://terminology.hl7.org/CodeSystem/observation-category|social-history&amp;date=2026-01-10"/>
      </operation>
    </action>
    <action>
      <assert>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').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="Observation"/>
        <encodeRequestUrl value="true"/>
        <params value="/${smokingStatusId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <expression value="Observation.status.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Observation.category.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Observation.category.coding.code.where($this = 'social-history').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression
                    value="Observation.code.coding.code.where($this = '1747861000168109').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Observation.subject.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Observation.effective.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <expression value="Observation.value.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="MustSupportAbsent"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Observation"/>
        <encodeRequestUrl value="true"/>
        <params value="/${smokingStatusAbsentId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <expression value="Observation.dataAbsentReason.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="Observation"/>
        <encodeRequestUrl value="true"/>
        <params value="/${smokingStatusId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <validateProfileId
                           value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatus"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
  <test>
    <name value="ProfileValidationAbsent"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Observation"/>
        <encodeRequestUrl value="true"/>
        <params value="/${smokingStatusAbsentId}"/>
      </operation>
    </action>
    <action>
      <assert>
        <validateProfileId
                           value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatus"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>