Overview

End-to-end technical documentation for the Historical Summary feature, covering test, sample, and bill volume trend analytics for lab operations

👤 Aakash Pawar📅 Updated: Apr 3, 2026🏷️ feature

Historical Summary

Historical Summary is a feature within the Operations Dashboard that gives labs a longitudinal view of their test, sample, and bill volumes over time. Instead of looking at a single-day snapshot ("today you processed 280 tests"), it lets ops managers ask trend-oriented questions like "How did our referral-wise test volumes shift week-over-week for the last quarter?" and get answers in a pivot-grid that they can slice by organization, referral, branch, department, or individual test.

  • Feature flag: enable_operation_summary on the labFeatures table
  • MySQL event scheduler: operation_summary_nightly_event
  • Support Dashboard: toggled under Workflow Configurations → Enable Workflows/Features

Prerequisites

RequirementDetails
Feature flagenable_operation_summary = 1 in labFeatures for the lab
MySQL event schedulerMust be ON. The nightly aggregation job runs as a MySQL EVENT
billTime availabilityLab must have historical billing data; the first billTime in billing determines the start of available data
Timezone configlabTimeZone on the labs table must be set correctly. All date bucketing is timezone-aware

What is it For?

Traditional operations dashboards show only the current day's activity. This works for real-time ops but fails when managers want to:

  • Spot trends - Are referrals from "Apollo Hospitals" growing or declining month-over-month?
  • Benchmark branches - Which branch processes the highest test volume every week?
  • Audit sample access - How many samples were accessed vs. not-accessed in a given period?
  • Track billing patterns - Department-wise bill counts per week, for capacity planning.

Historical Summary answers all of these by pre-aggregating operational data into a star-schema-like table (operation_historical_summary) and exposing it through a pivot grid on the frontend.

Core Concepts

Dimensions

The system uses a two-dimension model to categorize every metric:

DimensionRoleExamples
dimension_a (Primary)The main grouping entityOrganization, Referral, Branch, Department
dimension_b (Secondary)The drill-down entity within the primary groupTest ID, Sample ID

Event Types

Each combination of primary × secondary dimension produces an event_type. Here is the full matrix:

Primary DimensionTest CountSample CountBill CountSample AccessedSample Not Accessed
Organizationorganization_testorganization_sampleorganization_billorganization_sample_accessedorganization_sample_not_accessed
Referralreferral_testreferral_samplereferral_billreferral_sample_accessedreferral_sample_not_accessed
Branchbranch_testbranch_samplebranch_billbranch_sample_accessedbranch_sample_not_accessed
Departmentdepartment_testN/AN/AN/AN/A

Granularity

Users can view data at three time resolutions:

GranularityMax Date RangeBucketing Logic
Daily14 daysEach day = one bucket
Weekly62 days (~2 months)7-day intervals anchored to start_date
MonthlyUnlimitedFirst-of-month buckets (uses the stored ordered_month column)

UI Overview

The Historical View tab lives inside the Operations Dashboard, alongside the existing Summary View and Detailed View.

Test Count — Organization Wise (Weekly)

Historical View showing weekly organization-wise test counts with Grand Total and Grand Average rows

Sample Count — Organization Wise with Sample Breakdown (Weekly)

Historical View showing weekly sample counts with Sample Wise breakdown, expandable organization groups

Bill Count — Organization Wise (Monthly)

Historical View showing monthly organization-wise bill counts

Key elements visible in the interface:

  • View tabs — Summary View / Detailed View / Historical View (Beta)
  • Controls — Filter By Sample Status, granularity dropdown (Weekly / Monthly), date range picker, Export button
  • Count tabs — Test Count, Sample Count, Bill Count (some hidden depending on entity)
  • Entity tabs — Organization Wise, Referral Wise, Department Wise, Test Wise, Branch Wise (varies by count tab)
  • Breakdown selector — "Select Breakdown" / "Sample Wise" for secondary grouping
  • Pivot grid — Entity names in the first column, date buckets as dynamic columns, with Grand Total and Grand Average pinned to the bottom
  • Notification banner"All activities related to orders & samples performed today will appear in the Historical View on the next day. All data is calculated based on the {timezone} timezone."

Feature Components

On this page