Case study · Automation · Healthcare
Appointment Automation
A FastAPI platform for a dental clinic in Portugal that talks to patients on WhatsApp first, falls back to SMS, and keeps every action in sync with the clinic's appointment system.
- Python & FastAPI
- WhatsApp Cloud API
- Twilio SMS
- iMED GraphQL
- Cron scheduling
At a glance
- Channels: WhatsApp first, SMS as fallback
- 2
- Reminder steps before the front desk steps in
- 3
- Languages: Portuguese and English
- 2
- Reminders
- Confirm
- Reschedule
- Cancel
- New booking
The project
Fewer manual reminders, fewer missed appointments

Calls to change plans
Not everyone is on WhatsApp
Two languages
One source of truth
A record for staff
Reminders & escalation

Template buttons got no response
Template buttons sent a different payload from normal interactive replies, so taps were ignored.
What we builtThe webhook handler was extended to process both button types and carry the appointment ID in the payload.
Reschedules rejected by iMED
iMED rejected reschedule requests with an APPOINTMENT_NOT_FOUND error.
What we builtIDs were traced between local and iMED records, and the lookup fixed so the correct patient number and appointment ID are used.
Contradictory actions
Patients could press Cancel after pressing Confirm.
What we builtState checks were added so only the first action on a reminder is accepted.
Incomplete time lists
Time lists showed only a sample of the available slots.
What we builtSampling was replaced with the full slot list in one scrollable menu.
Duplicate or mistimed reminders
Reminders risked being sent twice or at the wrong time.
What we builtA reminders table records what was sent, with a protected endpoint called by a cron job every 15 minutes.
Wrong language
Some patients' phone codes did not match their nationality.
What we builtLanguage selection now uses nationality first and the phone prefix second.
Technology
Technology stack
Backend
- Python
- FastAPI
Messaging
- WhatsApp Cloud API
- Meta Graph API v23.0
- Twilio SMS
Integration
- GraphQL (iMED)
- Webhooks
Data
- SQL database
Scheduling
- Linux cron
Hosting
- Ubuntu server on AWS
Outcome
What the clinic now has
Reminders on a schedule
Reminders and escalation run automatically, without front-desk effort.
Self-service for patients
Patients confirm, cancel, reschedule and book on WhatsApp or SMS without calling.
Systems in sync
Changes by patients and by staff are kept in sync with iMED.
A full history
Staff can see the communication history for each appointment.
Insights
Latest From the Blog
- Healthcare App Development: Features Patients Expect in 2025The healthcare industry is undergoing a massive transformation, driven by technological advancements and evolving patient expectations. As…Read article
- Enhancing Patient Experience Through UX-Centric Healthcare App DesignRead article
- How Wearable Devices Are Transforming Preventative HealthcareRead article
- Essential Features for a Successful Healthcare AppRead article
Let's Engineer What's Next
Let's Build Something That Moves Business Forward
Have a complex challenge, ambitious idea or system that needs engineering? Let's discuss how we can make it happen.
CodeNomad
Built to Scale. Designed to Work.
