Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat 1147 interoception #1190

Merged
merged 16 commits into from
Jan 6, 2025
93 changes: 92 additions & 1 deletion src/aind_data_schema/core/procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import List, Literal, Optional, Set, Union

from aind_data_schema_models.mouse_anatomy import MouseAnatomicalStructure
from aind_data_schema_models.organizations import Organization
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.species import Species
from aind_data_schema_models.specimen_procedure_types import SpecimenProcedureType
Expand Down Expand Up @@ -136,6 +137,38 @@ class VirusPrepType(str, Enum):
PURIFIED = "Purified"


class CatheterMaterial(str, Enum):
"""Type of catheter material"""

NAKED = "Naked"
SILICONE = "VAB silicone"
MESH = "VAB mesh"


class CatheterDesign(str, Enum):
"""Type of catheter design"""

MAGNETIC = "Magnetic"
NONMAGNETIC = "Non-magnetic"
NA = "N/A"


class CatheterPort(str, Enum):
"""Type of catheter port"""

SINGLE = "Single"
DOUBLE = "Double"


class CatheterPatency(str, Enum):
"""Patency of catheter"""

NOT_PATENT = "Not patent"
PATENT = "Patent"
ONLY_PUSH = "Only push"
ONLY_PULL = "Only pull"


class Readout(Reagent):
"""Description of a readout"""

Expand Down Expand Up @@ -292,6 +325,45 @@ class OtherSubjectProcedure(AindModel):
notes: Optional[str] = Field(default=None, title="Notes")


class CatheterImplant(AindModel):
"""Description of a catheter implant procedure"""

procedure_type: Literal["Catheter Implant"] = "Catheter implant"
where_performed: Organization.CATHETER_IMPLANT_INSTITUTIONS = Field(..., title="Where performed")
catheter_material: CatheterMaterial = Field(..., title="Catheter material")
catheter_design: CatheterDesign = Field(..., title="Catheter design")
catheter_port: CatheterPort = Field(..., title="Catheter port")
targeted_vessel: MouseAnatomicalStructure.BLOOD_VESSELS = Field(..., title="Targeted blood vessel")
saskiad marked this conversation as resolved.
Show resolved Hide resolved


class CatheterMaintenance(AindModel):
"""Description of a single catheter maintenance procedure"""

procedure_type: Literal["Catheter maintenance"] = "Catheter maintenance"
start_date: date = Field(..., title="Start date")
saskiad marked this conversation as resolved.
Show resolved Hide resolved
experimenter_full_name: str = Field(
...,
description="First and last name of the experimenter.",
title="Experimenter full name",
)
animal_weight_prior: Decimal = Field(
..., title="Animal weight (g)", description="Animal weight before procedure"
)
weight_unit: MassUnit = Field(default=MassUnit.G, title="Weight unit")
health_assessment: Optional[str] = Field(default=None, title="Health assessment")
patent: CatheterPatency = Field(..., title="Catheter patent")
notes: Optional[str] = Field(default=None, title="Notes")


class CatheterMaintenanceRecord(AindModel):
"""Description of catheter maintenance record"""

procedure_type: Literal["Catheter maintenance"] = "Catheter maintenance"
protocol_id: Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io")
iacuc_protocol: str = Field(..., title="IACUC protocol")
catheter_maintenance: List[CatheterMaintenance] = Field(..., title="Cathether maintenance")


class Craniotomy(AindModel):
"""Description of craniotomy procedure"""

Expand Down Expand Up @@ -415,6 +487,7 @@ class IntraperitonealInjection(Injection):
"""Description of an intraperitoneal injection procedure"""

procedure_type: Literal["Intraperitoneal injection"] = "Intraperitoneal injection"
time: Optional[AwareDatetimeWithDefault] = Field(default=None, title="Injection time")
injection_volume: Decimal = Field(..., title="Injection volume (uL)")
injection_volume_unit: VolumeUnit = Field(default=VolumeUnit.UL, title="Injection volume unit")

Expand Down Expand Up @@ -495,6 +568,16 @@ class IntraCisternalMagnaInjection(BrainInjection):
injection_volume_unit: VolumeUnit = Field(VolumeUnit.NL, title="Injection volume unit")


class BloodCollection(AindModel):
saskiad marked this conversation as resolved.
Show resolved Hide resolved
"""Description of a single blood collection"""

procedure_type: Literal["Blood collection"] = "Blood collection"
time: AwareDatetimeWithDefault = Field(..., title="Collection time")
collection_volume: Decimal = Field(..., title="Collection volume")
collection_volume_unit: VolumeUnit = Field(..., title="Collection volume unit")
collection_method: Optional[str] = Field(default=None, title="Collection method for terminal collection")


class TrainingProtocol(AindModel):
"""Description of an animal training protocol"""

Expand Down Expand Up @@ -624,6 +707,8 @@ class Surgery(AindModel):
procedures: List[
Annotated[
Union[
BloodCollection,
CatheterImplant,
Craniotomy,
FiberImplant,
Headframe,
Expand Down Expand Up @@ -658,7 +743,13 @@ class Procedures(AindCoreModel):
)
subject_procedures: List[
Annotated[
Union[Surgery, TrainingProtocol, WaterRestriction, OtherSubjectProcedure],
Union[
CatheterMaintenance,
Surgery,
TrainingProtocol,
WaterRestriction,
OtherSubjectProcedure
],
Field(discriminator="procedure_type"),
]
] = Field(default=[], title="Subject Procedures")
Expand Down
Loading