Operations Workflows

Explore the end-to-end operational workflows demonstrating how clinical, financial, and diagnostic modules interact on the platform.

1. Patient OPD Visit (Walk-in)

This is the most common daily workflow — a patient visiting the clinic in person for a consultation.

sequenceDiagram actor Patient actor Receptionist actor Doctor actor Accountant rect rgb(240, 249, 255) note right of Patient: Registration & Intake Patient->>Receptionist: Arrives at clinic Receptionist->>Receptionist: add_patient (if new) Receptionist->>Receptionist: add_appointment (type: clinic, Status: Pending) end rect rgb(240, 253, 244) note right of Receptionist: Consultation Receptionist->>Doctor: appointment_checkin (Status: Visited) Doctor->>Doctor: add_prescription (Diagnosis, Medicines, Lab Tests) Doctor->>Doctor: update_appointment_status (Status: Completed) end rect rgb(254, 243, 199) note right of Accountant: Billing & Settlement Accountant->>Accountant: add_invoice (services + appointment fee) note over Accountant: Doctor income share auto-calculated Accountant->>Accountant: mark_paid_invoice (Status: Paid) Accountant-->>Patient: Print prescription & receipt PDFs end

2. Video Consultation (Telemedicine)

A remote digital workflow containing automated Zoom meeting creation and lifecycle triggers.

sequenceDiagram actor Patient participant API as ICARE API participant Zoom as Zoom API actor Doctor Patient->>API: add_appointment (type: video) API->>Zoom: OAuth authentication & Create Meeting Zoom-->>API: Returns meeting_id + join_url API-->>Patient: Sends booking confirmation + Join Link Note over Patient, Doctor: Notifications sent via FCM & Email Doctor->>API: update_appointment_status (Visited/In-Progress) note over Patient, Doctor: Video call consultation takes place Doctor->>API: add_prescription & Mark Completed API->>API: Automatically creates Invoice & Doctor Share

3. Lab Test Order Lifecycle

How laboratory test bookings are requested, processed, billed, and finalized.

flowchart TD A[Patient or Doctor orders tests] --> B[add_lab_test_cart] B --> C[add_lab_booking] C --> D[Lab staff confirms booking] D --> E[Patient sample collected] E --> F[Lab technicians update_pathology_sub_test results] F --> G[Accountant creates invoice & records payment] G --> H[Patient receives report PDF & submits lab review]

4. Clinic Onboarding (New Tenant Setup)

How a clinic goes from registration to active clinical operations.

flowchart TD A[Super Admin adds clinic] --> B[Create subscription request] B --> C[Approve subscription & invoice status: Paid] C --> D[Configure taxes, services, and rooms] D --> E[Add doctors & assign to departments] E --> F[Configure doctor consultation fees & income share percentages] F --> G[Create assistant & accounting staff accounts] G --> H[Clinic is fully operational]

5. SaaS Subscription Lifecycle

The billing and access control states mapping out active vs deactivated tenants.

stateDiagram-v2 [*] --> Created: Subscribe Triggered Created --> Active: Invoice Approved & Paid state Active { [*] --> NormalAccess NormalAccess: Full write and read operations } Active --> Expired: Lapsed Renewal Date state Expired { [*] --> GracePeriod GracePeriod: Read-only access (GET queries permitted) GracePeriod: Write actions blocked (POST/DELETE rejected) } Expired --> Deactivated: Admin suspends clinic Deactivated --> [*]: Access Terminated (Data Retained) Expired --> Active: Successful Renewal payment

6. Month-End Doctor Payout

How accounting tracks and settles doctor shares at the end of each billing cycle.

sequenceDiagram actor Accountant participant API as ICARE API Accountant->>API: GET pending doctor incomes list API-->>Accountant: Filtered pending incomes & summary totals Accountant->>Accountant: Select income items to settle Accountant->>API: POST add_doctor_payment (Record payout detail) API->>API: Mark selected income records as PAID API-->>Accountant: Settlement transaction finalized