Hi Phil,

Very nice concept indeed. I am going to work on that one.

Thanks,


Youri




Phil Heycock wrote:
BitMap/BitMask

Put an integer field in you scheduling table, with each bit position
representing a schedule slot... a 'BitMap':


0 = 8:00 = 8:15
1 = 8:15 - 8:30

... etc. (Depending on your scheduling windows, you may need one BitMap for
the morning, another for the afternoon.)

When you fire up your application, read all the appointment bitmaps from the
database, into an array... or even a MemoryBlock.. With the start date
known, and the number of days in a week known, it is trivial to compare a
BitMask with the BitMap that resides in array elements of interest. The
BitMask bit positions can be set to indicate the appointment slots that are
acceptable to the patient. Then, in a loop, using bitwise logical functions,
compare the mask with the selected masks. When an open appointment is found,
update the mask (set the appropriate bit) in the array bitmap... from there,
update the appropriate bitmap in the database.

Very, very fast. Foolproof.

P.

on 10/17/06 1:51 PM, Youri at [EMAIL PROTECTED] wrote:


Hi,



I need to develop an Agenda (very common sorry), but it will have to
answer to some simple questions for a human, such as :


What is the 1st possibility for my patient to get an appointement? (find
the 1st possible date)

My patient can only come on Fridays, what is the 1st possible date of
appointment?

...

It is mainly a quick and dirty way to "optimize" an agenda for a Doctor.


The agenda will be based on a DB.


Any suggestion will be apreciated.


TIA,


Youri


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to