Solved

help with a DB schema..

Posted on 2012-04-04
3
283 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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 dynamically set the form action using jQuery.
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 …

758 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

26 Experts available now in Live!

Get 1:1 Help Now