Business Flows Overview
Business flows describe what happens in the second-opinion service from a domain perspective — who does what, and in what order. For HTTP requests and system integrations, see API Flows.
Core actors
Section titled “Core actors”| Actor | Role |
|---|---|
| Patient | Submits a case, uploads documents, pays, and views the final report |
| Case coordinator | Oversees the case, assigns specialist doctors, and submits the final summary |
| Specialist doctor | Reviews the case, may request more documents, and submits a medical opinion |
| Admin | Configures review types and disease categories, assigns coordinators, and manages cases |
| Scheduled jobs | Sends automated reminders (e.g. draft cases left unfinished, overdue reports) |
Key flows
Section titled “Key flows”| Flow | Description |
|---|---|
| Case lifecycle | How a case moves from creation to completion, cancellation, or rejection |
| Payment | How payment is initiated and what happens after success or failure |
| Assignment | How coordinators and specialist doctors are assigned |
| Cancellation & rejection | Patient/admin cancel, admin reject, refunds |
| Notifications | Draft reminders and overdue-report alerts |
| Admin configuration | Review types, disease categories, coordinator setup |
End-to-end flow
Section titled “End-to-end flow”The complete journey from case creation to report delivery:
flowchart TD
subgraph PT["Patient"]
A[Browse review types & disease categories]
B[Create case — save as draft]
C[Upload medical documents]
D[Submit case for review]
D2[Pay via payment link]
C2[Upload requested documents]
R[View final report]
end
subgraph AD["Admin"]
H[Assign case coordinator — payment link sent to patient]
end
subgraph CO["Case coordinator"]
I[Review case]
J[Assign specialist doctors]
P[Submit final coordinator summary]
end
subgraph DR["Specialist doctors"]
K[Review case & documents]
L{Need more documents?}
M[Request documents from patient]
N[Submit medical opinion]
end
E{Payment result}
F[Payment successful]
G[Payment failed]
O[Final PDF report prepared]
Q[Case completed]
A --> B --> C --> D --> H --> D2 --> E
E -->|success| F
E -->|failed| G
F --> I --> J --> K --> L
L -->|yes| M --> C2 --> K
L -->|no| N --> P --> Q --> O --> R
Coordinator assignment triggers payment. Once the admin assigns a coordinator, the patient receives a payment link and an in-app prompt to proceed to pay.
Completion triggers the report. When the coordinator submits the final summary, the case is marked complete and the PDF report is generated for the patient.
Not shown above: the patient may cancel an active case (a refund is processed automatically if payment was already taken). The admin may cancel or reject a case with a reason. See Case lifecycle for all stages and outcomes.
External systems
Section titled “External systems”The Second Opinion service connects to other Sanar platforms:
flowchart LR SOP[Second Opinion service] Profiles[User & doctor profiles] Pay[Payment platform] Notify[Push notifications] Reports[Report PDF generation] SOP --> Profiles SOP --> Pay SOP --> Notify SOP --> Reports
| System | Used for |
|---|---|
| User & doctor profiles | Patient and doctor details, departments, invoice creation |
| Payment platform | Payment links and payment outcome callbacks |
| Push notifications | Alerts to patients, coordinators, and doctors |
| Report PDF generation | Building the final downloadable report |