[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

help with a DB schema..

Posted on 2012-04-04
3
Medium Priority
?
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to count occurrences of each item in an array.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 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