using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; /// /// Patient-scoped endpoints for digitization history and audit trail. /// [ApiController] [Route("api/v1/patients")] [Produces("application/json")] [Authorize] public class PatientsController : ControllerBase { private readonly IDigitizationHistoryService _history; public PatientsController(IDigitizationHistoryService history) => _history = history; /// /// Returns the complete digitization history for a patient, including all /// batches, their promotion status, correction chains, and per-batch audit trails. /// Superseded observations are included with their supersession metadata. /// [HttpGet("{patientId:guid}/digitization-history")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status404NotFound)] public async Task GetDigitizationHistory(Guid patientId) { var history = await _history.GetPatientHistoryAsync(patientId); return Ok(ApiResponse.Ok(history)); } }