Telemedicine APIs and Schemas
Telemedicine schemas
User table
Column | Type | Description |
---|---|---|
id | integer | primary key |
varchar(255) | unique email address of the user | |
password | varchar(255) | encrypted password |
created_at | datetime | timestamp of when the user was created |
Patient table
Column | Type | Description |
---|---|---|
id | integer | primary key |
user_id | integer | foreign key referencing the id column of the User table |
name | varchar(255) | name of the patient |
date_of_birth | date | date of birth of the patient |
gender | varchar(10) | gender of the patient |
created_at | datetime | timestamp of when the patient was created |
Doctor table
Column | Type | Description |
---|---|---|
id | integer | primary key |
user_id | integer | foreign key referencing the id column of the User table |
name | varchar(255) | name of the doctor |
specialty | varchar(255) | specialty of the doctor |
created_at | datetime | timestamp of when the doctor was created |
Appointment table
Column | Type | Description |
---|---|---|
id | integer | primary key |
patient_id | integer | foreign key referencing the id column of the Patient table |
doctor_id | integer | foreign key referencing the id column of the Doctor table |
appointment_date | datetime | date and time of the appointment |
reason | varchar(255) | reason for the appointment |
created_at | datetime | timestamp of when the appointment was created |
Prescription table
Column | Type | Description |
---|---|---|
id | integer | primary key |
appointment_id | integer | foreign key referencing the id column of the Appointment table |
medication | varchar(255) | name of the prescribed medication |
dosage | varchar(255) | dosage of the prescribed medication |
frequency | varchar(255) | frequency of the prescribed medication |
created_at | datetime | timestamp of when the prescription was created |
Medical Record table
Column | Type | Description |
---|---|---|
id | integer | primary key |
patient_id | integer | foreign key referencing the id column of the Patient table |
doctor_id | integer | foreign key referencing the id column of the Doctor table |
diagnosis | varchar(255) | diagnosis of the patient |
notes | text | any notes related to the medical record |
created_at | datetime | timestamp of when the medical record was created |
Diagnosis
Column | Type | Description |
---|---|---|
id | SERIAL | Primary key |
name | VARCHAR | Name of the diagnosis |
code | VARCHAR | ICD-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