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 MedicationRequest

AU Core MedicationRequest — SHALL-level conformance

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.

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

Fixtures

  • patient-fixture: au-core-patient-conformant (created before, and removed after, the run)
  • medication-fixture: au-core-medicationrequest-medication (created before, and removed after, the run)
  • medicationrequest-fixture: au-core-medicationrequest-conformant (created before, and removed after, the run)

Variables

  • ${patientId} = Patient.id of patient-fixture
  • ${medicationRequestId} = MedicationRequest.id of medicationrequest-fixture

Read

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

SearchById

  1. Search MedicationRequest where _id = ${medicationRequestId} SEARCH MedicationRequest?_id=${medicationRequestId}
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationRequest).exists() expression = Bundle.entry.resource.ofType(MedicationRequest).exists()

SearchByAuthoredOn

  1. Search MedicationRequest where authoredon = 2024-03-15 SEARCH MedicationRequest?authoredon=2024-03-15
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationRequest).exists() expression = Bundle.entry.resource.ofType(MedicationRequest).exists()

SearchByIntent

  1. Search MedicationRequest where intent = order SEARCH MedicationRequest?intent=order
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationRequest).exists() expression = Bundle.entry.resource.ofType(MedicationRequest).exists()

SearchByStatus

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

SearchByPatient

  1. Search MedicationRequest where patient = ${patientId} SEARCH MedicationRequest?patient=${patientId}
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationRequest).exists() expression = Bundle.entry.resource.ofType(MedicationRequest).exists()

SearchWithIncludeMedication

  1. Search MedicationRequest where patient = ${patientId} and _include = MedicationRequest:medication SEARCH MedicationRequest?patient=${patientId}&_include=MedicationRequest:medication
  2. Response status is okay response = okay
  3. Check: Bundle.entry.resource.ofType(MedicationRequest).exists() expression = Bundle.entry.resource.ofType(MedicationRequest).exists()
  4. Check: Bundle.entry.resource.ofType(Medication).exists() expression = Bundle.entry.resource.ofType(Medication).exists()

MustSupport

  1. Read MedicationRequest by id (${medicationRequestId}) READ MedicationRequest/${medicationRequestId}
  2. Check: MedicationRequest.status.exists() expression = MedicationRequest.status.exists()
  3. Check: MedicationRequest.intent.exists() expression = MedicationRequest.intent.exists()
  4. Check: MedicationRequest.medication.exists() expression = MedicationRequest.medication.exists()
  5. Check: MedicationRequest.medication.ofType(Reference).exists() expression = MedicationRequest.medication.ofType(Reference).exists()
  6. Check: MedicationRequest.subject.exists() expression = MedicationRequest.subject.exists()
  7. Check: MedicationRequest.encounter.exists() expression = MedicationRequest.encounter.exists()
  8. Check: MedicationRequest.authoredOn.exists() expression = MedicationRequest.authoredOn.exists()
  9. Check: MedicationRequest.requester.exists() expression = MedicationRequest.requester.exists()
  10. Check: MedicationRequest.reasonCode.exists() expression = MedicationRequest.reasonCode.exists()
  11. Check: MedicationRequest.reasonReference.exists() expression = MedicationRequest.reasonReference.exists()
  12. Check: MedicationRequest.dosageInstruction.exists() expression = MedicationRequest.dosageInstruction.exists()
  13. Check: MedicationRequest.dosageInstruction.text.exists() expression = MedicationRequest.dosageInstruction.text.exists()

ProfileValidation

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