| | 1 | = ''**Pink Patrol**'' |
| | 2 | |
| | 3 | = Entity Relationship Diagram |
| | 4 | |
| | 5 | == The Diagram |
| | 6 | [[Image("wiki:WikiStart:ERDiagramOfMedSystem.jpg")]] |
| | 7 | |
| | 8 | == Descriptive documentation and argumentation |
| | 9 | The designed database represents an Engineering Project Management System in the healthcare domain, integrating hospital operations, patient management, medical processes, and pharmaceutical workflows. The system is structured to support real-world activities such as scheduling appointments, recording diagnoses, managing prescriptions, and handling pharmacy sales. |
| | 10 | The model follows a relational approach, ensuring data integrity, scalability, and efficient querying. |
| | 11 | |
| | 12 | **Core Entities and Their Roles** |
| | 13 | |
| | 14 | - Hospital, Department, and Specialization |
| | 15 | |
| | 16 | The system models the organizational structure through Hospital, Department, and Specialization entities. |
| | 17 | |
| | 18 | A Hospital contains multiple departments. |
| | 19 | |
| | 20 | Each Department is associated with a specific Specialization (e.g., Cardiology, Neurology). |
| | 21 | |
| | 22 | This separation allows flexibility: The same specialization can exist in multiple departments.Departments can be managed independently. |
| | 23 | |
| | 24 | - Doctor |
| | 25 | |
| | 26 | The Doctor entity stores personal and professional information such as name, contact details, and specialization. |
| | 27 | |
| | 28 | Each doctor is linked to a specialization. |
| | 29 | |
| | 30 | The relationship Doctor–Department is modeled as a many-to-many relationship through an associative table, allowing: A doctor to work in multiple departments. Departments to have multiple doctors. |
| | 31 | |
| | 32 | This reflects real hospital environments. |
| | 33 | |
| | 34 | - Patient |
| | 35 | |
| | 36 | The Patient entity captures demographic and contact information. |
| | 37 | |
| | 38 | This entity is central to the system and connects to: Appointments. Diagnoses. Laboratory tests. Prescriptions.Pharmacy transactions. |
| | 39 | |
| | 40 | This ensures a complete medical history for each patient. |
| | 41 | |
| | 42 | **Medical Process Entities** |
| | 43 | |
| | 44 | - Appointment |
| | 45 | |
| | 46 | The Appointment entity represents scheduled interactions between patients and doctors. |
| | 47 | |
| | 48 | It includes: Date. Status (scheduled, completed, cancelled). Type (checkup, emergency, consultation). Priority level. |
| | 49 | |
| | 50 | A recursive relationship (parent_appointment_id) allows modeling follow-up visits. |
| | 51 | |
| | 52 | - Medical Examination and Laboratory Test |
| | 53 | |
| | 54 | Medical_examination records clinical observations and notes. |
| | 55 | Laboratory_test stores diagnostic test results. |
| | 56 | |
| | 57 | These entities: Are linked to both doctor and patient. Provide detailed medical insights. Reflect real diagnostic workflows. |
| | 58 | |
| | 59 | - Diagnosis (ICD-based) |
| | 60 | |
| | 61 | The system uses: ICD (standard medical classification). Patient_diagnosis. |
| | 62 | |
| | 63 | This design ensures: Standardization of diagnoses. Ability to track multiple diagnoses per patient. Compatibility with real healthcare systems. |
| | 64 | |
| | 65 | The Appointment_diagnosis table resolves the many-to-many relationship between examinations and diagnoses. |
| | 66 | |
| | 67 | **Pharmaceutical and Sales Subsystem** |
| | 68 | |
| | 69 | - Drug, ATC Code, and Producers |
| | 70 | |
| | 71 | Drug represents medications |
| | 72 | |
| | 73 | ATC_code classifies drugs |
| | 74 | |
| | 75 | Drug_producers stores manufacturer data |
| | 76 | |
| | 77 | This structure supports: Drug traceability. Regulatory compliance. Classification-based queries. |
| | 78 | |
| | 79 | - Pharmacy and Inventory |
| | 80 | |
| | 81 | Pharmacy represents physical locations |
| | 82 | |
| | 83 | Inventory tracks available drugs and quantities |
| | 84 | |
| | 85 | Inventory_price stores price changes over time |
| | 86 | |
| | 87 | This allows: Stock management. Historical price tracking. Realistic pharmacy operations. |
| | 88 | |
| | 89 | - Prescription and Sales |
| | 90 | |
| | 91 | Prescription connects doctor, patient, and medication |
| | 92 | |
| | 93 | Pharmacy_sale records completed transactions |
| | 94 | |
| | 95 | Sale_item details individual items within a sale |
| | 96 | |
| | 97 | This separation ensures: Accurate billing. Traceability of sold drugs. Support for multi-item transactions. |