Defining Availability (Alpha)
This guide covers how to configure availability using the SchedulingParameters extension — at both the actor level (per Schedule) and the service type level (via ActivityDefinition). It covers scheduling constraints, override behavior, timezone handling, and multi-resource scheduling patterns.
The diagram below shows how availabilty can be defined at both
- The actor level (via Schedule)
- The service level (via ActivityDefinition)
The Scheduling Parameters Extension
All scheduling constraints are managed through a single consolidated extension: SchedulingParameters. This extension can appear on both ActivityDefinition (for defaults) and Schedule.
Extension Fields Reference
| Url | Type | Applies To | Required | Behavior when defined | Behavior when not defined |
|---|---|---|---|---|---|
serviceType | CodeableConcept | Schedule only | Required | Applies configuration only to the specified service type, overriding defaults for that service | N/A - must be specified |
availability | Timing | Schedule only | Optional | Bookings must fully fit within the recurring windows | Time is implicitly available by default (unless blocked by Slots or other constraints) |
timezone | Code | Schedule only | Optional | Specifies the timezone (IANA timezone identifier, e.g., America/New_York) for interpreting the availability timing. Falls back to the Schedule's actor timezone if not specified | Uses the timezone defined on the Schedule's actor reference |
duration | Duration | Both Schedule and ActivityDefinition | Required | Determines how long the time increments for a Slot are | N/A - must be specified |
bufferBefore | Duration | Both Schedule and ActivityDefinition | Optional | Requires prep time before start to also be free | No prep time required |
bufferAfter | Duration | Both Schedule and ActivityDefinition | Optional | Requires cleanup time after end to also be free | No cleanup time required |
alignmentInterval | Duration | Both Schedule and ActivityDefinition | Optional | Start times must align to the interval (e.g., every 15 minutes) | Start times are not constrained by an interval grid |
alignmentOffset | Duration | Both Schedule and ActivityDefinition | Optional, and alignmentInterval must be defined | Shifts allowed start times by the offset relative to the interval (e.g., with a 15-minute alignmentInterval and a 5-minute alignmentOffset, valid starts are :05, :20, :35, :50) | Grid anchored to :00 (no shift) |
bookingLimit | Timing | Both Schedule and ActivityDefinition | Optional | Caps number of appointments per period (multiple entries can stack) | No capacity cap for that period |
Example of the SchedulingParameters extension
{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
// Required on Schedule: you must specify what type of appointment these parameters aply to
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "bariatric-surgery"}]
}
},
// Optional: specify time zone for availability interpretation (Schedule only)
// Falls back to Schedule's actor time zone if not specified
{
"url": "timezone",
"valueCode": "America/Los_Angeles"
},
// Required: duration determines how long the time increments for a Slot are
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
// Recurring availability (Schedule only)
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "wed", "fri"],
"timeOfDay": ["09:00:00"], // Interpreted in America/Los_Angeles time zone
"duration": 8,
"durationUnit": "h"
}
}
},
// Buffer time before appointment
{
"url": "bufferBefore",
"valueDuration": {
"value": 15,
"unit": "min",
"system": "http://unitsofmeasure.org",
"code": "min"
}
},
// Buffer time after appointment
{
"url": "bufferAfter",
"valueDuration": {
"value": 10,
"unit": "min",
"system": "http://unitsofmeasure.org",
"code": "min"
}
},
// Time alignment interval (appointment start time boundaries)
{
"url": "alignmentInterval",
"valueDuration": {
"value": 15,
"unit": "min",
"system": "http://unitsofmeasure.org",
"code": "min"
}
},
// Time alignment offset (shift from interval boundaries)
{
"url": "alignmentOffset",
"valueDuration": {
"value": 0,
"unit": "min",
"system": "http://unitsofmeasure.org",
"code": "min"
}
},
// Booking limits (can have multiple)
{
"url": "bookingLimit",
"valueTiming": {
"repeat": {
"frequency": 8,
"period": 1,
"periodUnit": "d"
}
}
}
]
}
Actor Level Availability
The Concept of Implicit Availability
Medplum's scheduling model uses implicit availability: time is assumed to be free by default. You define availability rules using extensions that specify when resources are available based on recurring patterns. Slot resources are only used for explicit overrides—either to mark time as busy (when an appointment is booked) or to block out unavailable time.
This approach avoids the need to pre-generate thousands of Slot resources for every possible time slot. Instead, the system calculates available windows dynamically based on the availability rules you define.
The Schedule Resource
The Schedule resource is the foundation for defining actor-level availability for a provider, location, or device.
Here is an example of a Schedule resource that defines availability for a Practitioner.
{
"resourceType": "Schedule",
"id": "dr-smith-schedule",
"actor": [{"reference": "Practitioner/dr-smith"}],
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "office-visit"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed", "thu", "fri"],
"timeOfDay": ["09:00:00"],
"duration": 8,
"durationUnit": "h"
}
}
}
]
}]
//...
}
Service Level Availability
Service Types and ActivityDefinition
An ActivityDefinition gives a mechanism to define the default scheduling parameters for a specific service type (appointment type), which can then be used by multiple Practitioner's Schedules. This allows you to define standard appointment durations, buffer times, alignment intervals, and booking limits once and apply them across multiple providers.
To get the Schedule to use the ActivityDefinition's scheduling parameters, the Schedule.serviceType must match the ActivityDefinition.code.
{
"resourceType": "ActivityDefinition",
"id": "office-visit",
"code": {
"coding": [{
"system": "http://example.org/appointment-types",
"code": "office-visit" // ← This is the key
}]
},
//...
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed", "thu", "fri"],
"timeOfDay": ["09:00:00"],
"duration": 8,
"durationUnit": "h"
}
}
}
]
}]
}
{
"resourceType": "Schedule",
"id": "dr-smith-schedule",
"actor": [{"reference": "Practitioner/dr-smith"}],
//...
}
Override Behavior
A Practitioner's Schedule can also override the default ActivityDefinition's availability for a specific service type by defining a serviceType extension.
Here is an example Schedule that overrides the availability for a specific service type.
{
"resourceType": "Schedule",
"id": "dr-chen-schedule",
"active": true,
"serviceType": [
{"coding": [{"code": "new-patient-visit"}]},
{"coding": [{"code": "follow-up"}]}
],
"actor": [{"reference": "Practitioner/dr-chen"}],
"extension": [
// Service type level availability for this Practitioner - overrides any availability parameters specified elsewhere
{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "new-patient-visit"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["tue", "thu"],
"timeOfDay": ["09:00:00"],
"duration": 4,
"durationUnit": "h"
}
}
}
]
}
]
}
All-or-nothing rule: When a SchedulingParameters extension includes a serviceType, it completely replaces the default configuration for that service type. No attribute-level merging occurs.
Priority order (highest to lowest):
- Schedule where
https://medplum.com/fhir/StructureDefinition/SchedulingParameters.serviceTypeextension matchesservice-typeparam on$findrequest. - ActivityDefinition where
ActivityDefinition.codematchesservice-typeparam on$findrequest. ActivityDefinition parameters are used.
Blocking Time by Service Type
Here is an example of a Slot resource that blocks time for a specific service type.
{
"resourceType": "Slot",
"schedule": {"reference": "Schedule/dr-johnson-schedule"},
"status": "busy-unavailable",
"start": "2025-12-24T08:00:00Z",
"end": "2025-12-27T07:59:59Z",
"comment": "Holiday vacation",
"serviceType": [{"coding": [{"code": "office-visit"}]}]
}
- With serviceType: Blocks only that specific service
- Without serviceType: Blocks all services
Timezone per Scheduling Parameters Entry
The timezone parameter allows you to specify different timezones for different service types within the same Schedule. This is useful when a provider needs to define availability in different timezones for different services (e.g., a doctor who provides cardiac surgery where they might travel to in one time zone and call center availability in another time zone).
Fallback Logic: If no time zone is specified in the scheduling-parameters extension, then the availability will be interpreted in the time zone defined on the Schedule's actor reference (Practitioner, Location, or Device). It looks for the FHIR sanctioned time zone extension:
{
"resourceType": "Practitioner",
"id": "dr-smith",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/timezone",
"valueCode": "America/Los_Angeles"
}
]
}
There is no native timezone field on Practitioner, Location, or Device, so you must add it via the FHIR timezone extension:
{
resourceType: 'Practitioner',
// ...
extension: [
{
url: "http://hl7.org/fhir/StructureDefinition/timezone",
valueCode: "America/Los_Angeles"
}
]
}
Timezone Resolution Order:
- If
timezoneis specified in thescheduling-parametersextension, use that time zone - Otherwise, fall back to the time zone defined on the Schedule's actor reference (Practitioner, Location, or Device)
Important Notes:
timezoneis only available on Schedule resources, not ActivityDefinition- The time zone value should be an IANA time zone identifier (e.g.,
America/New_York,America/Los_Angeles,America/Miami) - When
timezoneis specified, alltimeOfDayvalues in theavailabilitytiming are interpreted in that time zone
Here is an example of a Schedule with multiple service types, each with its own time zone:
{
"resourceType": "Schedule",
"id": "dr-smith-schedule",
"actor": [{"reference": "Practitioner/dr-smith"}],
"extension": [
{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "cardiac-surgery"}]
}
},
{
"url": "timezone",
"valueCode": "America/Los_Angeles"
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed"],
"timeOfDay": ["11:00:00"], // Interpreted in America/Los_Angeles
"duration": 4,
"durationUnit": "h"
}
}
}
]
},
{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "timezone",
"valueCode": "America/New_York"
},
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "call-center-availability"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed"],
"timeOfDay": ["09:00:00"], // Interpreted in America/New_York
"duration": 8,
"durationUnit": "h"
}
}
}
]
}
]
}
In this example:
- Cardiac surgery availability is defined in
America/Los_Angelestime zone (Mon-Wed 11am-3pm America/Los Angeles) - Call Center availability is defined in
America/New_Yorktime zone (Mon-Wed 9am-5pm Eastern) - Each service type's availability times are interpreted independently based on their respective timezones
Examples
Example 1: Simple Primary Care Office with Appointment Type Defaults
This example shows how to define availability for a simple primary care office where Practitioner's Schedules inherit default scheduling parameters from an ActivityDefinition.
ActivityDefinition: Office Visit Defaults
This ActivityDefinition defines default scheduling parameters for a 30-minute office visit with 5-minute buffers and 15-minute alignment intervals.
{
"resourceType": "ActivityDefinition",
"id": "office-visit",
"status": "active",
"kind": "Appointment",
"code": {
"coding": [{
"system": "http://example.org/appointment-types",
"code": "office-visit",
"display": "Office Visit"
}]
},
"timingDuration": {
"value": 30,
"unit": "min",
"system": "http://unitsofmeasure.org",
"code": "min"
},
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "bufferBefore",
"valueDuration": {"value": 5, "unit": "min"}
},
{
"url": "bufferAfter",
"valueDuration": {"value": 5, "unit": "min"}
},
{
"url": "alignmentInterval",
"valueDuration": {"value": 15, "unit": "min"}
},
{
"url": "alignmentOffset",
"valueDuration": {"value": 0, "unit": "min"}
}
]
}]
}
Schedule: Practitioner's Schedule without Overrides
This Schedule shows Dr. Johnson's availability (Mon-Fri 9am-5pm) that inherits all default parameters from the ActivityDefinition without any service-specific overrides.
{
"resourceType": "Schedule",
"id": "dr-johnson-schedule",
"active": true,
"actor": [{
"reference": "Practitioner/dr-johnson",
"display": "Dr. Sarah Johnson"
}],
"planningHorizon": {
"start": "2025-01-01T00:00:00Z",
"end": "2025-12-31T23:59:59Z"
},
"extension": [
// No values here, everything is inherited from shared definitions
]
}
Result: Dr. Johnson's schedule inherits all the default parameters from the ActivityDefinition for an office visit:
- $find called with
service-type=office-visit: For office visits, available to start every 15 minutes (:00, :15, :30, :45) with 5-minute buffers [from ActivityDefinition]
Example 2: Multi-Service Provider with Multiple Appointment Types and Overrides
A provider who offers different appointment types with varying availability and constraints. Overrides the default scheduling parameters for new patient visits.
ActivityDefinition: New Patient Visit
This ActivityDefinition defines a 60-minute new patient visit with 15-minute buffers, 30-minute alignment intervals, and a booking limit of 3 per day.
{
"resourceType": "ActivityDefinition",
"id": "new-patient-visit",
"status": "active",
"kind": "Appointment",
"code": {
"coding": [{
"system": "http://example.org/appointment-types",
"code": "new-patient-visit",
"display": "New Patient Visit"
}]
},
"timingDuration": {"value": 60, "unit": "min"},
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{"url": "bufferBefore", "valueDuration": {"value": 15, "unit": "min"}},
{"url": "bufferAfter", "valueDuration": {"value": 15, "unit": "min"}},
{"url": "alignmentInterval", "valueDuration": {"value": 30, "unit": "min"}},
{
"url": "bookingLimit",
"valueTiming": {
"repeat": {"frequency": 3, "period": 1, "periodUnit": "d"}
}
}
]
}]
}
ActivityDefinition: Follow-up Visit
This ActivityDefinition defines a 20-minute follow-up visit with 5-minute buffers and 10-minute alignment intervals for more frequent scheduling.
{
"resourceType": "ActivityDefinition",
"id": "follow-up-visit",
"status": "active",
"kind": "Appointment",
"code": {
"coding": [{
"system": "http://example.org/appointment-types",
"code": "follow-up",
"display": "Follow-up Visit"
}]
},
"timingDuration": {"value": 20, "unit": "min"},
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{"url": "bufferBefore", "valueDuration": {"value": 5, "unit": "min"}},
{"url": "bufferAfter", "valueDuration": {"value": 5, "unit": "min"}},
{"url": "alignmentInterval", "valueDuration": {"value": 10, "unit": "min"}}
]
}]
}
Schedule: Multi-Service with Overrides
This Schedule shows how to configure default availability for all services (Mon-Fri 9am-5pm), then override new patient visits to only be available on Tuesday and Thursday mornings (9am-1pm).
{
"resourceType": "Schedule",
"id": "dr-chen-schedule",
"active": true,
"actor": [{"reference": "PractitionerRole/dr-chen"}],
"planningHorizon": {
"start": "2025-01-01T00:00:00Z",
"end": "2025-12-31T23:59:59Z"
},
"extension": [
// New patient visits only on Tuesday and Thursday mornings
{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"code": "new-patient-visit"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["tue", "thu"],
"timeOfDay": ["09:00:00"],
"duration": 4,
"durationUnit": "h"
}
}
}
]
}
]
}
Result:
- New patient visits (ie.
$findcalled withservice-type=new-patient-visit): Tue/Thu 9am-1pm only, 60 minutes, can start every 30 minutes, max 3 per day, 15-min buffers - Follow-ups (ie.
$findcalled withservice-type=follow-up): Mon-Fri 9am-5pm, 20 minutes, can start every 10 minutes, 5-min buffers
Example 3: Location-Specific Complex Surgical Scheduling
A bariatric surgery requiring surgeon, OR room, and anesthesiologist coordination.
ActivityDefinition: Bariatric Surgery
This ActivityDefinition defines a 120-minute surgical procedure requiring coordination of surgeon, anesthesiologist, and OR room with 45/30-minute buffers and multiple booking limits (2 per day, 8 per week).
{
"resourceType": "ActivityDefinition",
"id": "bariatric-surgery",
"status": "active",
"kind": "Appointment",
"code": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "287809009",
"display": "Bariatric Surgery"
}]
},
"timingDuration": {"value": 120, "unit": "min"},
"participant": [
{
"type": "practitioner",
"role": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "304292004",
"display": "Surgeon"
}]
}
},
{
"type": "practitioner",
"role": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "88189002",
"display": "Anesthesiologist"
}]
}
},
{
"type": "location",
"role": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
"code": "OR",
"display": "Operating Room"
}]
}
}
],
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{"url": "bufferBefore", "valueDuration": {"value": 45, "unit": "min"}},
{"url": "bufferAfter", "valueDuration": {"value": 30, "unit": "min"}},
{"url": "alignmentInterval", "valueDuration": {"value": 30, "unit": "min"}},
{
"url": "bookingLimit",
"valueTiming": {
"repeat": {"frequency": 2, "period": 1, "periodUnit": "d"}
}
},
{
"url": "bookingLimit",
"valueTiming": {
"repeat": {"frequency": 8, "period": 1, "periodUnit": "wk"}
}
}
]
}]
}
Schedule: Surgeon Availability
This Schedule shows Dr. Martinez's availability for bariatric surgeries, limited to Tuesday and Thursday mornings (8am-4pm).
{
"resourceType": "Schedule",
"id": "surgeon-martinez-schedule",
"active": true,
"serviceType": [
{"coding": [{"system": "http://snomed.info/sct", "code": "287809009"}]}
],
"actor": [{
"reference": "PractitionerRole/surgeon-martinez",
"display": "Dr. Maria Martinez - Bariatric Surgeon"
}],
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"system": "http://snomed.info/sct", "code": "287809009"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["tue", "thu"],
"timeOfDay": ["08:00:00"],
"duration": 8,
"durationUnit": "h"
}
}
}
]
}]
}
Schedule: Operating Room Availability
This Schedule shows Operating Room 3's availability for surgical procedures, available weekdays 7am-7pm with extended 12-hour blocks.
{
"resourceType": "Schedule",
"id": "or-3-schedule",
"active": true,
"actor": [{
"reference": "Location/or-3",
"display": "Operating Room 3"
}],
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed", "thu", "fri"],
"timeOfDay": ["07:00:00"],
"duration": 12,
"durationUnit": "h"
}
}
}
]
}]
}
Schedule: Anesthesiologist Availability
This Schedule shows Dr. Kim's availability for surgical procedures, covering weekdays 7am-5pm (10-hour blocks).
{
"resourceType": "Schedule",
"id": "anesthesiologist-kim-schedule",
"active": true,
"serviceType": [
{"coding": [{"system": "http://snomed.info/sct", "code": "287809009"}]}
],
"actor": [{
"reference": "PractitionerRole/anesthesiologist-kim",
"display": "Dr. James Kim - Anesthesiologist"
}],
"extension": [{
"url": "https://medplum.com/fhir/StructureDefinition/SchedulingParameters",
"extension": [
{
"url": "serviceType",
"valueCodeableConcept": {
"coding": [{"system": "http://snomed.info/sct", "code": "287809009"}]
}
},
{
"url": "duration",
"valueDuration": {
"value": 1,
"unit": "h"
}
},
{
"url": "availability",
"valueTiming": {
"repeat": {
"dayOfWeek": ["mon", "tue", "wed", "thu", "fri"],
"timeOfDay": ["07:00:00"],
"duration": 10,
"durationUnit": "h"
}
}
}
]
}]
}
Result: When booking a bariatric surgery, the system queries all three schedules, calculates the intersection of availability, and creates atomic transaction bundles to book all required resources simultaneously.
Location Modeling
Location Hierarchy Pattern
Organization (Surgery Center)
└─ Location (Building) [mode=kind]
├─ Location (Operating Rooms) [mode=kind, type=OR]
│ ├─ Location (OR-1) [mode=instance]
│ ├─ Location (OR-2) [mode=instance]
│ └─ Location (OR-3) [mode=instance]
└─ Location (Recovery Rooms) [mode=kind, type=RR]
├─ Location (Recovery-A) [mode=instance]
└─ Location (Recovery-B) [mode=instance]
Specific vs. "Any Available" Room
Specific room required:
- Query
Schedule?actor=Location/or-3
Any OR room acceptable:
- Query:
Schedule?actor:Location.partof:Location.type=OR
Best Practices
1. Use All-or-Nothing Overrides
If adding a serviceType configuration on Schedule, specify ALL attributes to avoid confusion about inheritance.
2. Minimize Pre-Generated Slots
Only create Slot resources for:
- Booked appointments (status: busy)
- Blocked time (status: busy-unavailable)
Let $find calculate available windows dynamically.
3. Transaction Bundles for Multi-Resource Booking
Always use FHIR transaction bundles when booking appointments that require multiple resources to ensure atomicity.