API & the public website
The public hospital website and the BridgeERP REST API are two sides of one system: a marketing-and-services website that patients see, fed entirely by JSON endpoints that read from the clinical back office. Editors curate doctors, departments, services, conditions, news and patient stories inside BridgeERP HMS; the website renders them live; and online bookings and portal actions flow straight back into the clinical records. This page explains how content is authored, the REST endpoints that serve it, the booking flow and the patient portal.
Where to find it
Website content is authored under HMS Core → Configuration → Website Content, and the supporting bridges sit under HMS Core → Integration → HMS Integrations:
| Menu | What it controls |
|---|---|
| Website Content → Doctors | Public doctor profiles (hms.website.doctor.profile), each linked to a clinical staff record. |
| Website Content → Departments / Services | Department and service pages (hms.website.department, hms.website.service). |
| Website Content → Conditions A-Z | The health-library conditions index (hms.website.condition). |
| Website Content → News & Health Tips | Articles with tags and comments (hms.website.news). |
| Website Content → Patient Stories / Testimonials | Social-proof content (hms.website.story, hms.website.testimonial). |
| Website Content → Health Packages / Insurance Partners / Locations / Careers / FAQs / Homepage Pillars | The remaining homepage and informational blocks. |
| Configuration → Stakeholder Portal | Partner access and the audit log (hms.website.partner.access, hms.website.audit.log). |
Every content record carries a website_published flag and a slug; only published records are served, and the slug is the URL key.
How data flows: back office to website
The website itself is a separate front-end that never touches the database directly. Instead it calls the REST API, a set of public JSON routes rooted at /storefront/api. Each route reads published content (or, for portal routes, a token-authenticated patient’s own data) and returns JSON. The flow is: editor publishes a record → the website requests the matching endpoint → the API serializes the published record → the page renders. Writes go the other way: a booking or a comment posts to the API, which creates a real clinical or content record.
Content endpoints (GET)
| Route | Returns |
|---|---|
/storefront/api/site | Hospital identity: name, tagline, layout, emergency / appointment / WhatsApp numbers, social links, accreditation, ED wait times, mission and vision. |
/storefront/api/home, /storefront/api/pillars | Homepage composition and the homepage pillars. |
/storefront/api/doctors, /storefront/api/doctor/{slug} | Published doctor list and a single profile. |
/storefront/api/departments, /storefront/api/department/{slug} | Departments and a single department (a /full/{slug} variant returns the deep payload). |
/storefront/api/services, /storefront/api/service/{slug} | Services and a single service. |
/storefront/api/conditions, /storefront/api/conditions/letters | The A-Z health library, filterable by letter or query. |
/storefront/api/news, /storefront/api/news/{slug}, /storefront/api/news/tags | Articles, a single article and the tag list. |
/storefront/api/stories, /storefront/api/testimonials | Patient stories and testimonials. |
/storefront/api/packages, /storefront/api/insurers, /storefront/api/locations, /storefront/api/careers, /storefront/api/faqs | Health packages, insurance partners, locations, job openings and FAQs. |
/storefront/api/search | Site-wide search across the published content. |
/storefront/api/sitemap | A sitemap of public URLs for SEO. |
/storefront/api/availability | Bookable slots for the booking form. |
Action endpoints (POST)
| Route | Does |
|---|---|
/storefront/api/book | Creates a new patient and visit via the Reception model method. |
/storefront/api/appointment/book | Books an appointment, creating the patient if new and resolving doctor / department from the slug. |
/storefront/api/contact, /storefront/api/newsletter | Captures a contact enquiry and a newsletter sign-up. |
/storefront/api/news/comment | Submits a reader comment for moderation. |
/storefront/api/career/apply | Submits a job application. |
Step-by-step: how an online booking lands
- The visitor picks a doctor or department, a date and a time, and submits the booking form.
- The site POSTs to
/storefront/api/appointment/bookwith name, phone, optional email, gender, the doctor / department slug, date, time and channel (in-person or telehealth). - The API looks up the patient by phone; if none exists it creates one.
- It resolves the doctor profile slug to the clinical staff member and the department slug to the clinical department, then creates an hms.appointment stamped with the facility, the local time converted to UTC, and the online_booking flag.
- The appointment opens in a pending state, ready for reception to confirm. A honeypot field silently absorbs bot submissions.
The patient portal
Returning patients sign in to a self-service portal whose routes sit under /storefront/api/portal. Login takes a phone number plus date of birth, matches an existing patient record, and issues a token; subsequent calls send that token. Portal routes include:
| Route | Returns |
|---|---|
/storefront/api/portal/login | Authenticates by phone + date of birth, returns a token and the patient payload. |
/storefront/api/portal/dashboard | Next appointment, upcoming and recent visits, bills, results and outstanding balance. |
/storefront/api/portal/appointments, /storefront/api/portal/appointment/{id} | The patient’s appointments and one in detail; a cancel route lets them stand down a booking. |
/storefront/api/portal/bills, /storefront/api/portal/results, /storefront/api/portal/prescriptions | Bills, lab results and prescriptions for the signed-in patient only. |
/storefront/api/portal/profile | Lets the patient update their own contact details. |
Booking payload reference
| Field | Meaning | Required |
|---|---|---|
| name | Patient full name. | Yes |
| phone | Contact number, used to match or create the patient. | Yes |
| date / time | Requested slot (local time). | Yes |
| email / gender | Optional contact and demographic detail. | No |
| doctor / department | Slug of the chosen doctor or department. | No |
| channel | in_person or telehealth (maps to outpatient / telemedicine). | No (defaults in_person) |
Roles & publishing
Website editors curate content from the back office; the public API routes themselves require no login because they only serve published records and token-scoped portal data. Partner access to the stakeholder portal is governed by Configuration → Stakeholder Portal → Partner Access, with all access written to the Audit Log.
Tips & troubleshooting
| Symptom | Likely cause & fix |
|---|---|
| A doctor / article is missing from the site | Its record is not published; set website_published on the content record. |
| A page 404s by slug | The slug changed or is blank; set a unique slug on the record. |
| Booking returns an error | Name, phone, date and time are all required, and a facility must exist; check the facility configuration. |
| Portal login fails for a real patient | The phone or date of birth does not match the record; correct the patient’s contact details in the back office. |

