feature: qSOFA Scoring & Sepsis Bundle Compliance
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
/// <summary>
|
||||
/// Sepsis bundle compliance tracking: current bundle by encounter and bundle detail by id.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
public class SepsisBundlesController : ControllerBase
|
||||
{
|
||||
private readonly ISepsisBundleService _bundles;
|
||||
|
||||
public SepsisBundlesController(ISepsisBundleService bundles) => _bundles = bundles;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current (most recent) sepsis bundle for an encounter with elements and linked orders.
|
||||
/// </summary>
|
||||
/// <param name="encounterId">Encounter id.</param>
|
||||
[HttpGet("api/v1/encounters/{encounterId:guid}/sepsis-bundle/current")]
|
||||
[ProducesResponseType(typeof(ApiResponse<SepsisBundle>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetCurrentByEncounter(Guid encounterId)
|
||||
{
|
||||
var bundle = await _bundles.GetCurrentByEncounterAsync(encounterId);
|
||||
if (bundle is null)
|
||||
return NotFound(ApiResponse<object>.Fail(404, "No sepsis bundle exists for this encounter.", "BUNDLE_NOT_FOUND"));
|
||||
|
||||
return Ok(ApiResponse<SepsisBundle>.Ok(bundle));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sepsis bundle by id with all elements and linked orders.
|
||||
/// </summary>
|
||||
/// <param name="id">Bundle id.</param>
|
||||
[HttpGet("api/v1/sepsis-bundles/{id:guid}")]
|
||||
[ProducesResponseType(typeof(ApiResponse<SepsisBundle>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetById(Guid id)
|
||||
{
|
||||
var bundle = await _bundles.GetByIdAsync(id);
|
||||
return Ok(ApiResponse<SepsisBundle>.Ok(bundle));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user