# healthcare-shiraa/healthcare-demo architecture

> Architecture diagram of the GitHub repository healthcare-shiraa/healthcare-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/healthcare-shiraa/healthcare-demo
- Repository: https://github.com/healthcare-shiraa/healthcare-demo

## Overview

هذا نموذج تعليمي لسير عمل سلامة الدواء، ببيانات اصطناعية لاستخدام الاختبار، وليس نظامًا سريريًا معتمدًا. يبدأ المستخدم بتسجيل الدخول ثم يوجّه التطبيق كل دور إلى شاشته: التسجيل يدير المرضى والحساسية، والطبيب ينشئ وصفة تُفحص بالقواعد وتُرسل للصيدلي، ثم يراجعها الصيدلي، ويوثّق الممرض الإعطاء أو عدمه والإحالات. تشمل الطبقات الداخلية بيانات المرجع والإعدادات، والتخزين، والصلاحيات والتدقيق. الروابط مستندة إلى README وفهرس المصادر؛ لم تُفحص كل الشيفرات.

Main entry points: [`hc/prescriptions.py`](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/prescriptions.py) (الوصفات الدوائية), [`app.py`](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/app.py) (تطبيق Streamlit), [`hc/administration.py`](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/administration.py) (توثيق الإعطاء), [`hc/audit.py`](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/audit.py) (سجل التدقيق)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["واجهات الأدوار"]
  node_app["تطبيق Streamlit<br/>[app.py]"]
  node_ui_common["مكونات مشتركة<br/>[common.py]"]
  node_ui_registration["واجهة التسجيل<br/>[registration.py]"]
  node_ui_doctor["واجهة الطبيب<br/>[doctor.py]"]
  node_ui_pharmacist["واجهة الصيدلي<br/>[pharmacist.py]"]
  node_ui_nurse["واجهة الممرض<br/>[nurse.py]"]
  node_theme["نظام التصميم<br/>[theme.py]"]
end

subgraph group_workflow["دورة الدواء"]
  node_patients["إدارة المرضى<br/>[patients.py]"]
  node_prescriptions["الوصفات الدوائية<br/>[prescriptions.py]"]
  node_rules["محرك القواعد<br/>[rules.py]"]
  node_review["مراجعة الصيدلي<br/>[review.py]"]
  node_administration["توثيق الإعطاء<br/>[administration.py]"]
  node_doses["جدولة الجرعات<br/>[doses.py]"]
end

subgraph group_domain["بيانات وضوابط"]
  node_reference[("البيانات المرجعية<br/>[reference.py]")]
  node_access["فحص الصلاحيات<br/>[access.py]"]
  node_auth["الدخول والجلسات<br/>[auth.py]"]
  node_audit[("سجل التدقيق<br/>[audit.py]")]
end

subgraph group_platform["أساس التطبيق"]
  node_config["إعدادات البيئة<br/>[config.py]"]
  node_db["اتصال قاعدة البيانات<br/>[db.py]"]
  node_timefmt["التوقيت والعرض<br/>[timefmt.py]"]
end

node_user(("مستخدمو المستشفى"))

node_user -->|"يستخدم"| node_app
node_app -->|"يدير الدخول"| node_auth
node_app -->|"يحمّل الإعدادات"| node_config
node_app -->|"يوجّه إلى"| node_ui_registration
node_app -->|"يوجّه إلى"| node_ui_doctor
node_app -->|"يوجّه إلى"| node_ui_pharmacist
node_app -->|"يوجّه إلى"| node_ui_nurse
node_app -->|"يستخدم"| node_ui_common
node_app -->|"يستخدم"| node_theme
node_ui_registration -->|"يدير المرضى"| node_patients
node_ui_doctor -->|"يختار المرضى"| node_patients
node_ui_doctor -->|"ينشئ الوصفات"| node_prescriptions
node_ui_pharmacist -->|"يعرض الوصفات"| node_prescriptions
node_ui_pharmacist -->|"يراجع الوصفات"| node_review
node_ui_nurse -->|"يوثق الإعطاء"| node_administration
node_ui_nurse -->|"يعرض الوصفات"| node_prescriptions
node_ui_common -->|"يعرض المكونات"| node_theme
node_prescriptions -->|"يفحص بالقواعد"| node_rules
node_prescriptions -->|"يقرأ البيانات"| node_reference
node_prescriptions -->|"يستخدم الجرعات"| node_doses
node_review -->|"يعيد الفحص"| node_prescriptions
node_review -->|"يفحص بالقواعد"| node_rules
node_administration -->|"يتحقق من الجرعات"| node_doses
node_administration -->|"يتحقق من التنبيهات"| node_rules
node_administration -->|"يقرأ الإعدادات"| node_reference
node_prescriptions -->|"يعالج التوقيت"| node_timefmt
node_doses -->|"يعالج التوقيت"| node_timefmt
node_access -->|"يتحقق من المستخدم"| node_auth
node_auth -->|"يسجل الدخول"| node_audit
node_patients -->|"يسجل العمليات"| node_audit
node_prescriptions -->|"يسجل العمليات"| node_audit
node_administration -->|"يسجل العمليات"| node_audit
node_audit -->|"يكتب القيود"| node_db
node_patients -->|"يقرأ ويكتب"| node_db
node_prescriptions -->|"يقرأ ويكتب"| node_db
node_rules -->|"يقرأ ويكتب"| node_db
node_reference -->|"يقرأ ويكتب"| node_db

click node_app "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/app.py"
click node_ui_common "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/common.py"
click node_ui_registration "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/registration.py"
click node_ui_doctor "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/doctor.py"
click node_ui_pharmacist "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/pharmacist.py"
click node_ui_nurse "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/nurse.py"
click node_theme "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/theme.py"
click node_patients "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/patients.py"
click node_prescriptions "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/prescriptions.py"
click node_rules "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/rules.py"
click node_review "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/review.py"
click node_administration "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/administration.py"
click node_doses "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/doses.py"
click node_reference "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/reference.py"
click node_access "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/access.py"
click node_auth "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/auth.py"
click node_audit "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/audit.py"
click node_config "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/config.py"
click node_db "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/db.py"
click node_timefmt "https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/timefmt.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_ui_common,node_ui_registration,node_ui_doctor,node_ui_pharmacist,node_ui_nurse,node_theme toneBlue
class node_patients,node_prescriptions,node_rules,node_review,node_administration,node_doses toneAmber
class node_reference,node_access,node_auth,node_audit toneMint
class node_config,node_db,node_timefmt toneRose
class node_user toneIndigo
```

## Components

### واجهات الأدوار

- [تطبيق Streamlit](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/app.py): `app.py`
- [مكونات مشتركة](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/common.py): `hc/ui/common.py`
- [واجهة التسجيل](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/registration.py): `hc/ui/registration.py`
- [واجهة الطبيب](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/doctor.py): `hc/ui/doctor.py`
- [واجهة الصيدلي](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/pharmacist.py): `hc/ui/pharmacist.py`
- [واجهة الممرض](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/nurse.py): `hc/ui/nurse.py`
- [نظام التصميم](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/ui/theme.py): `hc/ui/theme.py`

### دورة الدواء

- [إدارة المرضى](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/patients.py): `hc/patients.py`
- [الوصفات الدوائية](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/prescriptions.py): `hc/prescriptions.py`
- [محرك القواعد](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/rules.py): `hc/rules.py`
- [مراجعة الصيدلي](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/review.py): `hc/review.py`
- [توثيق الإعطاء](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/administration.py): `hc/administration.py`
- [جدولة الجرعات](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/doses.py): `hc/doses.py`

### بيانات وضوابط

- [البيانات المرجعية](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/reference.py): `hc/reference.py`
- [فحص الصلاحيات](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/access.py): `hc/access.py`
- [الدخول والجلسات](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/auth.py): `hc/auth.py`
- [سجل التدقيق](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/audit.py): `hc/audit.py`

### أساس التطبيق

- [إعدادات البيئة](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/config.py): `hc/config.py`
- [اتصال قاعدة البيانات](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/db.py): `hc/db.py`
- [التوقيت والعرض](https://github.com/healthcare-shiraa/healthcare-demo/blob/main/hc/timefmt.py): `hc/timefmt.py`

### Other components

- **مستخدمو المستشفى**

## Connections

- مستخدمو المستشفى → تطبيق Streamlit: يستخدم (evidence: `README.md`)
- تطبيق Streamlit → الدخول والجلسات: يدير الدخول (evidence: `app.py`)
- تطبيق Streamlit → إعدادات البيئة: يحمّل الإعدادات (evidence: `app.py`)
- تطبيق Streamlit → واجهة التسجيل: يوجّه إلى (evidence: `app.py`)
- تطبيق Streamlit → واجهة الطبيب: يوجّه إلى (evidence: `app.py`)
- تطبيق Streamlit → واجهة الصيدلي: يوجّه إلى (evidence: `app.py`)
- تطبيق Streamlit → واجهة الممرض: يوجّه إلى (evidence: `app.py`)
- تطبيق Streamlit → مكونات مشتركة: يستخدم (evidence: `app.py`)
- تطبيق Streamlit → نظام التصميم: يستخدم (evidence: `app.py`)
- واجهة التسجيل → إدارة المرضى: يدير المرضى (evidence: `hc/ui/registration.py`)
- واجهة الطبيب → إدارة المرضى: يختار المرضى (evidence: `hc/ui/doctor.py`)
- واجهة الطبيب → الوصفات الدوائية: ينشئ الوصفات (evidence: `hc/ui/doctor.py`)
- واجهة الصيدلي → الوصفات الدوائية: يعرض الوصفات (evidence: `hc/ui/pharmacist.py`)
- واجهة الصيدلي → مراجعة الصيدلي: يراجع الوصفات (evidence: `hc/ui/pharmacist.py`)
- واجهة الممرض → توثيق الإعطاء: يوثق الإعطاء (evidence: `hc/ui/nurse.py`)
- واجهة الممرض → الوصفات الدوائية: يعرض الوصفات (evidence: `hc/ui/nurse.py`)
- مكونات مشتركة → نظام التصميم: يعرض المكونات (evidence: `hc/ui/common.py`)
- الوصفات الدوائية → محرك القواعد: يفحص بالقواعد (evidence: `hc/prescriptions.py`)
- الوصفات الدوائية → البيانات المرجعية: يقرأ البيانات (evidence: `hc/prescriptions.py`)
- الوصفات الدوائية → جدولة الجرعات: يستخدم الجرعات (evidence: `hc/prescriptions.py`)
- مراجعة الصيدلي → الوصفات الدوائية: يعيد الفحص (evidence: `hc/review.py`)
- مراجعة الصيدلي → محرك القواعد: يفحص بالقواعد (evidence: `hc/review.py`)
- توثيق الإعطاء → جدولة الجرعات: يتحقق من الجرعات (evidence: `hc/administration.py`)
- توثيق الإعطاء → محرك القواعد: يتحقق من التنبيهات (evidence: `hc/administration.py`)
- توثيق الإعطاء → البيانات المرجعية: يقرأ الإعدادات (evidence: `hc/administration.py`)
- الوصفات الدوائية → التوقيت والعرض: يعالج التوقيت (evidence: `hc/prescriptions.py`)
- جدولة الجرعات → التوقيت والعرض: يعالج التوقيت (evidence: `hc/doses.py`)
- فحص الصلاحيات → الدخول والجلسات: يتحقق من المستخدم (evidence: `hc/access.py`)
- الدخول والجلسات → سجل التدقيق: يسجل الدخول (evidence: `hc/auth.py`)
- إدارة المرضى → سجل التدقيق: يسجل العمليات (evidence: `hc/patients.py`)
- الوصفات الدوائية → سجل التدقيق: يسجل العمليات (evidence: `hc/prescriptions.py`)
- توثيق الإعطاء → سجل التدقيق: يسجل العمليات (evidence: `hc/administration.py`)
- سجل التدقيق → اتصال قاعدة البيانات: يكتب القيود (evidence: `hc/audit.py`)
- إدارة المرضى → اتصال قاعدة البيانات: يقرأ ويكتب (evidence: `hc/patients.py`)
- الوصفات الدوائية → اتصال قاعدة البيانات: يقرأ ويكتب (evidence: `hc/prescriptions.py`)
- محرك القواعد → اتصال قاعدة البيانات: يقرأ ويكتب (evidence: `hc/rules.py`)
- البيانات المرجعية → اتصال قاعدة البيانات: يقرأ ويكتب (evidence: `hc/reference.py`)
