diff --git a/src/aind_metadata_service/sharepoint/nsb2023/mapping.py b/src/aind_metadata_service/sharepoint/nsb2023/mapping.py index d570f63a..88a31516 100644 --- a/src/aind_metadata_service/sharepoint/nsb2023/mapping.py +++ b/src/aind_metadata_service/sharepoint/nsb2023/mapping.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, List, Optional, Union -from aind_data_schema.components.devices import FiberProbe +from aind_data_schema.components.devices import FerruleMaterial, FiberProbe from aind_data_schema.core.procedures import ( Anaesthetic, BrainInjection, @@ -20,11 +20,13 @@ NanojectInjection, NonViralMaterial, OphysProbe, + Procedures, Side, Surgery, ViralMaterial, ) from aind_data_schema.core.subject import Sex +from aind_data_schema_models.organizations import Organization from aind_metadata_service.sharepoint.nsb2023.models import NSBList from aind_metadata_service.sharepoint.nsb2023.models import ( @@ -86,6 +88,13 @@ class InjectionType(Enum): IONTOPHORESIS = "Iontophoresis" +class FiberType(Enum): + """Enum class for Fiber Types""" + + STANDARD = "Standard" + CUSTOM = "Custom (specs in comment)." + + @dataclass class SurgeryDuringInfo: """Container for information related to surgeries during initial or @@ -126,8 +135,10 @@ class BurrHoleInfo: alternating_current: Optional[str] = None inj_duration: Optional[Decimal] = None inj_volume: Optional[List[Decimal]] = None - fiber_implant_depth: Optional[Decimal] = None inj_materials: Optional[List[InjectableMaterial]] = None + fiber_implant_depth: Optional[Decimal] = None + fiber_type: Optional[FiberType] = None + fiber_implant_length: Optional[Decimal] = None @dataclass @@ -200,6 +211,7 @@ class MappedNSBList: r"^[-+]?\d*\.?\d+[eE][-+]?\d+(?![\d.])" ) CONCENTRATION_REGEX = re.compile(r"^\d+(\.\d+)?\s*mg[/]m[lL]$") + LENGTH_MM_REGEX = re.compile(r"^([1-9]\.\d) mm$") def __init__(self, nsb: NSBList): """Class constructor""" @@ -252,6 +264,17 @@ def _parse_length_of_time_str( else: return None + def _parse_fiber_length_mm_str(self, fiber_length_str: Optional[str]): + """Parses length of fiber length strings""" + if fiber_length_str is not None: + parsed_string = re.search(self.LENGTH_MM_REGEX, fiber_length_str) + if parsed_string: + return self._parse_basic_decimal_str(parsed_string.group(1)) + else: + return None + else: + return None + @staticmethod def _parse_datetime_to_date(dt: Optional[datetime]) -> Optional[date]: """Parse date from datetime""" @@ -819,14 +842,14 @@ def aind_burr_1_dv_2(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.burr_1_dv_2) @property - def aind_burr_1_fiber_t(self) -> Optional[Any]: + def aind_burr_1_fiber_t(self) -> Optional[FiberType]: """Maps burr_1_fiber_t to aind model""" return ( None if self._nsb.burr_1_fiber_t is None else { - self._nsb.burr_1_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_1_fiber_t.CUSTOM: None, + self._nsb.burr_1_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_1_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_1_fiber_t, None) ) @@ -883,14 +906,14 @@ def aind_burr_2_d_v_x000(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.burr_2_d_v_x000) @property - def aind_burr_2_fiber_t(self) -> Optional[Any]: + def aind_burr_2_fiber_t(self) -> Optional[FiberType]: """Maps burr_2_fiber_t to aind model""" return ( None if self._nsb.burr_2_fiber_t is None else { - self._nsb.burr_2_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_2_fiber_t.CUSTOM: None, + self._nsb.burr_2_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_2_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_2_fiber_t, None) ) @@ -950,14 +973,14 @@ def aind_burr_3_d_v_x000(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.burr_3_d_v_x000) @property - def aind_burr_3_fiber_t(self) -> Optional[Any]: + def aind_burr_3_fiber_t(self) -> Optional[FiberType]: """Maps burr_3_fiber_t to aind model""" return ( None if self._nsb.burr_3_fiber_t is None else { - self._nsb.burr_3_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_3_fiber_t.CUSTOM: None, + self._nsb.burr_3_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_3_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_3_fiber_t, None) ) @@ -1030,14 +1053,14 @@ def aind_burr_4_d_v_x000(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.burr_4_d_v_x000) @property - def aind_burr_4_fiber_t(self) -> Optional[Any]: + def aind_burr_4_fiber_t(self) -> Optional[FiberType]: """Maps burr_4_fiber_t to aind model""" return ( None if self._nsb.burr_4_fiber_t is None else { - self._nsb.burr_4_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_4_fiber_t.CUSTOM: None, + self._nsb.burr_4_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_4_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_4_fiber_t, None) ) @@ -1126,8 +1149,8 @@ def aind_burr_5_fiber_t(self) -> Optional[Any]: None if self._nsb.burr_5_fiber_t is None else { - self._nsb.burr_5_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_5_fiber_t.CUSTOM: None, + self._nsb.burr_5_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_5_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_5_fiber_t, None) ) @@ -1215,14 +1238,14 @@ def aind_burr_6_d_v_x001(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.burr_6_d_v_x001) @property - def aind_burr_6_fiber_t(self) -> Optional[Any]: + def aind_burr_6_fiber_t(self) -> Optional[FiberType]: """Maps burr_6_fiber_t to aind model""" return ( None if self._nsb.burr_6_fiber_t is None else { - self._nsb.burr_6_fiber_t.STANDARD_PROVIDED_BY_NSB: None, - self._nsb.burr_6_fiber_t.CUSTOM: None, + self._nsb.burr_6_fiber_t.STANDARD_PROVIDED_BY_NSB: FiberType.STANDARD, + self._nsb.burr_6_fiber_t.CUSTOM: FiberType.CUSTOM, }.get(self._nsb.burr_6_fiber_t, None) ) @@ -1596,23 +1619,9 @@ def aind_fiber_implant1_dv(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant1_dv) @property - def aind_fiber_implant1_lengt(self) -> Optional[Any]: + def aind_fiber_implant1_lengt(self) -> Optional[Decimal]: """Maps fiber_implant1_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant1_lengt is None - else { - self._nsb.fiber_implant1_lengt.SELECT: None, - self._nsb.fiber_implant1_lengt.N_15_MM: None, - self._nsb.fiber_implant1_lengt.N_20_MM: None, - self._nsb.fiber_implant1_lengt.N_25_MM: None, - self._nsb.fiber_implant1_lengt.N_30_MM: None, - self._nsb.fiber_implant1_lengt.N_35_MM: None, - self._nsb.fiber_implant1_lengt.N_40_MM: None, - self._nsb.fiber_implant1_lengt.N_45_MM: None, - self._nsb.fiber_implant1_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant1_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant1_lengt) @property def aind_fiber_implant2_dv(self) -> Optional[Decimal]: @@ -1620,23 +1629,9 @@ def aind_fiber_implant2_dv(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant2_dv) @property - def aind_fiber_implant2_lengt(self) -> Optional[Any]: + def aind_fiber_implant2_lengt(self) -> Optional[Decimal]: """Maps fiber_implant2_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant2_lengt is None - else { - self._nsb.fiber_implant2_lengt.SELECT: None, - self._nsb.fiber_implant2_lengt.N_15_MM: None, - self._nsb.fiber_implant2_lengt.N_20_MM: None, - self._nsb.fiber_implant2_lengt.N_25_MM: None, - self._nsb.fiber_implant2_lengt.N_30_MM: None, - self._nsb.fiber_implant2_lengt.N_35_MM: None, - self._nsb.fiber_implant2_lengt.N_40_MM: None, - self._nsb.fiber_implant2_lengt.N_45_MM: None, - self._nsb.fiber_implant2_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant2_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant2_lengt) @property def aind_fiber_implant3_d_x00(self) -> Optional[Decimal]: @@ -1644,23 +1639,9 @@ def aind_fiber_implant3_d_x00(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant3_d_x00) @property - def aind_fiber_implant3_lengt(self) -> Optional[Any]: + def aind_fiber_implant3_lengt(self) -> Optional[Decimal]: """Maps fiber_implant3_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant3_lengt is None - else { - self._nsb.fiber_implant3_lengt.SELECT: None, - self._nsb.fiber_implant3_lengt.N_15_MM: None, - self._nsb.fiber_implant3_lengt.N_20_MM: None, - self._nsb.fiber_implant3_lengt.N_25_MM: None, - self._nsb.fiber_implant3_lengt.N_30_MM: None, - self._nsb.fiber_implant3_lengt.N_35_MM: None, - self._nsb.fiber_implant3_lengt.N_40_MM: None, - self._nsb.fiber_implant3_lengt.N_45_MM: None, - self._nsb.fiber_implant3_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant3_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant3_lengt) @property def aind_fiber_implant4_d_x00(self) -> Optional[Decimal]: @@ -1668,23 +1649,9 @@ def aind_fiber_implant4_d_x00(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant4_d_x00) @property - def aind_fiber_implant4_lengt(self) -> Optional[Any]: + def aind_fiber_implant4_lengt(self) -> Optional[Decimal]: """Maps fiber_implant4_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant4_lengt is None - else { - self._nsb.fiber_implant4_lengt.SELECT: None, - self._nsb.fiber_implant4_lengt.N_15_MM: None, - self._nsb.fiber_implant4_lengt.N_20_MM: None, - self._nsb.fiber_implant4_lengt.N_25_MM: None, - self._nsb.fiber_implant4_lengt.N_30_MM: None, - self._nsb.fiber_implant4_lengt.N_35_MM: None, - self._nsb.fiber_implant4_lengt.N_40_MM: None, - self._nsb.fiber_implant4_lengt.N_45_MM: None, - self._nsb.fiber_implant4_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant4_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant4_lengt) @property def aind_fiber_implant5_d_x00(self) -> Optional[Decimal]: @@ -1692,23 +1659,9 @@ def aind_fiber_implant5_d_x00(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant5_d_x00) @property - def aind_fiber_implant5_lengt(self) -> Optional[Any]: + def aind_fiber_implant5_lengt(self) -> Optional[Decimal]: """Maps fiber_implant5_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant5_lengt is None - else { - self._nsb.fiber_implant5_lengt.SELECT: None, - self._nsb.fiber_implant5_lengt.N_15_MM: None, - self._nsb.fiber_implant5_lengt.N_20_MM: None, - self._nsb.fiber_implant5_lengt.N_25_MM: None, - self._nsb.fiber_implant5_lengt.N_30_MM: None, - self._nsb.fiber_implant5_lengt.N_35_MM: None, - self._nsb.fiber_implant5_lengt.N_40_MM: None, - self._nsb.fiber_implant5_lengt.N_45_MM: None, - self._nsb.fiber_implant5_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant5_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant5_lengt) @property def aind_fiber_implant6_d_x00(self) -> Optional[Decimal]: @@ -1716,23 +1669,9 @@ def aind_fiber_implant6_d_x00(self) -> Optional[Decimal]: return self._map_float_to_decimal(self._nsb.fiber_implant6_d_x00) @property - def aind_fiber_implant6_lengt(self) -> Optional[Any]: + def aind_fiber_implant6_lengt(self) -> Optional[Decimal]: """Maps fiber_implant6_lengt to aind model""" - return ( - None - if self._nsb.fiber_implant6_lengt is None - else { - self._nsb.fiber_implant6_lengt.SELECT: None, - self._nsb.fiber_implant6_lengt.N_15_MM: None, - self._nsb.fiber_implant6_lengt.N_20_MM: None, - self._nsb.fiber_implant6_lengt.N_25_MM: None, - self._nsb.fiber_implant6_lengt.N_30_MM: None, - self._nsb.fiber_implant6_lengt.N_35_MM: None, - self._nsb.fiber_implant6_lengt.N_40_MM: None, - self._nsb.fiber_implant6_lengt.N_45_MM: None, - self._nsb.fiber_implant6_lengt.N_50_MM: None, - }.get(self._nsb.fiber_implant6_lengt, None) - ) + return self._parse_fiber_length_mm_str(self._nsb.fiber_implant6_lengt) @property def aind_first_inj_recovery(self) -> Optional[Decimal]: @@ -3254,8 +3193,10 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj1volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant1_dv, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant1_dv, + fiber_type=self.aind_burr_1_fiber_t, + fiber_implant_length=self.aind_fiber_implant1_lengt, ) elif burr_hole_num == 2: coordinate_depth = self._map_burr_hole_dv( @@ -3292,8 +3233,10 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj2volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant2_dv, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant2_dv, + fiber_type=self.aind_burr_2_fiber_t, + fiber_implant_length=self.aind_fiber_implant2_lengt, ) elif burr_hole_num == 3: coordinate_depth = self._map_burr_hole_dv( @@ -3330,8 +3273,10 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj3volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant3_d_x00, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant3_d_x00, + fiber_type=self.aind_burr_3_fiber_t, + fiber_implant_length=self.aind_fiber_implant3_lengt, ) elif burr_hole_num == 4: coordinate_depth = self._map_burr_hole_dv( @@ -3368,8 +3313,10 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj4volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant4_d_x00, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant4_d_x00, + fiber_type=self.aind_burr_4_fiber_t, + fiber_implant_length=self.aind_fiber_implant4_lengt, ) elif burr_hole_num == 5: coordinate_depth = self._map_burr_hole_dv( @@ -3406,8 +3353,10 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj5volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant5_d_x00, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant5_d_x00, + fiber_type=self.aind_burr_5_fiber_t, + fiber_implant_length=self.aind_fiber_implant5_lengt, ) elif burr_hole_num == 6: coordinate_depth = self._map_burr_hole_dv( @@ -3444,29 +3393,14 @@ def burr_hole_info(self, burr_hole_num: int) -> BurrHoleInfo: inj_volume=self._map_burr_hole_volume( vol=self.aind_inj6volperdepth, dv=coordinate_depth ), - fiber_implant_depth=self.aind_fiber_implant6_d_x00, inj_materials=injectable_materials, + fiber_implant_depth=self.aind_fiber_implant6_d_x00, + fiber_type=self.aind_burr_6_fiber_t, + fiber_implant_length=self.aind_fiber_implant6_lengt, ) else: return BurrHoleInfo() - @staticmethod - def _map_burr_hole_number_to_probe( - burr_hole_num: int, - ) -> Optional[str]: - """Maps NSB Burr hole number into AIND ProbeName""" - # TODO: add probes for burr_hole_nums 5 and 6 - if burr_hole_num == 1: - return "Probe A" - elif burr_hole_num == 2: - return "Probe B" - elif burr_hole_num == 3: - return "Probe C" - elif burr_hole_num == 4: - return "Probe D" - else: - return None - @staticmethod def _map_burr_hole_dv(dv1, dv2, dv3): """Maps dvs for a burr hole to one coordinate depth list""" @@ -3536,6 +3470,48 @@ def _pair_burr_hole_inj_materials( injectable_materials.append(injectable_material) return injectable_materials + def _map_burr_fiber_probe(self, burr_info: BurrHoleInfo) -> FiberProbe: + """Constructs a fiber probe""" + if burr_info.fiber_type == FiberType.STANDARD: + return FiberProbe.model_construct( + manufacturer=Organization.NEUROPHOTOMETRICS, + core_diameter=200, + numerical_aperture=0.37, + ferrule_material=FerruleMaterial.CERAMIC, + total_length=burr_info.fiber_implant_length, + ) + elif burr_info.fiber_type == FiberType.CUSTOM: + # if custom, specs are stored in requestor comments + return FiberProbe.model_construct( + total_length=burr_info.fiber_implant_length, + notes=self.aind_long_requestor_comments, + ) + else: + return FiberProbe.model_construct( + total_length=burr_info.fiber_implant_length, + ) + + @staticmethod + def assign_fiber_probe_names(procedures: List) -> None: + """Assigns ordered names to FiberProbe objects within each fiber implant""" + all_probes = [] + for proc in procedures: + if isinstance(proc, FiberImplant): + all_probes.extend(proc.probes) + + # Sort all probes based on ap (descending) and ml (ascending) + sorted_probes = sorted( + all_probes, + key=lambda probe: ( + -float(probe.stereotactic_coordinate_ap), + float(probe.stereotactic_coordinate_ml), + ), + ) + for probe_index, probe in enumerate(sorted_probes): + probe.ophys_probe.name = f"Fiber_{probe_index}" + + return None + def get_procedure(self) -> List[Surgery]: """Get a List of Surgeries""" # Surgery info @@ -3760,7 +3736,6 @@ def get_procedure(self) -> List[Surgery]: BurrHoleProcedure.FIBER_IMPLANT, BurrHoleProcedure.INJECTION_FIBER_IMPLANT, }: - probe_name = self._map_burr_hole_number_to_probe(burr_hole_num) burr_hole_info = self.burr_hole_info( burr_hole_num=burr_hole_num ) @@ -3769,16 +3744,9 @@ def get_procedure(self) -> List[Surgery]: inj_type=burr_hole_info.inj_type, ) bregma_to_lambda_distance = self.aind_breg2_lamb - # Need to figure out core_diameter, numerical_aperture, - # total_length, and targeted_structure - fiber_probe = FiberProbe.model_construct( - name=probe_name, - core_diameter=None, - numerical_aperture=None, - total_length=None, - ) + fiber_probe = self._map_burr_fiber_probe(burr_hole_info) ophys_probe = OphysProbe.model_construct( - fiber_probe=fiber_probe, + ophys_probe=fiber_probe, targeted_structure=None, stereotactic_coordinate_ml=burr_hole_info.coordinate_ml, stereotactic_coordinate_ap=burr_hole_info.coordinate_ap, @@ -3815,6 +3783,7 @@ def get_procedure(self) -> List[Surgery]: surgeries = [] if initial_procedures: + self.assign_fiber_probe_names(initial_procedures) initial_surgery = Surgery.model_construct( start_date=initial_start_date, experimenter_full_name=experimenter_full_name, @@ -3828,6 +3797,7 @@ def get_procedure(self) -> List[Surgery]: ) surgeries.append(initial_surgery) if followup_procedures: + self.assign_fiber_probe_names(followup_procedures) followup_surgery = Surgery.model_construct( start_date=followup_start_date, experimenter_full_name=experimenter_full_name, @@ -3843,6 +3813,7 @@ def get_procedure(self) -> List[Surgery]: # any other mapped procedures without During info will be put into one surgery object if other_procedures: + self.assign_fiber_probe_names(other_procedures) other_surgery = Surgery.model_construct( start_date=None, experimenter_full_name=experimenter_full_name, diff --git a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item14.json b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item14.json index cc5476cc..5484f70b 100644 --- a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item14.json +++ b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item14.json @@ -1,221 +1,313 @@ [ { + "procedure_type": "Surgery", "start_date": "2022-01-03", "experimenter_full_name": "NSB-187", "iacuc_protocol": "2103", "animal_weight_prior": "25.2", "animal_weight_post": "28.2", + "weight_unit": "gram", "anaesthesia": { "type": "isoflurane", "duration": "90.0", - "level": "2.0", - "duration_unit": "minute" + "duration_unit": "minute", + "level": "2.0" }, "workstation_id": "SWS 4", "procedures": [ { + "procedure_type": "Headframe", "headframe_type": "Frontal Ctx", "headframe_part_number": "0160-100-46", + "headframe_material": null, "well_part_number": "0160-055-08", - "well_type": "WHC NP", - "procedure_type": "Headframe", - "headframe_material": null + "well_type": "WHC NP" }, { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-5.2", "injection_coordinate_ap": "-0.85", "injection_coordinate_depth": [ "-3.1" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, + "bregma_to_lambda_unit": "millimeter", "injection_angle": "0.0", + "injection_angle_unit": "degrees", + "targeted_structure": null, "injection_hemisphere": "Left", + "procedure_type": "Nanoject injection", "injection_volume": [ "600.0" ], - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", - "bregma_to_lambda_unit": "millimeter", - "injection_angle_unit": "degrees", - "targeted_structure": null, - "procedure_type": "Nanoject injection", "injection_volume_unit": "nanoliter" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "numerical_aperture": 0.37, + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-0.85", "stereotactic_coordinate_ml": "-5.2", "stereotactic_coordinate_dv": "-2.95", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] }, { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-0.5", "injection_coordinate_ap": "2.0", "injection_coordinate_depth": [ "5.0" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Left", - "injection_current": null, - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Left", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": null, + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": "2.5", + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "2.0", "stereotactic_coordinate_ml": "-0.5", "stereotactic_coordinate_dv": "-1.05", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] } ], - "notes": null, - "procedure_type": "Surgery", - "weight_unit": "gram" + "notes": null }, { + "procedure_type": "Surgery", "start_date": "2022-01-03", "experimenter_full_name": "NSB-187", "iacuc_protocol": "2103", "animal_weight_prior": "25.2", "animal_weight_post": "28.2", + "weight_unit": "gram", "anaesthesia": { "type": "isoflurane", "duration": "90.0", - "level": "2.0", - "duration_unit": "minute" + "duration_unit": "minute", + "level": "2.0" }, "workstation_id": "SWS 4", "procedures": [ { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-2.2", "injection_coordinate_ap": "-6.1", "injection_coordinate_depth": [ "3.1" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Left", - "injection_current": "5", - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Left", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": "5", + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-6.1", "stereotactic_coordinate_ml": "-2.2", "stereotactic_coordinate_dv": "-1.85", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] }, { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-2.5", "injection_coordinate_ap": "1.0", "injection_coordinate_depth": [ "3.0" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Right", - "injection_current": "5", - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Right", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": "5", + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "1.0", "stereotactic_coordinate_ml": "-2.5", "stereotactic_coordinate_dv": "-1.8", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] } ], - "notes": null, - "procedure_type": "Surgery", - "weight_unit": "gram" + "notes": null } ] \ No newline at end of file diff --git a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item15.json b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item15.json index 534e1c98..bf2dbd24 100644 --- a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item15.json +++ b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item15.json @@ -60,7 +60,30 @@ "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", "angle_unit": "degrees", - "notes": null + "notes": null, + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_2" + } } ], "procedure_type": "Fiber implant" @@ -103,7 +126,30 @@ "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", "angle_unit": "degrees", - "notes": null + "notes": null, + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": "2.5", + "length_unit": "millimeter", + "name": "Fiber_0" + } } ], "procedure_type": "Fiber implant" @@ -146,7 +192,30 @@ "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", "angle_unit": "degrees", - "notes": null + "notes": null, + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_3" + } } ], "procedure_type": "Fiber implant" @@ -189,7 +258,30 @@ "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", "angle_unit": "degrees", - "notes": null + "notes": null, + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + } } ], "procedure_type": "Fiber implant" diff --git a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item16.json b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item16.json index 05174976..c124692d 100644 --- a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item16.json +++ b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item16.json @@ -49,6 +49,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": "2.5", + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "2.0", "stereotactic_coordinate_ml": "-0.5", @@ -111,6 +134,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-6.1", "stereotactic_coordinate_ml": "-2.2", @@ -169,6 +215,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-0.85", "stereotactic_coordinate_ml": "-5.2", @@ -212,6 +281,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "1.0", "stereotactic_coordinate_ml": "-2.5", diff --git a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item17.json b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item17.json index 55158037..e6351a1b 100644 --- a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item17.json +++ b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item17.json @@ -49,6 +49,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": "2.5", + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "2.0", "stereotactic_coordinate_ml": "-0.5", @@ -111,6 +134,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-6.1", "stereotactic_coordinate_ml": "-2.2", @@ -169,6 +215,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-0.85", "stereotactic_coordinate_ml": "-5.2", @@ -212,6 +281,29 @@ { "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "1.0", "stereotactic_coordinate_ml": "-2.5", diff --git a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item19.json b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item19.json index 6737858e..20869872 100644 --- a/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item19.json +++ b/tests/resources/sharepoint/nsb2023/mapped/mapped_list_item19.json @@ -1,73 +1,93 @@ [ { + "procedure_type": "Surgery", "start_date": "2022-01-03", "experimenter_full_name": "NSB-187", "iacuc_protocol": "2103", "animal_weight_prior": "25.2", "animal_weight_post": "28.2", + "weight_unit": "gram", "anaesthesia": { "type": "isoflurane", "duration": "90.0", - "level": "2.0", - "duration_unit": "minute" + "duration_unit": "minute", + "level": "2.0" }, "workstation_id": "SWS 4", "procedures": [ { + "procedure_type": "Headframe", "headframe_type": "WHC 2P", "headframe_part_number": "0160-100-45", + "headframe_material": null, "well_part_number": "0160-200-62", - "well_type": "WHC 2P", - "procedure_type": "Headframe", - "headframe_material": null + "well_type": "WHC 2P" }, { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-0.5", "injection_coordinate_ap": "2.0", "injection_coordinate_depth": [ "5.0" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Left", - "injection_current": null, - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Left", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": null, + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": null, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter_unit": "micrometer", + "ferrule_material": null, + "active_length": null, + "total_length": "2.5", + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "2.0", "stereotactic_coordinate_ml": "-0.5", "stereotactic_coordinate_dv": "-1.05", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] }, { "injection_materials": [], "recovery_time": "25.0", + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-0.3", "injection_coordinate_ap": "1.2", @@ -75,188 +95,250 @@ "1.4", "1.2" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": null, - "injection_hemisphere": null, - "injection_current": null, - "alternating_current": null, - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": null, "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": null, "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": null, + "injection_current_unit": "microamps", + "alternating_current": null } ], - "notes": null, - "procedure_type": "Surgery", - "weight_unit": "gram" + "notes": null }, { + "procedure_type": "Surgery", "start_date": null, "experimenter_full_name": "NSB-187", "iacuc_protocol": "2103", "animal_weight_prior": null, "animal_weight_post": null, + "weight_unit": "gram", "anaesthesia": { "type": "isoflurane", "duration": null, - "level": null, - "duration_unit": "minute" + "duration_unit": "minute", + "level": null }, "workstation_id": null, "procedures": [ { "injection_materials": [], "recovery_time": null, + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-2.2", "injection_coordinate_ap": "-6.1", "injection_coordinate_depth": [ "3.1" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Left", - "injection_current": "5", - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Left", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": "5", + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-6.1", "stereotactic_coordinate_ml": "-2.2", "stereotactic_coordinate_dv": "-1.85", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] } ], - "notes": null, - "procedure_type": "Surgery", - "weight_unit": "gram" + "notes": null }, { + "procedure_type": "Surgery", "start_date": null, "experimenter_full_name": "NSB-187", "iacuc_protocol": "2103", "animal_weight_prior": null, "animal_weight_post": null, + "weight_unit": "gram", "anaesthesia": null, "workstation_id": null, "procedures": [ { "injection_materials": [], "recovery_time": null, + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-5.2", "injection_coordinate_ap": "-0.85", "injection_coordinate_depth": [ "-3.1" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, + "bregma_to_lambda_unit": "millimeter", "injection_angle": "0.0", + "injection_angle_unit": "degrees", + "targeted_structure": null, "injection_hemisphere": "Left", + "procedure_type": "Nanoject injection", "injection_volume": [ "600.0" ], - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", - "bregma_to_lambda_unit": "millimeter", - "injection_angle_unit": "degrees", - "targeted_structure": null, - "procedure_type": "Nanoject injection", "injection_volume_unit": "nanoliter" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": null, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": "Some custom specs.", + "core_diameter_unit": "micrometer", + "ferrule_material": null, + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_1" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "-0.85", "stereotactic_coordinate_ml": "-5.2", "stereotactic_coordinate_dv": "-2.95", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] }, { "injection_materials": [], "recovery_time": null, + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "-2.5", "injection_coordinate_ap": "1.0", "injection_coordinate_depth": [ "3.0" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": "0.0", - "injection_hemisphere": "Right", - "injection_current": "5", - "alternating_current": "7/7", - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": "0.0", "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Right", "procedure_type": "Iontophoresis injection", - "injection_current_unit": "microamps" + "injection_current": "5", + "injection_current_unit": "microamps", + "alternating_current": "7/7" }, { + "procedure_type": "Fiber implant", "probes": [ { + "ophys_probe": { + "device_type": "Fiber optic probe", + "serial_number": null, + "manufacturer": { + "name": "Neurophotometrics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "core_diameter": 200, + "numerical_aperture": 0.37, + "core_diameter_unit": "micrometer", + "ferrule_material": "Ceramic", + "active_length": null, + "total_length": null, + "length_unit": "millimeter", + "name": "Fiber_0" + }, "targeted_structure": null, "stereotactic_coordinate_ap": "1.0", "stereotactic_coordinate_ml": "-2.5", "stereotactic_coordinate_dv": "-1.8", + "stereotactic_coordinate_unit": "millimeter", "stereotactic_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "angle": "0.0", - "stereotactic_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "angle": "0.0", "angle_unit": "degrees", "notes": null } - ], - "procedure_type": "Fiber implant" + ] }, { "injection_materials": [], "recovery_time": null, + "recovery_time_unit": "minute", "injection_duration": null, + "injection_duration_unit": "minute", "instrument_id": null, "injection_coordinate_ml": "2.45", "injection_coordinate_ap": "1.0", @@ -265,23 +347,19 @@ "1.2", "2.0" ], + "injection_coordinate_unit": "millimeter", "injection_coordinate_reference": "Bregma", "bregma_to_lambda_distance": null, - "injection_angle": null, - "injection_hemisphere": "Left", - "injection_volume": null, - "recovery_time_unit": "minute", - "injection_duration_unit": "minute", - "injection_coordinate_unit": "millimeter", "bregma_to_lambda_unit": "millimeter", + "injection_angle": null, "injection_angle_unit": "degrees", "targeted_structure": null, + "injection_hemisphere": "Left", "procedure_type": "Nanoject injection", + "injection_volume": null, "injection_volume_unit": "nanoliter" } ], - "notes": null, - "procedure_type": "Surgery", - "weight_unit": "gram" + "notes": null } -] \ No newline at end of file +] diff --git a/tests/resources/sharepoint/nsb2023/raw/list_item19.json b/tests/resources/sharepoint/nsb2023/raw/list_item19.json index dea9ed3d..e1ed360c 100644 --- a/tests/resources/sharepoint/nsb2023/raw/list_item19.json +++ b/tests/resources/sharepoint/nsb2023/raw/list_item19.json @@ -39,7 +39,7 @@ "FirstInjRecovery": null, "Breg2Lamb": null, "SurgeryStatus": "Ready for Feedback", - "LongRequestorComments": null, + "LongRequestorComments": "Some custom specs.", "Procedure_x0020_Slots": "Single surgical session", "Procedure_x0020_Family": "Headpost only", "Procedure_x0020_T2": "Select...", @@ -153,11 +153,11 @@ "Burr_x0020_Hole_x0020_1_x0020_st": null, "Burr_x0020_1_x0020_DV_x0020_2": null, "Burr_x0020_1_x0020_D_x002f_V_x00": null, - "Burr_x0020_1_x0020_Fiber_x0020_t": "Standard (provided by NSB)", + "Burr_x0020_1_x0020_Fiber_x0020_t": "Custom", "Burr2_x0020_Status": null, "Burr_x0020_2_x0020_D_x002f_V_x00": null, "Burr_x0020_2_x0020_D_x002f_V_x000": null, - "Burr_x0020_2_x0020_Fiber_x0020_T": "Standard (Provided by NSB)", + "Burr_x0020_2_x0020_Fiber_x0020_T": "Edge case type", "Burr3_x0020_Status": null, "Inj3volperdepth": null, "Burr_x0020_3_x0020_D_x002f_V_x00": null, diff --git a/tests/sharepoint/nsb2023/test_mapping.py b/tests/sharepoint/nsb2023/test_mapping.py index 0b9e48a8..8ebbf0a6 100644 --- a/tests/sharepoint/nsb2023/test_mapping.py +++ b/tests/sharepoint/nsb2023/test_mapping.py @@ -163,7 +163,6 @@ def test_burr_hole_to_probe_edge_case(self): raw_data = deepcopy(list_item[0]) nsb_model = NSBList.model_validate(raw_data) mapper = MappedNSBList(nsb=nsb_model) - self.assertIsNone(mapper._map_burr_hole_number_to_probe(7)) self.assertEqual(BurrHoleInfo(), mapper.burr_hole_info(7))