Mobile App Booking Integration - hmislk/hmis GitHub Wiki
HMIS supports patient-facing mobile applications that allow patients to browse available channelling sessions, book appointments, view their booking history, and receive notifications โ all without visiting the hospital front desk.
This article is aimed at mobile app developers and IT administrators integrating a patient-facing app with HMIS channelling.
Patient App (iOS / Android)
โ HTTPS REST calls
HMIS Channelling API (/api/channel/*)
โ
HMIS Core (bookings, sessions, patients, bills)
โ WebSocket push
Patient App (real-time updates)
The app communicates exclusively through the Channelling API. No direct database access is used.
GET /api/channel/specialities
GET /api/channel/consultants?specialityId={id}
GET /api/channel/sessions?consultantId={id}&fromDate=2026-05-18&toDate=2026-05-25
Present the list of available session instances to the patient with:
- Consultant name, photo, qualifications
- Session date, start time
- Available slots / tokens remaining
- Fee
Patients must be identified before booking:
-
Existing patient: Search by NIC, phone number, or patient ID:
GET /api/patients/search?phone=0771234567 -
New patient: Register:
POST /api/patients { "name": "...", "dob": "...", "phone": "..." }
POST /api/channel/bookings
{
"sessionInstanceId": 12345,
"patientId": 67890,
"paymentMethod": "OnCall",
"itemId": 111
}
Response includes:
- Booking ID
- Token / serial number
- Total fee
- Bill reference
GET /api/channel/bookings/patient/{patientId}
Returns all bookings for the patient (past and upcoming) with status.
PUT /api/channel/bookings/{bookingId}/cancel
Subscribe to the WebSocket endpoint for push notifications:
wss://<host>/<context>/ws/notify
When a session status changes (e.g., doctor has arrived, queue is started), the app receives a push message and can update the UI accordingly.
Bookings created through the mobile app are recorded in HMIS with a dedicated bill type:
CHANNEL_BOOKING_FOR_PAYMENT_ONLINE_COMPLETED_PAYMENT
These bookings appear in the Channel Booking View with a yellow "OB" tag and the online reference number. No manual re-entry is required โ the booking flows into the same queue as front-desk bookings.
Mobile app payments can be handled in two ways:
| Method | Description |
|---|---|
| OnCall | Patient books online but pays at the hospital on arrival |
| Online Payment Gateway | Payment is collected in-app via a payment gateway (requires additional integration with the gateway and HMIS payment confirmation API) |
For online payment gateway integration, refer to the gateway provider's documentation and the HMIS payment API endpoints (documented in Swagger/DOC990).
In addition to WebSocket updates for in-app notifications, the mobile app should implement:
- FCM (Firebase Cloud Messaging) for Android background notifications
- APNs for iOS background notifications
HMIS can be configured to send push notification payloads to an intermediary server that dispatches them to FCM/APNs. This requires:
- Setting up a notification relay server
- Configuring the HMIS push notification endpoint with the relay server URL and credentials
Contact the HMIS technical team for the push notification API specification.
| Feature | Status |
|---|---|
| Session search by speciality and consultant | API available |
| Session availability and slot count | API available |
| Patient registration and search | API available |
| Booking creation | API available |
| Booking cancellation | API available |
| Booking history | API available |
| WebSocket real-time session updates | API available |
| SMS confirmation (server-side) | Handled by HMIS automatically |
| Online payment gateway | Requires additional integration |
| Push notifications (FCM/APNs) | Requires relay server setup |
| Audio/video consultation scheduling | Future feature โ refer to current roadmap |