feature: Corrections and Supersession

This commit is contained in:
voltsrage
2026-06-26 16:33:31 +08:00
parent 706318e5d2
commit f232761fd7
35 changed files with 4907 additions and 75 deletions
@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// Patient-scoped endpoints for digitization history and audit trail.
/// </summary>
[ApiController]
[Route("api/v1/patients")]
[Produces("application/json")]
[Authorize]
public class PatientsController : ControllerBase
{
private readonly IDigitizationHistoryService _history;
public PatientsController(IDigitizationHistoryService history) =>
_history = history;
/// <summary>
/// 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.
/// </summary>
[HttpGet("{patientId:guid}/digitization-history")]
[ProducesResponseType(typeof(ApiResponse<PatientDigitizationHistoryResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetDigitizationHistory(Guid patientId)
{
var history = await _history.GetPatientHistoryAsync(patientId);
return Ok(ApiResponse<PatientDigitizationHistoryResponse>.Ok(history));
}
}