Norman,


The thing is that I have thought of 2 options :

Let's say that I have a APPTS_TBL with :

ID_Appts, id_patient, id_doctor, Date, Time_start, Time_finish


1 - Clever one :

I only create a record in the Table when an appointment is made. I need to find a SQL statement that could perform the search of "non presence of record"... Not sure if possible. The query needs to find the "holes" and propose a solution to the user.


2 - Brute force one :

At the start I create 1 year of empty records with slots of 15 mins. Every day or week I create the additional day required to have a year in advance in my Table. Thus, when an appointment is made I just fill in the appropriate record. The SQL query is quite simple there. This solution lacks of elegance.


That's where I am so far, and I'm quite stuck with these 2 structures.

Any better/clever idea?


TIA,


Youri


Norman Palardy wrote:

On Oct 17, 2006, at 11:51 AM, Youri 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.

Depending on how your schedule is set up in the DB then you will have different possibilities

Say you know that an appointment should be booked in 15 minute increments

So then if the patient only wants to come on a friday find the first open 15 minute time slot on a friday

I can't write an SQL statement for this without knowing what your database looks like


_______________________________________________
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