Project Name Docmate: Ahsanullah University of Science & Technology
Project Name Docmate: Ahsanullah University of Science & Technology
Project Name
DocMate
Database Lab(CSE 3104)
Submitted By:
K.M. Azizullah Tanim 17.02.04.001
Rukaiya Fahmida 17.02.04.004
G. M. Rezwan Kabir Robin 17.02.04.027
Reason of Selection Project
Customers
Doctors
There are few risks and limitations of this project. There should be
uninterrupted power supply present. And there should also be a proper data backup system
otherwise there might be a risk of losing data. The doctors and their assistants should be
provided with working computers and they should have general computer skills.
Conclusion
Page 1
Entity:
Doctor
Patients
Prescription
Medicine
Relationship:
Visits
Receives
Uses
Attributes:
Primary key:
Doctor – DoctorId
Patient – PatientId
Prescription – PrescriptionId
Medicine – MedicineId
Foreign key:
Patient – DoctorId
Prescription – PatientId
Page 2
Here after normalization we have 10 tables in our Database.
1. DOCTOR Table:
This table keeps information of the doctor. Here the primary key is the
DoctorId.
(
DoctorId int IDENTITY(1,1) PRIMARY KEY,
DoctorName varchar(50) NOT NULL,
DoctorSex varchar(6) CHECK(DoctorSex IN('Male','Female',
'Other')),
DoctorEmail varchar(50) NOT NULL UNIQUE,
DoctorPhone varchar(20) NULL,
DoctorPassword varchar(50) NOT NULL,
DoctorAbout varchar(500) NULL
)
2. SPECIALIZATION Table:
This table keeps information of the Specialization of the doctor. Here the
primary key is the SpecializationId. Here DoctorId is a foreign key from DOCTOR.
(
SpecializationId int IDENTITY(1,1) PRIMARY KEY,
DoctorId int NOT NULL FOREIGN KEY REFERENCES
DOCTOR(DoctorId),
SpecializationField varchar(200) NOT NULL,
SpecializationInfo varchar(200) NOT NULL
)
Page 3
3. GENERIC MEDICINE Table:
This table contains the generic names of the drugs. Here GenericId is the primary
key.
(
GenericId int IDENTITY(1,1) PRIMARY KEY,
GenericName varchar(50) NOT NULL,
TherapeuticClass varchar(50) NOT NULL,
Indication varchar(500),
SideEffect varchar(300)
)
4. MANUFACTURER Table:
This table contains the names of the Pharmaceutical Companies. Here
ManufacturerId is the primary key.
(
ManufacturerId int IDENTITY(1,1) PRIMARY KEY,
ManufacturerName varchar(50) NOT NULL,
ManufacturerCountry varchar (50) NULL
5. MEDICINE Table:
This table contains the names of the drugs by which they are marketed. Here
MedicineId is the primary key and GenericId and ManufacturerId are foreign keys
from the tables GENERIC and MANUFACTURER respectively.
Page 4
MedicineId GenericId ManufacturerId BrandName Strength DosageForm
(
MedicineId int IDENTITY(1,1) NOT NULL,
GenericId int NOT NULL FOREIGN KEY REFERENCES
GENERIC_MEDICINE (GenericId),
ManufacturerId int NOT NULL FOREIGN KEY REFERENCES
MANUFACTURER (ManufacturerId),
CONSTRAINT PK_MEDICINE PRIMARY KEY (MedicineId),
BrandName varchar(50) NOT NULL,
Strength varchar(50) NOT NULL,
DosageForm varchar(100),
)
6. PATIENT Table:
This table keeps the records of the patients. Here PatientId is the primary key.
And DoctorId is the foreign key
PatientId DoctorId PatientName PatientDOB PatientSex PatientPhone PatientAddress PatientEmail PatientRegistrationDate PatientComments
(
PatientId int IDENTITY(202009,1) PRIMARY KEY,
DoctorId int NOT NULL FOREIGN KEY REFERENCES
DOCTOR(DoctorId),
PatientName varchar(50) NOT NULL,
PatientDOB date NOT NULL,
PatientSex varchar(6) NOT NULL CHECK(PatientSex IN('Male',
'Female', 'Other')),
PatientPhone varchar(20) NULL,
PatientAddress varchar(200) NULL,
PatientEmail varchar(50) NULL,
PatientRegistrationDate date NULL,
PatientComments varchar(5000) NULL,
)
Page 5
7. PRESCRIPTION Table:
This table contains the Prescriptions issued to the patients. Here
PrescriptionId is the primary key and PatientId and DoctorID are the foreign keys
from the table PATIENT.
(
PrescriptionId int IDENTITY(1,1) NOT NULL,
PatientId int NOT NULL FOREIGN KEY REFERENCES PATIENT
(PatientId),
DoctorId int NOT NULL FOREIGN KEY REFERENCES
DOCTOR(DoctorId),
Symptoms varchar(500) NULL,
PrescribedTest varchar(500),
Diagnosis varchar(500) NULL,
PrescriptionAdvice varchar(500),
VisitAfter varchar (300),
Observation varchar (300),
PrescriptionDate date NULL
CONSTRAINT PK_PRESCRIPTION PRIMARY KEY (PrescriptionId)
)
8. PATIENTMEDICINE Table:
This table contains the records of Drugs Prescribed to the patients and their
dosage. Here the primary key is a composite key of MedicineId and PrescriptionId.
Page 6
(
PrescriptionId int NOT NULL,
MedicineId int NOT NULL,
CONSTRAINT PK_PAITENT_MEDICINE PRIMARY KEY (
PrescriptionId, MedicineId),
DrugDosages varchar(50) NOT NULL,
DrugDuration varchar(50),
DrugAdvice varchar(100),
)
9. VISIT Table:
Visit Table records the data of each visit of the patient with the doctor.
Here the primary key is VisitId and foreign keys are PatientId and DoctorId.
(
VisitId int IDENTITY(1,1) PRIMARY KEY,
DoctorId int NOT NULL FOREIGN KEY REFERENCES
DOCTOR(DoctorId),
PatientId int NOT NULL FOREIGN KEY REFERENCES
PATIENT(PatientId),
VisitDate date NOT NULL
)
Page 7
(
ReceivesId int IDENTITY(1,1) PRIMARY KEY,
PrescriptionId int NOT NULL,
CONSTRAINT FK_RECEIVES_PRESCRIPTION FOREIGN KEY
(PrescriptionId) REFERENCES PRESCRIPTION(PrescriptionId),
PatientId int NOT NULL FOREIGN KEY REFERENCES
PATIENT(PatientId)
)
Page 8