Conversation
It just wasn't necessary.
…andler I may choose to change the order of the route handlers and this gives me more freedom to do so (and reduces the complex dependencies between handlers)
As well as reducing repetition, this will come in handy later when reusing the book-into-a-clinic controller for routes that don't necessarily include a booking UUID.
The route here uses a cleaner URL that needs just the session ID and the appointment UUID. Arguably, it didn't even need the session ID, but that's been kept in the route to clarify the context from which the user's chosen to edit the appointment. Anyway, this required a new param handler to dig the booking UUID out of the appointment and then call the existing param handlers for booking UUID and appointment UUID separately.
Previously, we were trying to access the patient on the wizard context when deciding where to fork from the team-facing page that offers to record health answers. And that resulted in a server error.
Previously, for the edit action, we'd been saving the copy from the global context i.e. the original.
…and time This has none of the complexity of the new appointment journey re running out of space across all clinics (the 'fully-booked' forks), but that's probably ok to just demonstrate the flow.
This is to match what we currently show on the live service's page.
The link destination isn't coded yet; coming soon.
This is a very naïve initial implementation, as it doesn't attempt to check whether there's space for the appointment.
PatientSessions weren't previously being moved across and nothing was being added to the patient's programme activity.
Appointment cancellation now lives at /sessions/:id/appointments/:appointment_uuid/cancel, to be consistent with the edit route, which is /sessions/:id/appointments/:appointment_uuid/edit
Previously, was sometimes redirecting to /availability rather than the intended relative path.
This looks at all possible times in the session, not just the time at which the appointment is currently sat. Maybe it should be clearer that you might be about to change the appointment time though...?
…nt.js There were two functions in utils/clinic-appointment.js that were doing conceptually very similar things. They now both use the new Session.canFitSlotCount
Previously, the check to see whether an appointment had been shortened was only comparing the current length to the default length for the appointment, which didn't take account of extension for support needs (whether in the creation of the appointment or during editing).
Only set the new appointment's path on booking routes, and rename it to newAppointmentPath, just to make it doubly clear that it's not used in any appointment editing routes/journeys.
c65d9b5 to
c895706
Compare
|
Yeah, that's something I was aware of, but wasn't sure it was right to make consistent. How religiously do you make the order of the properties on a check-answers page match the order of the pages in the journey? I feel like it's quite important and that's why the appointment length comes before the appointment time in the editing journey's check answers page. In the booking journey, there's no explicit choose-an-appointment-length page, so I felt more free to choose where that value went in the check answers page – and it felt weird putting it in the middle of the location > date > time range > time sequence of pages. |
Regarding showing the appointment length, do you reckon it's still valuable to show the start and end times? For example, in Appointment length: 20 minutes (2 slots) I feel like I'm duplicating information. 😐 Some options, for the booking journeys, might be:
Thoughts? (Oh, and I'll never include the bit about slots in parent-facing pages.) |
MAV-10701 Can extend appointments to cover multiple slots
Context
While the settings on the session relating to double-slot appointments will cover a lot of the need for variable length appointments, there will be times when the SAIS team wants to extend – or possibly even shorten – an appointment, typically when they know the child has extra support needs that can affect the time it takes to vaccinate. So while the session's rules for double-slot appointments will still be honoured, this PR adds the ability to extend an appointment during the team's booking process, or change the length of an appointment arbitrarily thereafter.
The changes
There are two main parts to this, giving the SAIS team control over an appointment's length:
In both cases, the inability to fit the desired length into the session will result in the team being offered a shortened appointment and flagging the potential for overrun (which research suggests SAIS teams are very good at accommodating).
Screenshots
During booking, the team is offered the chance to extend the appointment for support needs:

Appointment length shown explicitly on the check answers page, support needs in the Child details:

The Edit Appointment page, with the new Appointment length property and Change link:

The appointment length page in the appointment editing journey:

The same page, showing the option to enter a specific length:

An optional page following the appointment length page, offering to shorten the appointment to fit the session:
