Connecting a hospital website to the hospital information system (HIS) sounds like one task: show doctor slots and let the patient book. In practice it is four separate problems. Reading slots accurately, writing a booking exactly once, handling the HIS being slow or unavailable, and keeping cancellations and reschedules in step. Most failed integrations solve the first and discover the other three after launch.
This framework is for hospital IT leads, digital heads and the web or product teams working with them. It assumes you already have a booking journey; if you are still fixing the form itself, start with accessible appointment forms and the earlier piece on AI chatbots for appointment conversion. Here we stay on the API layer.
A note on evidence. We do not have a reliable public survey of which Indian HIS products expose which APIs, so this post does not claim one. Instead, it gives you the questions to put to each vendor and a way to score the answers.
Start with who owns the schedule
The HIS, or a scheduling module inside it, is normally the system of record for a doctor's availability. The website should never be a second source of truth. Every pattern below follows from that rule: the website asks, the HIS decides.
That has a practical consequence. You can cache a slot list for display, but a booking is only real when the HIS confirms it. Design the interface so the patient sees "requested" until the HIS returns a booking reference.
Reading slots: three patterns
Direct read per page view. The website calls the HIS API each time a patient opens a doctor's booking panel. It is the most accurate and the most fragile: page speed now depends on the HIS, and a burst of traffic from a campaign becomes load on the clinical system.
Short-lived cache. A middle layer stores slot lists for a short time, say 30 to 120 seconds (an illustrative range, not a benchmark). Displayed slots can be slightly stale, so the booking write must tolerate "slot already taken" and respond with the next options, not an error page.
Push or sync. The HIS emits slot changes (through events, a message queue, or a scheduled export) and a middle layer maintains its own copy. This is the most scalable and the most complex, and only worth it when direct reads cannot keep up or the HIS cannot take the load.
For most hospitals, the second pattern with a careful write path is the right start. Whichever you choose, include a "fetched at" timestamp in the response and log it with every booking attempt. When something goes wrong, you will need to know how old the data was.
Writing a booking: stop double booking
Double booking happens when two requests believe the same slot is free. The fixes are well known; the failure is skipping one of them.
- The HIS holds the lock, not you. The authoritative check is inside the HIS: an atomic "book this slot if still free" operation, or a database constraint on resource, date and time. If the HIS API only offers "list" and "create" as separate calls, assume a race and ask the vendor how they prevent it.
- Idempotency key per attempt. Generate a key when the patient submits, send it with the request, and store it. If the response is lost and the patient (or your retry logic) submits again, the HIS or your middle layer returns the original booking instead of creating a second one.
- Short hold, then confirm. Where the HIS supports a tentative state, place a hold when the patient selects a slot and confirm after verification. Where it does not, hold in your own layer for a short window and treat the HIS write as the commit. The hold timer deserves its own design; the wider friction questions are in our guide to appointment booking optimisation.
- Handle the conflict response as a normal path. "Slot taken" should return alternatives on the same day and the same doctor, then adjacent doctors, not a generic error.
- Reconcile. A scheduled job compares website-side booking records with HIS records and flags any booking that exists on one side only.
FHIR, HL7 v2 and custom APIs
You will meet three kinds of interface, and often more than one in a single HIS.
HL7 FHIR. FHIR models scheduling as three linked resources. A Slot is a block of time on a Schedule that may be available for booking, with a status such as free or busy. The Appointment resource is the booking itself, with statuses including proposed, pending, booked, cancelled, noshow and waitlist, and it references the Slots it fills. The FHIR page also notes that an available time shown does not guarantee the booking will succeed, which is exactly the race condition above. In India, the ABDM FHIR implementation guide publishes an Appointment profile with required elements such as status, start and participant; check which version your vendor targets.
HL7 v2 messaging. Many older hospital systems exchange scheduling events as pipe-delimited messages over an interface engine rather than as web APIs. This suits internal system-to-system flows, but it is not a natural fit for a public website. If this is all the vendor offers, plan for an interface engine or middleware layer that translates to a web-friendly API.
Custom or proprietary APIs. A vendor-specific REST or SOAP interface, sometimes only available on request and sometimes only to the vendor's own app. They can be perfectly good. The risk is not the format; it is documentation, versioning and who supports a change at midnight.
| Question | What a good answer looks like |
|---|
| Can we read free slots by doctor, location and date range? | Documented endpoint with pagination and a sandbox |
| How is a slot locked at booking? | Atomic operation or constraint, explained |
| Do you support idempotency keys? | Yes, or a documented duplicate check |
| What do cancel and reschedule look like? | Dedicated operations with status events |
| What are the rate limits and expected latency? | Stated numbers and a plan for peak load |
| How do we get notified of roster changes? | Webhook, event or a documented polling pattern |
| Who supports us, and in which hours? | Named contact and a written SLA |
Score each vendor on the table. If an answer is "we will check", that is a finding.
Fallback queues: what happens when the HIS does not answer
Assume the HIS will sometimes be slow, in maintenance, or down. The patient has still filled a form. You have three choices, and you should choose deliberately.
- Fail closed: show an error and ask them to call. Safe, but you lose the enquiry.
- Accept as a request, not a booking. Save the patient's preferred doctor, date and contact, tell them clearly that it is a request, and let the call centre confirm. Nothing is promised that the system did not give.
- Retry and confirm. Queue the booking with its idempotency key, retry with backoff, and notify the patient when confirmed or when a human takes over.
The second option is the safest default for a hospital. The queue should carry a state (received, sent_to_his, confirmed, failed_needs_human), an owner, and an age limit after which it escalates. Without an owner, the fallback queue becomes the place enquiries go to die.
This is where a CRM earns its place. A tool such as Pioneer CRM gives you one place for enquiries, lead ownership, follow-ups and pipeline visibility, so a request that could not be confirmed automatically has a named person and a follow-up date.
Failure modes to test before launch
- Time zones and formats. The HIS stores local time without a zone; your server converts to UTC and shifts every slot by 5 hours 30 minutes. Test with real clocks at midnight.
- Roster changes. A doctor's clinic is cancelled after the slot list was cached. Test the cancel event and the displayed slots.
- Partial writes. The HIS creates the appointment, your service times out, the patient retries. Test duplicate handling.
- Patient identity. A new patient has no UHID. Decide whether the integration creates a patient record or only a request, and who approves it.
- Cancellations. A patient cancels on the website but the HIS still shows the slot as busy. Test both directions.
- Rate limits. A campaign sends traffic that exhausts the HIS API allowance. Test with a realistic burst, using a sandbox.
- Version changes. The vendor updates a field name. Pin the API version and monitor responses for unexpected shapes.
Where to start
- List what the HIS can do today, with documentation, from the vendor.
- Pick the read pattern (cache for most hospitals) and set the staleness limit in writing.
- Insist on atomic booking and idempotency; add a reconciliation job regardless.
- Define the fallback state machine and name an owner for the queue.
- Run the failure-mode tests in a sandbox before any campaign points at the page.
If the vendor offers FHIR or a documented API, the healthcare API and EHR/EMR integration pages describe how we scope this work.
Filed underHIS appointment booking API integrationhospital information system APIFHIR appointment bookingdouble booking prevention hospitalHL7 FHIR vs custom API hospital

About the author
Arush Thapar
Co-Founder & CTO · Gurugram, India
Arush builds the systems the rest of the company runs on — the patient-acquisition pipelines, the AI chatbots, the analytics that tie a single click to a booked appointment. If a campaign reports a number, it's because something his team built is tracking it.
Free guide · 13 pages
WhatsApp AI Chatbot for Hospitals (14-Day Deploy)
The 14-day WhatsApp booking-bot implementation playbook.