- Optionally Drop
DropDB.sql
any previous databases namedHospitalMS
if any - run with caution - Create a new Database
CreateDB
- Run all the queries in
DeployDB
- You will have all the infrastructure ready for data input right away, refer to Logical Data entry steps to avoid errors. - Create all the Stored Procedures to be used in the ASP.net project correctly.
StoredProcedureCalculateDays.sql
for bill calculationsStoredProcedureDisadmittPatient
for patient deletion from database - NOTE: this script contains a transactionStoredProcedureSearchPatients
for searching patients effeciently, without entering all the needed Entity attributs.
BasicInsertions
for initiallizing the database by test data.KillATransaction
just contains the code needed if the system is halted by an ongoing transaction. Don't use it unless needed.
- Just place the folder in a suitable place on your hard disk and open the solution using the
.sln
file. Then run the Debugger on Visual Studio 2017. - This will initialize the solution with the needed packages if they are installed.
Introductory Youtube Video: https://youtu.be/ww1DwIGYCaw
Database is already filled with the most common Hospital Departments worldwide and is initialized with about 200 room of different types. So, Nurses, Doctors, Wardboys, and Patients data should be entered right away.
Next, there would be a green light to startup the hospital and have:
- Patients ADMITTED to Rooms
- Doctors TREAT Patients
- Nurses SERVE Patients
-
Enter Nurse Data
INSERT INTO Ent_Nurse (NurName, WorksIn) VALUES (.., ..);
-
Enter Doctors Data
INSERT INTO Ent_Doctor (DocName, WorksIn) VALUES (.., ..);
-
Enter Patients Data
INSERT INTO Ent_Patient (Pname, Pnumber, Pdisease, PdayIn, PdayOut) VALUES (.., .., .., .., ..);
-
Enter Hospital Room Data (For additional rooms)
INSERT INTO Hos_Room (RmType, RmDep) VALUES (.., ..);
-
Enter Wardboys data
INSERT INTO Ent_Wardboy (WarName, Maintains) VALUES (.., ..);
-
Enter Admission Data
INSERT INTO Rel_AdmittedIn (RmId, Pid) VALUES (.., ..);
-
Enter Treatment Data
INSERT INTO Rel_Treats (DocId, Pid, Treatment) VALUES (.., .., ..);
Treatment: Optional field, used as a 'notes about treatment and medicine' field
- Enter Service Data
INSERT INTO Rel_Serves (NurId, Pid) VALUES (.., ..);
NOTE: All IDs in the database are automatically generated, the database is supposed to hold 999,999 data entry in each table.
Patients IDs start with 1xxxxxxx entity_name: Ent_Patient
Doctors IDs start with 2xxxxxxx entity_name: Ent_Doctor
Nurses IDs start with 3xxxxxxx entity_name: Ent_Nurse
Wardboys IDs start with 4xxxxxxx entity_name: Ent_Wardboy
Room IDs start with 5xxxxxxx entity_name: Hos_Room
Departments IDs start with 6xxxxxxx entity_name: Hos_Departments
To Search for an ID for a specific Entity:
SELECT * FROM [entity_name]
Features of the web interface to be added in the next README.md update.