Run initial test for Climate Resilience Verification Suite
Add first part of Alert Quality Analytics
This commit is contained in:
@@ -173,4 +173,30 @@ public class AlertsController : ControllerBase
|
||||
var alert = await _alerts.ResolveAsync(id);
|
||||
return Ok(ApiResponse<ClinicalAlert>.Ok(alert));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Submits clinician feedback for an acknowledged or resolved alert.
|
||||
/// One submission per user per alert.
|
||||
/// </summary>
|
||||
[HttpPost("api/v1/alerts/{id:guid}/feedback")]
|
||||
[AuthorizePermission(ClinicalPermissions.AlertsFeedback)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status409Conflict)]
|
||||
public async Task<IActionResult> SubmitFeedback(
|
||||
Guid id, [FromBody] SubmitAlertFeedbackRequest req)
|
||||
{
|
||||
var feedback = await _alerts.SubmitFeedbackAsync(id, req.FeedbackType, req.Comment);
|
||||
return Created(
|
||||
$"/api/v1/alerts/{id}/feedback/{feedback.Id}",
|
||||
ApiResponse<object>.Ok(new
|
||||
{
|
||||
id = feedback.Id,
|
||||
alertId = feedback.AlertId,
|
||||
feedbackType = feedback.FeedbackType.ToString(),
|
||||
comment = feedback.Comment,
|
||||
createdAt = feedback.CreatedAt
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user