Skip to main content

Telemedicine APIs and Schemas

Telemedicine schemas

User table

ColumnTypeDescription
idintegerprimary key
emailvarchar(255)unique email address of the user
passwordvarchar(255)encrypted password
created_atdatetimetimestamp of when the user was created

Patient table

ColumnTypeDescription
idintegerprimary key
user_idintegerforeign key referencing the id column of the User table
namevarchar(255)name of the patient
date_of_birthdatedate of birth of the patient
gendervarchar(10)gender of the patient
created_atdatetimetimestamp of when the patient was created

Doctor table

ColumnTypeDescription
idintegerprimary key
user_idintegerforeign key referencing the id column of the User table
namevarchar(255)name of the doctor
specialtyvarchar(255)specialty of the doctor
created_atdatetimetimestamp of when the doctor was created

Appointment table

ColumnTypeDescription
idintegerprimary key
patient_idintegerforeign key referencing the id column of the Patient table
doctor_idintegerforeign key referencing the id column of the Doctor table
appointment_datedatetimedate and time of the appointment
reasonvarchar(255)reason for the appointment
created_atdatetimetimestamp of when the appointment was created

Prescription table

ColumnTypeDescription
idintegerprimary key
appointment_idintegerforeign key referencing the id column of the Appointment table
medicationvarchar(255)name of the prescribed medication
dosagevarchar(255)dosage of the prescribed medication
frequencyvarchar(255)frequency of the prescribed medication
created_atdatetimetimestamp of when the prescription was created

Medical Record table

ColumnTypeDescription
idintegerprimary key
patient_idintegerforeign key referencing the id column of the Patient table
doctor_idintegerforeign key referencing the id column of the Doctor table
diagnosisvarchar(255)diagnosis of the patient
notestextany notes related to the medical record
created_atdatetimetimestamp of when the medical record was created

Diagnosis

ColumnTypeDescription
idSERIALPrimary key
nameVARCHARName of the diagnosis
codeVARCHARICD-10 code for the diagnosis

APIs

  • POST /users: Create a new user.
  • GET /users/{user_id}: Retrieve user information by ID.
  • PUT /users/{user_id}: Update user information by ID.
  • DELETE /users/{user_id}: Delete a user by ID.
  • POST /doctors: Create a new doctor.
  • GET /doctors/{doctor_id}: Retrieve doctor information by ID.
  • PUT /doctors/{doctor_id}: Update doctor information by ID.
  • DELETE /doctors/{doctor_id}: Delete a doctor by ID.
  • POST /patients: Create a new patient.
  • GET /patients/{patient_id}: Retrieve patient information by ID.
  • PUT /patients/{patient_id}: Update patient information by ID.
  • DELETE /patients/{patient_id}: Delete a patient by ID.
  • POST /appointments: Create a new appointment.
  • GET /appointments/{appointment_id}: Retrieve appointment information by ID.
  • PUT /appointments/{appointment_id}: Update appointment information by ID.
  • DELETE /appointments/{appointment_id}: Delete an appointment by ID.
  • POST /prescriptions: Create a new prescription.
  • GET /prescriptions/{prescription_id}: Retrieve prescription information by ID

Sequence Diagrams

Entity Relationship Diagram

Flowchart

Telemedicine flowchart

Requirements

User Journey