6.5.2.2 ObservationType
6.5.2.2.1 Purpose¶
The versioned catalog entry that defines what an observation means: the property, material, result shape, canonical unit and validation. A new provider maps to an existing type whenever the meaning matches; the profile definitions live in the canonical type catalog.
6.5.2.2.2 Questions it answers¶
- What does this code measure, in which unit and result form?
- Which subjects, species and body sites can it apply to?
- Which version of the definition did an observation use?
6.5.2.2.3 Fields¶
| Field | Type | Cardinality | Description |
|---|---|---|---|
id |
string (uuid) |
1..1 |
Key. |
code |
string |
1..1 |
|
name |
string |
1..1 |
|
description |
string |
1..1 |
|
value_type |
enum | 1..1 |
Values: quantity, count, category, flag. |
canonical_unit |
CodedValue | 0..1 |
One unit per published version; required for quantity/count, absent for category/flag. Prefer UCUM; non-UCUM assay scales require a separately versioned moo.unit definition, never invented UCUM symbols. |
categories |
string |
0..* |
Required non-empty vocabulary for category, empty for other value types; milk detection profiles use detected/not_detected/inconclusive/invalid. |
valid_range |
NumericBounds | 0..1 |
Hard mathematical/physical limits only, not normal clinical ranges; anomalies are flagged, not automatically deleted. |
comparability |
enum | 1..1 |
Values: physical, method_specific, vendor_index.Physical means a physical measurand, not guaranteed interchangeability across methods, matrices or bases. vendor_index only for a vendor scale whose definition is documented (scale, range, meaning); undocumented proprietary indices are not canonical (IngestionSkip reason proprietary_index). |
applies_to |
AnimalType | 1..* |
|
allowed_body_sites |
BodySite | 0..* |
Only applicable sites in this list are allowed; subject-specific constraints remain mandatory. Empty does not mean any site. |
allowed_subjects |
enum | 1..* |
Values: animal, animal_group, product. |
external_codes |
CodedValue | 0..* |
Crosswalks require matching semantics; an external metric code alone does not prove equivalent meaning. |
version |
string |
1..1 |
|
profile_family |
string |
1..1 |
Registered family, e.g. milk_protein, milk_scc, milk_pathogen_test; it selects the closed constants schema in the canonical type catalog.A family can define several concrete profiles; arbitrary strings do not create a new validated family. |
property_definition |
PropertyDefinition | 1..1 |
Immutable typed constants: matrix, analyte/target, denominator, count basis or index definition, according to family. |
qualifier_schema |
CodedValue | 1..1 |
Selects a closed versioned PropertyQualifiers schema; empty schema allowed where no extra fields are needed. |
allowed_result_forms |
set of enum | 1..1 |
Values: point, interval, lower_bound, upper_bound, category, flag.Non-empty subset of numeric forms for quantity/count; exactly {category} for category and {flag} for flag. Must match value_type and ObservationValue.result_form (ObservationValue); supplied by the profile, not guessed by the adapter. |
status |
enum | 1..1 |
Values: draft, active, retired. |
created_at |
datetime |
1..1 |
|
updated_at |
datetime |
1..1 |
6.5.2.2.4 Relationships¶
References
ObservationType.applies_to→ AnimalType (1..*)ObservationType.allowed_body_sites→ BodySite (0..*)
Referenced by
CanonicalObservation.observation_type(1..1)Model.output_observation_type(0..1)MlDatasetSelection.observation_types(0..*)
Uses types
CodedValue, NumericBounds, PropertyDefinition
6.5.2.2.5 Rules & constraints¶
- Published semantic profile: what, material/base, result shape, canonical unit and validation.
- This is catalog data; milk-analysis and production definitions are maintained in the canonical type catalog.
(code, version)is unique. Published semantics/unit/schema are immutable; retirement does not invalidate historical records.- Different analytes, bases or qualitative/quantitative meanings use distinct codes; corrections to a definition use a new version.
- Numeric conversion alone cannot bridge milk mass/volume, urea/MUN, true/crude protein, CFU/IBC/MPN or assay scales.
- A new provider maps to an existing profile whenever semantics match; never create provider-named physical types by default.
- Activation requires concrete constants, resolved dictionaries/units, closed schemas and reviewed constraints.
- Profile activation and adapter/source-mapping validation are separate; retired profiles remain addressable by historical observations.