From 330763ce688ef2463b2739eff770a7cb78aac01f Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Mon, 25 Nov 2024 17:35:37 -0800 Subject: [PATCH 01/14] added cathether implant --- src/aind_data_schema/core/procedures.py | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 7731da57..6408ec8c 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -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 @@ -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""" @@ -292,6 +316,27 @@ 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: Optional[str] = Field(default=None, 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], + 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: Annotated[Union[MouseAnatomicalStructure.JUGULAR_VEIN, MouseAnatomicalStructure.CAROTID_ARTERY], + Field(..., title="Targeted blood vessel", discriminator="name")] + + class Craniotomy(AindModel): """Description of craniotomy procedure""" From d741ed29752ae51898e627423ad0f23aa3485cde Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Mon, 9 Dec 2024 11:04:07 -0800 Subject: [PATCH 02/14] added catheter procedures --- src/aind_data_schema/core/procedures.py | 57 +++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 6408ec8c..19b3ea87 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -321,7 +321,7 @@ class CatheterImplant(AindModel): procedure_type: Literal["Catheter implant"] = "Catheter implant" protocol_id: Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io") - iacuc_protocol: Optional[str] = Field(default=None, title="IACUC protocol") + iacuc_protocol: str = Field(..., title="IACUC protocol") start_date: date = Field(..., title="Start date") experimenter_full_name: str = Field( ..., @@ -333,8 +333,49 @@ class CatheterImplant(AindModel): catheter_material: CatheterMaterial = Field(..., title="Catheter material") catheter_design: CatheterDesign = Field(..., title="Catheter design") catheter_port: CatheterPort = Field(..., title="Catheter port") - targeted_vessel: Annotated[Union[MouseAnatomicalStructure.JUGULAR_VEIN, MouseAnatomicalStructure.CAROTID_ARTERY], - Field(..., title="Targeted blood vessel", discriminator="name")] + targeted_vessel: MouseAnatomicalStructure.BODY_PARTS = 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") + notes: Optional[str] = Field(default=None, title="Notes") + + +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: IntraperitonealInjection = Field(..., title="IP injection") + injection_time: + 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") + notes: Optional[str] = Field(default=None, title="Notes" class Craniotomy(AindModel): @@ -703,7 +744,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") From 4837aecde205ce0c1e92e92383f5fd7ffe98671f Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Mon, 9 Dec 2024 14:24:03 -0800 Subject: [PATCH 03/14] added time fields --- src/aind_data_schema/core/procedures.py | 43 +++++++++++++------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 19b3ea87..82cff88e 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -357,27 +357,6 @@ class CatheterMaintenance(AindModel): notes: Optional[str] = Field(default=None, title="Notes") -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: IntraperitonealInjection = Field(..., title="IP injection") - injection_time: - 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") - notes: Optional[str] = Field(default=None, title="Notes" - - class Craniotomy(AindModel): """Description of craniotomy procedure""" @@ -581,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: IntraperitonealInjection = Field(..., title="IP injection") + 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") + 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""" From d664b7a3699d88ffa9e619d0af8cbad1ed6b8103 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Tue, 10 Dec 2024 13:28:04 -0800 Subject: [PATCH 04/14] small edits --- src/aind_data_schema/core/procedures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 82cff88e..a98ed44b 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -333,7 +333,7 @@ class CatheterImplant(AindModel): catheter_material: CatheterMaterial = Field(..., title="Catheter material") catheter_design: CatheterDesign = Field(..., title="Catheter design") catheter_port: CatheterPort = Field(..., title="Catheter port") - targeted_vessel: MouseAnatomicalStructure.BODY_PARTS = Field(..., title="Targeted blood vessel") + targeted_vessel: MouseAnatomicalStructure.BLOOD_VESSELS = Field(..., title="Targeted blood vessel") notes: Optional[str] = Field(default=None, title="Notes") @@ -572,7 +572,7 @@ class BloodCollection(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - injection: IntraperitonealInjection = Field(..., title="IP injection") + injection: List[IntraperitonealInjection] = Field(..., title="IP injections") 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") From 48c7ed86fc11146e7ba87617302a38eefb0f4ee9 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Sat, 14 Dec 2024 16:33:19 -0800 Subject: [PATCH 05/14] more clean up --- src/aind_data_schema/core/procedures.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index a98ed44b..c922368f 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -160,6 +160,15 @@ class CatheterPort(str, Enum): 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""" @@ -328,7 +337,7 @@ class CatheterImplant(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - where_performed: Annotated[Union[Organization.AIND, Organization.JAX], + where_performed: Annotated[Union[Organization.AIND, Organization.CHARLES_RIVER, Organization.JAX], Field(..., title="Where performed", discriminator="name")] catheter_material: CatheterMaterial = Field(..., title="Catheter material") catheter_design: CatheterDesign = Field(..., title="Catheter design") @@ -353,7 +362,7 @@ class CatheterMaintenance(AindModel): ..., 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") + patent: CatheterPatency = Field(..., title="Catheter patent") notes: Optional[str] = Field(default=None, title="Notes") @@ -572,14 +581,12 @@ class BloodCollection(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - injection: List[IntraperitonealInjection] = Field(..., title="IP injections") - 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") 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" + notes: Optional[str] = Field(default=None, title="Notes") class TrainingProtocol(AindModel): From 7599c6b6059a6965c81e088b4c932b2fcf972578 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Sat, 14 Dec 2024 16:51:57 -0800 Subject: [PATCH 06/14] cleaned up blood collection and IP injections --- src/aind_data_schema/core/procedures.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index c922368f..36b2ab53 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -489,6 +489,7 @@ class IntraperitonealInjection(Injection): """Description of an intraperitoneal injection procedure""" procedure_type: Literal["Intraperitoneal injection"] = "Intraperitoneal injection" + procedure_time: Optional[AwareDatetimeWithDefault] = Field(default=None, title="Collection time") injection_volume: Decimal = Field(..., title="Injection volume (uL)") injection_volume_unit: VolumeUnit = Field(default=VolumeUnit.UL, title="Injection volume unit") @@ -570,7 +571,15 @@ class IntraCisternalMagnaInjection(BrainInjection): class BloodCollection(AindModel): - """Description of a blood collection procedure""" + """Description of a single blood collection""" + + collection_time: AwareDatetimeWithDefault = Field(..., title="Collection time") + collection_volume: Decimal = Field(..., title="Collection volume") + collection_volume_unit: VolumeUnit = Field(..., title="Collection volume unit") + + +class BloodCollectionProcedure(AindModel): + """Description of a series of blood collection procedures""" procedure_type: Literal["Blood collection"] = "Blood collection" protocol_id = Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io") @@ -581,10 +590,7 @@ class BloodCollection(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - collection_time: int = Field(..., title="Relative collection time") - time_unit: TimeUnit = Field(default=TimeUnit.M, title="Time unit") - collection_volume: Decimal = Field(..., title="Collection volume") - collection_volume_unit: VolumeUnit = Field(..., title="Collection volume unit") + blood_collections: List[BloodCollection] = Field(..., title="Blood collections") collection_method: Optional[str] = Field(default=None, title="Collection method for terminal collection") notes: Optional[str] = Field(default=None, title="Notes") @@ -753,9 +759,10 @@ class Procedures(AindCoreModel): subject_procedures: List[ Annotated[ Union[ - BloodCollection, + BloodCollectionProcedure, CatheterImplant, CatheterMaintenance, + IntraperitonealInjection, Surgery, TrainingProtocol, WaterRestriction, From 3835aa0386c223d076433c8d13a67a130a495243 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Mon, 16 Dec 2024 14:27:32 -0800 Subject: [PATCH 07/14] Charles River --- src/aind_data_schema/core/procedures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 36b2ab53..4f01abe3 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -337,7 +337,7 @@ class CatheterImplant(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - where_performed: Annotated[Union[Organization.AIND, Organization.CHARLES_RIVER, Organization.JAX], + where_performed: Annotated[Union[Organization.AIND, Organization.CRL, Organization.JAX], Field(..., title="Where performed", discriminator="name")] catheter_material: CatheterMaterial = Field(..., title="Catheter material") catheter_design: CatheterDesign = Field(..., title="Catheter design") From c6f584f7d74f6c86ea42529160b112a59522ba66 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Tue, 17 Dec 2024 14:41:17 -0800 Subject: [PATCH 08/14] implant organizations --- src/aind_data_schema/core/procedures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 4f01abe3..225cd6ce 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -337,8 +337,7 @@ class CatheterImplant(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - where_performed: Annotated[Union[Organization.AIND, Organization.CRL, Organization.JAX], - Field(..., title="Where performed", discriminator="name")] + where_performed: Organization.CATHETER_IMPLANT_ORGANIZATIONS = 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") From e48eb68f44f164056fc7ed896466c959afe6969a Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Tue, 17 Dec 2024 14:43:31 -0800 Subject: [PATCH 09/14] wrong word --- src/aind_data_schema/core/procedures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 225cd6ce..09fa85e9 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -337,7 +337,7 @@ class CatheterImplant(AindModel): description="First and last name of the experimenter.", title="Experimenter full name", ) - where_performed: Organization.CATHETER_IMPLANT_ORGANIZATIONS = Field(..., title="Where performed") + 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") From bbc4cba9c99dfa8c615e17fabee78954fc53289a Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Tue, 17 Dec 2024 15:00:52 -0800 Subject: [PATCH 10/14] syntax --- src/aind_data_schema/core/procedures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 09fa85e9..d0700a86 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -581,7 +581,7 @@ class BloodCollectionProcedure(AindModel): """Description of a series of blood collection procedures""" procedure_type: Literal["Blood collection"] = "Blood collection" - protocol_id = Optional[str] = Field(default=None, title="Protocol ID", description="DOI for protocols.io") + 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( From 32a40dd1c019805531c071f35a45ae7820de7f5a Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Tue, 17 Dec 2024 16:55:40 -0800 Subject: [PATCH 11/14] use Surgery, tweak times/dates --- src/aind_data_schema/core/procedures.py | 51 ++++++++----------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index d0700a86..ef170ef2 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -328,29 +328,16 @@ class OtherSubjectProcedure(AindModel): 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: 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") - notes: Optional[str] = Field(default=None, title="Notes") class CatheterMaintenance(AindModel): - """Description of a catheter maintenance procedure""" + """Description of a single 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( ..., @@ -360,11 +347,21 @@ class CatheterMaintenance(AindModel): 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""" @@ -488,7 +485,7 @@ class IntraperitonealInjection(Injection): """Description of an intraperitoneal injection procedure""" procedure_type: Literal["Intraperitoneal injection"] = "Intraperitoneal injection" - procedure_time: Optional[AwareDatetimeWithDefault] = Field(default=None, title="Collection time") + 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") @@ -572,26 +569,11 @@ class IntraCisternalMagnaInjection(BrainInjection): class BloodCollection(AindModel): """Description of a single blood collection""" - collection_time: AwareDatetimeWithDefault = Field(..., title="Collection time") + 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") - - -class BloodCollectionProcedure(AindModel): - """Description of a series of blood collection procedures""" - - 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", - ) - blood_collections: List[BloodCollection] = Field(..., title="Blood collections") collection_method: Optional[str] = Field(default=None, title="Collection method for terminal collection") - notes: Optional[str] = Field(default=None, title="Notes") class TrainingProtocol(AindModel): @@ -723,6 +705,8 @@ class Surgery(AindModel): procedures: List[ Annotated[ Union[ + BloodCollection, + CatheterImplant, Craniotomy, FiberImplant, Headframe, @@ -758,10 +742,7 @@ class Procedures(AindCoreModel): subject_procedures: List[ Annotated[ Union[ - BloodCollectionProcedure, - CatheterImplant, CatheterMaintenance, - IntraperitonealInjection, Surgery, TrainingProtocol, WaterRestriction, From bf86cc427ee9e1ae90275b417af792c1ef26b8b8 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Fri, 3 Jan 2025 14:46:50 -0800 Subject: [PATCH 12/14] procedures type missing --- src/aind_data_schema/core/procedures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index ef170ef2..6c3563ed 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -328,6 +328,7 @@ class OtherSubjectProcedure(AindModel): 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") From f481db5ae5e3f74248cd0045e63dd3144768a995 Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Fri, 3 Jan 2025 14:50:40 -0800 Subject: [PATCH 13/14] another missing type --- src/aind_data_schema/core/procedures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 6c3563ed..1e5d7406 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -339,6 +339,7 @@ class CatheterImplant(AindModel): class CatheterMaintenance(AindModel): """Description of a single catheter maintenance procedure""" + procedure_type: Literal["Catheter maintenance"] = "Catheter maintenance" start_date: date = Field(..., title="Start date") experimenter_full_name: str = Field( ..., From a00f118e1c396e6f9000e97ce3dc0699b8bdbebb Mon Sep 17 00:00:00 2001 From: Saskia de Vries Date: Mon, 6 Jan 2025 11:47:01 -0800 Subject: [PATCH 14/14] removed maintenance, other small updates --- src/aind_data_schema/core/procedures.py | 50 +++++-------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/src/aind_data_schema/core/procedures.py b/src/aind_data_schema/core/procedures.py index 1e5d7406..c4aefcb6 100644 --- a/src/aind_data_schema/core/procedures.py +++ b/src/aind_data_schema/core/procedures.py @@ -160,13 +160,11 @@ class CatheterPort(str, Enum): DOUBLE = "Double" -class CatheterPatency(str, Enum): - """Patency of catheter""" +class SampleType(str, Enum): + """Sample type""" - NOT_PATENT = "Not patent" - PATENT = "Patent" - ONLY_PUSH = "Only push" - ONLY_PULL = "Only pull" + BLOOD = "Blood" + OTHER = "Other" class Readout(Reagent): @@ -333,35 +331,7 @@ class CatheterImplant(AindModel): 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") - - -class CatheterMaintenance(AindModel): - """Description of a single catheter maintenance procedure""" - - procedure_type: Literal["Catheter maintenance"] = "Catheter maintenance" - 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" - ) - 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") + targeted_structure: MouseAnatomicalStructure.BLOOD_VESSELS = Field(..., title="Targeted blood vessel") class Craniotomy(AindModel): @@ -568,10 +538,11 @@ class IntraCisternalMagnaInjection(BrainInjection): injection_volume_unit: VolumeUnit = Field(VolumeUnit.NL, title="Injection volume unit") -class BloodCollection(AindModel): - """Description of a single blood collection""" +class SampleCollection(AindModel): + """Description of a single sample collection""" - procedure_type: Literal["Blood collection"] = "Blood 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") @@ -707,7 +678,6 @@ class Surgery(AindModel): procedures: List[ Annotated[ Union[ - BloodCollection, CatheterImplant, Craniotomy, FiberImplant, @@ -722,6 +692,7 @@ class Surgery(AindModel): Perfusion, ProtectiveMaterialReplacement, RetroOrbitalInjection, + SampleCollection, ], Field(discriminator="procedure_type"), ] @@ -744,7 +715,6 @@ class Procedures(AindCoreModel): subject_procedures: List[ Annotated[ Union[ - CatheterMaintenance, Surgery, TrainingProtocol, WaterRestriction,