diff --git a/src/bdc_variable_library/datamodel/bdc_variable_library.py b/src/bdc_variable_library/datamodel/bdc_variable_library.py index 3e4d660..f973975 100644 --- a/src/bdc_variable_library/datamodel/bdc_variable_library.py +++ b/src/bdc_variable_library/datamodel/bdc_variable_library.py @@ -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 @@ -124,6 +124,10 @@ class CompoundHeight002Id(CompoundVariableId): pass +class CompoundHeight001Id(CompoundVariableId): + pass + + class IntegratedHeight001Id(IntegratedVariableId): pass @@ -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): """ diff --git a/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py b/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py index 37383d9..59002d7 100644 --- a/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py +++ b/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py @@ -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 @@ -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() diff --git a/src/bdc_variable_library/schema/bdc_variable_library.yaml b/src/bdc_variable_library/schema/bdc_variable_library.yaml index b6afd2a..30cfc9f 100644 --- a/src/bdc_variable_library/schema/bdc_variable_library.yaml +++ b/src/bdc_variable_library/schema/bdc_variable_library.yaml @@ -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 diff --git a/tests/data/valid/CompoundHeight001-test.yml b/tests/data/valid/CompoundHeight001-test.yml new file mode 100644 index 0000000..39813e4 --- /dev/null +++ b/tests/data/valid/CompoundHeight001-test.yml @@ -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 diff --git a/tests/data/valid/IntegratedHeight001-test.yaml b/tests/data/valid/IntegratedHeight001-test.yaml index 9c0561d..fa0f81a 100644 --- a/tests/data/valid/IntegratedHeight001-test.yaml +++ b/tests/data/valid/IntegratedHeight001-test.yaml @@ -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 \ No newline at end of file + - FHSg3b0483phv00177539c + - ARICABI5phv00294492c \ No newline at end of file diff --git a/tests/data/valid/SingleVariable-004test.yaml b/tests/data/valid/SingleVariable-004test.yaml new file mode 100644 index 0000000..56e279a --- /dev/null +++ b/tests/data/valid/SingleVariable-004test.yaml @@ -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 diff --git a/tests/data/valid/SingleVariable-005test.yaml b/tests/data/valid/SingleVariable-005test.yaml new file mode 100644 index 0000000..8350661 --- /dev/null +++ b/tests/data/valid/SingleVariable-005test.yaml @@ -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 diff --git a/tests/data/valid/SingleVariable-006test.yaml b/tests/data/valid/SingleVariable-006test.yaml new file mode 100644 index 0000000..3a4ece7 --- /dev/null +++ b/tests/data/valid/SingleVariable-006test.yaml @@ -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