Appointments and patient identity
How Fatma books and reschedules safely, books for family members, and flags duplicates.
Fatma can book, reschedule, and cancel only through the Wareed appointment service. The service stays responsible for permissions, clinic rules, schedules, conflicts, and the latest record state.
Booking an appointment
For a clear request with an exact doctor and time, Fatma can book directly when the clinic capability permits it. For a request such as after work, she shows a small set of suitable real slots instead of silently choosing one.
Meaningful history can rank the options. Repeated evening appointments at one branch may place that branch first. Fatma still shows alternatives and does not turn a pattern into a permanent patient rule.
Avoiding stale appointment changes
Appointments use version numbers. If Fatma read version 42 and a staff member changed the appointment to version 43, her update is rejected. She cannot silently overwrite newer state.
Booking and message requests also use idempotency keys. A worker retry returns the existing result instead of creating a duplicate appointment or sending the same response twice.
Reschedule limit
Fatma can complete up to three successful reschedules for one uninterrupted appointment state.
These do not count:
- Asking about an unavailable time
- Exploring slot options
- A failed action
An authorized manual appointment change resets the counter. After three successful Fatma reschedules, she explains that someone from the team will help and includes the previous changes in the handoff.
Safe revert
Revert is a new compensating action, not database time travel.
Wareed checks whether the original slot is still available, validates permissions and scheduling rules again, explains that the patient was already notified, and requires confirmation. A successful revert restores the appointment, sends a correction, and records the activity.
If the original slot is gone, Wareed does not force it. Staff can find another slot, open the conversation, or assign the case.
Exact identity matches
An exact verified phone association can reuse an existing patient profile. A partial phone suffix is never enough to select a patient.
If a patient says they previously used another number, Fatma can ask for it and prepare a Cleanup candidate. She does not merge records.
Booking for another person
If Ahmed writes from his own registered number and asks to book for his son Youssef, the appointment must belong to Youssef.
Wareed can:
- Create a separate Youssef profile
- Keep the shared contact number when appropriate
- Complete the booking without waiting for a merge decision
- Create a shared-number Cleanup item linked to the source conversation
Reviewing Cleanup
Open the Cleanup item to see the reason, relevant fields, suggested profile, and source conversation.
Available actions can include:
- Keep separate
- Review later
- Dismiss
- Link relationship when available
- Merge with explicit confirmation and the required permission
Fatma never merges patients automatically. Identity accuracy takes priority over convenience.