Sheduling Appointments

Sheduling Appointments

am 22.01.2008 07:46:17 von clk

I have a table with appointments and need to make sure they do not
overlap.

Say I have these fields

Date
TimeBegin
TimeEnd

The user should be able to add appointments at any time. The solution
should stop him if there already is an appointment at the same time.

I tend to make global fields and do a lot of scripting if I had to
re-invent the wheel.

At this time, things are very simple. The entire solution is for one
doctor and one room. I wouldn't want a solution that only works in this
situation, though.

Anyone put me in the right direction before I do anything stupid?
--
http://clk.ch

Re: Sheduling Appointments

am 22.01.2008 08:48:42 von Christoph Kaufmann

I just asked

[sheduling]
>Anyone put me in the right direction before I do anything stupid?

I found http://www.seedcode.com
--
http://clk.ch

Re: Sheduling Appointments

am 24.01.2008 21:33:47 von clk

I wrote:

> I have a table with appointments and need to make sure they do not
> overlap. Say I have these fields
>
> Date
> TimeBegin
> TimeEnd

ReservationID (key)
DateBegin
DateEnd
TimeBegin
TimeEnd
Room ID
PatientID
StaffID
TimeStampBegin_c
TimeSTampEnd_c

> The user should be able to add appointments at any time. The solution
> should stop him if there already is an appointment at the same time.

After searching the archives for some time, I decided to use the auld
Brain 1.0 (or re-invent the wheel) and came up with something that
should work in Filemaker 7 and newer:

In order to make sure the bookings of one room do not overlap, I create
a selfjoin called doublecheck on 4 criteria:

[1] RoomID = Doublecheck::Room ID
[2] TimeStampBegin < Doublecheck::TimeStampEnd
[3] TimeStampEnd > Doublechck::TimeStampBegin
[4] ReservationID /= Doublecheck::ReservationID

Conflicting entries should now appear as related records, because

[1] it's the same room
AND
[2] the booking starts before the other booking has ended
AND
[3] the booking ends after the other booking has started
AND
[4] it's a different booking (otherwise each record will relate to
itself, because 1, 2 and 3 are positive).

I need to build similar relations to check that the staff and patient
assignments are unique.

I assume this could work if staff and patients were assigned with join
tables, but haven't tested this yet.

Any comments?
--
http://clk.ch