feature: Optional OCR-Assisted Draft Pre-Fill

This commit is contained in:
voltsrage
2026-06-28 01:28:54 +08:00
parent 5039dbb979
commit c160c5f912
42 changed files with 3592 additions and 33 deletions
@@ -2,7 +2,8 @@ public record DraftPayloadResponse(
Guid BatchId,
string Status,
string BatchType,
BatchTypeFieldRequirements FieldRequirements,
BatchTypeFieldRequirements FieldRequirements,
OcrConfidenceMap? OcrConfidence,
DraftPatientDto? Patient,
DraftEncounterDto? Encounter,
List<DraftObservationDto> Observations
@@ -0,0 +1,6 @@
public record OcrConfidenceMap(
string Provider,
DateTimeOffset ProcessedAt,
int DurationMs,
Dictionary<string, double> FieldConfidences
);
@@ -0,0 +1,5 @@
public record OcrExtractedField(
string FieldName, // e.g. "patient.fullName", "observation.HEART_RATE.value"
string RawValue, // raw text as extracted
double Confidence // 0.0 1.0
);
@@ -0,0 +1,5 @@
public record OcrExtractionResult(
List<OcrExtractedField> Fields,
string RawText,
int DurationMs
);
@@ -2,29 +2,30 @@
/// Aggregate work queue health metrics for the supervisor dashboard.
/// Returned by GET /api/v1/work-queue/overview.
/// </summary>
public record WorkQueueOverviewResponse(
public record WorkQueueOverviewResponse
{
/// <summary>
/// Count of batches per status. Key is the DB status string
/// (e.g. "UPLOADED", "IN_ENTRY", "PENDING_VERIFICATION").
/// All 8 statuses are always present, even if count is 0.
/// </summary>
Dictionary<string, int> StatusCounts,
public required Dictionary<string, int> StatusCounts { get; init; }
/// <summary>
/// Average time in minutes that batches currently in PendingVerification
/// have been waiting. Zero if no batches are pending.
/// </summary>
double AverageTimeInQueueMinutes,
public required double AverageTimeInQueueMinutes { get; init; }
/// <summary>
/// Rejection rate as a decimal (0.0 to 1.0). Calculated as
/// rejections / (rejections + verifications) over the last 24 hours.
/// </summary>
double RejectRate,
public required double RejectRate { get; init; }
/// <summary>
/// Age in minutes of the oldest batch in PendingVerification status.
/// Zero if no batches are pending.
/// </summary>
double OldestPendingVerificationMinutes
);
public required double OldestPendingVerificationMinutes { get; init; }
}