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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 96 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,29 @@ 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 Readout(Reagent):
"""Description of a readout"""

Expand Down Expand Up @@ -292,6 +316,47 @@ 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"
protocol_id: Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io")
iacuc_protocol: str = Field(..., title="IACUC protocol")
start_date: date = Field(..., title="Start date")
experimenter_full_name: str = Field(
...,
description="First and last name of the experimenter.",
title="Experimenter full name",
)
where_performed: Annotated[Union[Organization.AIND, Organization.JAX],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Charles River

Field(..., title="Where performed", discriminator="name")]
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")
notes: Optional[str] = Field(default=None, title="Notes")


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

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")
start_date: date = Field(..., title="Start date")
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"
)
health_assessment: Optional[str] = Field(default=None, title="Health assessment")
pantent: bool = Field(default=True, title="Catheter patent")
saskiad marked this conversation as resolved.
Show resolved Hide resolved
notes: Optional[str] = Field(default=None, title="Notes")


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

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


class BloodCollection(AindModel):
"""Description of a blood collection procedure"""

procedure_type: Literal["Blood collection"] = "Blood collection"
protocol_id = Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io")
iacuc_protcol: str = Field(..., title="IACUC protocol")
start_date: date = Field(..., title="Start date")
experimenter_full_name: str = Field(
...,
description="First and last name of the experimenter.",
title="Experimenter full name",
)
injection: List[IntraperitonealInjection] = Field(..., title="IP injections")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove injection fields

injection_time: int = Field(..., title="Relative injection time")
collection_time: int = Field(..., title="Relative collection time")
time_unit: TimeUnit = Field(default=TimeUnit.M, title="Time unit")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list of times and collection volumes

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")
notes: Optional[str] = Field(default=None, title="Notes"


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

Expand Down Expand Up @@ -658,7 +745,15 @@ class Procedures(AindCoreModel):
)
subject_procedures: List[
Annotated[
Union[Surgery, TrainingProtocol, WaterRestriction, OtherSubjectProcedure],
Union[
BloodCollection,
CatheterImplant,
CatheterMaintenance,
Surgery,
TrainingProtocol,
WaterRestriction,
OtherSubjectProcedure
],
Field(discriminator="procedure_type"),
]
] = Field(default=[], title="Subject Procedures")
Expand Down
Loading