Skip to content

Commit

Permalink
forgot to add files
Browse files Browse the repository at this point in the history
  • Loading branch information
calmacx committed Jan 31, 2024
1 parent 9ddd0f5 commit 8310075
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
54 changes: 54 additions & 0 deletions hdr_schemata/definitions/HDRUK/BiologicalSamples.py
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"
50 changes: 50 additions & 0 deletions hdr_schemata/models/HDRUK/v2_2_0/Coverage.py
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"])
26 changes: 26 additions & 0 deletions hdr_schemata/models/HDRUK/v2_2_0/Summary.py
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",
)

0 comments on commit 8310075

Please sign in to comment.