|
Hi,
i have several question regarding database design.
first, which one is better, having a simple database but you play around deeply in the code or otherwise?
second, i'm doing an appoitnment system for a clinic right now, and i find some problems on matching the time appointed by the patient with the doctor's schedule.
1 patient can have many appointment and 1 appointment can only be done by specific patient. each appointment duration is about 15 minutes. thus, for instance, a patient books for dr.A which has a schedule on MOnday from 7pm-9pm. she books for 7.45pm by sms and waiting for the confirmation reply. the receptionist will check wether at 7.30 the doctor has got another appointment or not.
my existing design is as the following:
i have 1 table for patient with patientId
appointment with appointmentId, doctorId, staffId, date, fromTime
schedule with scheduleId, dayId, defaultInterval, isAvailable, time
doctor with doctorId
doctor_schedule with doctorId, scheduleId
is this correct or is there any other best solution? because i'm still learning =)
i'm quite confuse with the schedule table, previously i have timeId attribute.
thx for your attention
|