Skip to content

Commit

Permalink
Feat 1147 interoception (#1190)
Browse files Browse the repository at this point in the history
* added cathether implant

* added catheter procedures

* added time fields

* small edits

* more clean up

* cleaned up blood collection and IP injections

* Charles River

* implant organizations

* wrong word

* syntax

* use Surgery, tweak times/dates

* procedures type missing

* another missing type

* removed maintenance, other small updates
  • Loading branch information
saskiad authored Jan 6, 2025
1 parent 13a9c9a commit 6b6e672
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 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,36 @@ 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 SampleType(str, Enum):
"""Sample type"""

BLOOD = "Blood"
OTHER = "Other"


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

Expand Down Expand Up @@ -292,6 +323,17 @@ 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_structure: MouseAnatomicalStructure.BLOOD_VESSELS = Field(..., title="Targeted blood vessel")


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

Expand Down Expand Up @@ -415,6 +457,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 +538,17 @@ class IntraCisternalMagnaInjection(BrainInjection):
injection_volume_unit: VolumeUnit = Field(VolumeUnit.NL, title="Injection volume unit")


class SampleCollection(AindModel):
"""Description of a single sample collection"""

procedure_type: Literal["Sample collection"] = "Sample collection"
sample_type: SampleType = Field(..., title="Sample type")
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 +678,7 @@ class Surgery(AindModel):
procedures: List[
Annotated[
Union[
CatheterImplant,
Craniotomy,
FiberImplant,
Headframe,
Expand All @@ -637,6 +692,7 @@ class Surgery(AindModel):
Perfusion,
ProtectiveMaterialReplacement,
RetroOrbitalInjection,
SampleCollection,
],
Field(discriminator="procedure_type"),
]
Expand All @@ -658,7 +714,12 @@ class Procedures(AindCoreModel):
)
subject_procedures: List[
Annotated[
Union[Surgery, TrainingProtocol, WaterRestriction, OtherSubjectProcedure],
Union[
Surgery,
TrainingProtocol,
WaterRestriction,
OtherSubjectProcedure
],
Field(discriminator="procedure_type"),
]
] = Field(default=[], title="Subject Procedures")
Expand Down

0 comments on commit 6b6e672

Please sign in to comment.