feature: Digitization Workstation UI

This commit is contained in:
voltsrage
2026-06-27 12:15:43 +08:00
parent 88e70b3dbe
commit e22d33b654
55 changed files with 6411 additions and 143 deletions
@@ -1,9 +1,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// Patient-scoped endpoints for digitization history and audit trail.
/// Patient registry search and digitization history.
/// </summary>
[ApiController]
[Route("api/v1/patients")]
@@ -12,9 +11,27 @@ using Microsoft.AspNetCore.Mvc;
public class PatientsController : ControllerBase
{
private readonly IDigitizationHistoryService _history;
private readonly IPatientRegistryService _patients;
public PatientsController(IDigitizationHistoryService history) =>
public PatientsController(
IDigitizationHistoryService history,
IPatientRegistryService patients)
{
_history = history;
_patients = patients;
}
/// <summary>
/// Searches live patients by MRN or full name (minimum 2 characters).
/// </summary>
[HttpGet("search")]
[Authorize(Roles = "INTAKE_CLERK,ADMINISTRATOR")]
[ProducesResponseType(typeof(ApiResponse<IReadOnlyList<PatientSearchResult>>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search([FromQuery] string q)
{
var results = await _patients.SearchAsync(q ?? string.Empty);
return Ok(ApiResponse<IReadOnlyList<PatientSearchResult>>.Ok(results));
}
/// <summary>
/// Returns the complete digitization history for a patient, including all
@@ -29,4 +46,4 @@ public class PatientsController : ControllerBase
var history = await _history.GetPatientHistoryAsync(patientId);
return Ok(ApiResponse<PatientDigitizationHistoryResponse>.Ok(history));
}
}
}
@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// User directory for batch assignment and operational lookups.
/// </summary>
[ApiController]
[Route("api/v1/users")]
[Produces("application/json")]
[Authorize]
public class UsersController : ControllerBase
{
private readonly IUserDirectoryService _users;
public UsersController(IUserDirectoryService users) => _users = users;
/// <summary>
/// Lists active users, optionally filtered by role.
/// </summary>
[HttpGet]
[Authorize(Roles = "INTAKE_CLERK,ADMINISTRATOR")]
[ProducesResponseType(typeof(ApiResponse<IReadOnlyList<UserSummaryResponse>>), StatusCodes.Status200OK)]
public async Task<IActionResult> List([FromQuery] string? role)
{
UserRole? parsedRole = null;
if (!string.IsNullOrWhiteSpace(role))
parsedRole = UserRoleExtensions.FromDbString(role);
var results = await _users.ListByRoleAsync(parsedRole);
return Ok(ApiResponse<IReadOnlyList<UserSummaryResponse>>.Ok(results));
}
}
@@ -68,4 +68,17 @@ public class WorkQueueController : ControllerBase
var result = await _workQueue.GetClinicalApprovalQueueAsync(page, pageSize);
return Ok(ApiResponse<WorkQueueResponse>.Ok(result));
}
/// <summary>
/// Returns aggregate work queue health metrics for the supervisor dashboard.
/// </summary>
[HttpGet("overview")]
[Authorize(Roles = "ADMINISTRATOR")]
[ProducesResponseType(typeof(ApiResponse<WorkQueueOverviewResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status403Forbidden)]
public async Task<IActionResult> GetOverview()
{
var overview = await _workQueue.GetOverviewAsync();
return Ok(ApiResponse<WorkQueueOverviewResponse>.Ok(overview));
}
}