@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement> a fhir:TestScript ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "au-core-medicationstatement"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: TestScript au-core-medicationstatement</b></p><a name=\"au-core-medicationstatement\"> </a><a name=\"hcau-core-medicationstatement\"> </a><p><b>url</b>: <a href=\"TestScript-au-core-medicationstatement.html\">TestScript AU Core MedicationStatement — SHALL-level conformance</a></p><p><b>version</b>: 0.1.0</p><p><b>name</b>: AUCoreMedicationStatement</p><p><b>title</b>: AU Core MedicationStatement — 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 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.</p>\n</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>medicationstatement-reason-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-medicationstatement-reason-condition</code></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>medicationstatement-fixture</blockquote><p><b>autocreate</b>: true</p><p><b>autodelete</b>: true</p><p><b>resource</b>: <code>au-core-medicationstatement-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>: medicationStatementId</p><p><b>path</b>: MedicationStatement.id</p><p><b>sourceId</b>: medicationstatement-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>MedicationStatement</td><td>true</td><td>/${medicationStatementId}</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>MedicationStatement</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(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()</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>MedicationStatement</td><td>true</td><td>?_id=${medicationStatementId}</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(MedicationStatement).status = 'active'</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: SearchByEffective</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>MedicationStatement</td><td>true</td><td>?effective=2024-06-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(MedicationStatement).effective = '2024-06-01'</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>MedicationStatement</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(MedicationStatement).status = 'active'</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>MedicationStatement</td><td>true</td><td>/${medicationStatementId}</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>MedicationStatement.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>MedicationStatement.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>MedicationStatement.medication.ofType(CodeableConcept).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>MedicationStatement.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>MedicationStatement.effective.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>MedicationStatement.dateAsserted.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>MedicationStatement.dosage.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>MedicationStatement.dosage.text.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>MedicationStatement.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>MedicationStatement.reasonReference.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>MedicationStatement</td><td>true</td><td>/${medicationStatementId}</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-medicationstatement</td><td>false</td></tr></table></blockquote></blockquote></div>"
  ] ;
  fhir:TestScript.url [ fhir:value "http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement"] ;
  fhir:TestScript.version [ fhir:value "0.1.0"] ;
  fhir:TestScript.name [ fhir:value "AUCoreMedicationStatement"] ;
  fhir:TestScript.title [ fhir:value "AU Core MedicationStatement — SHALL-level conformance"] ;
  fhir:TestScript.status [ fhir:value "active"] ;
  fhir:TestScript.date [ fhir:value "2026-08-16T05:55:37+00:00"^^xsd:dateTime] ;
  fhir:TestScript.publisher [ fhir:value "FHIR Frog"] ;
  fhir:TestScript.contact [
     fhir:index 0 ;
     fhir:ContactDetail.name [ fhir:value "FHIR Frog" ] ;
     fhir:ContactDetail.telecom [
       fhir:index 0 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://gitlab.com/fhirfrog" ]
     ]
  ] ;
  fhir:TestScript.description [ fhir: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."] ;
  fhir:TestScript.fixture [
     fhir:index 0 ;
     fhir:Element.id [ fhir:value "patient-fixture" ] ;
     fhir:TestScript.fixture.autocreate [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.autodelete [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.resource [
       fhir:Reference.reference [ fhir:value "au-core-patient-conformant" ]
     ]
  ], [
     fhir:index 1 ;
     fhir:Element.id [ fhir:value "medicationstatement-reason-fixture" ] ;
     fhir:TestScript.fixture.autocreate [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.autodelete [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.resource [
       fhir:Reference.reference [ fhir:value "au-core-medicationstatement-reason-condition" ]
     ]
  ], [
     fhir:index 2 ;
     fhir:Element.id [ fhir:value "medicationstatement-fixture" ] ;
     fhir:TestScript.fixture.autocreate [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.autodelete [ fhir:value "true"^^xsd:boolean ] ;
     fhir:TestScript.fixture.resource [
       fhir:Reference.reference [ fhir:value "au-core-medicationstatement-conformant" ]
     ]
  ] ;
  fhir:TestScript.variable [
     fhir:index 0 ;
     fhir:TestScript.variable.name [ fhir:value "patientId" ] ;
     fhir:TestScript.variable.path [ fhir:value "Patient.id" ] ;
     fhir:TestScript.variable.sourceId [ fhir:value "patient-fixture" ]
  ], [
     fhir:index 1 ;
     fhir:TestScript.variable.name [ fhir:value "medicationStatementId" ] ;
     fhir:TestScript.variable.path [ fhir:value "MedicationStatement.id" ] ;
     fhir:TestScript.variable.sourceId [ fhir:value "medicationstatement-fixture" ]
  ] ;
  fhir:TestScript.test [
     fhir:index 0 ;
     fhir:TestScript.test.name [ fhir:value "Read" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "read" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "/${medicationStatementId}" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 1 ;
     fhir:TestScript.test.name [ fhir:value "SearchByPatient" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "search" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "?patient=${patientId}" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 2 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 2 ;
     fhir:TestScript.test.name [ fhir:value "SearchById" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "search" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "?_id=${medicationStatementId}" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 2 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "Bundle.entry.resource.ofType(MedicationStatement).status = 'active'" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 3 ;
     fhir:TestScript.test.name [ fhir:value "SearchByEffective" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "search" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "?effective=2024-06-01" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 2 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 4 ;
     fhir:TestScript.test.name [ fhir:value "SearchByStatus" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "search" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "?status=active" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 2 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "Bundle.entry.resource.ofType(MedicationStatement).status = 'active'" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 5 ;
     fhir:TestScript.test.name [ fhir:value "MustSupport" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "read" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "/${medicationStatementId}" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.status.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 2 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.medication.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 3 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.medication.ofType(CodeableConcept).exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 4 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.subject.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 5 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.effective.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 6 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.dateAsserted.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 7 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.dosage.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 8 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.dosage.text.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 9 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.reasonCode.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ], [
       fhir:index 10 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.expression [ fhir:value "MedicationStatement.reasonReference.exists()" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ], [
     fhir:index 6 ;
     fhir:TestScript.test.name [ fhir:value "ProfileValidation" ] ;
     fhir:TestScript.test.action [
       fhir:index 0 ;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" ] ;
           fhir:Coding.code [ fhir:value "read" ]
         ] ;
         fhir:TestScript.setup.action.operation.resource [ fhir:value "MedicationStatement" ] ;
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "true"^^xsd:boolean ] ;
         fhir:TestScript.setup.action.operation.params [ fhir:value "/${medicationStatementId}" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.validateProfileId [ fhir:value "http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement" ] ;
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]
       ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

