avniproject / jss-sickle-cell-screening

0 stars 0 forks source link

Tasks for newly created encounter type. #81

Closed Gojo-Taqi closed 5 months ago

Gojo-Taqi commented 5 months ago

---Link to the ticket - https://avni.freshdesk.com/a/tickets/3510

  1. During the initial development of the encounterType(SCD Followup Jan 2024), which was done by Rahul as a Self Service Request, he had given the overdue date as 5 days from the earliestVisitDateTime. Identify those encounters that have been scheduled and have a difference of 5 days when you do a (maxVisitDateTime - earliestVisitDateTime)

    • [x] Update the maxVisitDateTime of those uncompleted encounters, by adding 20 days.
  2. The users are completing the visits that are scheduled in the future. To prevent this add a validation rule in the "SCD Followup Jan 2024" encounter.

    • [x] Write a validation rule, that allows the user to complete the visit only if the user is trying to complete the visits in prior window 20 days of the scheduled date. If it is beyond 20 days, system should give a validation error : "Encounter date cannot be more than 20 days prior to scheduled date" Usecase 1- If the Schedule date is 25-June-2024 and the user tries to complete the visit on 5-June-2024, then the user must be allowed to complete the visit. Usecase 2- If the Schedule date is 25-June-2024 and the user tries to complete the visit on 2-June-2024, then the user must be not allowed to complete the visit. Note : There is no condition for when ecounter date is after scheduled date.
  3. During the initial development of the encounterType(SCD Followup Jan 2024), which was done by Rahul as a Self Service Request, he had given the follow-up encounters date as 30 days. Write a script to identify all the uncompleted encounters and update the earliestvisitDateTime and the maxVisitDateTime.

    • [x] The scheduled dates will be 90 days from the previously completed encounter and maxVisitDateTime will be 25 days more from the scheduled date.
Gojo-Taqi commented 5 months ago

Link to the script - https://github.com/avniproject/data-fixes/blob/main/JSCS/Data%20fixes%20%233510.sql

Dinesh2019 commented 5 months ago

The user was allowed to complete the visit too earlier

https://api.zenhub.com/attachedFiles/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBL3JOQkE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e4dd4047e50383d1f3c2fb43135b8adcc2c35b/My%20Movie.mp4