Scheduling
Appointment Reminders
Delivering appointment reminders to patients
Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.
How reminders work in Esus. The FHIR
Appointmentresource does not carry a built-inreminders[]field. Reminders are delivered by your application (or a partner service), triggered by the appointment’s scheduled time and the patient’s communication preferences. This page describes the recommended integration pattern.
Integration Pattern
- Read the appointment. Query for upcoming appointments (
status=booked) that fall within the lead time you want (e.g. appointments starting in the next 24 hours). - Read the patient. Retrieve the patient’s preferred contact channels from
Patient.telecom[](SMS, email, phone) andPatient.communication[](preferred language). - Send the reminder via your messaging provider (SMS gateway, email platform, voice call, push-notification service).
- Record the outcome. Create a
CommunicationFHIR resource linked to the appointment so the reminder is auditable.
Esus does not schedule or run this job for you: run it from your own scheduler (cron, queue worker, etc.).
Query Upcoming Appointments
# A practitioner's booked appointments starting in the next 24 hours
curl "https://api.esus.health/fhir/Appointment?practitioner=a7b1c2d3-e4f5-6789-abcd-ef0123456789&status=booked&date=ge2026-04-21T09:00:00Z&date=lt2026-04-22T09:00:00Z&_count=100" \
-H "Authorization: Bearer YOUR_TOKEN"
const { resources, total } = await esus.fhir.search("Appointment", {
"practitioner": "a7b1c2d3-e4f5-6789-abcd-ef0123456789",
"status": "booked",
"date": [
"ge2026-04-21T09:00:00Z",
"lt2026-04-22T09:00:00Z"
],
"_count": 100
});
date filters on the appointment’s start and can be repeated to form a range; practitioner takes the bare id or Practitioner/<id>. Follow link.next to page through the results.
Read Patient Contact Details
curl https://api.esus.health/fhir/Patient/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "Authorization: Bearer YOUR_TOKEN"
const result = await esus.fhir.read("Patient", "3fa85f64-5717-4562-b3fc-2c963f66afa6");
Response includes telecom[]:
{
"telecom": [
{ "system": "email", "value": "patient@email.com", "use": "home" },
{ "system": "sms", "value": "+54911..." }
]
}
Recommended Lead Times
| Offset | Use case |
|---|---|
| 1 week before | Non-urgent appointments, surgery prep |
| 24 hours before | Standard reminder |
| 2 hours before | Same-day reminder |
| 30 minutes before | Final reminder |
Log the Reminder with Communication
Create a FHIR Communication once the message is delivered. Note that the patient goes in the flat subjectId field, while about[] keeps the FHIR reference shape:
curl -X POST https://api.esus.health/fhir/Communication \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "completed",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"about": [
{ "reference": "Appointment/d4e5f6a7-b8c9-0123-def4-567890abcdef" }
],
"category": [{
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/communication-category",
"code": "notification"
}]
}],
"medium": [{
"coding": [{ "code": "SMSWRIT", "display": "SMS message" }]
}],
"sent": "2026-04-20T10:00:00Z",
"payload": [
{ "contentString": "Reminder: your appointment with Dr. Johnson is tomorrow at 09:00." }
]
}'
const created = await esus.fhir.create("Communication", {
"status": "completed",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"about": [
{
"reference": "Appointment/d4e5f6a7-b8c9-0123-def4-567890abcdef"
}
],
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/communication-category",
"code": "notification"
}
]
}
],
"medium": [
{
"coding": [
{
"code": "SMSWRIT",
"display": "SMS message"
}
]
}
],
"sent": "2026-04-20T10:00:00Z",
"payload": [
{
"contentString": "Reminder: your appointment with Dr. Johnson is tomorrow at 09:00."
}
]
});
Capturing Confirmations
If the patient replies to a reminder (“YES” / “CANCEL”), record it as an AppointmentResponse (appointmentId plus participantStatus accepted or declined; see “Appointment Responses”). Updating the Appointment is a separate request: for a cancellation, PATCH it to cancelled and free its slot.