A database design for a real world hospital management system. It consists of 10 schemas/dbs which amount to a total of 77 tables, each pertaining to a different aspect of the hospital.
- Room: Consists of office rooms, emergency rooms, doctor offices, labs etc.
- Consumable: Consists of pharmaceuticals, medical supplies etc.
- Inventory: This includes from the medical equipment for operations, to lab machines and vehicles.
- Budget: The expenses and cashflow for each department and daily operations.
- Management: All personnel of the facility who oversee various aspects.
- Staff: All worker category personnel.
- Profile: Human entity document.
- Patient: Patient profiles.
- Schedule: Self Explanatory. Includes appointments and equipemnt check-in/check-out.
- Document: Details that should be on an ouput page.
The folder hierarchy is as follows:
├───design
│ ├───docs
│ ├───queries
│ │ ├───mysql
│ │ └───postgresql
│ ├───schema
│ └───templates
├───db
│ ├───mysql
│ ├───postgresql
└───utils- The schema and tables are implemented in
/design/templates/schema.yaml. - The
/utils/yamlToJson.pyis used to convert/design/templates/schema.yamlto json/design/templates/schema.jsonfor ease of Editing data types. - The
/utils/jsonToXsql.pyis used to convert the/design/templates/schema_Xsql.jsonfiles into/design/queries/X/query_create_xyz.sqlqueries to generate the database. - Finally edit
/design/queries/X/query_create_relations.sqlquery files to properly align foreign keys with schemas. (X=MyorP)
