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

AU Core MedicationStatement

AU Core MedicationStatement — SHALL-level conformance

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.

Name
AUCoreMedicationStatement
URL
http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-medicationstatement
Status
active

Fixtures

  • patient-fixture: au-core-patient-conformant (created before, and removed after, the run)
  • medicationstatement-reason-fixture: au-core-medicationstatement-reason-condition (created before, and removed after, the run)
  • medicationstatement-fixture: au-core-medicationstatement-conformant (created before, and removed after, the run)

Variables

  • ${patientId} = Patient.id of patient-fixture
  • ${medicationStatementId} = MedicationStatement.id of medicationstatement-fixture

Read

  1. Read MedicationStatement by id (${medicationStatementId}) READ MedicationStatement/${medicationStatementId}
  2. Response status is okay response = okay

SearchByPatient

  1. Search MedicationStatement where patient = ${patientId} SEARCH MedicationStatement?patient=${patientId}
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists() expression = Bundle.entry.resource.ofType(MedicationStatement).medication.ofType(CodeableConcept).text.where($this.contains('Bactrim')).exists()

SearchById

  1. Search MedicationStatement where _id = ${medicationStatementId} SEARCH MedicationStatement?_id=${medicationStatementId}
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationStatement).status = 'active' expression = Bundle.entry.resource.ofType(MedicationStatement).status = 'active'

SearchByEffective

  1. Search MedicationStatement where effective = 2024-06-01 SEARCH MedicationStatement?effective=2024-06-01
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01' expression = Bundle.entry.resource.ofType(MedicationStatement).effective = '2024-06-01'

SearchByStatus

  1. Search MedicationStatement where status = active SEARCH MedicationStatement?status=active
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationStatement).status = 'active' expression = Bundle.entry.resource.ofType(MedicationStatement).status = 'active'

MustSupport

  1. Read MedicationStatement by id (${medicationStatementId}) READ MedicationStatement/${medicationStatementId}
  2. Check: MedicationStatement.status.exists() expression = MedicationStatement.status.exists()
  3. Check: MedicationStatement.medication.exists() expression = MedicationStatement.medication.exists()
  4. Check: MedicationStatement.medication.ofType(CodeableConcept).exists() expression = MedicationStatement.medication.ofType(CodeableConcept).exists()
  5. Check: MedicationStatement.subject.exists() expression = MedicationStatement.subject.exists()
  6. Check: MedicationStatement.effective.exists() expression = MedicationStatement.effective.exists()
  7. Check: MedicationStatement.dateAsserted.exists() expression = MedicationStatement.dateAsserted.exists()
  8. Check: MedicationStatement.dosage.exists() expression = MedicationStatement.dosage.exists()
  9. Check: MedicationStatement.dosage.text.exists() expression = MedicationStatement.dosage.text.exists()
  10. Check: MedicationStatement.reasonCode.exists() expression = MedicationStatement.reasonCode.exists()
  11. Check: MedicationStatement.reasonReference.exists() expression = MedicationStatement.reasonReference.exists()

ProfileValidation

  1. Read MedicationStatement by id (${medicationStatementId}) READ MedicationStatement/${medicationStatementId}
  2. Validate the response against profile http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement validateProfileId = http://hl7.org.au/fhir/core/StructureDefinition/au-core-medicationstatement