name: manage_lab description: Manage subjects, cases, and administrative lab tasks.
Manage Lab Skill
Use this skill to perform CRUD operations on Subjects and Cases, archive closed cases, and generate lab performance reports.
Dependencies
DentalID.Core.Interfaces.ISubjectRepositoryDentalID.Core.Interfaces.ICaseRepositoryDentalID.Core.Entities.SubjectDentalID.Core.Entities.Case
Workflow
Onboard New Subject:
- Create a
Subjectentity. - Mandatory Fields:
FullName(or "Unknown-{Date}" for John Does),Gender(if known). - ID Generation: Use standard format
SUB-{YYYY}-{SEQ}.
- Create a
Create Case:
- Link a
Subjectto aCase. - Set Status to
Open. - Assign an
Investigator(currrent user).
- Link a
Archive Case:
- When a match is confirmed or investigation ends.
- Set Status to
ClosedSolvedorClosedUnsolved. - Requirement: Ensure all evidence is saved and hashed before closing.
Advanced: Bulk Import:
- Scenario: Importing a legacy database or ZIP export.
- Workflow:
- Extract ZIP to temp folder.
- Parse
manifest.jsonor folder structure (SubjectName/Image.jpg). - For each folder:
- Create
Subject. - For each Image: Create
DentalImage, Calculate Hash, Move to Storage.
- Create
Lab Reporting:
- Generate statistics on
OpenCases,AverageTurnaroundTime, andMatchSuccessRate.
- Generate statistics on
Example Usage (C#)
public async Task<Case> CreateNewInvestigation(string subjectName, ISubjectRepository subRepo, ICaseRepository caseRepo)
{
// 1. Create Subject
var subject = new Subject
{
FullName = subjectName,
SubjectId = $"SUB-{DateTime.Now.Year}-{Guid.NewGuid().ToString().Substring(0, 4)}"
};
await subRepo.AddAsync(subject);
// 2. Open Case
var newCase = new Case
{
SubjectId = subject.Id,
Status = CaseStatus.Open,
OpenedAt = DateTime.UtcNow,
Description = "New forensic intake"
};
await caseRepo.AddAsync(newCase);
return newCase;
}