32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
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));
|
|
}
|
|
} |