Module 21, Visitor Access Registry

Visitor
Registry

The Visitors module manages facility access through a structured check-in/check-out system, pre-registration for scheduled visits, and a security blacklist. Every entry is logged with visitor identity, patient relationship, purpose, and duration.

What is Visitor Management?

Visitor Management handles the complete facility access lifecycle: check-in (record visitor identity, CNIC, phone, patient linkage, purpose, ward), check-out (single or bulk with duration logging), pre-registration (schedule expected visits with planned arrival), blacklist management (restrict individuals from entry with reasoning), patient visit history (complete timeline of all visitors for a patient), and real-time stats (active visitors, today's volume, peak hours, average visit duration, ward distribution).

Each visitor record captures the check-in/check-out timestamps, ward location, relationship to patient, purpose of visit, and optionally a badge number, creating a complete access governance trail.

Why Does It Exist?

  • → Ward security — Unrestricted visitor access compromises patient privacy and clinical safety
  • → Patient privacy — Every visitor is logged with their relationship and purpose, creating an auditable access trail
  • → Regulatory compliance — Healthcare facilities must maintain visitor logs for safety and legal compliance
  • → Operational intelligence — Visitor volume and peak hour data helps optimize reception staffing and ward access policies
Step by Step

Check-In / Check-Out Workflow

1

Visitor Arrival

At the reception desk, the visitor provides their name, CNIC (optional, validated format XXXXX-XXXXXXX-X), phone, relationship to patient, and purpose. The receptionist optionally links them to an admitted patient via search.

2

Check-In Registration

The system logs the check-in with an automatic timestamp. The visitor receives a badge (optional badge number). Their record shows their ward, purpose, and expected duration. Status is set to 'checked_in'.

3

Active Monitoring

The visitor appears in the active visitors list. Reception staff can view all currently checked-in visitors grouped by ward, track duration, and manage extensions if needed.

4

Check-Out & Duration

At departure, the receptionist checks the visitor out. The system records the check-out timestamp and calculates the visit duration in minutes. The record is archived but remains visible in the visit history.

Step by Step

Pre-Registration & Blacklist

1

Pre-Register Visitor

Staff schedule a future visit by capturing the visitor's details and expected arrival time. The record is stored in 'pre_registered' status. Pre-registrations are visible in a dedicated queue for check-in processing.

2

Convert to Check-In

When the pre-registered visitor arrives, staff locate them in the queue and perform check-in. The pre-registration data populates the check-in form, and the status transitions from 'pre_registered' to 'checked_in'.

3

Blacklist Entry

Security or management can add individuals to the blacklist with their name, identifying number (CNIC), and reason. Blacklist entries can have an optional expiry date for time-bound restrictions.

4

Blacklist Enforcement

Reception staff check arriving visitors against the blacklist. Matched individuals are denied entry. Blacklist entries can be removed by authorized staff with audit logging.

Deep Dive

Every Feature Explained

Visitor Check-In & Check-Out

What it is

Record visitor arrivals and departures with full identity and context.

Why it exists

Creates an auditable trail of who entered the facility, when, and why.

How it works

Check-in captures name, CNIC (validated format), phone, relationship, purpose, ward, badge number, and optional patient linkage. Check-out auto-records timestamp and calculates duration. Bulk checkout supports up to 500 IDs simultaneously.

Pre-Registration Queue

What it is

Schedule expected visits in advance with planned arrival times.

Why it exists

Streamlines reception workflows by batching visitor processing and managing expected volumes.

How it works

Pre-registration captures all check-in fields plus expectedArrival datetime. Records stay in 'pre_registered' status until check-in. Paginated view with expected arrival sorting. Pre-registrations are excluded from active visitor counts.

Security Blacklist

What it is

Restrict specific individuals from facility entry with reasoning.

Why it exists

Essential for patient protection, staff safety, and institutional security compliance.

How it works

Blacklist entries store name, optional ID number, reason (mandatory), addedBy user ID, and optional expiresAt date. Paginated list view. Deletion is authorized only for visitors:manage permission holders. Full audit logging on add and remove.

Patient Visit History

What it is

Complete timeline of all visitors for a specific patient.

Why it exists

Provides clinical staff with visibility into who has been visiting their patients.

How it works

History is retrieved by patientId via /history/:patientId endpoint. Returns patient details + chronologically-ordered visits (newest first). Each visit includes calculated durationMinutes. Table view shows visitor name, check-in, check-out, and duration.

Real-Time Stats & Analytics

What it is

Live dashboard of visitor activity with operational metrics.

Why it exists

Enables data-driven staffing decisions and capacity management at reception.

How it works

Stats endpoint computes: totalToday, currentlyActive, byWard distribution, avgVisitDurationMinutes (from today's completed visits), peakHourToday (hour with most check-ins today), totalThisWeek, totalThisMonth. Ward counts show where active visitors are currently located.

Visit Extension Management

What it is

Authorize extended visit durations beyond standard limits.

Why it exists

Accommodates special circumstances (e.g., critical patient status, family conferences) while maintaining audit.

How it works

The /extend endpoint accepts extendedUntil datetime and extensionReason. Both are stored on the visitor record alongside original check-in timestamp. Extensions are audited with deep change capture.

Visitor Search & Filters

What it is

Search visitors by name, CNIC, or phone across all records.

Why it exists

Quick retrieval for reception staff handling inquiries and security checks.

How it works

Search queries name, CNIC, and phone fields with case-insensitive partial matching (/search endpoint). Filters by check-in date range, status (inside/out/all), and patient. Dedicated /active endpoint returns only currently checked-in visitors.

Patient Linkage & Record Detail

What it is

Link visitors to specific patients and view the full record payload.

Why it exists

Clarifies the clinical relationship and provides context for security assessments.

How it works

Linked visitor records include patient name, MRN, and ID. Full record detail dialog shows the complete server payload including all timestamps, notes, and extension data. Patient names link to visit history for quick lookup.

Technical Architecture

FieldTypeInstitutional Role
visitor_idUUIDUnique visitor log identifier.
visitor_nameVarChar(200)Full name of the visitor.
visitor_cnicVarChar(15)National ID (format: XXXXX-XXXXXXX-X).
statusEnumPre-Registered, Checked In, Checked Out.
patient_idUUID (nullable)Linked patient reference (optional).

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

Governance & Power

visitors:view
visitors:checkin
visitors:checkout
visitors:manage
  • CNIC Validation

    Visitor CNIC follows the Pakistan NADRA format XXXXX-XXXXXXX-X with regex validation. This ensures consistent identity records across all facility entry points.

  • Checked-In Protection

    Visitors with active check-in status cannot be deleted, they must be checked out first. This prevents loss of active visitor tracking data.

  • Bulk Operations

    The bulk checkout endpoint supports up to 500 concurrent check-outs with individual result tracking per ID. Each checkout is independently audited with before/after snapshots.