Module 20, Clinical Referrals

Clinical
Referrals

The Referrals module manages patient transfers between clinicians, departments, and external facilities. It provides a structured workflow for referral creation, acceptance, scheduling, completion, and rejection with comprehensive analytics and follow-up tracking.

What is Referral Management?

Referral Management handles the complete patient transfer lifecycle: referral creation (internal to doctors/departments or external to facilities), acceptance workflow (receiving clinician acknowledges), appointment scheduling (date/time for the referred consultation), completion tracking (outcome documentation), rejection handling (with reasoned rejection notes), follow-up monitoring (accepted referrals past their appointment date), and analytics (turnaround time, completion rate, top referrers, monthly volume).

Each referral follows a five-stage status: Pending → Accepted → Completed → Cancelled → Rejected, with full audit logging at every transition. Service catalog linking allows referencing hospital services directly.

Why Does It Exist?

  • → Care continuity — Structured referrals ensure patients don't fall through the cracks during transfers
  • → Accountability — Every referral is tracked with timestamps, actor identity, and outcome, no lost handoffs
  • → Timeliness — Follow-up monitoring catches overdue appointments before they become missed care events
  • → Data-driven improvement — Turnaround analytics enables institutional optimization of transfer processes
Step by Step

The Referral Workflow

1

Referral Initiation

A clinician creates a referral specifying the referring doctor, receiving doctor or department, reason, urgency, and optionally links a service catalog entry. The referral enters 'pending' status and broadcasts a notification to receiving clinicians.

Behind the scenes: Referral creation validates patient access via canAccessPatient. If a hospitalSubServiceId or serviceSubDivisionId is provided, the system resolves the service selection and automatically creates a patientServiceLink record. Deep audit captures the full before/null snapshot.
2

Accept & Schedule

The receiving clinician reviews the referral details and accepts it. They can optionally schedule an appointment date for the consultation. The referral moves to 'accepted' status and is queued for follow-up monitoring.

Behind the scenes: Acceptance requires the referrals:accept permission. The system validates that the referral exists with patient access checks. On acceptance, a notification is broadcast to referrals:manage permission holders. The scheduled appointment date is tracked separately.
3

Completion & Outcome

After the consultation or procedure, the receiving clinician documents the outcome. This free-text outcome record captures the clinical disposition, follow-up instructions, and any referral loop closure details.

Behind the scenes: Completion requires the referrals:complete permission. The outcome field (max 2000 chars) is stored directly on the referral record. Once completed, the referral is closed and appears in completion analytics. Average turnaround time is calculated from creation to completion.
4

Rejection & Resolve

If the receiving clinician cannot accept the referral, they reject it with a reason. The rejection reason is appended to the referral notes with a timestamp. The referral is closed as 'rejected' and the referring clinician is notified.

Behind the scenes: Rejection requires the referrals:reject permission. The reason (max 1000 chars) is prepended with a timestamp marker and appended to existing notes. A high-priority notification is sent to referrals:manage holders. The referral is immutable in its 'rejected' terminal state.
Deep Dive

Every Feature Explained

Referral Creation & Context

What it is

Create referrals with full clinical context, reason, urgency, and doctor routing.

Why it exists

Comprehensive referral data prevents information loss during patient handoffs.

How it works

Captures patient, referring doctor, receiving doctor/department, reason, urgency (routine/urgent/emergency), referral type (internal/external), external facility name, appointment date, optional notes, optional service catalog linkage. On creation, a patientServiceLink is automatically created.

Accept/Reject Workflow

What it is

Structured acceptance and rejection with reasoned outcomes.

Why it exists

Ensures every referral has a clear disposition and prevents indefinite pending states.

How it works

Accept moves to 'accepted' status. Reject requires a mandatory reason that gets appended to notes with a timestamp. Both transitions broadcast notifications to permission holders. Rejection is a terminal state.

Appointment Scheduling

What it is

Schedule consultation appointments for accepted referrals.

Why it exists

Binds the referral to a concrete time slot for the receiving clinician.

How it works

Accepts a datetime-local input. The appointmentDate is stored on the referral record. Accepted referrals with past appointment dates are surfaced in the follow-ups view for monitoring.

Follow-Up Monitoring

What it is

Track accepted referrals with past-due appointments requiring follow-up.

Why it exists

Prevents patients from getting lost in the referral pipeline.

How it works

The /follow-ups endpoint queries referrals where status=accepted, appointmentDate is not null and in the past. Results are ordered by appointmentDate ascending (most overdue first). Designed for paginated review by nursing or case management staff.

Service Catalog Integration

What it is

Link referrals to hospital services and sub-divisions.

Why it exists

Gives receiving teams precise context about the requested service.

How it works

Two-tier service linkage: hospitalSubService (category › sub-service) or serviceSubDivision (category › sub-service › division). Service selection is parsed with a prefix convention (sub: / div:). On creation, a patientServiceLink is established for continuity.

Analytics & Intelligence

What it is

Comprehensive analytics with turnaround time, completion rates, and volume trends.

Why it exists

Data-driven insights enable continuous process improvement.

How it works

Analytics endpoint computes: average turnaround days (completed referrals only), completion rate percentage, top 5 referring doctors, top 5 referred-to departments, 12-month monthly volume series. Avg turnaround uses raw SQL AVG extraction on epoch difference.

Patient Search & Filters

What it is

Search referrals by patient name, MRN, reason, referrer across all fields.

Why it exists

Quick retrieval is essential in a busy clinical environment.

How it works

Search fields include: reason, referredBy, referredTo, department, externalFacility, patient name and MRN. Filters by status, referral type. Paginated with ServerPagination. Record scopes enforce patient-level access control.

External Facility Support

What it is

Support referrals to external hospitals and clinics outside the system.

Why it exists

Not all care destinations are internal, external transfers need the same governance.

How it works

External facility name overrides the referred-to doctor when set. Referral type distinguishes internal (within institution) vs external (outside). External referrals track the facility name, reason, and outcome, but skip patientServiceLink creation.

Technical Architecture

FieldTypeInstitutional Role
referral_idUUIDUnique referral identifier.
patient_idUUIDReference to the referred patient.
statusEnumPending, Accepted, Completed, Cancelled, Rejected.
referral_typeEnumInternal (institution) or External (outside facility).
urgencyEnumRoutine, Urgent, Emergency.

Note: Sensitive fields use AES-256 field-level encryption where applicable.

Governance & Power

referrals:view
referrals:create
referrals:edit
referrals:accept
referrals:complete
referrals:reject
referrals:schedule
referrals:manage
  • Graceful Deletion

    Only pending status referrals can be deleted. Accepted, completed, or rejected referrals are immutable for audit trail integrity. Deletion requires the referrals:manage permission.

  • Patient Scoped Access

    Referrals enforce patient-level record scoping. Users see only referrals for patients they have access to, based on doctor-patient relationships and module-specific scope rules.

  • Service Linkage Continuity

    When a referral is created with a service catalog reference, a patientServiceLink is automatically generated, ensuring the referred service follows the patient across the institution.