Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hospital database design

Featured Replies

  • Newbies

Hi,

I am designing a database for a hospital.

I have to make around 12 tables but if i get the basic structure of the first 2 tables correct, i will be able to do the rest.

basically, i have a patient table which has basic patient details like patient number(unique), name etc. and then there is a disease table which has a patient number field same as the patient table, a few disease fields and a calculated field which simply amalgamates the patient number, date and the site of the disease called the disease_id.

I want a one to many relationship between these 2 tables as one patient can have multiple diseases.

So

1. What field constraints do i have to put.

2. How am i supposed to join the tables.

3. How and in which layout do i make the button which enables me to add a new disease to a patient.

Any help will be appreciated.

I want a one to many relationship between these 2 tables as one patient can have multiple diseases.

A one-to-many relationship from patients to diseases will not work if you need to report on diseases.

  • Author
  • Newbies

so how do i relate them?

A one-to-many relationship between Patients and Diseases would look like this:

Patients::PatientID = Diseases::PatientID

If you place a portal to Diseases on a layout of Patients, you can create new related diseases simply by entering them into the first empty portal row (provided you have enabled this in the definition of the relationship).

a calculated field which simply amalgamates the patient number, date and the site of the disease called the disease_id.

This is neither necessary nor advisable. Define DiseaseID to auto-enter a serial number.

  • Author
  • Newbies

the disease id has to be like that as it goes into the national database format as (patient number-date_of_diagnosis-site)

Vinny,

Please adjust your skill level. I imagine it is not "entry-level" since you have passed the FM7 certification test.

-Barbara

the disease id has to be like that as it goes into the national database format as (patient number-date_of_diagnosis-site)

That's fine - just call it something else (at least here) to avoid confusion.

  • Author
  • Newbies

right, the logical scenario goes like this

patient>>>>>diseases>>>>>diagnosis details

there has to be a disease id generated every time a patient comes to the hospital with a disease

patient(PK:patient number)

diseases(PK:diseaseID, FK:patient number)

diagnosis is like multiple tables containing the information of the whole treatment which needs to be connected to diseases.

diagnosis(FK:diseaseID)

diseaseID= patientnumber-date_of_diagnosis-site

I think i have drawn the relationships correctly, as ive linked

Patients::PatientID = Diseases::PatientID and Diseases::DiseaseID=Diagnosis::DiseaseID

Where and how do i have to create the button which will enable me to create a new disease and diagnosis details for an existing patient(who will have the details in the patient table as before).

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.