Conditions for Calculating Job and Sample Required On Date
A job's default priority is inherited in this order: from the project if the job links to a project and the project has a priority defined, from the client if the client has a priority defined, or from the DEFAULT_PRIORITY application preference.
Working days of the week are defined by the WORKING_DAYS_OF_WEEK application preference is defined and contains a seven-character string of y and n characters, representing Monday through to Sunday, to indicate the days of the week that are regular working days, and a Y or a N to represent the starting day of the week, when a job or sample is created or updated and the Received On date-time or Priority is changed, then the Required On date-time calculation takes into consideration the laboratory's working days and holidays that are in the window of the job or sample, as follows.
Required On date-time = Received On date-time + Priority, with the overriding statement that for each day in-between the Received On date-time and Required On date-time, when a laboratory holiday falls on a non-working day, then the holiday's Adjustment determines the new non-working day (instead of the holiday), and that new non-working day is then incorporated in the calculation of the Required On date-time, as follows:
-
Where the day is NOT a working day according to the preference then add one day to the Required On date-time.
-
Where the day IS a working day according to the preference, and the holiday's Holiday Type is OnceOff, or the holiday's Holiday Type is Repeat and DAYMONT(Day) = DAYMONT(Holiday) and the holiday's Adjustment is None, then ADD one day to the Required On date-time.
-
Where the day is NOT a working day according to the preference and the holiday's Holiday Type is OnceOff, or the holiday's Holiday Type is Repeat and DAYMONT(Day) = DAYMONT(Holiday) and the holiday's Adjustment is None, then DO NOT add one day to the Required On date-time.
-
Where the day is NOT a working day according to the preference and the holiday's Holiday Type is OnceOff, or the holiday's Holiday Type is Repeat and DAYMONT(Day) = DAYMONT(Holiday) and the holiday's Adjustment is Forward or Backward, then add one day to the Required On date-time.
If the WORKING_DAYS_OF_WEEK application preference is not defined, or is defined and contains an invalid string, such that Monday is presumed the first day of the week and all days of the week are working days in the week, when a job or sample is created or updated and the Received On date-time or Priority is changed, then the Required On date-time calculation only takes into consideration the laboratory's holidays that are in the window of the job or sample.
