Need Help in "Appointment" code in Asterisk

Hi all,
I have to design an appointment schedule in asterisk. Say, a patient calls the doctor,then asterisk itself has to take the call and ask the person’s name,record it and read the intime and outtime for that person and update in database… Upto this point, am done . Now, after accepting intime and outtime, I will have to check

a) if the slot is open. If not - you should ask the caller to enter a different time---------It can be done through database check,this is OK…
b) do some time validations (shouldn’t be too late)
c) caller should even be able to cancel the slot automatically. I should do a check on his phone number.
d) if the number is not known from callerid (blocked), you should prompt the user to provide you with the number.

Hw to make it???
Pls help me in this, If possible pls send me sample project code also.I need it at the earliest.

Expecting a favourable reply and thanx in advance…

Padmaja T N.

Although I do not know anything in computer programming, that is an interesting and useful project.

There is a lot going on here.

I am ‘familiar’ with using a php call in the dialplan to access a database, and you also can take asterisk input and output while the php program is still running (like choosing appt day, time), but you can also access mysql directly via the dialplan (this gets klunkly fast it seems). There is also fast agi which i do not know much about.

I guess the first question is, what database does the scheduler use? But foremost , does the medical director really want this?

Our doctor’s office had thought about implementing this approach to automated appointment scheduling a couple years ago, but we decided not to. We did not want a patient to make an automated appointment for chest pain, for example, when we really should have triaged them to call 911. Or a patient that is suddenly short of breath with a fever, or partial paralysis of a limb… you get the point. If a patient can make an appointment without any form of triage, you will run into trouble. You cannot let the patient triage themselves because the patient often enough will not know how urgent a matter is and I would never trust some computer algorithm to triage the severity of a problem - you really need human interaction. Routine automated follow up appointments are ok, but you will still get some peole scheduling sick visits.