au-core-medicationstatement
type: TestScript
node role: treeRoot
resource.id:
  value: au-core-medicationstatement
domain resource.text:
  narrative.status:
    value: generated
  narrative.div: Generated Narrative: TestScript au-core-medicationstatement url: TestScript AU Core MedicationStatement — SHALL-level conformance version: 0.1.0 name: AUCoreMedicationStatement title: AU Core MedicationStatement — SHALL-level conformance status: Active date: 2026-08-16 05:55:37+0000 publisher: FHIR Frog contact: FHIR Frog: https://gitlab.com/fhirfrog description: 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: true autodelete: true resource: au-core-patient-conformant fixture id medicationstatement-reason-fixture autocreate: true autodelete: true resource: au-core-medicationstatement-reason-condition fixture id medicationstatement-fixture autocreate: true autodelete: true resource: au-core-medicationstatement-conformant variable name: patientId path: Patient.id sourceId: patient-fixture variable name: medicationStatementId path: MedicationSta…
test script.url:
  value: http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement
test script.version:
  value: 0.1.0
test script.name:
  value: AUCoreMedicationStatement
test script.title:
  value: AU Core MedicationStatement — SHALL-level conformance
test script.status:
  value: active
test script.date:
  value: 2026-08-16T05:55:37+00:00
test script.publisher:
  value: FHIR Frog
test script.contact:
  index: 0
  contact detail.name:
    value: FHIR Frog
  contact detail.telecom:
    index: 0
    contact point.system:
      value: url
    contact point.value:
      value: https://gitlab.com/fhirfrog
test script.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.
test script.fixture:
  index: 0
  element.id:
    value: patient-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-core-patient-conformant
test script.fixture:
  index: 1
  element.id:
    value: medicationstatement-reason-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-core-medicationstatement-reason-condition
test script.fixture:
  index: 2
  element.id:
    value: medicationstatement-fixture
  test script.fixture.autocreate:
    value: true
  test script.fixture.autodelete:
    value: true
  test script.fixture.resource:
    reference.reference:
      value: au-core-medicationstatement-conformant
test script.variable:
  index: 0
  test script.variable.name:
    value: patientId
  test script.variable.path:
    value: Patient.id
  test script.variable.source id:
    value: patient-fixture
test script.variable:
  index: 1
  test script.variable.name:
    value: medicationStatementId
  test script.variable.path:
    value: MedicationStatement.id
  test script.variable.source id:
    value: medicationstatement-fixture
test script.test:
  index: 0
  test script.test.name:
    value: Read
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: MedicationStatement
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: /${medicationStatementId}
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 1
  test script.test.name:
    value: SearchByPatient
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: MedicationStatement
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?patient=${patientId}
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 2
  test script.test.name:
    value: SearchById
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: MedicationStatement
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?_id=${medicationStatementId}
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Bundle.entry.resource.ofType(MedicationStatement).status = 'active'
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 3
  test script.test.name:
    value: SearchByEffective
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: MedicationStatement
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?effective=2024-06-01
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false
  test script.test.action:
    index: 2
    test script.test.action.assert:
      test script.setup.action.assert.expression:
        value: Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'
      test script.setup.action.assert.warning only:
        value: false
test script.test:
  index: 4
  test script.test.name:
    value: SearchByStatus
  test script.test.action:
    index: 0
    test script.test.action.operation:
      test script.setup.action.operation.resource:
        value: MedicationStatement
      test script.setup.action.operation.encode request url:
        value: true
      test script.setup.action.operation.params:
        value: ?status=active
  test script.test.action:
    index: 1
    test script.test.action.assert:
      test script.setup.action.assert.response:
        value: okay
      test script.setup.action.assert.warning only:
        value: false

value: read

value: search

value: search

value: search

value: search

index: 2
test script.test.action.assert:
  test script.setup.action.assert.expression:
    value: Bundle.entry.resource.ofType(MedicationStatement).status = 'active'
  test script.setup.action.assert.warning only:
    value: false

index: 5
test script.test.name:
  value: MustSupport
test script.test.action:
  index: 0
  test script.test.action.operation:
    test script.setup.action.operation.type:
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/testscript-operation-codes
      coding.code:
        value: read
    test script.setup.action.operation.resource:
      value: MedicationStatement
    test script.setup.action.operation.encode request url:
      value: true
    test script.setup.action.operation.params:
      value: /${medicationStatementId}
test script.test.action:
  index: 1
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.status.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 2
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.medication.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 3
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.medication.ofType(CodeableConcept).exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 4
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.subject.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 5
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.effective.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 6
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.dateAsserted.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 7
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.dosage.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 8
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.dosage.text.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 9
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.reasonCode.exists()
    test script.setup.action.assert.warning only:
      value: false
test script.test.action:
  index: 10
  test script.test.action.assert:
    test script.setup.action.assert.expression:
      value: MedicationStatement.reasonReference.exists()
    test script.setup.action.assert.warning only:
      value: false

index: 6
test script.test.name:
  value: ProfileValidation
test script.test.action:
  index: 0
  test script.test.action.operation:
    test script.setup.action.operation.type:
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/testscript-operation-codes
      coding.code:
        value: read
    test script.setup.action.operation.resource:
      value: MedicationStatement
    test script.setup.action.operation.encode request url:
      value: true
    test script.setup.action.operation.params:
      value: /${medicationStatementId}
test script.test.action:
  index: 1
  test script.test.action.assert:
    test script.setup.action.assert.validate profile id:
      value: http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement
    test script.setup.action.assert.warning only:
      value: false