# dhyeyfarasram/healthcare architecture

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

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

## Overview

This is an Odoo hospital/patient-management module. Patients use the portal to browse appointments, submit a booking, pay, view visit details, cancel, and download receipts. Clinical records center on visits, with prescriptions and follow-ups; patient profiles hold medical history. Doctors are organized by department, and the module extends Odoo users and payments. The tree and manifest also show administrative views, access rules, scheduled-job configuration, and a visit report. Several of those implementations were not sampled, so their runtime links are omitted rather than inferred.

Main entry points: [`models/patient_visit.py`](https://github.com/dhyeyfarasram/healthcare/blob/main/models/patient_visit.py) (Patient Visits), [`controllers/portal.py`](https://github.com/dhyeyfarasram/healthcare/blob/main/controllers/portal.py) (Portal Workflows), [`models/res_partner.py`](https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_partner.py) (Patient Profile), [`models/res_users.py`](https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_users.py) (Doctor Accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Patient Portal"]
  node_portal["Portal Workflows<br/>[portal.py]"]
  node_portal_templates["Portal Pages"]
end

subgraph group_clinical["Clinical Records"]
  node_visit[("Patient Visits<br/>[patient_visit.py]")]
  node_profile[("Patient Profile<br/>[res_partner.py]")]
  node_prescription[("Prescription Lines")]
  node_followup[("Follow-ups<br/>[follow_up.py]")]
end

subgraph group_directory["Care Team"]
  node_department[("Departments")]
  node_doctors[("Doctor Accounts<br/>[res_users.py]")]
end

subgraph group_admin["Administration &amp; Reporting"]
  node_patient_views["Patient Views<br/>[patient_views.xml]"]
  node_history_views["Medical History Views"]
  node_department_views["Department Views"]
  node_navigation["Patient Navigation<br/>[patient_menu.xml]"]
  node_scheduled_jobs["Scheduled Jobs<br/>[cron.xml]"]
  node_visit_report["Visit Report"]
  node_access_rules["Access Controls"]
  node_record_rules["Record Rules<br/>[ir.rules.xml]"]
  node_role_groups["Role Groups<br/>[res.groups.xml]"]
end

subgraph group_integration["Odoo Extensions"]
  node_payment_extension[("Visit Payment Link<br/>[account_payment.py]")]
end

node_patient(("Patient"))
node_accounting["Odoo Accounting"]
node_mail_server["SMTP Mail Server"]

node_patient -->|"uses"| node_portal
node_portal -->|"creates and reads"| node_visit
node_portal -->|"updates status"| node_visit
node_portal -->|"searches"| node_department
node_portal -->|"selects doctors"| node_doctors
node_portal -->|"renders"| node_portal_templates
node_visit -->|"owns lines"| node_prescription
node_visit -->|"owns follow-ups"| node_followup
node_visit -->|"reads history"| node_profile
node_profile -->|"links visits"| node_visit
node_profile -->|"links payments"| node_payment_extension
node_doctors -->|"belongs to"| node_department
node_payment_extension -->|"extends"| node_accounting
node_visit -->|"sends email"| node_mail_server

click node_portal "https://github.com/dhyeyfarasram/healthcare/blob/main/controllers/portal.py"
click node_visit "https://github.com/dhyeyfarasram/healthcare/blob/main/models/patient_visit.py"
click node_profile "https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_partner.py"
click node_prescription "https://github.com/dhyeyfarasram/healthcare/blob/main/models/patient_prescription_line.py"
click node_followup "https://github.com/dhyeyfarasram/healthcare/blob/main/models/follow_up.py"
click node_department "https://github.com/dhyeyfarasram/healthcare/blob/main/models/doctor_department.py"
click node_doctors "https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_users.py"
click node_payment_extension "https://github.com/dhyeyfarasram/healthcare/blob/main/models/account_payment.py"
click node_portal_templates "https://github.com/dhyeyfarasram/healthcare/blob/main/views/portal_template.xml"
click node_patient_views "https://github.com/dhyeyfarasram/healthcare/blob/main/views/patient_views.xml"
click node_history_views "https://github.com/dhyeyfarasram/healthcare/blob/main/views/medical_history.xml"
click node_department_views "https://github.com/dhyeyfarasram/healthcare/blob/main/views/doctor_department.xml"
click node_navigation "https://github.com/dhyeyfarasram/healthcare/blob/main/views/patient_menu.xml"
click node_scheduled_jobs "https://github.com/dhyeyfarasram/healthcare/blob/main/views/cron.xml"
click node_visit_report "https://github.com/dhyeyfarasram/healthcare/blob/main/report/patient_visit_report.xml"
click node_access_rules "https://github.com/dhyeyfarasram/healthcare/blob/main/security/ir.model.access.csv"
click node_record_rules "https://github.com/dhyeyfarasram/healthcare/blob/main/security/ir.rules.xml"
click node_role_groups "https://github.com/dhyeyfarasram/healthcare/blob/main/security/res.groups.xml"

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_portal,node_portal_templates toneBlue
class node_visit,node_profile,node_prescription,node_followup toneAmber
class node_department,node_doctors,node_mail_server toneMint
class node_patient_views,node_history_views,node_department_views,node_navigation,node_scheduled_jobs,node_visit_report,node_access_rules,node_record_rules,node_role_groups toneRose
class node_payment_extension,node_patient,node_accounting toneIndigo
```

## Components

### Patient Portal

- [Portal Workflows](https://github.com/dhyeyfarasram/healthcare/blob/main/controllers/portal.py): `controllers/portal.py`
- [Portal Pages](https://github.com/dhyeyfarasram/healthcare/blob/main/views/portal_template.xml): `views/portal_template.xml`

### Clinical Records

- [Patient Visits](https://github.com/dhyeyfarasram/healthcare/blob/main/models/patient_visit.py): `models/patient_visit.py`
- [Patient Profile](https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_partner.py): `models/res_partner.py`
- [Prescription Lines](https://github.com/dhyeyfarasram/healthcare/blob/main/models/patient_prescription_line.py): `models/patient_prescription_line.py`
- [Follow-ups](https://github.com/dhyeyfarasram/healthcare/blob/main/models/follow_up.py): `models/follow_up.py`

### Care Team

- [Departments](https://github.com/dhyeyfarasram/healthcare/blob/main/models/doctor_department.py): `models/doctor_department.py`
- [Doctor Accounts](https://github.com/dhyeyfarasram/healthcare/blob/main/models/res_users.py): `models/res_users.py`

### Administration & Reporting

- [Patient Views](https://github.com/dhyeyfarasram/healthcare/blob/main/views/patient_views.xml): `views/patient_views.xml`
- [Medical History Views](https://github.com/dhyeyfarasram/healthcare/blob/main/views/medical_history.xml): `views/medical_history.xml`
- [Department Views](https://github.com/dhyeyfarasram/healthcare/blob/main/views/doctor_department.xml): `views/doctor_department.xml`
- [Patient Navigation](https://github.com/dhyeyfarasram/healthcare/blob/main/views/patient_menu.xml): `views/patient_menu.xml`
- [Scheduled Jobs](https://github.com/dhyeyfarasram/healthcare/blob/main/views/cron.xml): `views/cron.xml`
- [Visit Report](https://github.com/dhyeyfarasram/healthcare/blob/main/report/patient_visit_report.xml): `report/patient_visit_report.xml`
- [Access Controls](https://github.com/dhyeyfarasram/healthcare/blob/main/security/ir.model.access.csv): `security/ir.model.access.csv`
- [Record Rules](https://github.com/dhyeyfarasram/healthcare/blob/main/security/ir.rules.xml): `security/ir.rules.xml`
- [Role Groups](https://github.com/dhyeyfarasram/healthcare/blob/main/security/res.groups.xml): `security/res.groups.xml`

### Odoo Extensions

- [Visit Payment Link](https://github.com/dhyeyfarasram/healthcare/blob/main/models/account_payment.py): `models/account_payment.py`

### Other components

- **Patient**
- **Odoo Accounting**
- **SMTP Mail Server**

## Connections

- Patient → Portal Workflows: uses (evidence: `controllers/portal.py`)
- Portal Workflows → Patient Visits: creates and reads (evidence: `controllers/portal.py`)
- Portal Workflows → Patient Visits: updates status (evidence: `controllers/portal.py`)
- Portal Workflows → Departments: searches (evidence: `controllers/portal.py`)
- Portal Workflows → Doctor Accounts: selects doctors (evidence: `controllers/portal.py`)
- Portal Workflows → Portal Pages: renders (evidence: `controllers/portal.py`)
- Patient Visits → Prescription Lines: owns lines (evidence: `models/patient_visit.py`)
- Patient Visits → Follow-ups: owns follow-ups (evidence: `models/patient_visit.py`)
- Patient Visits → Patient Profile: reads history (evidence: `models/patient_visit.py`)
- Patient Profile → Patient Visits: links visits (evidence: `models/res_partner.py`)
- Patient Profile → Visit Payment Link: links payments (evidence: `models/res_partner.py`)
- Doctor Accounts → Departments: belongs to (evidence: `models/doctor_department.py`)
- Visit Payment Link → Odoo Accounting: extends (evidence: `models/account_payment.py`)
- Patient Visits → SMTP Mail Server: sends email (evidence: `models/patient_visit.py`)
