What the task deadlines and durations are for

On 10/10/2013 8:04 AM, Tom Harper wrote:


Ok so I fixed the EOP Part, there was a pathway to add tasks where it was failing to consider the protocol info. I unified all of the addTask calls so that everything is considered in the addTaskToShift function. The algorithm for scheduling currently uses the deadline_int field, and ignores the duration field when scheduling.
 


That is the correct algorithm.  A task's deadline determines its placement in the SAG screen and its sequence in the To-Do List screen.  Its duration is irrelevant to this algorithm.

However, duration is essential for the calculation of the values shown in the status box at the bottom of the SAG screen,
such as total number of minutes of nursing tasks remaining to be done;  the durations of those tasks are summed to yield this number.
 

However, when you create a to-do (i.e. task) there is not a way to set the deadline_int, just the duration_int.
 


That is also the correct algorithm.  When a task is created, it is not yet known what its deadline will be.  That becomes defined when a shift or a protocol is created with the task in it.  The deadline now has meaning because there is now a context. Also, a given task may appear in several different shifts and protocols, with a different deadline in each.  So the deadline is not a feature of the task itself;  it is a feature of the task in any particular context.
 

SO what ends up happening is that only the default tasks that have deadline_int are scheduled correctly, and the duration_int ones are only considered in Shift At a Glance. I tried adding the duration info in but it isn't cumulative.
 


Right.  Durations are not used for scheduling, only for status calculation.