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
| Active as of 2026-10-23 |
<TestScript xmlns="http://hl7.org/fhir">
<id value="au-core-medicationstatement"/>
<url
value="http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement"/>
<version value="0.1.0"/>
<name value="AUCoreMedicationStatement"/>
<title value="AU Core MedicationStatement — 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 SHALL-level AU Core MedicationStatement (2.0.0) requirements: read, search by patient (SHALL), plus the single-parameter _id/effective/status searches called for by fhirfrog/au-core-compiler#15, must-support element presence, and profile conformance validation. Mirrors the SHALL subset of au-fhir-core-inferno's MedicationStatementGroup (medication_statement_read_test, medication_statement_patient_search_test, medication_statement__id_search_test, medication_statement_effective_search_test, medication_statement_status_search_test, medication_statement_must_support_test, medication_statement_validation_test) — the patient+status/patient+effective combinatorial searches and the identifier chain searches (dva/ihi/medicare) are not replicated here, matching the SHALL-only scope rationale from #6. Uses medicationCodeableConcept only (simpler than MedicationRequest's medication[x] case); the medicationReference must-support slice is therefore not exercised by this single-fixture set. Per #15, Inferno itself does not wire an inclusion-validation (_include) test for MedicationStatement, so no _include coverage is authored here either."/>
<fixture id="patient-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-patient-conformant"/>
</resource>
</fixture>
<fixture id="medicationstatement-reason-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-medicationstatement-reason-condition"/>
</resource>
</fixture>
<fixture id="medicationstatement-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-medicationstatement-conformant"/>
</resource>
</fixture>
<variable>
<name value="patientId"/>
<path value="Patient.id"/>
<sourceId value="patient-fixture"/>
</variable>
<variable>
<name value="medicationStatementId"/>
<path value="MedicationStatement.id"/>
<sourceId value="medicationstatement-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="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationStatementId}"/>
</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="MedicationStatement"/>
<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(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchById"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="?_id=${medicationStatementId}"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationStatement).status = 'active'"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchByEffective"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="?effective=2024-06-01"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchByStatus"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="?status=active"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationStatement).status = 'active'"/>
<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="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationStatementId}"/>
</operation>
</action>
<action>
<assert>
<expression value="MedicationStatement.status.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.medication.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="MedicationStatement.medication.ofType(CodeableConcept).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.subject.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.effective.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.dateAsserted.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.dosage.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.dosage.text.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.reasonCode.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationStatement.reasonReference.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="MedicationStatement"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationStatementId}"/>
</operation>
</action>
<action>
<assert>
<validateProfileId
value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>