== Entity Relationship Diagram == ER дијаграмот ја прикажува структурата на податоците во апликацијата **Reportium**. Преку него се дефинираат ентитетите, нивните атрибути, како и релациите помеѓу нив. Овој дијаграм служи како основна водилка за дизајнирање на базата на податоци. [[Image(er_diagram_reportium.jpg, align=center)]] == Податочни побарувања == === Ентитети === ==== Strong Entities ==== 1. Person * **Primary Key (PK):** person_id * **Attributes:** * name * surname * address * gender * date_of_birth * contact_phone * is_alive * is_stub 2. Institution * **Primary Key (PK):** institution_id * **Attributes:** * name * address * type * year_established * city 3. Report * **Primary Key (PK):** report_id * **Attributes: * report_type * date * notes * person_id (Foreign Key) 4. !CrimeType * **Primary Key (PK):** crime_type_id * **Attributes:** * label * severity_level 5. Punishment * **Primary Key (PK):** punishment_id * **Attributes:** * value * value_unit * punishment_type 6. Diagnosis * **Primary Key (PK):** diagnosis_id * **Attributes:** * description * therapy * severity * is_chronic 7. Doctor * **Primary Key (PK):** doctor_id * **Attributes:** * surname * years_of_experience * specialization * name * is_active 8. Role * **Primary Key (PK):** role_id * **Attributes:** * role_name * description ==== Weak Entities ==== 1. !FilterSession * **Primary Key (PK):** session_id * **Attributes:** * filter_description * searched_at * user_id (Foreign Key) 2. !ReportiumUser * **Primary Key (PK):** reportium_user_id * **Attributes:** * password_hash * is_active * email * surname 3. !UserProfile * **Primary Key (PK):** profile_id * **Attributes:** * profile_created_at * user_id (Foreign Key) * username * has_fs_own * has_fs_stored 4. !UserProfileLog * **Primary Key (PK):** log_id * **Attributes:** * change_description * profile_id (Foreign Key) * changed_at 5. !ExportLog * **Primary Key (PK):** export_id * **Additional Attributes:** * export_date * export_format * filter_summary * file_name * session_id (Foreign Key) ==== Report Subtypes ==== 1. !AcademicReport * **Primary Key (PK):** report_id (inherited) * **Additional Attributes:** * field * description 2. !CriminalReport * **Primary Key (PK):** report_id (inherited) * **Additional Attributes:** * location * resolved * from_type 3. !MedicalReport * **Primary Key (PK):** report_id (inherited) * **Additional Attributes:** * doctor_surname * next_control_date 4. !EmploymentReport * **Primary Key (PK):** report_id (inherited) * **Additional Attributes:** * position_description * start_date * end_date * income_per_month