terra.models.v2.body

 1#  Copyright 2022 Terra Enabling Developers Limited
 2#
 3#  Licensed under the Apache License, Version 2.0 (the "License");
 4#  you may not use this file except in compliance with the License.
 5#  You may obtain a copy of the License at
 6#
 7#      http://www.apache.org/licenses/LICENSE-2.0
 8#
 9#  Unless required by applicable law or agreed to in writing, software
10#  distributed under the License is distributed on an "AS IS" BASIS,
11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#  See the License for the specific language governing permissions and
13#  limitations under the License.
14import dataclasses
15import typing
16
17from terra.models import base_model
18from terra.models.v2 import activity
19from terra.models.v2 import samples as samples_
20from terra.models.v2.activity import OxygenData
21
22__all__ = ["Body"]
23
24
25@dataclasses.dataclass
26class Metadata(base_model.TerraDataModel):
27    start_time: typing.Optional[str] = dataclasses.field(default=None)
28    end_time: typing.Optional[str] = dataclasses.field(default=None)
29
30
31@dataclasses.dataclass
32class DeviceData(base_model.TerraDataModel):
33    name: typing.Optional[str] = dataclasses.field(default=None)
34    activation_timestamp: typing.Optional[str] = dataclasses.field(default=None)
35    manufacturer: typing.Optional[str] = dataclasses.field(default=None)
36    serial_number: typing.Optional[str] = dataclasses.field(default=None)
37    software_version: typing.Optional[str] = dataclasses.field(default=None)
38    hardware_version: typing.Optional[str] = dataclasses.field(default=None)
39    other_devices: typing.List[samples_.OtherDeviceData] = dataclasses.field(default_factory=list)
40
41
42@dataclasses.dataclass
43class MeasurementsData(base_model.TerraDataModel):
44    measurements: typing.List[samples_.MeasurementDataSample] = dataclasses.field(default_factory=list)
45
46
47@dataclasses.dataclass
48class TemperatureData(base_model.TerraDataModel):
49    ambient_temperature_samples: typing.List[samples_.TemperatureSample] = dataclasses.field(default_factory=list)
50    body_temperature_samples: typing.List[samples_.TemperatureSample] = dataclasses.field(default_factory=list)
51    skin_temperature_samples: typing.List[samples_.TemperatureSample] = dataclasses.field(default_factory=list)
52
53
54@dataclasses.dataclass
55class HydrationData(base_model.TerraDataModel):
56    hydration_amount_samples: typing.List[samples_.HydrationMeasurementSample] = dataclasses.field(default_factory=list)
57    day_total_water_consumption_ml: typing.Optional[float] = dataclasses.field(default=None)
58
59
60@dataclasses.dataclass
61class HeartData(base_model.TerraDataModel):
62    heart_rate_data: activity.HeartRateData = dataclasses.field(default_factory=activity.HeartRateData)
63    pulse_wave_velocity_samples: typing.List[samples_.PulseVelocitySample] = dataclasses.field(default_factory=list)
64    afib_classification_samples: typing.List[samples_.AFibClassificationSample] = dataclasses.field(
65        default_factory=list
66    )
67
68
69@dataclasses.dataclass
70class BloodPressureData(base_model.TerraDataModel):
71    blood_pressure_samples: typing.List[samples_.BloodPressureSample] = dataclasses.field(default_factory=list)
72
73
74@dataclasses.dataclass
75class GlucoseData(base_model.TerraDataModel):
76    day_avg_blood_glucose_mg_per_dL: typing.Optional[float] = dataclasses.field(default=None)
77    blood_glucose_samples: typing.List[samples_.GlucoseDataSample] = dataclasses.field(default_factory=list)
78    detailed_blood_glucose_samples: typing.List[samples_.GlucoseDataSample] = dataclasses.field(default_factory=list)
79
80
81@dataclasses.dataclass
82class Body(base_model.TerraDataModel):
83    metadata: Metadata = dataclasses.field(default_factory=Metadata)
84    measurements_data: MeasurementsData = dataclasses.field(default_factory=MeasurementsData)
85    temperature_data: TemperatureData = dataclasses.field(default_factory=TemperatureData)
86    hydration_data: HydrationData = dataclasses.field(default_factory=HydrationData)
87    oxygen_data: OxygenData = dataclasses.field(default_factory=OxygenData)
88    heart_data: HeartData = dataclasses.field(default_factory=HeartData)
89    blood_pressure_data: BloodPressureData = dataclasses.field(default_factory=BloodPressureData)
90    glucose_data: GlucoseData = dataclasses.field(default_factory=GlucoseData)
91    device_data: DeviceData = dataclasses.field(default_factory=DeviceData)
@dataclasses.dataclass
class Body(terra.models.base_model.TerraDataModel):
82@dataclasses.dataclass
83class Body(base_model.TerraDataModel):
84    metadata: Metadata = dataclasses.field(default_factory=Metadata)
85    measurements_data: MeasurementsData = dataclasses.field(default_factory=MeasurementsData)
86    temperature_data: TemperatureData = dataclasses.field(default_factory=TemperatureData)
87    hydration_data: HydrationData = dataclasses.field(default_factory=HydrationData)
88    oxygen_data: OxygenData = dataclasses.field(default_factory=OxygenData)
89    heart_data: HeartData = dataclasses.field(default_factory=HeartData)
90    blood_pressure_data: BloodPressureData = dataclasses.field(default_factory=BloodPressureData)
91    glucose_data: GlucoseData = dataclasses.field(default_factory=GlucoseData)
92    device_data: DeviceData = dataclasses.field(default_factory=DeviceData)

Body(metadata: terra.models.v2.body.Metadata = , measurements_data: terra.models.v2.body.MeasurementsData = , temperature_data: terra.models.v2.body.TemperatureData = , hydration_data: terra.models.v2.body.HydrationData = , oxygen_data: terra.models.v2.activity.OxygenData = , heart_data: terra.models.v2.body.HeartData = , blood_pressure_data: terra.models.v2.body.BloodPressureData = , glucose_data: terra.models.v2.body.GlucoseData = , device_data: terra.models.v2.body.DeviceData = )

Body( metadata: terra.models.v2.body.Metadata = <factory>, measurements_data: terra.models.v2.body.MeasurementsData = <factory>, temperature_data: terra.models.v2.body.TemperatureData = <factory>, hydration_data: terra.models.v2.body.HydrationData = <factory>, oxygen_data: terra.models.v2.activity.OxygenData = <factory>, heart_data: terra.models.v2.body.HeartData = <factory>, blood_pressure_data: terra.models.v2.body.BloodPressureData = <factory>, glucose_data: terra.models.v2.body.GlucoseData = <factory>, device_data: terra.models.v2.body.DeviceData = <factory>)