Why OpenSpecimen does not reuse UID sequence?
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Why OpenSpecimen does not reuse UID sequence?

Summary

OpenSpecimen does not reuse UID (e.g., PSPEC_UID, SYS_UID, EVENT_UID, etc.) sequence numbers after a participant, visit, or specimen is deleted. The sequence continues from the last number issued to preserve label uniqueness and traceability.

For example, if aliquots 01 through 05 are created and an intermediate sample, such as 03, is deleted, OpenSpecimen will not backfill slot 03. The sequence generator continues forward from the highest issued number (05) and assigns 06 to the next aliquot created.

Why is the sequence number not reused?

  • Prevent duplicate labels: Resetting the sequence can generate labels that are already assigned to existing records.

  • Maintain traceability: Reusing a number can create ambiguity between a deleted record and a newly created record.

  • Avoid specimen misidentification: Original labels may remain on physical tubes, exported files, or external systems. Reusing them could associate new data with the wrong specimen.

UID Token Examples

Object

Label Format

Object

Label Format

PPID

CP_UID(2),%SYS_UID%

Visit

%EVENT_UID%

Specimen

%PSPEC_UID%

 

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com