Context
Clinics ran scheduling, patient records, and billing as adjacent tools. Handoffs were people. A missed booking did not update the operational picture.
System boundary
In scope
- locations
- booking
- patient workflows
- CRM
- ERP views
Out of scope
- clinical decision support
- device integration
Architecture
Domains are explicit: location, appointment, patient, commercial account. ERP and CRM read the same operational events; they do not keep a second booking calendar.
- Location
- Booking
- Patient
- Visit
- CRM
- ERP
- Hub is the owning domain
- CRM/ERP are views, not calendars
- Location
- Booking
- Patient
- Visit
- CRM
- ERP
Counts from the published record. They describe structure, not a measured result.
How do the system domains relate?
domain
- serviceLocation
operations
- serviceBooking
- storePatient
- processVisit
consumers
- interfaceCRM
- interfaceERP
- LocationBooking
- LocationVisit
- BookingPatient
- PatientVisit
- VisitCRM
- VisitERP
Critical flows
A booking is created against a location and practitioner
patient record is bound
visit workflow runs
CRM sees the relationship
ERP sees the commercial consequence.
Stages
Decisions
One appointment object
CRM and ERP do not own calendars. They subscribe to operational facts.
Patient is not a contact
A CRM person and a clinical patient can relate, but collapsing them loses consent and record boundaries.
Location is a first-class node
Multi-clinic operations fail if “the clinic” is a label on a user.
When it fails
| Condition | Detection | Response |
|---|---|---|
| Double-book | Slot uniqueness | Reject write; show conflict |
| Orphan visit without patient bind | Workflow invariant | Block status change to arrived |
| ERP posting without visit close | Event completeness | Queue posting; do not invent line items |
Infrastructure
- Laravel
- MySQL/Postgres
- queues for notifications
- backups
- role-based access per location
Outcome
Clinics operate from one booking and patient core. CRM and ERP are views on that core.
Current state
In production across clinic operations. New locations attach to the same domain map.