# karishmasingh122/carepoint_his-be architecture

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

- Interactive diagram: https://gitdiagram.com/karishmasingh122/carepoint_his-be
- Repository: https://github.com/karishmasingh122/carepoint_his-be

## Overview

Carepoint is a hospital information system API covering patient records, clinical care, admissions, facility operations, billing, staff administration, and authentication; the tree also shows OneHcx integration. The likely user workflow is an authenticated staff member managing a patient’s care and related operational records through the API. Sampled service interfaces document the domain capabilities, while sampled authentication code shows token and cookie handling and OneHcx account flows. Most controllers and implementations were not excerpted, so links for those workflows are shown as unverified rather than asserted as observed calls.

Main entry points: [`src/main/java/com/suma/carepoint/controllers`](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/controllers) (REST API), [`src/main/java/com/suma/carepoint/services/auth/AuthService.java`](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/auth/AuthService.java) (Authentication), [`src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java) (OneHcx auth), [`src/main/java/com/suma/carepoint/services/organization`](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/organization) (Staff and departments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API access"]
  node_api["REST API"]
end

subgraph group_identity["Identity and integration"]
  node_auth_service["Authentication<br/>[AuthService.java]"]
  node_cookie_service["Auth cookies"]
  node_token_service["JWT tokens<br/>[TokenService.java]"]
  node_current_user["Current user"]
  node_onehcx_auth["OneHcx auth"]
end

subgraph group_care["Patient care"]
  node_patients["Patient records"]
  node_visits["Visits"]
  node_admissions["Admissions"]
  node_medical_records["Medical records"]
  node_diagnoses["Diagnoses"]
  node_medications["Medication and prescriptions"]
  node_procedures["Procedures and treatments"]
  node_documents["Clinical documents"]
  node_allergies["Allergies"]
  node_discharge["Discharge"]
end

subgraph group_operations["Hospital operations"]
  node_billing["Billing and payments"]
  node_bed_assignment["Bed assignments"]
  node_facility["Wards and rooms"]
  node_room_service["Room management"]
  node_staff_service["Staff and departments"]
  node_service_catalog["Service catalog"]
end

subgraph group_persistence["Persistence"]
  node_onehcx_accounts[("OneHcx accounts")]
  node_users[("User accounts")]
end

node_staff_actor(("Hospital staff"))
node_onehcx_provider["OneHcx provider"]

node_staff_actor -.->|"uses"| node_api
node_api -.->|"routes requests"| node_auth_service
node_api -.->|"routes requests"| node_patients
node_api -.->|"routes requests"| node_visits
node_api -.->|"routes requests"| node_admissions
node_api -.->|"routes requests"| node_medical_records
node_api -.->|"routes requests"| node_diagnoses
node_api -.->|"routes requests"| node_medications
node_api -.->|"routes requests"| node_procedures
node_api -.->|"routes requests"| node_documents
node_api -.->|"routes requests"| node_allergies
node_api -.->|"routes requests"| node_billing
node_api -.->|"routes requests"| node_bed_assignment
node_api -.->|"routes requests"| node_facility
node_api -.->|"routes requests"| node_room_service
node_api -.->|"routes requests"| node_staff_service
node_api -.->|"routes requests"| node_service_catalog
node_api -.->|"routes requests"| node_discharge
node_auth_service -->|"reads and writes"| node_cookie_service
node_auth_service -->|"issues and rotates"| node_token_service
node_auth_service -->|"logs out"| node_onehcx_auth
node_auth_service -->|"reads roles"| node_users
node_onehcx_auth -->|"reads and saves"| node_onehcx_accounts
node_onehcx_auth -->|"looks up staff"| node_staff_service
node_onehcx_auth -->|"gets identity"| node_current_user
node_onehcx_auth -->|"authenticates"| node_onehcx_provider

click node_api "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/controllers"
click node_auth_service "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/auth/AuthService.java"
click node_cookie_service "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/jwt/AuthCookieService.java"
click node_token_service "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/jwt/TokenService.java"
click node_current_user "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/CurrentUserService.java"
click node_onehcx_auth "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java"
click node_onehcx_accounts "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/repositories/onehcx/OneHcxAccountRepository.java"
click node_users "https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/repositories/auth/UserRepository.java"
click node_patients "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/patient"
click node_visits "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/visit"
click node_admissions "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/admission"
click node_medical_records "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medical_record"
click node_diagnoses "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/emr"
click node_medications "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medication"
click node_procedures "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/procedure"
click node_documents "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/document"
click node_allergies "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/allergy"
click node_billing "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/billing"
click node_bed_assignment "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/bed_assignment"
click node_facility "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/ward"
click node_room_service "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/rooms"
click node_staff_service "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/organization"
click node_service_catalog "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medical_service"
click node_discharge "https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/discharge"

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_api toneBlue
class node_auth_service,node_cookie_service,node_token_service,node_current_user,node_onehcx_auth toneAmber
class node_patients,node_visits,node_admissions,node_medical_records,node_diagnoses,node_medications,node_procedures,node_documents,node_allergies,node_discharge toneMint
class node_billing,node_bed_assignment,node_facility,node_room_service,node_staff_service,node_service_catalog toneRose
class node_onehcx_accounts,node_users,node_staff_actor,node_onehcx_provider toneIndigo
```

## Components

### API access

- [REST API](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/controllers): `src/main/java/com/suma/carepoint/controllers`

### Identity and integration

- [Authentication](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/auth/AuthService.java): `src/main/java/com/suma/carepoint/services/auth/AuthService.java`
- [Auth cookies](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/jwt/AuthCookieService.java): `src/main/java/com/suma/carepoint/security/jwt/AuthCookieService.java`
- [JWT tokens](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/jwt/TokenService.java): `src/main/java/com/suma/carepoint/security/jwt/TokenService.java`
- [Current user](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/security/CurrentUserService.java): `src/main/java/com/suma/carepoint/security/CurrentUserService.java`
- [OneHcx auth](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java): `src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`

### Patient care

- [Patient records](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/patient): `src/main/java/com/suma/carepoint/services/patient`
- [Visits](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/visit): `src/main/java/com/suma/carepoint/services/visit`
- [Admissions](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/admission): `src/main/java/com/suma/carepoint/services/admission`
- [Medical records](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medical_record): `src/main/java/com/suma/carepoint/services/medical_record`
- [Diagnoses](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/emr): `src/main/java/com/suma/carepoint/services/emr`
- [Medication and prescriptions](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medication): `src/main/java/com/suma/carepoint/services/medication`
- [Procedures and treatments](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/procedure): `src/main/java/com/suma/carepoint/services/procedure`
- [Clinical documents](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/document): `src/main/java/com/suma/carepoint/services/document`
- [Allergies](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/allergy): `src/main/java/com/suma/carepoint/services/allergy`
- [Discharge](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/discharge): `src/main/java/com/suma/carepoint/services/discharge`

### Hospital operations

- [Billing and payments](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/billing): `src/main/java/com/suma/carepoint/services/billing`
- [Bed assignments](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/bed_assignment): `src/main/java/com/suma/carepoint/services/bed_assignment`
- [Wards and rooms](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/ward): `src/main/java/com/suma/carepoint/services/ward`
- [Room management](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/rooms): `src/main/java/com/suma/carepoint/services/rooms`
- [Staff and departments](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/organization): `src/main/java/com/suma/carepoint/services/organization`
- [Service catalog](https://github.com/karishmasingh122/carepoint_his-be/tree/main/src/main/java/com/suma/carepoint/services/medical_service): `src/main/java/com/suma/carepoint/services/medical_service`

### Persistence

- [OneHcx accounts](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/repositories/onehcx/OneHcxAccountRepository.java): `src/main/java/com/suma/carepoint/repositories/onehcx/OneHcxAccountRepository.java`
- [User accounts](https://github.com/karishmasingh122/carepoint_his-be/blob/main/src/main/java/com/suma/carepoint/repositories/auth/UserRepository.java): `src/main/java/com/suma/carepoint/repositories/auth/UserRepository.java`

### Other components

- **Hospital staff**
- **OneHcx provider**

## Connections

- Hospital staff → REST API: uses
- REST API → Authentication: routes requests
- REST API → Patient records: routes requests
- REST API → Visits: routes requests
- REST API → Admissions: routes requests
- REST API → Medical records: routes requests
- REST API → Diagnoses: routes requests
- REST API → Medication and prescriptions: routes requests
- REST API → Procedures and treatments: routes requests
- REST API → Clinical documents: routes requests
- REST API → Allergies: routes requests
- REST API → Billing and payments: routes requests
- REST API → Bed assignments: routes requests
- REST API → Wards and rooms: routes requests
- REST API → Room management: routes requests
- REST API → Staff and departments: routes requests
- REST API → Service catalog: routes requests
- REST API → Discharge: routes requests
- Authentication → Auth cookies: reads and writes (evidence: `src/main/java/com/suma/carepoint/services/auth/AuthService.java`)
- Authentication → JWT tokens: issues and rotates (evidence: `src/main/java/com/suma/carepoint/services/auth/AuthService.java`)
- Authentication → OneHcx auth: logs out (evidence: `src/main/java/com/suma/carepoint/services/auth/AuthService.java`)
- Authentication → User accounts: reads roles (evidence: `src/main/java/com/suma/carepoint/services/auth/AuthService.java`)
- OneHcx auth → OneHcx accounts: reads and saves (evidence: `src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`)
- OneHcx auth → Staff and departments: looks up staff (evidence: `src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`)
- OneHcx auth → Current user: gets identity (evidence: `src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`)
- OneHcx auth → OneHcx provider: authenticates (evidence: `src/main/java/com/suma/carepoint/services/onehcx/auth/OneHcxAuthService.java`)
