6.5.2.7 Sample
6.5.2.7.1 Purpose¶
A physical specimen, such as a milk sample sent to a lab. It links several test results to the same material and records how and when it was collected.
6.5.2.7.2 Questions it answers¶
- Which results come from the same physical sample?
- Was it a single or a composite collection, and from which sessions?
- Which animal or product lot does the sample represent?
6.5.2.7.3 Fields¶
| Field | Type | Cardinality | Description |
|---|---|---|---|
id |
string (uuid) |
1..1 |
Key. |
source_producer |
SourceProducerEntity | 1..1 |
The producer of the sample record itself; each result keeps its own producer on the observation. |
source_sample_reference |
string |
0..1 |
|
matrix |
CodedValue | 1..1 |
|
collected_time |
ObservationTime | 1..1 |
|
collection_kind |
enum | 1..1 |
Values: single_collection, composite_collection, unknown. |
animal |
Animal | 0..1 |
|
product_material |
ProductMaterial | 0..1 |
|
collection_session |
ObservationSession | 0..1 |
|
contributing_sessions |
ObservationSession | 0..* |
|
body_site |
BodySite | 0..1 |
|
revision |
RecordRevision | 1..1 |
|
status |
enum | 1..1 |
Values: active, cancelled. Default: active. |
created_at |
datetime |
1..1 |
|
updated_at |
datetime |
1..1 |
6.5.2.7.4 Relationships¶
References
Sample.source_producer→ SourceProducerEntity (1..1)Sample.animal→ Animal (0..1)Sample.product_material→ ProductMaterial (0..1)Sample.collection_session→ ObservationSession (0..1)Sample.contributing_sessions→ ObservationSession (0..*)Sample.body_site→ BodySite (0..1)
Referenced by
CanonicalObservation.sample(0..1)
Uses types
CodedValue, ObservationTime, RecordRevision
6.5.2.7.5 Rules & constraints¶
- Physical specimen, not its collection session and not a second source-provenance chain.
- Exactly animal or
product_materialfor published samples; a MilkMaterial requires matrix milk. - A collection activity is distinct from contributing milking sessions. All individual contributors concern the same animal.
- A mixed-milk sample may have contributors from several animals; unknown composition is allowed, invented composition is not.
- A sample may support many tests/retests; source-local bottle numbers and animal+day are not global sample identities.
- No artificial specimen for inline sensing; a multi-milking result leaves
observation.sessionempty. - Sample and result must agree on subject, matrix and known anatomical scope.
- Cancellation/reinstatement appends a revision and triggers dependent validation; do not cascade-delete historical results.