SPECIALITY
Key
id    
uuid
NN
name    
varchar
NN
description    
text
NN
PATIENT
Key
id    
uuid
NN
first_name    
varchar
last_name    
varchar
email    
varchar
phone    
varchar
date_of_birth    
date
gender    
gender
registered_at    
timestamp
DIAGNOSTIC_TEST
Key
id    
uuid
NN
name    
varchar
category    
varchar
description    
text
base_price    
double precision
DOCTOR
Key
id    
uuid
NN
Key
speciality_id    
uuid
first_name    
varchar
last_name    
varchar
email    
varchar
license_number    
varchar
status    
status
APPOINTMENT
Key
id    
uuid
NN
Key
patient_id    
uuid
Key
doctor_id    
uuid
scheduled_at    
timestamp
duration_mins    
integer
status    
status
notes    
text
created_at    
timestamp
Key
payment_id    
integer
PAYMENT
Key
id    
uuid
NN
Key
appointment_id    
uuid
total_amount    
double precision
tax_amount    
double precision
payment method    
payment_method
status    
status
paid_at    
timestamp
transaction_ref    
varchar
CONSULTATION
Key
id    
uuid
NN
appointment_id    
uuid
started_at    
timestamp
ended_at    
timestamp
cheif_complaint    
text
diagnosis    
text
prescription    
text
followup_req    
followup
PRESCRIBED TEST
Key
id    
uuid
NN
Key
consultation_id    
uuid
Key
diagnostic_test_id    
uuid
reason    
text
status    
status
ordered_at    
timestamp
DIAGNOSTIC_REPORT
Key
id    
uuid
NN
Key
prescribed_test_id    
uuid
report_url    
varchar
findings    
text
remarks    
text
reported_at    
timestamp
reported_by    
varchar
Enum
status
Enum
gender
Enum
payment_method
Enum
followup
Documentation for project Clinic Management System
Clinic Management System
Project
Name
Clinic Management System
Description
Cohort 2026 assignments
Diagram
Name
Main Diagram
Report
Generated
4/8/2026 | 8:36:12 PM
tables
Name
SPECIALITY
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
name
varchar
Yes
description
text
Yes
Keys
SPECIALITY_pkey
Column in SPECIALITY_pkey
id
Name
PATIENT
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
first_name
varchar
last_name
varchar
email
varchar
phone
varchar
date_of_birth
date
gender
registered_at
timestamp
Keys
PATIENT_pkey
Column in PATIENT_pkey
id
Name
DIAGNOSTIC_TEST
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
name
varchar
category
varchar
description
text
base_price
double precision
Keys
DIAGNOSTIC_TEST_pkey
Column in DIAGNOSTIC_TEST_pkey
id
Name
DOCTOR
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
speciality_id
uuid
first_name
varchar
last_name
varchar
email
varchar
license_number
varchar
status
Keys
DOCTOR_pkey
Column in DOCTOR_pkey
id
Name
APPOINTMENT
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
patient_id
uuid
doctor_id
uuid
scheduled_at
timestamp
duration_mins
integer
status
notes
text
created_at
timestamp
payment_id
integer
Keys
APPOINTMENT_pkey
Column in APPOINTMENT_pkey
id
Name
PAYMENT
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
appointment_id
uuid
total_amount
double precision
tax_amount
double precision
payment method
status
paid_at
timestamp
transaction_ref
varchar
Keys
PAYMENT_pkey
Column in PAYMENT_pkey
id
Name
CONSULTATION
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
appointment_id
uuid
started_at
timestamp
ended_at
timestamp
cheif_complaint
text
diagnosis
text
prescription
text
followup_req
Keys
CONSULTATION_pkey
Column in CONSULTATION_pkey
id
Name
PRESCRIBED TEST
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
consultation_id
uuid
diagnostic_test_id
uuid
reason
text
status
ordered_at
timestamp
Keys
PRESCRIBED TEST_pkey
Column in PRESCRIBED TEST_pkey
id
Name
DIAGNOSTIC_REPORT
Columns
Name
Data type
Param
Key
Not Null
id
uuid
Yes
Yes
prescribed_test_id
uuid
report_url
varchar
findings
text
remarks
text
reported_at
timestamp
reported_by
varchar
Keys
DIAGNOSTIC_REPORT_pkey
Column in DIAGNOSTIC_REPORT_pkey
id
relationships
Name
DOCTOR_speciality_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in SPECIALITY
Column in DOCTOR
SPECIALITY_pkey
id
speciality_id
Name
PRESCRIBED TEST_diagnostic_test_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in DIAGNOSTIC_TEST
Column in PRESCRIBED TEST
DIAGNOSTIC_TEST_pkey
id
diagnostic_test_id
Name
PRESCRIBED TEST_consultation_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in CONSULTATION
Column in PRESCRIBED TEST
CONSULTATION_pkey
id
consultation_id
Name
PAYMENT_appointment_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in APPOINTMENT
Column in PAYMENT
APPOINTMENT_pkey
id
appointment_id
Name
DIAGNOSTIC_REPORT_prescribed_test_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in PRESCRIBED TEST
Column in DIAGNOSTIC_REPORT
PRESCRIBED TEST_pkey
id
prescribed_test_id
Name
APPOINTMENT_patient_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in PATIENT
Column in APPOINTMENT
PATIENT_pkey
id
patient_id
Name
APPOINTMENT_doctor_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in DOCTOR
Column in APPOINTMENT
DOCTOR_pkey
id
doctor_id
Name
APPOINTMENT_payment_id_fkey
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Mandatory
Mandatory
Key and columns
Key name
Column in PAYMENT
Column in APPOINTMENT
PAYMENT_pkey
id
payment_id
Lines
Line name
status-status
Line name
status-status
Line name
gender-gender
Line name
followup_req-followup
Line name
payment method-payment_method
Other objects
Name
status
Type
Enum
Enum values
"open", "closed", "done"
Name
gender
Type
Enum
Enum values
"male","female","others"
Name
payment_method
Type
Enum
Name
followup
Type
Enum