Shift / Hospital Reviews by Doctors ¶
Description ¶
When an Indevet clocks out after their shift, they are asked to review the hospital / shift (see implementation for more details around this). The review, as of Monday, March 28, 2022, consists only of a general rating between 1 and 5. These results are then collected and averaged out to be shown under the hospital profile. It is important to note that the user is not forced to submit a review and can skip the review step should they choose to do so.
Implementation ¶
After much discussion, the ask seemed more like a shift review rather than an actual hospital review. For this reason, the data + models were constructed in such a way that reflects a shift review being performed by a doctor. In the future, the table and models can be refactored to reflect a hospital review but that is work to be done later.
Once the hospital has at least one review, the average of these reviews are shown on the hospital profile page. It is important to note that the average is actually an average of averages. Because a sin gle person will have multiple ratings for a single site this will be a reflection of their immediate shift, not the hospital itself. To combat this a bit, averaging the ratings of each person first, then averaging those, should give a potentially more accurate view.
Extreme example: Vet A has 12 shifts at hospital X over a month and has a beef with person at hospital X. They give reviews of 1 star each time. Vet B, C, D and E all have 3 shifts each at hospital X, and each gives ratings of 3-5 each time.
Doing a raw average of everything would provide a somewhat skewed number.
B has 3 shifts of 4, C has 3 shifts of 5, D has 3 shifts of 3, E has 3 shifts of 4
12+12+15+9+12 = 60 total points divided by 24 shifts is 2.5
Averaging each vet first may give averages of A=1, B=4, C=5, D=3, E=4. This gives 3.4 or, a more likely representation of the hospital.
Currently, the calculation for the UI is happening in real time however, future work on this should determine if this the best solution or if it should be calculated at the end of each review and stored related to a site (score and total count).
Testing ¶
Unit tests for this functionality can be found in tests/Http/Api/Reviews/AddShiftReviewByDoctorTest.php
Additional Notes ¶
-
The is a contact email ignore list for the event notification which is is stored in config->indevets.php - hospital_review_ignore_list. If a recipient is in this list, they will not be sent a hospital review email.
-
All reviews with a general rating of 3 and below will trigger an email to the user’s review recipient email records. If the review has a general rating of 4 and above an email will not be sent unless there is a comment added in which case, an email will be sent.