API Documentation - Overview
Base URL: /api
Authentication: Required (Bearer token / ASP.NET Core Identity)
About This Documentation
This is the main index for the Surveillance-MVP API documentation. The API is organized into separate, focused documents for each major system.
System Documentation
Topics Covered:
- Patient Friendly ID Generation (thread-safe, concurrent)
- Duplicate Detection Engine (Levenshtein distance matching)
- Patient Merge API
- Code examples and performance optimizations
Key Services:
PatientIdGeneratorService - Generate unique patient IDs
PatientDuplicateCheckService - Find potential duplicates
PatientMergeService - Merge duplicate records
Topics Covered:
- Survey mapping configuration (priority-based)
- Business rules (AlwaysSave, SaveIfEmpty, SaveIfDifferent)
- Mapping actions (AutoSave, QueueForReview, RequireApproval)
- Survey versioning (auto-update to active version)
- Collection mappings (create related entities)
- Re-process survey results (Data Inbox approval)
Key Services:
SurveyMappingService - Execute field mappings
SurveyService - Load surveys and save responses
Topics Covered:
- Report preview API (
POST /api/reports/preview)
- Report data service (dynamic query building)
- Collection queries (HasAny, Count, Sum, etc.)
- Field auto-correction
- Performance optimizations and batching
Key Services:
ReportDataService - Extract report data
ReportFieldMetadataService - Field discovery