S-SCH-01 · W02 Scheduling · fit: unknown

Book an appointment

As a scheduler, I want to find an open slot in a clinic and book the patient into it, so that the patient has a time and the clinic's day is planned.

Personascheduler
JourneyAn appointment is booked and the patient checks in
StepFinds an open slot and books the patient Task_02_FindsAnOpenSlotAndBooksThePa

Scenarios

S-SCH-01.1Given a clinic with open slots on a date, When I pick a slot and a registered patient, Then the appointment shows on the clinic's schedule and in the patient's appointments.
S-SCH-01.2Given a slot that is full, When I try to book it, Then I am told it is full, or asked to overbook if I hold the key for it.
S-SCH-01.3Given a slot chosen but no patient, date, time or appointment length, When I save, Then it is refused and names the missing value, and nothing is filed.
S-SCH-01.4Given a note on the appointment shorter than 2 or longer than 150 characters, or one containing a semicolon or a colon, When I save, Then it is refused and no appointment is filed.
S-SCH-01.5Given the patient already has an active appointment (not cancelled, not a no-show) at that date and time in PATIENT (#2.98), When I book, Then it is refused and the existing appointment is unchanged.
S-SCH-01.6Given a patient with a date of death in PATIENT (#2), When I book, Then it is refused.
S-SCH-01.7Given a clinic whose inactivate date in HOSPITAL LOCATION (#44) is on or before the chosen date and whose reactivate date is absent or later, When I book, Then it is refused and nothing is filed.
S-SCH-01.8Given a date further ahead than the clinic's maximum days for future booking in HOSPITAL LOCATION (#44), When I book, Then it is refused.
S-SCH-01.9Given a time with no access block for the clinic's resource in BSDX ACCESS BLOCK (#9002018.3), or one whose access type in BSDX ACCESS TYPE (#9002018.35) prevents access, When I book without the master overbook right on that resource in BSDX RESOURCE USER (#9002018.15) and without SDZSUP, Then it is refused; with either, I am asked to confirm and the appointment is filed as an overbook.
S-SCH-01.10Given a slot whose active appointments already equal the block's slot count, the overbook right on that resource for me in BSDX RESOURCE USER (#9002018.15), and fewer overbooks today on the clinic than its OVERBOOKS/DAY MAXIMUM (#44, field 1918), When I confirm the overbook, Then the appointment is on the clinic in HOSPITAL LOCATION (#44.003) and on the patient in PATIENT (#2.98), marked as an overbook in OVERBOOK (#44.003, field 9). (BPRM sets it itself after `MAKE^BSDAPI`, in `BSD_SetPatientAppointmentV4M`. Neither MAKE^BSDAPI nor BSDX ADD NEW APPOINTMENT sets it, so a booking through the BSDX RPC is not marked.)
S-SCH-01.11Given a full slot and the clinic's overbooks for that day already at its maximum, and I hold neither the master overbook right on the resource nor SDZSUP, When I try to book, Then it is refused and no appointment is filed.
S-SCH-01.12Given I hold neither SDZSUP nor SDZMENU, When I open scheduling, Then I cannot see a clinic's schedule or book, cancel, check in, check out or run a scheduling report.
S-SCH-01.13Given a clinic whose resource gives my user no right to modify appointments in BSDX RESOURCE USER (#9002018.15), or a clinic marked as prohibiting access in HOSPITAL LOCATION (#44), and I do not hold SDZSUP, When I open its schedule, Then I can see it but cannot book, cancel, check in or out, or mark a no-show on it.
S-SCH-01.14Given a clinic that is not in HOSPITAL LOCATION (#44), When I book, Then it is refused and names the clinic, and nothing is filed.