FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagefhirfrog.au-core-tests
Resource TypeTestScript
IdTestScript-au-core-medicationstatement.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/jgsuess/au-core-tests/TestScript-au-core-medicationstatement.html
URLhttp://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement
Version0.1.0
Statusactive
Date2026-08-16T05:55:37+00:00
NameAUCoreMedicationStatement
TitleAU Core MedicationStatement — SHALL-level conformance
DescriptionCovers 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.

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

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: MedicationStatement.id

sourceId: medicationstatement-fixture

test

name: Read

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)MedicationStatementtrue/${medicationStatementId}

action

Asserts

-ResponseWarningOnly
*okayfalse

test

name: SearchByPatient

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)MedicationStatementtrue?patient=${patientId}

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()false

test

name: SearchById

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)MedicationStatementtrue?_id=${medicationStatementId}

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(MedicationStatement).status = 'active'false

test

name: SearchByEffective

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)MedicationStatementtrue?effective=2024-06-01

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'false

test

name: SearchByStatus

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)MedicationStatementtrue?status=active

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(MedicationStatement).status = 'active'false

test

name: MustSupport

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)MedicationStatementtrue/${medicationStatementId}

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.status.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.medication.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.medication.ofType(CodeableConcept).exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.subject.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.effective.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.dateAsserted.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.dosage.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.dosage.text.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.reasonCode.exists()false

action

Asserts

-ExpressionWarningOnly
*MedicationStatement.reasonReference.exists()false

test

name: ProfileValidation

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)MedicationStatementtrue/${medicationStatementId}

action

Asserts

-ValidateProfileIdWarningOnly
*http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatementfalse

Source1

{
  "resourceType": "TestScript",
  "id": "au-core-medicationstatement",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement",
  "version": "0.1.0",
  "name": "AUCoreMedicationStatement",
  "title": "AU Core MedicationStatement — SHALL-level conformance",
  "status": "active",
  "date": "2026-08-16T05:55:37+00:00",
  "publisher": "FHIR Frog",
  "contact": [
    {
      "name": "FHIR Frog",
      "telecom": [
        {
          "system": "url",
          "value": "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": {
        "reference": "au-core-patient-conformant"
      }
    },
    {
      "id": "medicationstatement-reason-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-core-medicationstatement-reason-condition"
      }
    },
    {
      "id": "medicationstatement-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-core-medicationstatement-conformant"
      }
    }
  ],
  "variable": [
    {
      "name": "patientId",
      "path": "Patient.id",
      "sourceId": "patient-fixture"
    },
    {
      "name": "medicationStatementId",
      "path": "MedicationStatement.id",
      "sourceId": "medicationstatement-fixture"
    }
  ],
  "test": [
    {
      "name": "Read",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "/${medicationStatementId}"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatient",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "?patient=${patientId}"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchById",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "?_id=${medicationStatementId}"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(MedicationStatement).status = 'active'",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByEffective",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "?effective=2024-06-01"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByStatus",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "?status=active"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(MedicationStatement).status = 'active'",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "MustSupport",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "/${medicationStatementId}"
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.status.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.medication.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.medication.ofType(CodeableConcept).exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.subject.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.effective.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.dateAsserted.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.dosage.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.dosage.text.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.reasonCode.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "MedicationStatement.reasonReference.exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "ProfileValidation",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "MedicationStatement",
            "encodeRequestUrl": true,
            "params": "/${medicationStatementId}"
          }
        },
        {
          "assert": {
            "validateProfileId": "http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}