29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
/// <summary>
|
||
/// qSOFA scoring: current active criteria count per encounter (Redis-backed).
|
||
/// </summary>
|
||
[ApiController]
|
||
[Route("api/v1/encounters/{encounterId:guid}/qsofa")]
|
||
[Produces("application/json")]
|
||
[AuthorizePermission(ClinicalPermissions.EncountersRead)]
|
||
public class QsofaController : ControllerBase
|
||
{
|
||
private readonly IQsofaService _qsofa;
|
||
|
||
public QsofaController(IQsofaService qsofa) => _qsofa = qsofa;
|
||
|
||
/// <summary>
|
||
/// Returns the current qSOFA active criteria count (0–3) for an encounter.
|
||
/// </summary>
|
||
[HttpGet("current")]
|
||
[ProducesResponseType(typeof(ApiResponse<QsofaCurrentResponse>), StatusCodes.Status200OK)]
|
||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
|
||
public async Task<IActionResult> Current(Guid encounterId)
|
||
{
|
||
var score = await _qsofa.GetCurrentAsync(encounterId);
|
||
return Ok(ApiResponse<QsofaCurrentResponse>.Ok(score));
|
||
}
|
||
}
|