-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from enum import Enum | ||
|
||
|
||
class AnthropometricType(Enum): | ||
BLOOD_PRESSURE = "Blood Pressure" | ||
HIP_CIRCUMFERENCE = "Hip Circumference" | ||
HEIGHT = "Height" | ||
WAIST_CIRCUMFERENCE = "Waist Circumference" | ||
WEIGHT = "Weight" | ||
|
||
|
||
class BiologicalSampleType(Enum): | ||
BLOOD = "Blood" | ||
OTHER = "Other" | ||
URINE = "Urine" | ||
SALIVA = "Saliva" | ||
|
||
|
||
class PhysicalType(Enum): | ||
RESPIRATORY = "Respiratory" | ||
VISION = "Vision" | ||
HEARING = "Hearing" | ||
MUSCULOSKELETAL = "Musculoskeletal" | ||
CARDIOVASCULAR = "Cardiovascular" | ||
REPRODUCTIVE = "Reproductive" | ||
|
||
|
||
class PsychologicalType(Enum): | ||
COGNITIVE_FUNCTION = "Cognitive Function" | ||
MENTAL_HEALTH = "Mental Health" | ||
|
||
|
||
class LifestylesType(Enum): | ||
SMOKING = "Smoking" | ||
DIETARY_HABITS = "Dietary Habits" | ||
PHYSICAL_ACTIVITY = "Physical Activity" | ||
ALCOHOL = "Alcohol" | ||
|
||
|
||
class GenderType(Enum): | ||
MALE = "Male" | ||
FEMALE = "Female" | ||
OTHER = "Other" | ||
|
||
|
||
class SocioEconomicType(Enum): | ||
FINANCES = "Finances" | ||
FAMILY_CIRCUMSTANCES = "Family Circumstances" | ||
HOUSING = "Housing" | ||
EDUCATION = "Education" | ||
MARITAL_STATUS = "Marital Status" | ||
OCCUPATION = "Occupation" | ||
ETHNIC_GROUP = "Ethnic Group" | ||
SOCIAL_SUPPORT = "Social Support" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from hdr_schemata.models import remove_fields_from_cls | ||
from hdr_schemata.models.GWDM.v1_0 import Coverage as BaseCoverage | ||
from hdr_schemata.definitions.HDRUK.BiologicalSamples import * | ||
from typing import Optional, List | ||
from pydantic import Field | ||
|
||
|
||
class Coverage(BaseCoverage): | ||
class Config: | ||
extra = "forbid" | ||
|
||
gender: Optional[List[GenderType]] = Field( | ||
None, title="Gender", description="Male, Female, Other" | ||
) | ||
|
||
biologicalsamples: Optional[List[BiologicalSampleType]] = Field( | ||
None, title="Biological Samples", description="Blood, Saliva, Urine, Other" | ||
) | ||
|
||
psychological: Optional[List[PsychologicalType]] = Field( | ||
None, title="Psychological", description="Mental health, Cognitive function" | ||
) | ||
|
||
physical: Optional[List[PhysicalType]] = Field( | ||
None, | ||
title="Physical", | ||
description="Cardiovascular, Respiratory, Musculoskeletal, Hearing and Vision, Reproductive", | ||
) | ||
|
||
anthropometric: Optional[List[AnthropometricType]] = Field( | ||
None, | ||
title="Anthropometric", | ||
description="Height, Weight, Waist circumference, Hip circumference, Blood pressure", | ||
) | ||
|
||
lifestyle: Optional[List[LifestylesType]] = Field( | ||
None, | ||
title="Lifestyle", | ||
description="Cohort lifestyle habits: Smoking, Physical activity, Dietary habits, Alcohol", | ||
) | ||
|
||
socioeconomic: Optional[List[SocioEconomicType]] = Field( | ||
None, | ||
title="Socio-economic", | ||
description="Occupation, Family circumstances, Housing, Education, Ethnic group, Martial status, Social support", | ||
) | ||
|
||
|
||
# inherited physicalSampleAvailability but this has now been replaced by biologicalsamples | ||
remove_fields_from_cls(Coverage, ["physicalSampleAvailability"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import Optional | ||
from pydantic import Field | ||
from hdr_schemata.models.HDRUK.v2_1_2.Summary import Summary as BaseSummary | ||
from hdr_schemata.definitions.HDRUK import DatasetType | ||
|
||
|
||
class Summary(BaseSummary): | ||
datasetType: Optional[DatasetType] = Field( | ||
..., | ||
description="Placeholder for dataset type", | ||
examples=[[""]], | ||
title="Datasetype", | ||
) | ||
|
||
datasetSubType: Optional[DatasetType] = Field( | ||
..., | ||
description="Placeholder for dataset sub-type", | ||
examples=[[""]], | ||
title="Datasetype", | ||
) | ||
|
||
populationSize: Optional[int] = Field( | ||
..., | ||
description="Summary population size of the cohort", | ||
title="Population size", | ||
) |