Full SOFA Score: Data Layer + Scoring Engine

Glasgow Coma Scale: Data Layer + Scoring Engine
This commit is contained in:
voltsrage
2026-06-21 01:09:50 +08:00
parent 78c043e4d3
commit 93ea473d2b
62 changed files with 7133 additions and 72 deletions
@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Route("api/v1/encounters/{encounterId:guid}/gcs")]
[Produces("application/json")]
public class GcsController : ControllerBase
{
private readonly IGcsService _gcs;
public GcsController(IGcsService gcs) => _gcs = gcs;
[HttpGet]
[ProducesResponseType(typeof(ApiResponse<GcsScoreResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Current(Guid encounterId)
{
var score = await _gcs.GetCurrentAsync(encounterId);
if (score is null)
return NotFound(ApiResponse<object>.Fail(
404, "No GCS score computed for this encounter.", "NO_GCS_SCORE"));
return Ok(ApiResponse<GcsScoreResponse>.Ok(new GcsScoreResponse(
score.EyeScore, score.VerbalScore, score.MotorScore,
score.TotalScore, score.Classification, score.CalculatedAt)));
}
}