entity MedicalCenter{ String nameCenter String addressCenter Integer zipCode String city String country Set(Department) departments oppositeTo belongsTo Set(Professional) employees oppositeTo worksIn } entity Department{ String nameDepartment String location MedicalCenter belongsTo oppositeTo departments Set(Doctor) doctors oppositeTo doctorDepartments Set(Nurse) nurses oppositeTo nurseDepartments Set(Patient) patients oppositeTo department } entity Patient{ Doctor doctor oppositeTo doctorPatients Department department oppositeTo patients Set(Referal) referredDoctors oppositeTo patient AllocationInfo allocation oppositeTo allocationPatient ContactInfo contact oppositeTo contactPatient AdministrativeInfo administrative oppositeTo administrativePatient MedicalInfo medical oppositeTo medicalPatient SocialInfo social oppositeTo socialPatient PublicInfo public oppositeTo publicPatient } entity AllocationInfo{ String floor String room Patient allocationPatient oppositeTo allocation } entity ContactInfo{ String namePatient String surnamePatient String gender LocalDateTime birthDate String address String id Patient contactPatient oppositeTo contact } entity AdministrativeInfo{ String insurance String accountNumber Patient administrativePatient oppositeTo administrative Set(Expense) expenses oppositeTo administrativeInfo } entity MedicalInfo{ Patient medicalPatient oppositeTo medical Set(MedicalCase) cases oppositeTo medicalInfo } entity SocialInfo{ String description Patient socialPatient oppositeTo social } entity PublicInfo{ String bloodType String allergies String diabetes String foodRestrictions String medicineRestrictions Patient publicPatient oppositeTo public } entity Expense{ String concept Integer amount LocalDateTime dateExpense AdministrativeInfo administrativeInfo oppositeTo expenses } entity MedicalCase{ LocalDateTime startDate LocalDateTime endDate String medicalDescription String medicalId MedicalInfo medicalInfo oppositeTo cases Set(EHR) eHRs oppositeTo medicalCase } entity EHR{ LocalDateTime date Professional createdBy oppositeTo createdEHRs MedicalCase medicalCase oppositeTo eHRs } enum Role { DEFAULT DIRECTOR ADMINISTRATIVE DOCTOR NURSE SYSTEM } entity Professional{ String user String password String name String surname Role role Nurse asNurse oppositeTo nurseProfessional Doctor asDoctor oppositeTo doctorProfessional Director asDirector oppositeTo directorProfessional Administrative asAdministrative oppositeTo administrativeProfessional /* A professional can work in more than one department, but just in one department of the same medical center. */ Set(MedicalCenter) worksIn oppositeTo employees Set(EHR) createdEHRs oppositeTo createdBy } entity Director{ Professional directorProfessional oppositeTo asDirector } entity Administrative{ Professional administrativeProfessional oppositeTo asAdministrative } entity Doctor{ String medicalLicense /* status: - unavailable - available */ String status Professional doctorProfessional oppositeTo asDoctor Set(Department) doctorDepartments oppositeTo doctors Set(Patient) doctorPatients oppositeTo doctor Set(Referal) referredPatients oppositeTo referred Set(Referal) referingPatients oppositeTo refering Doctor coveringDoctor oppositeTo substitutions Set(Doctor) substitutions oppositeTo coveringDoctor } entity Nurse{ String nursingLicense Professional nurseProfessional oppositeTo asNurse Set(Department) nurseDepartments oppositeTo nurses } entity Referal{ Doctor referred oppositeTo referredPatients Doctor refering oppositeTo referingPatients Patient patient oppositeTo referredDoctors }