Automated Shift Approval ¶
Summary ¶
Implement bypass of scheduler approval to publish new shifts that meet defined criteria.
Business Context - why are we doing this ¶
Currently schedulers spend a large amount of time manually publishing shifts. They manually approve around 8,000 shifts per month. Automating approval of shifts that don’t require further review would reduce this number more than 50%.
Criteria ¶
-
Hospital has had a shift published in the past. This is not their first shift request. It is important to note the stipulation that the shift must have been published not just created. ✅
-
Position is of Exams type ✅
-
Shift is not an overnight shift ✅
-
External shift notes is null (hospital did not create a note for the shift) ✅
-
Internal shift notes is null (IV admin did not create an internal note for the shift) ✅
-
Site notes for hospital is null (IV admin has not created a note on the site that is displayed to admins when viewing all shifts associated with that site. ✅
-
Shift is not within 7 days ✅
If the above criteria is met the shift is published without manual IV Scheduler approval. Shift does not appear on CATS New Shifts page. Instead, the steps are:
-
Hospital creates a shift
-
Shift is visible to doctors in Vet Portal
Additional Requirements ¶
-
Shift audit table must show approval by a system user
-
Existing 5-minute shift change request grace period window is respected. This means that, 5 mins after the shift was created, and subsequently approved, there is a 5 minute window in which the shift will not appear in the shift shopper. This allows the hospital to change and/or cancel the shift before it is taken
Shift Shopper Check ¶
Currently, the shift shopper is filtering out shifts through the processFilteredAndUnfilteredForShifts() function in the VetPortalCommonMixin.js. As it relates to status, the status allowed are Assigned, Opened, and Approved. These statuses are set on the status property of the shift. There are also published_at and is_approved properties that can be used but are not being applied for the vet portal. In order to accommodated the 5 min grace period, an additional function named isPublishedAndAvailbleForConsumption() has been added to the VetPortalCommonMixin.js which will filter out all shifts that have a published at value later then the current snapshop in time. It does not make sense to present a shift that has a future published_at value.
Tests ¶
The tests for this functionality can be found at AutoPublishShiftTest