feature: Corrections and Supersession
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user