Skip to content

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.

ActorRole
PatientSubmits a case, uploads documents, pays, and views the final report
Case coordinatorOversees the case, assigns specialist doctors, and submits the final summary
Specialist doctorReviews the case, may request more documents, and submits a medical opinion
AdminConfigures review types and disease categories, assigns coordinators, and manages cases
Scheduled jobsSends automated reminders (e.g. draft cases left unfinished, overdue reports)
FlowDescription
Case lifecycleHow a case moves from creation to completion, cancellation, or rejection
PaymentHow payment is initiated and what happens after success or failure
AssignmentHow coordinators and specialist doctors are assigned
Cancellation & rejectionPatient/admin cancel, admin reject, refunds
NotificationsDraft reminders and overdue-report alerts
Admin configurationReview types, disease categories, coordinator setup

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.

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
SystemUsed for
User & doctor profilesPatient and doctor details, departments, invoice creation
Payment platformPayment links and payment outcome callbacks
Push notificationsAlerts to patients, coordinators, and doctors
Report PDF generationBuilding the final downloadable report