Skip to content

Schedule Profile

Canonical../StructureDefinition/nexus-emr-core-schedule
Statusdraft · 1.26.0
BaseSchedule (constraint)
CQL primary code pathserviceTypewhat this means
SourceFSH · JSON

Minimal Nexus EMR profile for Schedule resources, representing a clinic or provider's bookable calendar. Slots reference back to a Schedule via Slot.schedule. Phase 1 sources OscarPro provider templates (one Schedule per provider) but the profile supports room/equipment (Location) and service-line (HealthcareService) schedules as well.

TypedFhir API / Pydantic schema

The typed accessor surface Schedule exposes for Schedule — 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 ScheduleSchemamodel_json_schema() is a structured-output / tool definition; instantiating validates an extraction. Generated source.

class ScheduleSchema(BaseModel):
    """AI-facing shape of the Schedule 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")

    active: bool | None = Field(
        None,
        description=(
            "Whether the schedule is in active use. Whether this schedule record is in active "
            "use. Defaults to true if absent (FHIR R4 semantics). Note: This element is labeled "
            "as a modifier because it may be used to mark that the resource was created in error. "
            "Schedule.active — 0..1"
        ),
    )
    service_category: Concept | None = Field(
        None,
        description=(
            "Service category with raw code support. A broad categorization of the service that "
            "is offered through this schedule. RECOMMENDED: Standard terminology codes when "
            "available OPTIONAL: Raw EMR codes for source system preservation. Note: Where this "
            "code was mapped from a source system's own vocabulary, carry the raw coding "
            "alongside the mapped one, flagged `userSelected = true`. See [Carrying the raw "
            "code](../guide/patterns/raw-codes.md). "
            "Schedule.serviceCategory — 0..*"
        ),
    )
    service_type: Concept | None = Field(
        None,
        description=(
            "Service type with raw code support. The specific service that is offered through "
            "this schedule. RECOMMENDED: Standard terminology codes when available OPTIONAL: Raw "
            "EMR codes for source system preservation. Note: Where this code was mapped from a "
            "source system's own vocabulary, carry the raw coding alongside the mapped one, "
            "flagged `userSelected = true`. See [Carrying the raw "
            "code](../guide/patterns/raw-codes.md). Schedule.serviceType "
            "— 0..*"
        ),
    )
    specialty: Concept | None = Field(
        None,
        description=(
            "Type of specialty needed. The specialty of a practitioner that would be required to "
            "perform the service requested in this appointment. Schedule.specialty — 0..*. codes "
            "(preferred): 394539006 | 394576009 | 394577000 | 394578005 | 394579002 | 394580004 | "
            "394581000 | 394582007 | …"
        ),
    )
    actor: Reference | None = Field(
        None,
        description=(
            "Who/what the schedule belongs to. The resource(s) this schedule represents available "
            "booking time for. Typically the **provider** whose calendar this is. The provider "
            "may be named by either a **PractitionerRole** (where the clinic/role binding is the "
            "assertion -- a provider's calendar *at this clinic, in this role*) or a raw "
            "**Practitioner** (the primary provider identity in this IG). Both are supported and "
            "consumers must handle either. May also be a Location (room or equipment schedule) or "
            "a HealthcareService (service-line schedule, e.g. walk-in clinic). At least one "
            "provider / Location / HealthcareService actor MUST be present (per "
            "schedule-actor-required invariant), and at most one provider actor (per "
            "schedule-actor-provider-max). Note: The capacity to support multiple referenced "
            "resource types should be used in cases where the specific resources themselves "
            "cannot be scheduled without the other, and thus only make sense to the system "
            "exposing them as a group. Common examples of this are where the combination of a "
            "practitioner and a room (Location) are always required by a system. Schedule.actor — "
            "1..*"
        ),
    )
    planning_horizon: dict | None = Field(
        None,
        description=(
            "Rolling booking window this schedule supports. The period of time that this schedule "
            "covers (typically a rolling 90 days from today). Slots SHOULD only exist within this "
            "period. Schedule.planningHorizon — 0..1"
        ),
    )
    comment: str | None = Field(
        None,
        description=(
            "Free-text scheduling notes. Comments on the availability to describe any extended "
            "information. Such as custom constraints on the slots that may be associated. "
            "Schedule.comment — 0..1"
        ),
    )