LIMS¶
Patients, samples, assays, and laboratory reports.
Entity Relationship Diagram¶
Entities¶
iris.domain.lims.entities
¶
LIMS domain entities: Patient, Sample, Assay, Aliquot, TestResult, TestReport.
Aliquot
¶
Bases: NamedEntity
A portion of a sample prepared for a specific assay.
Represents a physical sub-division of a Sample destined for a single
Assay. quantity and unit describe the volume or mass taken;
both are optional when the split was not measured.
Assay
¶
Bases: NamedEntity
A laboratory assay with its type, protocol, status, and timeline.
Tracks the lifecycle of a single analytical run: which protocol was
applied (protocol), who owns the run (owner), and its
start/completion dates. status is a free-text field whose
vocabulary is defined by the laboratory workflow.
Patient
¶
Bases: NamedEntity
A patient with demographic and clinical information.
contact_info and sex are required; all other fields are optional
to support partial registration. phenotypes lists observed HPO terms
and links the patient record to the genomics domain for variant
interpretation workflows.
Sample
¶
Bases: NamedEntity
A biological sample collected from a patient.
specimen_type classifies the material (blood, saliva, tissue, …).
The optional patient link may be absent for anonymous or
environmental samples. external_id stores the identifier assigned
by the referring institution or biobank.
TestReport
¶
Bases: NamedEntity
A formal test report summarizing one or more test results.
Represents the document delivered to the requesting physician or patient.
Authorization (is_authorized, authorized_by) and delivery
(is_delivered, delivery_method) are tracked as immutable flags;
state transitions are captured through domain events rather than
in-place mutation.
TestResult
¶
Bases: NamedEntity
The outcome of a laboratory assay applied to a sample.
Holds the tuple of ClinicalResult measurements produced by one
Assay run on one Sample. reference_range and
interpretation are free-text fields added by the reporting
scientist.
Objects¶
iris.domain.lims.objects
¶
LIMS domain value objects: AssayType, SpecimenType, ProtocolType, and result types.
AssayType
¶
Bases: Enum
Enumeration of supported laboratory assay types.
ProtocolType
¶
Bases: Enum
Enumeration of laboratory protocol procedure types.
ResultType
¶
Bases: Enum
The data type of a clinical test result value.
ResultCategory
¶
Bases: Enum
High-level interpretation category for a clinical test result.
SpecimenType
¶
Bases: Enum
Type of biological specimen collected from a patient.
LaboratoryProtocol
¶
A versioned laboratory protocol with validity period and limitations.
Captures the SOPs used in the laboratory. valid_from / valid_until
bound the period during which the protocol is accredited; a None
valid_until means the protocol is still current. limitations
documents known technical constraints or exclusions.
ClinicalResult
¶
A single clinical measurement with its type and value.
Exactly one of categorical_value, numerical_value, or
text_value is expected to be non-None depending on
result_type; the others remain None. Multiple
ClinicalResult instances are grouped in a TestResult.
Repositories¶
iris.domain.lims.repositories
¶
Repository interfaces for the LIMS domain.
PatientRepository
¶
SampleRepository
¶
AssayRepository
¶
AliquotRepository
¶
TestReportRepository
¶
Bases: CrudRepository[TestReport]
CRUD repository for TestReport entities.
TestResultRepository
¶
Bases: CrudRepository[TestResult]
CRUD repository for TestResult entities.
Events¶
iris.domain.lims.events
¶
Domain events for the LIMS bounded context.
PatientRegistered
¶
Emitted when a new patient is registered in the system.
SampleCollected
¶
Emitted when a biological sample is collected from a patient.
SampleReceived
¶
Emitted when a sample is received at the laboratory.
AssayStarted
¶
Emitted when a laboratory assay begins processing.
AssayCompleted
¶
Emitted when a laboratory assay finishes processing.
AliquotCreated
¶
Emitted when an aliquot is created from a sample for an assay.
TestResultRecorded
¶
Emitted when a test result is recorded for a sample and assay.
TestReportIssued
¶
Emitted when a test report is issued.
TestReportAuthorized
¶
Emitted when a test report is authorized by a responsible person.
TestReportDelivered
¶
Emitted when a test report is delivered to the patient or requestor.
Exceptions¶
iris.domain.lims.exceptions
¶
Exceptions for the LIMS domain.
LimsError
¶
Bases: Exception
Base exception for the LIMS domain.
PatientNotFoundError
¶
Bases: LimsError
Raised when a patient cannot be found by the given identifier.
SampleNotFoundError
¶
Bases: LimsError
Raised when a sample cannot be found by the given identifier.
AliquotNotFoundError
¶
Bases: LimsError
Raised when an aliquot cannot be found by the given identifier.
TestResultNotFoundError
¶
Bases: LimsError
Raised when a test result cannot be found by the given identifier.
TestReportNotFoundError
¶
Bases: LimsError
Raised when a test report cannot be found by the given identifier.
DuplicatePatientRegistrationError
¶
Bases: LimsError
Raised when registering a patient that already exists in the system.
SampleNotReceivedError
¶
Bases: LimsError
Raised when an operation requires a received sample but it has not been received yet.