A Data Model for a Medical Appointment Booking App

Booking a doctor’s appointment using an online app is an innovation that simplifies the entire process. Let’s dive into the data model behind an appointment booking app.

Why use an app? It makes it easier for people to find the doctors of their choice, letting them see the doctor’s professional records and patient reviews. When someone finds a doctor they like, they can book an appointment with them without leaving the app. An app can also help doctors keep their patients’ waiting times as short as possible, help them schedule their patients, and enable them to keep an eye on patients’ online reviews.

Medical Appointment App Requirements

In brief, we expect that our app will:

And don’t forget the app’s unique selling point: showing upcoming available appointments and allowing users to book one.

Categorizing App Requirements

Basically, we can divide the app’s requirements into these four areas:

  1. Managing Doctors’ Data – Doctors can register and enter all their details.
  2. Managing Doctors’ OPD (Outpatient Department) and Clinic Details – Doctors (or their staff) can log details about their clinic or OPD schedule and availability.
  3. Managing Client and Review Data – Users can register and enter their basic details. They can also post reviews about doctors.
  4. Managing Appointments – Users can search for doctors based on certain criteria.

Let’s look at these areas individually.

Managing Doctors’ Data

Doctors can register with the app by filling in certain mandatory details, but the appointment booking feature is enabled only after they complete their full profile. This includes their qualifications (professional degrees, certifications/specializations, and internships), and their past and current affiliations with hospitals and healthcare service providers, facilitating comprehensive healthcare data mining.

The tables shown below manage this information.

Managing Doctors’ Data

The doctor table stores elementary details about doctors, which they enter during registration. The columns in this table are:

The specialization table holds all existing medical specializations like orthopedic, neurologist, dentist, etc. A doctor can have more than one specialization; in fact, it’s pretty common for a doctor to specialize in related fields. For example, a neurologist can also be a psychiatrist; a gynecologist can be an endocrinologist, and so on. Therefore, the doctor_specialization table allows a many-to-many relationship between the doctor and specialization tables. The attributes on these two tables are self-explanatory.

The qualification table stores details about doctors’ education and professional qualifications, including degrees, certifications, research papers, seminars, ongoing training, etc. To facilitate the various types of qualification details, I have given these fields quite generic names:

The hospital_affiliation table keeps information about doctors’ affiliations with hospitals and healthcare service providers. This data is only for display on a doctor’s profile and has no significance in the appointment booking feature. OPD (Outpatient Department) details are entered separately and will be handled later in this article.

This table’s columns are:

Managing Doctors’ OPD/ Clinic Details

The information in this section is entered by doctors (or their staff) and plays a significant role in the app’s search and booking functionalities.

Managing Doctors’ OPD/ Clinic Details

The office table holds information about the Outpatient Department of the hospitals doctors are affiliated with as well as their own clinics (i.e. offices or surgeries). The columns in this table are:

Why Is There a Separate “office” Table When OPD Details Can Easily Be Tracked in the “hospital_affiliation” Table?

The office_doctor_availability table stores doctors’ OPD/ clinic availability in terms of time slots (say 2 hours in the morning and 4 hours in the evening). Splitting up the day this way is pretty common, so having an additional table to store availability slots makes sense. Plus, doctors can work more than one OPD shift. The columns for this table are:

The in_network_insurance table stores insurance information. In many countries, medical services are very costly and health insurance is mandatory. In such cases, this table contains the details about what insurance companies are fully accepted at the hospital OPD or clinic.

Managing Client and Review Data

For a patient, registering for the app requires very little information. From here on, I will use ‘client’ rather than ‘user’ or ‘patient’.

Managing Client and Review Data

The client_account table stores basic details for clients. These details are captured at the time of registration. The columns in this table are:

The client_review table not only offers feedback (i.e. client reviews) for doctors, but it also helps potential clients to choose doctors. It is an integral component of this app. Columns for this table are:

Managing Appointments

This section is the foremost USP (Unique Selling Point) for this app, as it allows clients to check the availability of various doctors and book an appointment.

Managing Appointments

The appointment table holds appointment details for clients. Its columns include:

See the Complete Data Model

The Search Function in Action

Let’s search for an ophthalmologist in the 63101 ZIP code. Search results should be ordered by the following criteria:

SELECT doctor_name, hospital_name, practicing_from, first_consultation_fee, recomm_count FROM (SELECT d.doctor_id, d.first_name || ‘ ‘ || d.last_name as doctor_name, ha.hospital_name, d.practicing_from, o.first_consultation_fee FROM office o, doctor d, doctor_specialization ds, specialization s, hospital_affiliation ha WHERE o.doctor_id = d.id AND d.id = ds.doctor_id AND s.id = ds.specialization_id AND s.specialization_name = ‘Ophthalmologist’ AND o.hospital_affiliation_id = ha.id (+) AND o.zip = ‘63101’) doctor_detail, (SELECT doctor_id, count(1) as recomm_count FROM client_review WHERE is_doctor_recommended = ‘Y’ GROUP BY doctor_id) review_count WHERE doctor_detail.doctor_id = review_count.doctor_id ORDER BY doctor_detail.practicing_from DESC, review_count.recomm_count DESC doctor_detail.first_consultation_fee ASC;

What Would You Add?

What else can be added to this app and this data model? Share your views in the comments.

Subscribe to our newsletter Join our weekly newsletter to be notified about the latest posts. Subscribe