I'm developing a scheduling application. It schedules office appointments for patients. It uses a tab control with several pages. Each page containe a Hierarchical Grid control. Each grid displays appointments for up to 3 different patients. Each patient's appointments are displayed in two consecutive columns. The first patient's appointments begin in the third column.
I am trying to develop an algorithm that determines when to go to the next page (after every third patient) and which column(s) should contain the current patient's appointment data.
I have the following variables defined:
NumPatients=running total of number of patients scheduled so far, including the current one.
MaxPerPage=maximum number of patients that can be placed on a single page.
MaxPages=total number of tabbed pages available for schedules.
I've developed one that uses a MOD 3 calculation, which can be made to work, but in my opinion is "clunky" because I have to use a special condition when NumPatients MOD 3=0.
My instincts tell me that there is a more direct way to do this using just the NumPatients and MaxPerPage variables and a straightforward calculation, probably involving the modulo division for the current column calculation and a Ceiling function for the current page calculation. Can anyone provide some insight?
Glenn Crumpley
I am trying to develop an algorithm that determines when to go to the next page (after every third patient) and which column(s) should contain the current patient's appointment data.
I have the following variables defined:
NumPatients=running total of number of patients scheduled so far, including the current one.
MaxPerPage=maximum number of patients that can be placed on a single page.
MaxPages=total number of tabbed pages available for schedules.
I've developed one that uses a MOD 3 calculation, which can be made to work, but in my opinion is "clunky" because I have to use a special condition when NumPatients MOD 3=0.
My instincts tell me that there is a more direct way to do this using just the NumPatients and MaxPerPage variables and a straightforward calculation, probably involving the modulo division for the current column calculation and a Ceiling function for the current page calculation. Can anyone provide some insight?
Glenn Crumpley