-
Notifications
You must be signed in to change notification settings - Fork 4
Add new appointment statuses for mammogram workflow #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
manage_breast_screening/mammograms/tests/presenters/test_appointment_presenters.py
Show resolved
Hide resolved
manage_breast_screening/mammograms/tests/presenters/test_appointment_presenters.py
Show resolved
Hide resolved
| return self.name in [ | ||
| self.STARTED, | ||
| self.IDENTITY_CONFIRMED, | ||
| self.MEDICAL_INFORMATION_REVIEWED, | ||
| self.IMAGES_TAKEN, | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to do this, should we add new statuses and forget to update this?
E.g. If the index is >= the STARTED status, but not cancelled etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've refactored this by:
- Specifying the YET_TO_BEGIN, IN_PROGRESS, and FINAL status groups in the AppointmentStatus model.
- Using these groups in other functions, where applicable.
The specification of the groups is still pretty manual but this should be less error prone on the whole.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the YET_TO_* status the only way?
As in, since the others don't need YET_TO_* counterparts:
YET_TO_HAVE_IDENTITY_CONFIRMEDYET_TO_HAVE_IMAGES_TAKEN
Have we accidentally picked a series of statuses that don't quite fit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work in 385011e is a nice way around it though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name could probably do with some refinement, but YET_TO_BEGIN_STATUSES is the group name, under which sit CONFIRMED and CHECKED_IN. The idea is that this group contains any status prior to STARTED.
manage_breast_screening/participants/migrations/0052_alter_appointmentstatus_name.py
Show resolved
Hide resolved
Using variations of 'status.state' in the codebase isn't as clear to read as it could be. In the first instance, rename the state field to name.
- Update all references to this field - Avoid slipping into usage of 'state' when we're referring to instances of the AppointmentStatus model
We're going to add some additional statuses, which will be represented by the 'In progress' tag on the frontend. To begin with, simply rename the existing IN_PROGRESS status to STARTED.
To support upcoming workflow changes for appointments, add the following statuses: IDENTITY_CONFIRMED MEDICAL_INFORMATION_REVIEWED IMAGES_TAKEN We also amend presenter behaviour to represent these statuses (and STARTED) with an 'In progress' tag on the frontend.
We only show the status bar for an appointment if the current user is the one who has the appointment in progress. Update the StatusBarPresenter to reflect this and amend the tests accordingly.
- Specify groups of statuses in the AppointmentStatus model - Use these groups in various functions instead of explicit lists of statuses.
ae8a645 to
636fefa
Compare
|
swebberuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me.



Description
status.statein favour ofstatus.name.Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-11594
Review notes
current_status->most_recent_event).AppointmentStatustoAppointmentStateas some point, so we can consistently use the language of 'states' in our codebase.Review checklist