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-08-16 |
<TestScript xmlns="http://hl7.org/fhir">
<id value="au-core-medicationrequest"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: TestScript au-core-medicationrequest</b></p><a name="au-core-medicationrequest"> </a><a name="hcau-core-medicationrequest"> </a><p><b>url</b>: <a href="TestScript-au-core-medicationrequest.html">TestScript AU Core MedicationRequest — SHALL-level conformance</a></p><p><b>version</b>: 0.1.0</p><p><b>name</b>: AUCoreMedicationRequest</p><p><b>title</b>: AU Core MedicationRequest — SHALL-level conformance</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 MedicationRequest (2.0.0) requirements: read, search by _id, authoredon, intent, status and patient, a search demonstrating the _include=MedicationRequest:medication inclusion mechanism, must-support element presence, and profile conformance validation. Mirrors the SHALL subset of au-fhir-core-inferno's MedicationRequestGroup (medication_request_read_test, medication_request__id_search_test, medication_request_authoredon_search_test, medication_request_intent_search_test, medication_request_status_search_test, medication_request_patient_search_test, medication_request_patient_include_medication_test, medication_request_must_support_test, medication_request_validation_test) — the SHOULD/MAY-level combinatorial search tests (chained patient.identifier searches, multi-param AND/OR combinations, the further patient+intent+authoredon/status _include variants) are not replicated here; see fhirfrog/au-core-compiler#6 for the general scope rationale established for Patient, applied here for #14. Known engine limitation, documented here rather than as a new issue: fhir-frog's AssertionEvaluator validateProfileId assertion validates whichever resource came back from the <em>last</em> operation directly; it cannot reach into a specific entry of a returned Bundle to separately validate an included resource (e.g. the Medication pulled in via _include) against its own profile as a sub-check. Consequently the IncludeMedication test below only demonstrates the retrieval mechanism — asserting via FHIRPath that the Bundle contains both a MedicationRequest and a Medication entry — and does not attempt to validateProfileId the included Medication against au-core-medication. MedicationRequest's own profile conformance is instead exercised separately in the ProfileValidation test via a plain read followed by validateProfileId, which the engine handles correctly. A second, unrelated engine quirk found during validation against a live HAPI server: HAPI's FHIRPathEngine (ca.uhn.fhir newFhirPath(), used by fhir-frog's assertion evaluator) does not resolve the suffixed choice-type accessor form (e.g. <code>medicationReference</code>) as a property name on a resource instance — only the base choice name (<code>medication</code>) or an explicit <code>.ofType(Reference)</code>/<code>as Reference</code> filter on it work. The MustSupport test below therefore asserts <code>MedicationRequest.medication.ofType(Reference).exists()</code> rather than <code>MedicationRequest.medicationReference.exists()</code> to check the specific slice actually populated by the fixture.</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>medication-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-medicationrequest-medication</code></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>medicationrequest-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-medicationrequest-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>: medicationRequestId</p><p><b>path</b>: MedicationRequest.id</p><p><b>sourceId</b>: medicationrequest-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>MedicationRequest</td><td>true</td><td>/${medicationRequestId}</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>: SearchById</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>MedicationRequest</td><td>true</td><td>?_id=${medicationRequestId}</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(MedicationRequest).exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByAuthoredOn</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>MedicationRequest</td><td>true</td><td>?authoredon=2024-03-15</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(MedicationRequest).exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByIntent</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>MedicationRequest</td><td>true</td><td>?intent=order</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(MedicationRequest).exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByStatus</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>MedicationRequest</td><td>true</td><td>?status=active</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(MedicationRequest).exists()</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>MedicationRequest</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(MedicationRequest).exists()</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchWithIncludeMedication</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>MedicationRequest</td><td>true</td><td>?patient=${patientId}&_include=MedicationRequest:medication</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(MedicationRequest).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>Bundle.entry.resource.ofType(Medication).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>MedicationRequest</td><td>true</td><td>/${medicationRequestId}</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>MedicationRequest.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>MedicationRequest.intent.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>MedicationRequest.medication.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>MedicationRequest.medication.ofType(Reference).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>MedicationRequest.subject.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>MedicationRequest.encounter.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>MedicationRequest.authoredOn.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>MedicationRequest.requester.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>MedicationRequest.reasonCode.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>MedicationRequest.reasonReference.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>MedicationRequest.dosageInstruction.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>MedicationRequest.dosageInstruction.text.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>MedicationRequest</td><td>true</td><td>/${medicationRequestId}</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-medicationrequest</td><td>false</td></tr></table></blockquote></blockquote></div>
</text>
<url
value="http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationrequest"/>
<version value="0.1.0"/>
<name value="AUCoreMedicationRequest"/>
<title value="AU Core MedicationRequest — SHALL-level conformance"/>
<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 MedicationRequest (2.0.0) requirements: read, search by _id, authoredon, intent, status and patient, a search demonstrating the _include=MedicationRequest:medication inclusion mechanism, must-support element presence, and profile conformance validation. Mirrors the SHALL subset of au-fhir-core-inferno's MedicationRequestGroup (medication_request_read_test, medication_request__id_search_test, medication_request_authoredon_search_test, medication_request_intent_search_test, medication_request_status_search_test, medication_request_patient_search_test, medication_request_patient_include_medication_test, medication_request_must_support_test, medication_request_validation_test) — the SHOULD/MAY-level combinatorial search tests (chained patient.identifier searches, multi-param AND/OR combinations, the further patient+intent+authoredon/status _include variants) are not replicated here; see fhirfrog/au-core-compiler#6 for the general scope rationale established for Patient, applied here for #14. Known engine limitation, documented here rather than as a new issue: fhir-frog's AssertionEvaluator validateProfileId assertion validates whichever resource came back from the *last* operation directly; it cannot reach into a specific entry of a returned Bundle to separately validate an included resource (e.g. the Medication pulled in via _include) against its own profile as a sub-check. Consequently the IncludeMedication test below only demonstrates the retrieval mechanism — asserting via FHIRPath that the Bundle contains both a MedicationRequest and a Medication entry — and does not attempt to validateProfileId the included Medication against au-core-medication. MedicationRequest's own profile conformance is instead exercised separately in the ProfileValidation test via a plain read followed by validateProfileId, which the engine handles correctly. A second, unrelated engine quirk found during validation against a live HAPI server: HAPI's FHIRPathEngine (ca.uhn.fhir newFhirPath(), used by fhir-frog's assertion evaluator) does not resolve the suffixed choice-type accessor form (e.g. `medicationReference`) as a property name on a resource instance — only the base choice name (`medication`) or an explicit `.ofType(Reference)`/`as Reference` filter on it work. The MustSupport test below therefore asserts `MedicationRequest.medication.ofType(Reference).exists()` rather than `MedicationRequest.medicationReference.exists()` to check the specific slice actually populated by the fixture."/>
<fixture id="patient-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-patient-conformant"/>
</resource>
</fixture>
<fixture id="medication-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-medicationrequest-medication"/>
</resource>
</fixture>
<fixture id="medicationrequest-fixture">
<autocreate value="true"/>
<autodelete value="true"/>
<resource>
<reference value="au-core-medicationrequest-conformant"/>
</resource>
</fixture>
<variable>
<name value="patientId"/>
<path value="Patient.id"/>
<sourceId value="patient-fixture"/>
</variable>
<variable>
<name value="medicationRequestId"/>
<path value="MedicationRequest.id"/>
<sourceId value="medicationrequest-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="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationRequestId}"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<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="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="?_id=${medicationRequestId}"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationRequest).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchByAuthoredOn"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="?authoredon=2024-03-15"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationRequest).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchByIntent"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="?intent=order"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationRequest).exists()"/>
<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="MedicationRequest"/>
<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(MedicationRequest).exists()"/>
<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="MedicationRequest"/>
<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(MedicationRequest).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test>
<name value="SearchWithIncludeMedication"/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params
value="?patient=${patientId}&_include=MedicationRequest:medication"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(MedicationRequest).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="Bundle.entry.resource.ofType(Medication).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="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationRequestId}"/>
</operation>
</action>
<action>
<assert>
<expression value="MedicationRequest.status.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.intent.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.medication.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="MedicationRequest.medication.ofType(Reference).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.subject.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.encounter.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.authoredOn.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.requester.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.reasonCode.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.reasonReference.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression value="MedicationRequest.dosageInstruction.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<expression
value="MedicationRequest.dosageInstruction.text.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="MedicationRequest"/>
<encodeRequestUrl value="true"/>
<params value="/${medicationRequestId}"/>
</operation>
</action>
<action>
<assert>
<validateProfileId
value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationrequest"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>