Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/bdc_variable_library/datamodel/bdc_variable_library.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from bdc_variable_library.yaml by pythongen.py version: 0.0.1
# Generation date: 2026-07-14T11:45:29
# Generation date: 2026-07-21T15:37:17
# Schema: bdc-variable-library
#
# id: https://w3id.org/linkml/bdc-variable-library
Expand Down Expand Up @@ -124,6 +124,10 @@ class CompoundHeight002Id(CompoundVariableId):
pass


class CompoundHeight001Id(CompoundVariableId):
pass


class IntegratedHeight001Id(IntegratedVariableId):
pass

Expand Down Expand Up @@ -457,6 +461,29 @@ def __post_init__(self, *_: str, **kwargs: Any):
super().__post_init__(**kwargs)


@dataclass(repr=False)
class CompoundHeight001(CompoundVariable):
"""
Height variable with metadata, measured in cm and collected using a wall-mounted stadiometer
"""
_inherited_slots: ClassVar[list[str]] = []

class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["CompoundHeight001"]
class_class_curie: ClassVar[str] = "bdc_variable_library:CompoundHeight001"
class_name: ClassVar[str] = "CompoundHeight001"
class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.CompoundHeight001

id: Union[str, CompoundHeight001Id] = None

def __post_init__(self, *_: str, **kwargs: Any):
if self._is_empty(self.id):
self.MissingRequiredField("id")
if not isinstance(self.id, CompoundHeight001Id):
self.id = CompoundHeight001Id(self.id)

super().__post_init__(**kwargs)


@dataclass(repr=False)
class IntegratedHeight001(IntegratedVariable):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,26 @@ class CompoundHeight002(CompoundVariable):
id: str = Field(default=..., description="""A unique identifier for a variable within BDC""", json_schema_extra = { "linkml_meta": {'domain_of': ['Entity'], 'slot_uri': 'schema:identifier'} })


class CompoundHeight001(CompoundVariable):
"""
Height variable with metadata, measured in cm and collected using a wall-mounted stadiometer
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library',
'instantiates': ['HumanBodyHeightRecord001']})

cde_id: Optional[str] = Field(default=None, description="""CURIE from Condor""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable', 'IntegratedVariable']} })
bdchm_type: Optional[BdchmTypeEnum] = Field(default=None, description="""Entity type from BDCHM that defines the variable type""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable', 'IntegratedVariable']} })
metadata: Optional[list[MetadataVariable]] = Field(default=None, description="""List of variable identifiers providing metadata for a compound variable""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} })
alert_value: Optional[list[str]] = Field(default=None, description="""List of values that provide extra optional information about a variable. Often this is used to indicate a violation of QA/QC""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} })
associated_study: Optional[str] = Field(default=None, description="""The study that produced the variable data""", json_schema_extra = { "linkml_meta": {'domain_of': ['Variable'], 'slot_uri': 'bdchm:ResearchStudy'} })
variable_description: Optional[str] = Field(default=None, description="""Human readable description of the variable.""", json_schema_extra = { "linkml_meta": {'domain_of': ['Variable']} })
concept_type: Optional[str] = Field(default=None, description="""CURIE describing the main content of the variable. This can be from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['Variable']} })
variable_label: Optional[str] = Field(default=None, description="""Human readable label describing the variable""", json_schema_extra = { "linkml_meta": {'domain_of': ['Variable']} })
unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'],
'slot_uri': 'bdchm:unit'} })
id: str = Field(default=..., description="""A unique identifier for a variable within BDC""", json_schema_extra = { "linkml_meta": {'domain_of': ['Entity'], 'slot_uri': 'schema:identifier'} })


class IntegratedHeight001(IntegratedVariable):
"""
Height variable containing data from multiple studies, normalized to cm
Expand Down Expand Up @@ -2358,5 +2378,6 @@ class ResearchStudy(Entity):
AlertValue.model_rebuild()
MetadataVariable.model_rebuild()
CompoundHeight002.model_rebuild()
CompoundHeight001.model_rebuild()
IntegratedHeight001.model_rebuild()
ResearchStudy.model_rebuild()
8 changes: 8 additions & 0 deletions src/bdc_variable_library/schema/bdc_variable_library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ classes:
wall-mounted stadiometer
instantiates:
- HumanBodyHeightRecord002

CompoundHeight001:
is_a: CompoundVariable
description: >-
Height variable with metadata, measured in cm and collected using a
wall-mounted stadiometer
instantiates:
- HumanBodyHeightRecord001

IntegratedHeight001:
is_a: IntegratedVariable
Expand Down
15 changes: 15 additions & 0 deletions tests/data/valid/CompoundHeight001-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
id: ARICABI5phv00294492c
associated_study: ARIC000280
variable_description: "Height"
concept_type: OBA:VT0001253
variable_label: "Height"
cde_id: CONDOR:00003
bdchm_type: observation
unit: https://units-of-measurement.org/cm
metadata:
- id: ARICABI5phv00294492s
microschema_slot: measurement_value
- id: ARICABI4phv00294491s
microschema_slot: age_at_measurement
- id: ARICSUBJECT_IDphv00294489s
microschema_slot: subject_identifier
5 changes: 3 additions & 2 deletions tests/data/valid/IntegratedHeight001-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ associated_study: DMCPilotv1
variable_description: "Height"
concept_type: OBA:VT0001253
variable_label: "Height"
cde_id: CONDOR:00001
cde_id: CONDOR:00003
bdchm_type: observation
unit: UCUM:cm
integrates:
- FHSg3b0483phv00177539c
- FHSg3b0483phv00177539c
- ARICABI5phv00294492c
12 changes: 12 additions & 0 deletions tests/data/valid/SingleVariable-004test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
id: ARICABI5phv00294492s
associated_study: ARIC000280
variable_description: "Height"
concept_type: OBA:VT0001253
variable_label: "Height"
source_id: phv00294492v3p3
file_id: pht006414v3p3
file_name: ABI
variable_name: ABI5
source_variable_description: "Body height, height [Ankle Brachial BP index. ABI. Visit 5]"
data_type: decimal
unit: https://units-of-measurement.org/cm
10 changes: 10 additions & 0 deletions tests/data/valid/SingleVariable-005test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
id: ARICSUBJECT_IDphv00294489s
associated_study: ARIC000280
variable_description: "Participant Identifier"
variable_label: "Participant Identifier"
source_id: phv00294489v3p3
file_id: pht006414v3p3
file_name: ABI
variable_name: shareid
source_variable_description: "De-identified ARIC subject ID [Ankle Brachial BP Index, ABI. Visit 5]"
data_type: uriorcurie
11 changes: 11 additions & 0 deletions tests/data/valid/SingleVariable-006test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id: ARICABI4phv00294491s
associated_study: ARIC000280
variable_description: "Participant age at visit 5"
variable_label: "Participant Age"
source_id: phv00294491v3p3
file_id: pht006414v3p3
file_name: ABI
variable_name: ABI4
source_variable_description: "Age [Ankle Brachial BP index, ABI. Visit 5]"
data_type: integer
unit: UCUM:a
Loading