The Challenge
AyuHealth was losing patients between diagnostics and surgery. A patient would come in for a consultation, get prescribed diagnostic tests, and then leave the AyuHealth ecosystem to book tests elsewhere — at a local lab, a competing chain, wherever was convenient. Many never came back for the surgery.
This diagnostics-to-surgery churn was a direct revenue leak. Every patient who left for diagnostics was a potential surgery that AyuHealth lost.
The challenge:
- No integrated diagnostics offering — patients had to go elsewhere for tests
- Massive catalog complexity — 20k+ tests across 100+ diagnostics centers, each with different pricing, availability, and capabilities
- Search at scale — patients and staff needed to find the right test at the right center instantly, not scroll through endless lists
- Mapping table exceeding 1M records — test-to-center-to-price combinations that needed to be queryable in real-time
The Solution
Built a diagnostics booking service fully integrated into the AyuHealth ecosystem — so patients never need to leave.
Search at Scale with Elasticsearch
The core challenge was making 1M+ test-center-price records searchable in real-time. SQL queries couldn't cut it at this scale with the fuzzy matching patients expect.
- Elasticsearch integration for full-text search across test names, center locations, specialties, and pricing
- Geolocation-based search — patients find the nearest diagnostics center based on their location, with distance-sorted results and radius filtering
- Paginated APIs with infinite scroll — smooth UX even when browsing thousands of results
- Typo tolerance and synonym matching — patients search for "blood test" not "Complete Blood Count (CBC)"
Event-Based Lazy Cache
Instead of rebuilding caches on a schedule (expensive and wasteful) or serving stale data (unacceptable for availability and pricing):
- Event-driven cache invalidation — when a center updates pricing or availability, only that specific cache entry refreshes
- Lazy updates — cache rebuilds only when data actually changes, not on a timer
- Result: latency as low as 100ms for search queries even at peak load
Integrated Booking Flow
- Patients get test recommendations directly after consultation
- One-click booking at the nearest available center with real-time slot availability
- Results flow back into the patient record automatically
The Impact
- 40% reduction in patient churn from diagnostics to surgery — patients stay in the AyuHealth ecosystem
- 20,000+ tests searchable across 100+ diagnostics centers
- Sub-100ms search latency across 1M+ records via Elasticsearch + event-based caching
- Direct revenue impact — every retained patient is a potential surgery booking that would have been lost
Testimonial
"Yatharth stands out as one of the most technically proficient engineers I've worked with, combining deep technical expertise with a keen understanding of business needs. He played a pivotal role in building and optimizing several critical backend services, ensuring the system's robustness and scalability. His contributions were instrumental in enabling our team to implement real-time prioritization algorithms, streamline data pipelines, and automate workflows — projects that required meticulous planning and flawless execution. He consistently delivered complex projects within aggressive timelines without compromising on quality."
— Vijay, Product Vertical Owner, AyuHealth