fixes: PromoteAsync (retry path) does not create clinical entities + Patient deduplication by exact name + DOB is fragile + Batch assignment creates inconsistent interim state
This commit is contained in:
@@ -6,7 +6,6 @@ public class DraftService : IDraftService
|
||||
private readonly AppDbContext _db;
|
||||
private readonly ILogger<DraftService> _logger;
|
||||
|
||||
// Statuses that allow data entry to begin or continue
|
||||
private static readonly HashSet<BatchStatus> _entryAllowedStatuses = new()
|
||||
{
|
||||
BatchStatus.Uploaded,
|
||||
@@ -335,15 +334,10 @@ public class DraftService : IDraftService
|
||||
return batch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transitions the batch from Uploaded or Rejected to InEntry on first save.
|
||||
/// If the batch is already InEntry, this is a no-op.
|
||||
/// </summary>
|
||||
private void TransitionToInEntryIfNeeded(DigitizationBatch batch, Guid actorUserId)
|
||||
{
|
||||
if (batch.Status == BatchStatus.InEntry) return;
|
||||
|
||||
// batch.Status is Uploaded or Rejected (validated by LoadBatchForEntryAsync)
|
||||
var previousStatus = batch.Status.ToDbString();
|
||||
batch.Status = BatchStatus.InEntry;
|
||||
batch.UpdatedAt = DateTimeOffset.UtcNow;
|
||||
|
||||
Reference in New Issue
Block a user