fix:
No SOFA trend chart or organ-system timeline No GCS trend chart or component history No qSOFA history view
This commit is contained in:
@@ -27,8 +27,33 @@ public class GcsController : ControllerBase
|
||||
if (score is null)
|
||||
return Ok(ApiResponse<GcsScoreResponse?>.Ok(null));
|
||||
|
||||
return Ok(ApiResponse<GcsScoreResponse>.Ok(new GcsScoreResponse(
|
||||
score.EyeScore, score.VerbalScore, score.MotorScore,
|
||||
score.TotalScore, score.Classification, score.CalculatedAt)));
|
||||
return Ok(ApiResponse<GcsScoreResponse>.Ok(MapResponse(score)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns cursor-paginated GCS score history for an encounter.
|
||||
/// </summary>
|
||||
/// <param name="encounterId">Encounter id.</param>
|
||||
/// <param name="limit">Maximum items per page.</param>
|
||||
/// <param name="cursor">Opaque cursor from a previous page.</param>
|
||||
/// <returns>A page of GCS scores with an optional next cursor.</returns>
|
||||
[HttpGet("history")]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> History(
|
||||
Guid encounterId,
|
||||
[FromQuery] int limit = 20,
|
||||
[FromQuery] string? cursor = null)
|
||||
{
|
||||
var page = await _gcs.GetHistoryAsync(encounterId, limit, cursor);
|
||||
return Ok(ApiResponse<object>.Ok(new
|
||||
{
|
||||
items = page.Items.Select(MapResponse),
|
||||
nextCursor = page.NextCursor,
|
||||
hasMore = page.HasMore
|
||||
}));
|
||||
}
|
||||
|
||||
private static GcsScoreResponse MapResponse(GcsScore score) =>
|
||||
new(score.EyeScore, score.VerbalScore, score.MotorScore,
|
||||
score.TotalScore, score.Classification, score.CalculatedAt);
|
||||
}
|
||||
@@ -39,7 +39,11 @@ public class QsofaController : ControllerBase
|
||||
var page = await _qsofa.GetHistoryAsync(encounterId, limit, cursor);
|
||||
return Ok(ApiResponse<object>.Ok(new
|
||||
{
|
||||
items = page.Items,
|
||||
items = page.Items.Select(e => new QsofaHistoryResponse(
|
||||
e.ActiveCriteria,
|
||||
QsofaCalculator.ParseCriteriaState(e),
|
||||
e.ScreenAlertFired,
|
||||
e.EvaluatedAt)),
|
||||
nextCursor = page.NextCursor,
|
||||
hasMore = page.HasMore
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user