Skip to content

MedicationRequest Profile

Canonical../StructureDefinition/nexus-emr-core-medicationrequest
Statusdraft · 1.26.0
BaseMedicationRequest (constraint)
SourceFSH · JSON

Defines the Nexus EMR FHIR profile for MedicationRequest resources, based on CA-Core constraints, for aggregating prescription data from multiple EMRs.

TypedFhir API / Pydantic schema

The typed accessor surface MedicationRequest exposes for MedicationRequest — generated from this IG's compiled profile; each typed accessor has a validating raw-FHIR twin (xRaw) where marked. The three ports are parity-enforced.

The AI-facing shape: from typed_fhir.facade.generated.schemas import MedicationRequestSchemamodel_json_schema() is a structured-output / tool definition; instantiating validates an extraction. Generated source.

class MedicationRequestSchema(BaseModel):
    """AI-facing shape of the MedicationRequest profile: the facade's typed accessor
    surface (curated + salient fields) as a pydantic model. `model_json_schema()` is a
    structured-output / tool schema; instantiating validates an extraction."""

    model_config = ConfigDict(extra="forbid")

    status: Literal[
        "active",
        "cancelled",
        "completed",
        "draft",
        "entered-in-error",
        "on-hold",
        "stopped",
        "unknown",
    ] | None = Field(
        None,
        description=(
            "Where the prescription is in its lifecycle. The current state of the medication "
            "request. Indicates whether the prescription is active, completed, or cancelled. "
            "Note: This is a modifier element. Cancelled or stopped prescriptions should not be "
            "dispensed. MedicationRequest.status — 1..1"
        ),
    )
    status_reason: Concept | None = Field(
        None,
        description=(
            "Reason for current status. Captures the reason for the current status of the "
            "medication request, if known. Note: This is generally only used for \"exception\" "
            "statuses such as \"suspended\" or \"cancelled\". The reason why the MedicationRequest "
            "was created at all is captured in reasonCode, not here. "
            "MedicationRequest.statusReason — 0..1"
        ),
    )
    intent: Literal[
        "filler-order",
        "instance-order",
        "option",
        "order",
        "original-order",
        "plan",
        "proposal",
        "reflex-order",
    ] | None = Field(
        None,
        description=(
            "proposal | plan | order | instance-order. Whether the request is a proposal, plan, "
            "or an original order. For prescriptions, this must be 'order'. Note: This element "
            "distinguishes between different stages of the medication workflow. "
            "MedicationRequest.intent — 1..1"
        ),
    )
    category: Concept | None = Field(
        None,
        description=(
            "Type of medication usage. Indicates the type of medication request (for example, "
            "where the medication is expected to be consumed or administered (i.e. inpatient or "
            "outpatient)). Note: The category can be used to include where the medication is "
            "expected to be consumed or other types of requests. MedicationRequest.category — "
            "0..*"
        ),
    )
    priority: Literal["asap", "routine", "stat", "urgent"] | None = Field(
        None,
        description=(
            "routine | urgent | asap | stat. Indicates how quickly the Medication Request should "
            "be addressed with respect to other requests. MedicationRequest.priority — 0..1"
        ),
    )
    subject: Reference | None = Field(
        None,
        description=(
            "Who the medication is for. The patient for whom the medication is prescribed. Must "
            "reference using Nexus EMR patient identifier. Note: References should use "
            "identifier-based references following Nexus EMR patterns. MedicationRequest.subject "
            "— 1..1"
        ),
    )
    encounter: Reference | None = Field(
        None,
        description=(
            "Encounter during which prescription was written. The encounter during which this "
            "medication was prescribed. Optional but provides important clinical context. Note: "
            "Linking to encounter helps establish the clinical context of the prescription. "
            "MedicationRequest.encounter — 0..1"
        ),
    )
    authored_on: FuzzyDate | None = Field(
        None,
        description=(
            "When prescription was written. The date and time when the prescription was written "
            "or created in the system. Note: This represents the prescribing date, not when the "
            "medication was dispensed. MedicationRequest.authoredOn — 1..1"
        ),
    )
    requester: Reference | None = Field(
        None,
        description=(
            "Who prescribed the medication. The healthcare provider who prescribed the "
            "medication. Should reference a Nexus EMR practitioner. MedicationRequest.requester — "
            "0..1"
        ),
    )
    performer_type: Concept | None = Field(
        None,
        description=(
            "Desired kind of performer of the medication administration. Indicates the type of "
            "performer of the administration of the medication. Note: If specified without "
            "indicating a performer, this indicates that the performer must be of the specified "
            "type. If specified with a performer then it indicates the requirements of the "
            "performer if the designated performer is not available. "
            "MedicationRequest.performerType — 0..1"
        ),
    )
    reason_code: Concept | None = Field(
        None,
        description=(
            "Reason or indication for ordering or not ordering the medication. The reason or the "
            "indication for ordering or not ordering the medication. Note: This could be a "
            "diagnosis code. If a full condition record exists or additional detail is needed, "
            "use reasonReference. MedicationRequest.reasonCode — 0..*"
        ),
    )
    course_of_therapy_type: Concept | None = Field(
        None,
        description=(
            "Overall pattern of medication administration. The description of the overall "
            "patte3rn of the administration of the medication to the patient. Note: This "
            "attribute should not be confused with the protocol of the medication. "
            "MedicationRequest.courseOfTherapyType — 0..1"
        ),
    )
    dosage_instruction: dict | None = Field(
        None,
        description=(
            "How medication should be taken. Complete instructions for how the medication should "
            "be administered, including dose, route, frequency, and duration. Note: Free text sig "
            "instructions are required. Structured elements provide additional detail. "
            "MedicationRequest.dosageInstruction — 0..*"
        ),
    )
    dispense_request: dict | None = Field(
        None,
        description=(
            "Pharmacy dispensing instructions. Instructions for the dispensing pharmacist "
            "including quantity to dispense and refills. MedicationRequest.dispenseRequest — 0..1"
        ),
    )
    medication: str | None = Field(
        None,
        description=(
            "The medication as written, in human-readable form. A human language representation "
            "of the concept as seen/selected/uttered by the user who entered the data and/or "
            "which represents the intended meaning of the user. Note: Required. Salient field — "
            "medicationCodeableConcept.text | medicationCodeableConcept.coding.first().display | "
            "medicationReference.display"
        ),
    )
    dosage: str | None = Field(
        None,
        description=(
            "Free text dosage instructions (sig). Complete dosage instructions as they should "
            "appear on the prescription label. Salient field — dosageInstruction.first().text"
        ),
    )
    authored: FuzzyDate | None = Field(
        None,
        description=(
            "When prescription was written. The date and time when the prescription was written "
            "or created in the system. Note: This represents the prescribing date, not when the "
            "medication was dispensed. Salient field — authoredOn"
        ),
    )