Solved

help with a DB schema..

Posted on 2012-04-04
3
290 Views
Last Modified: 2012-04-05
Hi, I am building a calendar application in PHP with a Mysql db. I have got the front end to work ( attached is the jpeg image). This calendar schedule is for each one of my patients. A patient may have 1 to  6 visits per week over  period of 60 days ( that is the reason the calendar has a 60 day view ). The max number of visits can be upto 3 times per day. Can someone suggest a schema I can use to build this calendar. I have another table that has all the patient details and each patient has a unique ID. Thank you for the help.

A
calendar.jpg
0
Comment
Question by:aej1973
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 250 total points
ID: 37806286
I think you need the following fields in your calendar table:

visitID - int, primary Key
patientID - int

description varchar(50) // If you want the ability to have different kinds of appointments.
OR
descriptionID (int) // If you want to have a defined selection of appointment types chosen from a drop-down  You would
                              // have a separate description table

startDate  - datetime
endDate - datetime
//Give the ability to cancel an appointment but not delete it from the database
active - int or boolean

// Information on
createdBy - varchar(50)
createdDate - datetime
updatedBy - varchar(50)
updatedDate - datetime

For your business rules on appointments you would need to check those in your PHP code before creating an appointment or updating an existing appointment.  I don't think you want to track that info in your database.

HTH...
0
 

Author Comment

by:aej1973
ID: 37806468
Thanks smadeira. My problem is how do I capture the appointments datewise? Right now we are capturing only the start and end dates. For example, I fill the appointment sheet for 3 weeks at a time. I go to each cell in the calendar to fill the appointments between the start and the end date. The calendar needs to show the appointments scheduled for each of those dates. From which field in the DB will this datewise information be picked up from? Thanks for the help.
0
 

Author Comment

by:aej1973
ID: 37811547
ok, I got what you suggested. What I had in my mind was to be update all cells in the calendar with one submit button, I have now changed my logic. Thanks for the help.

A
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now