# ess-llp/healthcare architecture

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

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

## Overview

Frappe Healthcare is a hospital information system app for ERPNext/Frappe. Its user-facing scope spans patient records and appointments, outpatient and inpatient care, diagnostics, procedures, rehabilitation, and reporting. The README documents those capabilities, but does not establish a single mandatory sequence among them, so the graph shows them as parallel care workflows. The sampled sources confirm selected links through shared settings and utility code; unsampled feature modules are represented at their existing directories, with no speculative call chains.

Main entry points: [`healthcare/healthcare/utils.py`](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/utils.py) (Billing & workflow utilities), [`healthcare/healthcare/doctype/patient_appointment/patient_appointment.py`](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py) (Appointments), [`healthcare/healthcare/doctype/patient/patient.py`](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient/patient.py) (Patient records), [`healthcare/healthcare/doctype/inpatient_record`](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/inpatient_record) (Inpatient care)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Patient Care"]
  node_patient["Patient records<br/>[patient.py]"]
  node_appointments["Appointments"]
  node_encounters["Patient encounters"]
  node_inpatient["Inpatient care"]
end

subgraph group_clinical["Clinical Services"]
  node_lab["Laboratory"]
  node_procedures["Clinical procedures"]
  node_rehab["Rehabilitation<br/>[therapy_session.py]"]
  node_prescriptions["Medication orders"]
  node_medical_codes["Medical code standards"]
end

subgraph group_operations["Facility Operations"]
  node_facility["Service units"]
  node_practitioners["Practitioners &amp; departments"]
end

subgraph group_insight["Records &amp; Insight"]
  node_history["Patient history<br/>[patient_history.py]"]
  node_reports["Reports &amp; analytics"]
end

subgraph group_shared["Shared Application Layer"]
  node_settings["Healthcare settings"]
  node_utils["Billing &amp; workflow utilities<br/>[utils.py]"]
end

node_clinician(("Healthcare staff"))
node_erpnext["ERPNext"]
node_frappe["Frappe framework"]
node_healthcare_app["Frappe Healthcare"]

node_clinician -->|"manages records"| node_patient
node_clinician -->|"manages visits"| node_appointments
node_clinician -->|"records care"| node_encounters
node_clinician -->|"manages admissions"| node_inpatient
node_clinician -->|"orders diagnostics"| node_lab
node_clinician -->|"manages procedures"| node_procedures
node_clinician -->|"plans rehabilitation"| node_rehab
node_clinician -->|"manages medication"| node_prescriptions
node_clinician -->|"configures standards"| node_medical_codes
node_clinician -->|"maps facilities"| node_facility
node_clinician -->|"configures specialties"| node_practitioners
node_clinician -->|"reviews analytics"| node_reports
node_appointments -->|"uses billing helpers"| node_utils
node_utils -->|"reads configuration"| node_settings
node_utils -->|"reads appointment types"| node_appointments
node_utils -->|"reads lab tests"| node_lab
node_patient -->|"reads configuration"| node_settings
node_inpatient -.->|"records medication"| node_prescriptions
node_healthcare_app -->|"integrates with"| node_erpnext
node_healthcare_app -->|"built on"| node_frappe

click node_patient "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient/patient.py"
click node_appointments "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py"
click node_encounters "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/patient_encounter"
click node_inpatient "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/inpatient_record"
click node_history "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/page/patient_history/patient_history.py"
click node_lab "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/lab_test_template"
click node_procedures "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/clinical_procedure"
click node_rehab "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/therapy_session/therapy_session.py"
click node_prescriptions "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py"
click node_medical_codes "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/medical_code"
click node_facility "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py"
click node_practitioners "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/healthcare_practitioner"
click node_reports "https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/report"
click node_settings "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/healthcare_settings/healthcare_settings.py"
click node_utils "https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/utils.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_patient,node_appointments,node_encounters,node_inpatient toneBlue
class node_lab,node_procedures,node_rehab,node_prescriptions,node_medical_codes toneAmber
class node_facility,node_practitioners toneMint
class node_history,node_reports toneRose
class node_settings,node_utils,node_clinician,node_erpnext,node_frappe,node_healthcare_app toneIndigo
```

## Components

### Patient Care

- [Patient records](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient/patient.py): `healthcare/healthcare/doctype/patient/patient.py`
- [Appointments](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py): `healthcare/healthcare/doctype/patient_appointment/patient_appointment.py`
- [Patient encounters](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/patient_encounter): `healthcare/healthcare/doctype/patient_encounter`
- [Inpatient care](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/inpatient_record): `healthcare/healthcare/doctype/inpatient_record`

### Clinical Services

- [Laboratory](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/lab_test_template): `healthcare/healthcare/doctype/lab_test_template`
- [Clinical procedures](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/clinical_procedure): `healthcare/healthcare/doctype/clinical_procedure`
- [Rehabilitation](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/therapy_session/therapy_session.py): `healthcare/healthcare/doctype/therapy_session/therapy_session.py`
- [Medication orders](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py): `healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py`
- [Medical code standards](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/medical_code): `healthcare/healthcare/doctype/medical_code`

### Facility Operations

- [Service units](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py): `healthcare/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py`
- [Practitioners & departments](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/doctype/healthcare_practitioner): `healthcare/healthcare/doctype/healthcare_practitioner`

### Records & Insight

- [Patient history](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/page/patient_history/patient_history.py): `healthcare/healthcare/page/patient_history/patient_history.py`
- [Reports & analytics](https://github.com/ess-llp/healthcare/tree/develop/healthcare/healthcare/report): `healthcare/healthcare/report`

### Shared Application Layer

- [Healthcare settings](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/doctype/healthcare_settings/healthcare_settings.py): `healthcare/healthcare/doctype/healthcare_settings/healthcare_settings.py`
- [Billing & workflow utilities](https://github.com/ess-llp/healthcare/blob/develop/healthcare/healthcare/utils.py): `healthcare/healthcare/utils.py`

### Other components

- **Healthcare staff**
- **ERPNext**
- **Frappe framework**
- **Frappe Healthcare**

## Connections

- Healthcare staff → Patient records: manages records
- Healthcare staff → Appointments: manages visits
- Healthcare staff → Patient encounters: records care
- Healthcare staff → Inpatient care: manages admissions
- Healthcare staff → Laboratory: orders diagnostics
- Healthcare staff → Clinical procedures: manages procedures
- Healthcare staff → Rehabilitation: plans rehabilitation
- Healthcare staff → Medication orders: manages medication
- Healthcare staff → Medical code standards: configures standards
- Healthcare staff → Service units: maps facilities
- Healthcare staff → Practitioners & departments: configures specialties
- Healthcare staff → Reports & analytics: reviews analytics
- Appointments → Billing & workflow utilities: uses billing helpers (evidence: `healthcare/healthcare/doctype/patient_appointment/patient_appointment.py`)
- Billing & workflow utilities → Healthcare settings: reads configuration (evidence: `healthcare/healthcare/utils.py`)
- Billing & workflow utilities → Appointments: reads appointment types (evidence: `healthcare/healthcare/utils.py`)
- Billing & workflow utilities → Laboratory: reads lab tests (evidence: `healthcare/healthcare/utils.py`)
- Patient records → Healthcare settings: reads configuration (evidence: `healthcare/healthcare/doctype/patient/patient.py`)
- Inpatient care → Medication orders: records medication
- Frappe Healthcare → ERPNext: integrates with
- Frappe Healthcare → Frappe framework: built on
