diff --git a/justfile b/justfile index fbb1b6b..0ffa155 100644 --- a/justfile +++ b/justfile @@ -123,7 +123,7 @@ lint: # Generate md documentation for the schema and add artifacts [group('model development')] gen-doc: _gen-yaml && _add-artifacts - uv run gen-doc {{gen_doc_args}} -d {{docdir}} {{source_schema_path}} + uv run gen-doc {{gen_doc_args}} --template-directory src/docs/templates -d {{docdir}} {{source_schema_path}} # Build docs and run test server [group('model development')] diff --git a/src/bdc_variable_library/datamodel/bdc_variable_library.py b/src/bdc_variable_library/datamodel/bdc_variable_library.py index f973975..4b8365d 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-21T15:37:17 +# Generation date: 2026-08-10T14:50:48 # Schema: bdc-variable-library # # id: https://w3id.org/linkml/bdc-variable-library @@ -77,7 +77,6 @@ BDC_VARIABLE_LIBRARY = CurieNamespace('bdc_variable_library', 'https://w3id.org/linkml/bdc-variable-library/') BDCHM = CurieNamespace('bdchm', 'https://w3id.org/bdchm/') BIOLINK = CurieNamespace('biolink', 'https://w3id.org/biolink/vocab/') -CM = CurieNamespace('cm', 'http://example.org/UNKNOWN/cm/') CMS = CurieNamespace('cms', 'https://w3id.org/linkml/clinical-microschemas/') EXAMPLE = CurieNamespace('example', 'http://www.example.org/rdf#') LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') @@ -96,7 +95,11 @@ class VariableId(EntityId): pass -class SingleVariableId(VariableId): +class SingleContinuousVariableId(VariableId): + pass + + +class SingleCategoricalVariableId(VariableId): pass @@ -116,10 +119,18 @@ class AlertValueId(EntityId): pass +class EnumValueId(EntityId): + pass + + class MetadataVariableId(EntityId): pass +class DocumentationVariableId(EntityId): + pass + + class CompoundHeight002Id(CompoundVariableId): pass @@ -132,6 +143,14 @@ class IntegratedHeight001Id(IntegratedVariableId): pass +class CompoundAsthma001Id(CompoundVariableId): + pass + + +class IntegratedAsthma001Id(IntegratedVariableId): + pass + + class ResearchStudyId(EntityId): pass @@ -176,7 +195,6 @@ class Variable(Entity): variable_description: Optional[str] = None concept_type: Optional[Union[str, URIorCURIE]] = None variable_label: Optional[str] = None - unit: Optional[Union[str, URIorCURIE]] = None def __post_init__(self, *_: str, **kwargs: Any): if self._is_empty(self.id): @@ -196,25 +214,22 @@ def __post_init__(self, *_: str, **kwargs: Any): if self.variable_label is not None and not isinstance(self.variable_label, str): self.variable_label = str(self.variable_label) - if self.unit is not None and not isinstance(self.unit, URIorCURIE): - self.unit = URIorCURIE(self.unit) - super().__post_init__(**kwargs) @dataclass(repr=False) -class SingleVariable(Variable): +class SingleContinuousVariable(Variable): """ - Represents a single entry in a data dictionary + Represents a single entry in a data dictionary of a variable with a continuous value """ _inherited_slots: ClassVar[list[str]] = [] - class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["SingleVariable"] - class_class_curie: ClassVar[str] = "bdc_variable_library:SingleVariable" - class_name: ClassVar[str] = "SingleVariable" - class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.SingleVariable + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["SingleContinuousVariable"] + class_class_curie: ClassVar[str] = "bdc_variable_library:SingleContinuousVariable" + class_name: ClassVar[str] = "SingleContinuousVariable" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.SingleContinuousVariable - id: Union[str, SingleVariableId] = None + id: Union[str, SingleContinuousVariableId] = None source_id: Optional[str] = None file_id: Optional[str] = None file_name: Optional[str] = None @@ -224,15 +239,16 @@ class SingleVariable(Variable): minimum_value: Optional[Decimal] = None maximum_value: Optional[Decimal] = None resolution: Optional[int] = None - coded_values: Optional[str] = None missing_value: Optional[Union[dict[Union[str, MissingValueId], Union[dict, "MissingValue"]], list[Union[dict, "MissingValue"]]]] = empty_dict() + unit: Optional[Union[str, URIorCURIE]] = None + alert_values: Optional[Union[dict[Union[str, AlertValueId], Union[dict, "AlertValue"]], list[Union[dict, "AlertValue"]]]] = empty_dict() comment: Optional[str] = None def __post_init__(self, *_: str, **kwargs: Any): if self._is_empty(self.id): self.MissingRequiredField("id") - if not isinstance(self.id, SingleVariableId): - self.id = SingleVariableId(self.id) + if not isinstance(self.id, SingleContinuousVariableId): + self.id = SingleContinuousVariableId(self.id) if self.source_id is not None and not isinstance(self.source_id, str): self.source_id = str(self.source_id) @@ -261,11 +277,70 @@ def __post_init__(self, *_: str, **kwargs: Any): if self.resolution is not None and not isinstance(self.resolution, int): self.resolution = int(self.resolution) - if self.coded_values is not None and not isinstance(self.coded_values, str): - self.coded_values = str(self.coded_values) + self._normalize_inlined_as_list(slot_name="missing_value", slot_type=MissingValue, key_name="id", keyed=True) + + if self.unit is not None and not isinstance(self.unit, URIorCURIE): + self.unit = URIorCURIE(self.unit) + + self._normalize_inlined_as_list(slot_name="alert_values", slot_type=AlertValue, key_name="id", keyed=True) + + if self.comment is not None and not isinstance(self.comment, str): + self.comment = str(self.comment) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class SingleCategoricalVariable(Variable): + """ + Represents a single entry in a data dictionary of a variable with a categorical value + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["SingleCategoricalVariable"] + class_class_curie: ClassVar[str] = "bdc_variable_library:SingleCategoricalVariable" + class_name: ClassVar[str] = "SingleCategoricalVariable" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.SingleCategoricalVariable + + id: Union[str, SingleCategoricalVariableId] = None + source_id: Optional[str] = None + file_id: Optional[str] = None + file_name: Optional[str] = None + variable_name: Optional[str] = None + source_variable_description: Optional[str] = None + data_type: Optional[Union[str, "DataTypeEnum"]] = None + missing_value: Optional[Union[dict[Union[str, MissingValueId], Union[dict, "MissingValue"]], list[Union[dict, "MissingValue"]]]] = empty_dict() + coded_values: Optional[Union[dict[Union[str, EnumValueId], Union[dict, "EnumValue"]], list[Union[dict, "EnumValue"]]]] = empty_dict() + comment: Optional[str] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, SingleCategoricalVariableId): + self.id = SingleCategoricalVariableId(self.id) + + if self.source_id is not None and not isinstance(self.source_id, str): + self.source_id = str(self.source_id) + + if self.file_id is not None and not isinstance(self.file_id, str): + self.file_id = str(self.file_id) + + if self.file_name is not None and not isinstance(self.file_name, str): + self.file_name = str(self.file_name) + + if self.variable_name is not None and not isinstance(self.variable_name, str): + self.variable_name = str(self.variable_name) + + if self.source_variable_description is not None and not isinstance(self.source_variable_description, str): + self.source_variable_description = str(self.source_variable_description) + + if self.data_type is not None and not isinstance(self.data_type, DataTypeEnum): + self.data_type = DataTypeEnum(self.data_type) self._normalize_inlined_as_list(slot_name="missing_value", slot_type=MissingValue, key_name="id", keyed=True) + self._normalize_inlined_as_list(slot_name="coded_values", slot_type=EnumValue, key_name="id", keyed=True) + if self.comment is not None and not isinstance(self.comment, str): self.comment = str(self.comment) @@ -287,8 +362,10 @@ class CompoundVariable(Variable): id: Union[str, CompoundVariableId] = None cde_id: Optional[Union[str, URIorCURIE]] = None bdchm_type: Optional[Union[str, "BdchmTypeEnum"]] = None - metadata: Optional[Union[dict[Union[str, MetadataVariableId], Union[dict, "MetadataVariable"]], list[Union[dict, "MetadataVariable"]]]] = empty_dict() - alert_value: Optional[Union[Union[str, AlertValueId], list[Union[str, AlertValueId]]]] = empty_list() + unit: Optional[Union[str, URIorCURIE]] = None + row_metadata: Optional[Union[dict[Union[str, MetadataVariableId], Union[dict, "MetadataVariable"]], list[Union[dict, "MetadataVariable"]]]] = empty_dict() + documentation_metadata: Optional[Union[dict[Union[str, DocumentationVariableId], Union[dict, "DocumentationVariable"]], list[Union[dict, "DocumentationVariable"]]]] = empty_dict() + alert_value: Optional[Union[dict[Union[str, AlertValueId], Union[dict, "AlertValue"]], list[Union[dict, "AlertValue"]]]] = empty_dict() def __post_init__(self, *_: str, **kwargs: Any): if self._is_empty(self.id): @@ -302,11 +379,14 @@ def __post_init__(self, *_: str, **kwargs: Any): if self.bdchm_type is not None and not isinstance(self.bdchm_type, BdchmTypeEnum): self.bdchm_type = BdchmTypeEnum(self.bdchm_type) - self._normalize_inlined_as_list(slot_name="metadata", slot_type=MetadataVariable, key_name="id", keyed=True) + if self.unit is not None and not isinstance(self.unit, URIorCURIE): + self.unit = URIorCURIE(self.unit) + + self._normalize_inlined_as_list(slot_name="row_metadata", slot_type=MetadataVariable, key_name="id", keyed=True) + + self._normalize_inlined_as_list(slot_name="documentation_metadata", slot_type=DocumentationVariable, key_name="id", keyed=True) - if not isinstance(self.alert_value, list): - self.alert_value = [self.alert_value] if self.alert_value is not None else [] - self.alert_value = [v if isinstance(v, AlertValueId) else AlertValueId(v) for v in self.alert_value] + self._normalize_inlined_as_list(slot_name="alert_value", slot_type=AlertValue, key_name="id", keyed=True) super().__post_init__(**kwargs) @@ -327,6 +407,7 @@ class IntegratedVariable(Variable): id: Union[str, IntegratedVariableId] = None cde_id: Optional[Union[str, URIorCURIE]] = None bdchm_type: Optional[Union[str, "BdchmTypeEnum"]] = None + unit: Optional[Union[str, URIorCURIE]] = None integrates: Optional[Union[Union[str, CompoundVariableId], list[Union[str, CompoundVariableId]]]] = empty_list() def __post_init__(self, *_: str, **kwargs: Any): @@ -341,6 +422,9 @@ def __post_init__(self, *_: str, **kwargs: Any): if self.bdchm_type is not None and not isinstance(self.bdchm_type, BdchmTypeEnum): self.bdchm_type = BdchmTypeEnum(self.bdchm_type) + if self.unit is not None and not isinstance(self.unit, URIorCURIE): + self.unit = URIorCURIE(self.unit) + if not isinstance(self.integrates, list): self.integrates = [self.integrates] if self.integrates is not None else [] self.integrates = [v if isinstance(v, CompoundVariableId) else CompoundVariableId(v) for v in self.integrates] @@ -410,6 +494,41 @@ def __post_init__(self, *_: str, **kwargs: Any): super().__post_init__(**kwargs) +@dataclass(repr=False) +class EnumValue(Entity): + """ + One possible answer in a list of enumerated values + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["EnumValue"] + class_class_curie: ClassVar[str] = "bdc_variable_library:EnumValue" + class_name: ClassVar[str] = "EnumValue" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.EnumValue + + id: Union[str, EnumValueId] = None + indicator_char: Optional[str] = None + indicator_meaning: Optional[str] = None + indicator_type: Optional[Union[str, URIorCURIE]] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, EnumValueId): + self.id = EnumValueId(self.id) + + if self.indicator_char is not None and not isinstance(self.indicator_char, str): + self.indicator_char = str(self.indicator_char) + + if self.indicator_meaning is not None and not isinstance(self.indicator_meaning, str): + self.indicator_meaning = str(self.indicator_meaning) + + if self.indicator_type is not None and not isinstance(self.indicator_type, URIorCURIE): + self.indicator_type = URIorCURIE(self.indicator_type) + + super().__post_init__(**kwargs) + + @dataclass(repr=False) class MetadataVariable(Entity): """ @@ -438,6 +557,38 @@ def __post_init__(self, *_: str, **kwargs: Any): super().__post_init__(**kwargs) +@dataclass(repr=False) +class DocumentationVariable(Entity): + """ + Information derived from study documentation or text in a data dictionary that provides essential metadata for a + variable + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["DocumentationVariable"] + class_class_curie: ClassVar[str] = "bdc_variable_library:DocumentationVariable" + class_name: ClassVar[str] = "DocumentationVariable" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.DocumentationVariable + + id: Union[str, DocumentationVariableId] = None + contr_vocab: Optional[str] = None + microschema_slot: Optional[Union[str, "ClinicalMicroschemaEnum"]] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, DocumentationVariableId): + self.id = DocumentationVariableId(self.id) + + if self.contr_vocab is not None and not isinstance(self.contr_vocab, str): + self.contr_vocab = str(self.contr_vocab) + + if self.microschema_slot is not None and not isinstance(self.microschema_slot, ClinicalMicroschemaEnum): + self.microschema_slot = ClinicalMicroschemaEnum(self.microschema_slot) + + super().__post_init__(**kwargs) + + @dataclass(repr=False) class CompoundHeight002(CompoundVariable): """ @@ -507,6 +658,52 @@ def __post_init__(self, *_: str, **kwargs: Any): super().__post_init__(**kwargs) +@dataclass(repr=False) +class CompoundAsthma001(CompoundVariable): + """ + A record of participant asthma status + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["CompoundAsthma001"] + class_class_curie: ClassVar[str] = "bdc_variable_library:CompoundAsthma001" + class_name: ClassVar[str] = "CompoundAsthma001" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.CompoundAsthma001 + + id: Union[str, CompoundAsthma001Id] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, CompoundAsthma001Id): + self.id = CompoundAsthma001Id(self.id) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class IntegratedAsthma001(IntegratedVariable): + """ + Participant asthma status containing data from multiple studies + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY["IntegratedAsthma001"] + class_class_curie: ClassVar[str] = "bdc_variable_library:IntegratedAsthma001" + class_name: ClassVar[str] = "IntegratedAsthma001" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.IntegratedAsthma001 + + id: Union[str, IntegratedAsthma001Id] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, IntegratedAsthma001Id): + self.id = IntegratedAsthma001Id(self.id) + + super().__post_init__(**kwargs) + + @dataclass(repr=False) class ResearchStudy(Entity): """ @@ -1178,7 +1375,6 @@ class HumanBodyHeightRecord006(HumanBodyHeightRecord): measurement_type: Union[str, URIorCURIE] = None age_at_measurement: Union[dict, Quantity] = None measurement_value: Union[dict, "HumanBodyHeightQuantity003"] = None - unit: Optional[Union[str, URIorCURIE]] = None def __post_init__(self, *_: str, **kwargs: Any): if self._is_empty(self.measurement_value): @@ -1186,9 +1382,6 @@ def __post_init__(self, *_: str, **kwargs: Any): if not isinstance(self.measurement_value, HumanBodyHeightQuantity003): self.measurement_value = HumanBodyHeightQuantity003(**as_dict(self.measurement_value)) - if self.unit is not None and not isinstance(self.unit, URIorCURIE): - self.unit = URIorCURIE(self.unit) - super().__post_init__(**kwargs) @@ -1657,6 +1850,240 @@ def __post_init__(self, *_: str, **kwargs: Any): super().__post_init__(**kwargs) +@dataclass(repr=False) +class AsthmaStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of asthma in the patient/participant or their + blood relatives + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["AsthmaStatusRecord"] + class_class_curie: ClassVar[str] = "cms:AsthmaStatusRecord" + class_name: ClassVar[str] = "AsthmaStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.AsthmaStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_condition_record: Union[dict, Quantity] = None + condition_status: Union[str, "HistoricalStatusEnum"] = None + relationship_to_participant: Union[str, "FamilyRelationshipEnum"] = None + condition_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.condition_type): + self.MissingRequiredField("condition_type") + if not isinstance(self.condition_type, URIorCURIE): + self.condition_type = URIorCURIE(self.condition_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class HeartFailureStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of congestive heart failure in the + patient/participant or their blood relatives + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["HeartFailureStatusRecord"] + class_class_curie: ClassVar[str] = "cms:HeartFailureStatusRecord" + class_name: ClassVar[str] = "HeartFailureStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.HeartFailureStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_condition_record: Union[dict, Quantity] = None + condition_status: Union[str, "HistoricalStatusEnum"] = None + relationship_to_participant: Union[str, "FamilyRelationshipEnum"] = None + condition_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.condition_type): + self.MissingRequiredField("condition_type") + if not isinstance(self.condition_type, URIorCURIE): + self.condition_type = URIorCURIE(self.condition_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class ObesityStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of obesity in the patient/participant or their + blood relatives + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["ObesityStatusRecord"] + class_class_curie: ClassVar[str] = "cms:ObesityStatusRecord" + class_name: ClassVar[str] = "ObesityStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.ObesityStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_condition_record: Union[dict, Quantity] = None + condition_status: Union[str, "HistoricalStatusEnum"] = None + relationship_to_participant: Union[str, "FamilyRelationshipEnum"] = None + condition_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.condition_type): + self.MissingRequiredField("condition_type") + if not isinstance(self.condition_type, URIorCURIE): + self.condition_type = URIorCURIE(self.condition_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class AspirinStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["AspirinStatusRecord"] + class_class_curie: ClassVar[str] = "cms:AspirinStatusRecord" + class_name: ClassVar[str] = "AspirinStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.AspirinStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_drug_record: Union[dict, Quantity] = None + drug_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.drug_type): + self.MissingRequiredField("drug_type") + if not isinstance(self.drug_type, URIorCURIE): + self.drug_type = URIorCURIE(self.drug_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class BetaBlockerStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["BetaBlockerStatusRecord"] + class_class_curie: ClassVar[str] = "cms:BetaBlockerStatusRecord" + class_name: ClassVar[str] = "BetaBlockerStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.BetaBlockerStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_drug_record: Union[dict, Quantity] = None + drug_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.drug_type): + self.MissingRequiredField("drug_type") + if not isinstance(self.drug_type, URIorCURIE): + self.drug_type = URIorCURIE(self.drug_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class DiabetesMedicationStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["DiabetesMedicationStatusRecord"] + class_class_curie: ClassVar[str] = "cms:DiabetesMedicationStatusRecord" + class_name: ClassVar[str] = "DiabetesMedicationStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.DiabetesMedicationStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_drug_record: Union[dict, Quantity] = None + drug_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.drug_type): + self.MissingRequiredField("drug_type") + if not isinstance(self.drug_type, URIorCURIE): + self.drug_type = URIorCURIE(self.drug_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class PacemakerStatusRecord(ProcedureStatusRecord): + """ + Record of having a pacemaker implanted + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["PacemakerStatusRecord"] + class_class_curie: ClassVar[str] = "cms:PacemakerStatusRecord" + class_name: ClassVar[str] = "PacemakerStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.PacemakerStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_procedure_record: Union[dict, Quantity] = None + procedure_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.procedure_type): + self.MissingRequiredField("procedure_type") + if not isinstance(self.procedure_type, URIorCURIE): + self.procedure_type = URIorCURIE(self.procedure_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class CoronaryAngioplastyStatusRecord(ProcedureStatusRecord): + """ + Record of having a coronary angioplasty + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["CoronaryAngioplastyStatusRecord"] + class_class_curie: ClassVar[str] = "cms:CoronaryAngioplastyStatusRecord" + class_name: ClassVar[str] = "CoronaryAngioplastyStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.CoronaryAngioplastyStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_procedure_record: Union[dict, Quantity] = None + procedure_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.procedure_type): + self.MissingRequiredField("procedure_type") + if not isinstance(self.procedure_type, URIorCURIE): + self.procedure_type = URIorCURIE(self.procedure_type) + + super().__post_init__(**kwargs) + + +@dataclass(repr=False) +class CoronaryBypassStatusRecord(ProcedureStatusRecord): + """ + Record of having a coronary artery bypass graft + """ + _inherited_slots: ClassVar[list[str]] = [] + + class_class_uri: ClassVar[URIRef] = CMS["CoronaryBypassStatusRecord"] + class_class_curie: ClassVar[str] = "cms:CoronaryBypassStatusRecord" + class_name: ClassVar[str] = "CoronaryBypassStatusRecord" + class_model_uri: ClassVar[URIRef] = BDC_VARIABLE_LIBRARY.CoronaryBypassStatusRecord + + subject_identifier: Union[str, URIorCURIE] = None + age_at_procedure_record: Union[dict, Quantity] = None + procedure_type: Union[str, URIorCURIE] = None + + def __post_init__(self, *_: str, **kwargs: Any): + if self._is_empty(self.procedure_type): + self.MissingRequiredField("procedure_type") + if not isinstance(self.procedure_type, URIorCURIE): + self.procedure_type = URIorCURIE(self.procedure_type) + + super().__post_init__(**kwargs) + + @dataclass(repr=False) class Relativity(YAMLRoot): """ @@ -2204,7 +2631,7 @@ class BdchmTypeEnum(EnumDefinitionImpl): class ClinicalMicroschemaEnum(EnumDefinitionImpl): """ - A list of slots describing clinical measurements in microschema + A list of slots describing clinical data in microschema """ subject_identifier = PermissibleValue(text="subject_identifier") measurement_type = PermissibleValue(text="measurement_type") @@ -2222,10 +2649,21 @@ class ClinicalMicroschemaEnum(EnumDefinitionImpl): age_at_measurement = PermissibleValue(text="age_at_measurement") study_site = PermissibleValue(text="study_site") absolute_time = PermissibleValue(text="absolute_time") + condition_type = PermissibleValue(text="condition_type") + associated_evidence = PermissibleValue(text="associated_evidence") + age_at_condition_start = PermissibleValue(text="age_at_condition_start") + age_at_condition_end = PermissibleValue(text="age_at_condition_end") + age_at_condition_record = PermissibleValue(text="age_at_condition_record") + condition_status = PermissibleValue(text="condition_status") + condition_provenance = PermissibleValue(text="condition_provenance") + condition_concept = PermissibleValue(text="condition_concept") + condition_severity = PermissibleValue(text="condition_severity") + relationship_to_participant = PermissibleValue(text="relationship_to_participant") + method_type = PermissibleValue(text="method_type") _defn = EnumDefinition( name="ClinicalMicroschemaEnum", - description="A list of slots describing clinical measurements in microschema", + description="A list of slots describing clinical data in microschema", ) class ComparatorEnum(EnumDefinitionImpl): @@ -2753,6 +3191,33 @@ class RelativeTimingEnum(EnumDefinitionImpl): description="Set of values describing the relative timing of an activity", ) +class DynamicAsthmaEnum(EnumDefinitionImpl): + """ + Asthma and asthma-related terms from Mondo and HPO + """ + _defn = EnumDefinition( + name="DynamicAsthmaEnum", + description="Asthma and asthma-related terms from Mondo and HPO", + ) + +class DynamicHeartFailureEnum(EnumDefinitionImpl): + """ + Heart failure and related terms from Mondo + """ + _defn = EnumDefinition( + name="DynamicHeartFailureEnum", + description="Heart failure and related terms from Mondo", + ) + +class DynamicObesityEnum(EnumDefinitionImpl): + """ + Obesity and related terms from HPO + """ + _defn = EnumDefinition( + name="DynamicObesityEnum", + description="Obesity and related terms from HPO", + ) + # Slots class slots: pass @@ -2790,9 +3255,6 @@ class slots: slots.resolution = Slot(uri=BDC_VARIABLE_LIBRARY.resolution, name="resolution", curie=BDC_VARIABLE_LIBRARY.curie('resolution'), model_uri=BDC_VARIABLE_LIBRARY.resolution, domain=None, range=Optional[int]) -slots.coded_values = Slot(uri=BDC_VARIABLE_LIBRARY.coded_values, name="coded_values", curie=BDC_VARIABLE_LIBRARY.curie('coded_values'), - model_uri=BDC_VARIABLE_LIBRARY.coded_values, domain=None, range=Optional[str]) - slots.missing_value = Slot(uri=BDC_VARIABLE_LIBRARY.missing_value, name="missing_value", curie=BDC_VARIABLE_LIBRARY.curie('missing_value'), model_uri=BDC_VARIABLE_LIBRARY.missing_value, domain=None, range=Optional[Union[dict[Union[str, MissingValueId], Union[dict, MissingValue]], list[Union[dict, MissingValue]]]]) @@ -2811,11 +3273,17 @@ class slots: slots.bdchm_type = Slot(uri=BDC_VARIABLE_LIBRARY.bdchm_type, name="bdchm_type", curie=BDC_VARIABLE_LIBRARY.curie('bdchm_type'), model_uri=BDC_VARIABLE_LIBRARY.bdchm_type, domain=None, range=Optional[Union[str, "BdchmTypeEnum"]]) -slots.metadata = Slot(uri=BDC_VARIABLE_LIBRARY.metadata, name="metadata", curie=BDC_VARIABLE_LIBRARY.curie('metadata'), - model_uri=BDC_VARIABLE_LIBRARY.metadata, domain=None, range=Optional[Union[dict[Union[str, MetadataVariableId], Union[dict, MetadataVariable]], list[Union[dict, MetadataVariable]]]]) +slots.row_metadata = Slot(uri=BDC_VARIABLE_LIBRARY.row_metadata, name="row_metadata", curie=BDC_VARIABLE_LIBRARY.curie('row_metadata'), + model_uri=BDC_VARIABLE_LIBRARY.row_metadata, domain=None, range=Optional[Union[dict[Union[str, MetadataVariableId], Union[dict, MetadataVariable]], list[Union[dict, MetadataVariable]]]]) + +slots.documentation_metadata = Slot(uri=BDC_VARIABLE_LIBRARY.documentation_metadata, name="documentation_metadata", curie=BDC_VARIABLE_LIBRARY.curie('documentation_metadata'), + model_uri=BDC_VARIABLE_LIBRARY.documentation_metadata, domain=None, range=Optional[Union[dict[Union[str, DocumentationVariableId], Union[dict, DocumentationVariable]], list[Union[dict, DocumentationVariable]]]]) slots.alert_value = Slot(uri=BDC_VARIABLE_LIBRARY.alert_value, name="alert_value", curie=BDC_VARIABLE_LIBRARY.curie('alert_value'), - model_uri=BDC_VARIABLE_LIBRARY.alert_value, domain=None, range=Optional[Union[Union[str, AlertValueId], list[Union[str, AlertValueId]]]]) + model_uri=BDC_VARIABLE_LIBRARY.alert_value, domain=None, range=Optional[Union[dict[Union[str, AlertValueId], Union[dict, AlertValue]], list[Union[dict, AlertValue]]]]) + +slots.alert_values = Slot(uri=BDC_VARIABLE_LIBRARY.alert_values, name="alert_values", curie=BDC_VARIABLE_LIBRARY.curie('alert_values'), + model_uri=BDC_VARIABLE_LIBRARY.alert_values, domain=None, range=Optional[Union[dict[Union[str, AlertValueId], Union[dict, AlertValue]], list[Union[dict, AlertValue]]]]) slots.indicator_char = Slot(uri=BDC_VARIABLE_LIBRARY.indicator_char, name="indicator_char", curie=BDC_VARIABLE_LIBRARY.curie('indicator_char'), model_uri=BDC_VARIABLE_LIBRARY.indicator_char, domain=None, range=Optional[str]) @@ -2823,12 +3291,21 @@ class slots: slots.indicator_meaning = Slot(uri=BDC_VARIABLE_LIBRARY.indicator_meaning, name="indicator_meaning", curie=BDC_VARIABLE_LIBRARY.curie('indicator_meaning'), model_uri=BDC_VARIABLE_LIBRARY.indicator_meaning, domain=None, range=Optional[str]) +slots.indicator_type = Slot(uri=BDC_VARIABLE_LIBRARY.indicator_type, name="indicator_type", curie=BDC_VARIABLE_LIBRARY.curie('indicator_type'), + model_uri=BDC_VARIABLE_LIBRARY.indicator_type, domain=None, range=Optional[Union[str, URIorCURIE]]) + slots.microschema_slot = Slot(uri=BDC_VARIABLE_LIBRARY.microschema_slot, name="microschema_slot", curie=BDC_VARIABLE_LIBRARY.curie('microschema_slot'), model_uri=BDC_VARIABLE_LIBRARY.microschema_slot, domain=None, range=Optional[Union[str, "ClinicalMicroschemaEnum"]]) slots.integrates = Slot(uri=BDC_VARIABLE_LIBRARY.integrates, name="integrates", curie=BDC_VARIABLE_LIBRARY.curie('integrates'), model_uri=BDC_VARIABLE_LIBRARY.integrates, domain=None, range=Optional[Union[Union[str, CompoundVariableId], list[Union[str, CompoundVariableId]]]]) +slots.coded_values = Slot(uri=BDC_VARIABLE_LIBRARY.coded_values, name="coded_values", curie=BDC_VARIABLE_LIBRARY.curie('coded_values'), + model_uri=BDC_VARIABLE_LIBRARY.coded_values, domain=None, range=Optional[Union[dict[Union[str, EnumValueId], Union[dict, EnumValue]], list[Union[dict, EnumValue]]]]) + +slots.contr_vocab = Slot(uri=BDC_VARIABLE_LIBRARY.contr_vocab, name="contr_vocab", curie=BDC_VARIABLE_LIBRARY.curie('contr_vocab'), + model_uri=BDC_VARIABLE_LIBRARY.contr_vocab, domain=None, range=Optional[str]) + slots.profile_version = Slot(uri=LINKML['linkml-microschema-profile/profile_version'], name="profile_version", curie=LINKML.curie('linkml-microschema-profile/profile_version'), model_uri=BDC_VARIABLE_LIBRARY.profile_version, domain=None, range=Optional[str]) @@ -3087,9 +3564,6 @@ class slots: slots.HumanBodyHeightRecord006_measurement_value = Slot(uri=CMS.measurement_value, name="HumanBodyHeightRecord006_measurement_value", curie=CMS.curie('measurement_value'), model_uri=BDC_VARIABLE_LIBRARY.HumanBodyHeightRecord006_measurement_value, domain=HumanBodyHeightRecord006, range=Union[dict, "HumanBodyHeightQuantity003"]) -slots.HumanBodyHeightRecord006_unit = Slot(uri=BDCHM.unit, name="HumanBodyHeightRecord006_unit", curie=BDCHM.curie('unit'), - model_uri=BDC_VARIABLE_LIBRARY.HumanBodyHeightRecord006_unit, domain=HumanBodyHeightRecord006, range=Optional[Union[str, URIorCURIE]]) - slots.HumanBodyWeightRecord_measurement_value = Slot(uri=CMS.measurement_value, name="HumanBodyWeightRecord_measurement_value", curie=CMS.curie('measurement_value'), model_uri=BDC_VARIABLE_LIBRARY.HumanBodyWeightRecord_measurement_value, domain=HumanBodyWeightRecord, range=Union[dict, "HumanBodyWeightQuantity"]) @@ -3156,6 +3630,33 @@ class slots: slots.HumanBasophilCountRecord002_unit = Slot(uri=BDCHM.unit, name="HumanBasophilCountRecord002_unit", curie=BDCHM.curie('unit'), model_uri=BDC_VARIABLE_LIBRARY.HumanBasophilCountRecord002_unit, domain=HumanBasophilCountRecord002, range=Optional[Union[str, URIorCURIE]]) +slots.AsthmaStatusRecord_condition_type = Slot(uri=BDCHM.condition_concept, name="AsthmaStatusRecord_condition_type", curie=BDCHM.curie('condition_concept'), + model_uri=BDC_VARIABLE_LIBRARY.AsthmaStatusRecord_condition_type, domain=AsthmaStatusRecord, range=Union[str, URIorCURIE]) + +slots.HeartFailureStatusRecord_condition_type = Slot(uri=BDCHM.condition_concept, name="HeartFailureStatusRecord_condition_type", curie=BDCHM.curie('condition_concept'), + model_uri=BDC_VARIABLE_LIBRARY.HeartFailureStatusRecord_condition_type, domain=HeartFailureStatusRecord, range=Union[str, URIorCURIE]) + +slots.ObesityStatusRecord_condition_type = Slot(uri=BDCHM.condition_concept, name="ObesityStatusRecord_condition_type", curie=BDCHM.curie('condition_concept'), + model_uri=BDC_VARIABLE_LIBRARY.ObesityStatusRecord_condition_type, domain=ObesityStatusRecord, range=Union[str, URIorCURIE]) + +slots.AspirinStatusRecord_drug_type = Slot(uri=BDCHM.drug_concept, name="AspirinStatusRecord_drug_type", curie=BDCHM.curie('drug_concept'), + model_uri=BDC_VARIABLE_LIBRARY.AspirinStatusRecord_drug_type, domain=AspirinStatusRecord, range=Union[str, URIorCURIE]) + +slots.BetaBlockerStatusRecord_drug_type = Slot(uri=BDCHM.drug_concept, name="BetaBlockerStatusRecord_drug_type", curie=BDCHM.curie('drug_concept'), + model_uri=BDC_VARIABLE_LIBRARY.BetaBlockerStatusRecord_drug_type, domain=BetaBlockerStatusRecord, range=Union[str, URIorCURIE]) + +slots.DiabetesMedicationStatusRecord_drug_type = Slot(uri=BDCHM.drug_concept, name="DiabetesMedicationStatusRecord_drug_type", curie=BDCHM.curie('drug_concept'), + model_uri=BDC_VARIABLE_LIBRARY.DiabetesMedicationStatusRecord_drug_type, domain=DiabetesMedicationStatusRecord, range=Union[str, URIorCURIE]) + +slots.PacemakerStatusRecord_procedure_type = Slot(uri=BDCHM.procedure_concept, name="PacemakerStatusRecord_procedure_type", curie=BDCHM.curie('procedure_concept'), + model_uri=BDC_VARIABLE_LIBRARY.PacemakerStatusRecord_procedure_type, domain=PacemakerStatusRecord, range=Union[str, URIorCURIE]) + +slots.CoronaryAngioplastyStatusRecord_procedure_type = Slot(uri=BDCHM.procedure_concept, name="CoronaryAngioplastyStatusRecord_procedure_type", curie=BDCHM.curie('procedure_concept'), + model_uri=BDC_VARIABLE_LIBRARY.CoronaryAngioplastyStatusRecord_procedure_type, domain=CoronaryAngioplastyStatusRecord, range=Union[str, URIorCURIE]) + +slots.CoronaryBypassStatusRecord_procedure_type = Slot(uri=BDCHM.procedure_concept, name="CoronaryBypassStatusRecord_procedure_type", curie=BDCHM.curie('procedure_concept'), + model_uri=BDC_VARIABLE_LIBRARY.CoronaryBypassStatusRecord_procedure_type, domain=CoronaryBypassStatusRecord, range=Union[str, URIorCURIE]) + slots.HumanBodyHeightQuantity_quantity_value = Slot(uri=LINKML['linkml-microschema-profile/quantity_value'], name="HumanBodyHeightQuantity_quantity_value", curie=LINKML.curie('linkml-microschema-profile/quantity_value'), model_uri=BDC_VARIABLE_LIBRARY.HumanBodyHeightQuantity_quantity_value, domain=HumanBodyHeightQuantity, range=Decimal) 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 59002d7..466f13b 100644 --- a/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py +++ b/src/bdc_variable_library/datamodel/bdc_variable_library_pydantic.py @@ -72,7 +72,7 @@ def __contains__(self, key:str) -> bool: 'id': 'https://w3id.org/linkml/bdc-variable-library', 'imports': ['linkml:types', 'https://raw.githubusercontent.com/linkml/linkml-microschema-profile/v0.3.0/src/linkml_microschema_profile/schema/linkml_microschema_profile', - 'https://raw.githubusercontent.com/linkml/clinical-microschemas/v0.0.2/src/clinical_microschemas/schema/clinical_microschemas'], + 'https://raw.githubusercontent.com/linkml/clinical-microschemas/v0.0.3/src/clinical_microschemas/schema/clinical_microschemas'], 'license': 'BSD-3-Clause', 'name': 'bdc-variable-library', 'prefixes': {'HP': {'prefix_prefix': 'HP', @@ -646,6 +646,27 @@ class RelativeTimingEnum(str, Enum): during = "during" +class DynamicAsthmaEnum(str): + """ + Asthma and asthma-related terms from Mondo and HPO + """ + pass + + +class DynamicHeartFailureEnum(str): + """ + Heart failure and related terms from Mondo + """ + pass + + +class DynamicObesityEnum(str): + """ + Obesity and related terms from HPO + """ + pass + + class BdchmTypeEnum(str, Enum): """ A list of BDCHM entities used to describe variables @@ -658,7 +679,7 @@ class BdchmTypeEnum(str, Enum): class ClinicalMicroschemaEnum(str, Enum): """ - A list of slots describing clinical measurements in microschema + A list of slots describing clinical data in microschema """ subject_identifier = "subject_identifier" measurement_type = "measurement_type" @@ -676,6 +697,17 @@ class ClinicalMicroschemaEnum(str, Enum): age_at_measurement = "age_at_measurement" study_site = "study_site" absolute_time = "absolute_time" + condition_type = "condition_type" + associated_evidence = "associated_evidence" + age_at_condition_start = "age_at_condition_start" + age_at_condition_end = "age_at_condition_end" + age_at_condition_record = "age_at_condition_record" + condition_status = "condition_status" + condition_provenance = "condition_provenance" + condition_concept = "condition_concept" + condition_severity = "condition_severity" + relationship_to_participant = "relationship_to_participant" + method_type = "method_type" @@ -794,7 +826,10 @@ class ClinicalMeasurementRecord(ConfiguredBaseModel): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: Quantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -804,7 +839,9 @@ class ClinicalMeasurementRecord(ConfiguredBaseModel): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -935,7 +972,10 @@ class HumanBodyHeightRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -945,7 +985,9 @@ class HumanBodyHeightRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -972,7 +1014,10 @@ class HumanBodyHeightRecord001(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity001 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -982,7 +1027,9 @@ class HumanBodyHeightRecord001(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1009,7 +1056,10 @@ class HumanBodyHeightRecord002(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity002 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1019,7 +1069,9 @@ class HumanBodyHeightRecord002(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1046,7 +1098,10 @@ class HumanBodyHeightRecord003(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity002 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1056,7 +1111,9 @@ class HumanBodyHeightRecord003(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1083,7 +1140,10 @@ class HumanBodyHeightRecord004(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity003 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1093,7 +1153,9 @@ class HumanBodyHeightRecord004(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1120,7 +1182,10 @@ class HumanBodyHeightRecord005(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity004 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1130,7 +1195,9 @@ class HumanBodyHeightRecord005(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1141,9 +1208,10 @@ class HumanBodyHeightRecord006(HumanBodyHeightRecord): Measurement of linear distance of a human body from the bottom of a flat foot to the top-most point of the head in cm """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'rules': [{'postconditions': {'slot_conditions': {'unit': {'equals_string': 'cm', + 'name': 'unit'}}}}], 'slot_usage': {'measurement_value': {'name': 'measurement_value', - 'range': 'HumanBodyHeightQuantity003'}, - 'unit': {'id_prefixes': ['cm'], 'name': 'unit'}}}) + 'range': 'HumanBodyHeightQuantity003'}}}) subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord', @@ -1152,8 +1220,10 @@ class HumanBodyHeightRecord006(HumanBodyHeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyHeightQuantity003 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], - 'id_prefixes': ['cm'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1163,7 +1233,9 @@ class HumanBodyHeightRecord006(HumanBodyHeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1202,7 +1274,10 @@ class HumanBodyWeightRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyWeightQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1212,7 +1287,9 @@ class HumanBodyWeightRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1239,7 +1316,10 @@ class HumanBodyWeightRecord001(HumanBodyWeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyWeightQuantity001 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1249,7 +1329,9 @@ class HumanBodyWeightRecord001(HumanBodyWeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1276,7 +1358,10 @@ class HumanBodyWeightRecord002(HumanBodyWeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyWeightQuantity002 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1286,7 +1371,9 @@ class HumanBodyWeightRecord002(HumanBodyWeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1313,7 +1400,10 @@ class HumanBodyWeightRecord003(HumanBodyWeightRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBodyWeightQuantity003 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1323,7 +1413,9 @@ class HumanBodyWeightRecord003(HumanBodyWeightRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1354,7 +1446,10 @@ class BodyMassIndexRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: BodyMassIndexQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1364,7 +1459,9 @@ class BodyMassIndexRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1390,7 +1487,10 @@ class BodyMassIndexRecord001(BodyMassIndexRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: BodyMassIndexQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1402,7 +1502,9 @@ class BodyMassIndexRecord001(BodyMassIndexRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1428,7 +1530,10 @@ class BodyMassIndexRecord002(BodyMassIndexRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: BodyMassIndexQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1440,7 +1545,9 @@ class BodyMassIndexRecord002(BodyMassIndexRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1478,7 +1585,10 @@ class HumanMeasuredFvcRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanMeasuredFvcQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1488,7 +1598,9 @@ class HumanMeasuredFvcRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1520,7 +1632,10 @@ class HumanMeasuredFvcRecord001(HumanMeasuredFvcRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanMeasuredFvcQuantity001 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1530,7 +1645,9 @@ class HumanMeasuredFvcRecord001(HumanMeasuredFvcRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1563,7 +1680,10 @@ class HumanPredictedFvcRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanPredictedFvcQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1573,7 +1693,9 @@ class HumanPredictedFvcRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1606,7 +1728,10 @@ class HumanPercentPredictedFvcRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanPercentPredictedFvcQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1616,7 +1741,9 @@ class HumanPercentPredictedFvcRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1654,7 +1781,10 @@ class HumanFev1Record(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanFev1Quantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1664,7 +1794,9 @@ class HumanFev1Record(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1699,7 +1831,10 @@ class HumanBasophilCountRecord(ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBasophilCountQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1709,7 +1844,9 @@ class HumanBasophilCountRecord(ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1733,7 +1870,10 @@ class HumanBasophilCountRecord001(HumanBasophilCountRecord): 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBasophilCountQuantity001 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': '10*3/uL'}], - 'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + 'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1743,7 +1883,9 @@ class HumanBasophilCountRecord001(HumanBasophilCountRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -1767,7 +1909,10 @@ class HumanBasophilCountRecord002(HumanBasophilCountRecord): 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanBasophilCountQuantity001 = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': '{#}/uL'}], - 'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + 'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1777,12 +1922,241 @@ class HumanBasophilCountRecord002(HumanBasophilCountRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) +class AsthmaStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of asthma in the patient/participant or their blood relatives + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'condition_type': {'any_of': [{'range': 'DynamicAsthmaEnum'}, + {'equals_string': 'ICD10:J45'}, + {'equals_string': 'OMOP:764677'}], + 'name': 'condition_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + condition_type: Union[DynamicAsthmaEnum, str] = Field(default=..., description="""A CURIE from MONDO or HPO""", json_schema_extra = { "linkml_meta": {'any_of': [{'range': 'DynamicAsthmaEnum'}, + {'equals_string': 'ICD10:J45'}, + {'equals_string': 'OMOP:764677'}], + 'domain_of': ['ConditionStatusRecord'], + 'slot_uri': 'bdchm:condition_concept'} }) + associated_evidence: Optional[AssociatedEvidenceEnum] = Field(default=None, description="""The method used for diagnosis""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) + age_at_condition_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_record: Quantity = Field(default=..., description="""Age of participant when record of the condition was collected. This slot can accommodate an \"age at encounter\" where a medical history was collected, or a record was adjudicated.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_status: HistoricalStatusEnum = Field(default=..., description="""A value indicating whether the medical condition described in this record is present, absent, historically present, or unknown for this individual patient.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_provenance: Optional[ProvenanceEnum] = Field(default=None, description="""A value representing the provenance of the Condition record.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_severity: Optional[ConditionSeverityEnum] = Field(default=None, description="""A subjective assessment of the severity of the condition.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + relationship_to_participant: FamilyRelationshipEnum = Field(default=..., description="""A value indicating the relationship between the Participant to which the Condition is attributed and the individual who had the reported Condition. If the Condition is affecting the participant themselves, then 'Self' is the appropriate relationship.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + + +class HeartFailureStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of congestive heart failure in the patient/participant or their blood relatives + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'condition_type': {'any_of': [{'range': 'DynamicHeartFailureEnum'}, + {'equals_string': 'ICD10:I50'}, + {'equals_string': 'OMOP:316139'}], + 'name': 'condition_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + condition_type: Union[DynamicHeartFailureEnum, str] = Field(default=..., description="""A CURIE from MONDO or HPO""", json_schema_extra = { "linkml_meta": {'any_of': [{'range': 'DynamicHeartFailureEnum'}, + {'equals_string': 'ICD10:I50'}, + {'equals_string': 'OMOP:316139'}], + 'domain_of': ['ConditionStatusRecord'], + 'slot_uri': 'bdchm:condition_concept'} }) + associated_evidence: Optional[AssociatedEvidenceEnum] = Field(default=None, description="""The method used for diagnosis""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) + age_at_condition_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_record: Quantity = Field(default=..., description="""Age of participant when record of the condition was collected. This slot can accommodate an \"age at encounter\" where a medical history was collected, or a record was adjudicated.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_status: HistoricalStatusEnum = Field(default=..., description="""A value indicating whether the medical condition described in this record is present, absent, historically present, or unknown for this individual patient.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_provenance: Optional[ProvenanceEnum] = Field(default=None, description="""A value representing the provenance of the Condition record.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_severity: Optional[ConditionSeverityEnum] = Field(default=None, description="""A subjective assessment of the severity of the condition.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + relationship_to_participant: FamilyRelationshipEnum = Field(default=..., description="""A value indicating the relationship between the Participant to which the Condition is attributed and the individual who had the reported Condition. If the Condition is affecting the participant themselves, then 'Self' is the appropriate relationship.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + + +class ObesityStatusRecord(ConditionStatusRecord): + """ + Record suggesting the current or historical presence or absence of obesity in the patient/participant or their blood relatives + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'condition_type': {'any_of': [{'range': 'DynamicObesityEnum'}, + {'equals_string': 'OMOP:433736'}], + 'name': 'condition_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + condition_type: Union[DynamicObesityEnum, str] = Field(default=..., description="""A CURIE from MONDO or HPO""", json_schema_extra = { "linkml_meta": {'any_of': [{'range': 'DynamicObesityEnum'}, {'equals_string': 'OMOP:433736'}], + 'domain_of': ['ConditionStatusRecord'], + 'slot_uri': 'bdchm:condition_concept'} }) + associated_evidence: Optional[AssociatedEvidenceEnum] = Field(default=None, description="""The method used for diagnosis""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) + age_at_condition_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the condition""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + age_at_condition_record: Quantity = Field(default=..., description="""Age of participant when record of the condition was collected. This slot can accommodate an \"age at encounter\" where a medical history was collected, or a record was adjudicated.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_status: HistoricalStatusEnum = Field(default=..., description="""A value indicating whether the medical condition described in this record is present, absent, historically present, or unknown for this individual patient.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_provenance: Optional[ProvenanceEnum] = Field(default=None, description="""A value representing the provenance of the Condition record.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + condition_severity: Optional[ConditionSeverityEnum] = Field(default=None, description="""A subjective assessment of the severity of the condition.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + relationship_to_participant: FamilyRelationshipEnum = Field(default=..., description="""A value indicating the relationship between the Participant to which the Condition is attributed and the individual who had the reported Condition. If the Condition is affecting the participant themselves, then 'Self' is the appropriate relationship.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ConditionStatusRecord']} }) + + +class AspirinStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'drug_type': {'any_of': [{'equals_string': 'OMOP:1112807'}, + {'equals_string': 'RxNORM:1191'}], + 'name': 'drug_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + drug_type: str = Field(default=..., description="""A CURIE from RxNorm""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'OMOP:1112807'}, + {'equals_string': 'RxNORM:1191'}], + 'domain_of': ['DrugStatusRecord'], + 'slot_uri': 'bdchm:drug_concept'} }) + age_at_drug_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_record: Quantity = Field(default=..., description="""Age of participant when record of the drug was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medication list. """, json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + route_of_administration: Optional[RouteAdminEnum] = Field(default=None, description="""Routes of drug administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + dose: Optional[Quantity] = Field(default=None, description="""Amount of drug per administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + frequency: Optional[Quantity] = Field(default=None, description="""How often e.g. 2 per day""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + indication: Optional[str] = Field(default=None, description="""Condition/reason for drug (SNOMED, ICD, Mondo, HPO, etc)""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + + +class BetaBlockerStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'drug_type': {'any_of': [{'equals_string': 'OMOP:21601741'}, + {'equals_string': 'ATC:C07A'}], + 'name': 'drug_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + drug_type: str = Field(default=..., description="""A CURIE from RxNorm""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'OMOP:21601741'}, {'equals_string': 'ATC:C07A'}], + 'domain_of': ['DrugStatusRecord'], + 'slot_uri': 'bdchm:drug_concept'} }) + age_at_drug_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_record: Quantity = Field(default=..., description="""Age of participant when record of the drug was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medication list. """, json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + route_of_administration: Optional[RouteAdminEnum] = Field(default=None, description="""Routes of drug administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + dose: Optional[Quantity] = Field(default=None, description="""Amount of drug per administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + frequency: Optional[Quantity] = Field(default=None, description="""How often e.g. 2 per day""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + indication: Optional[str] = Field(default=None, description="""Condition/reason for drug (SNOMED, ICD, Mondo, HPO, etc)""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + + +class DiabetesMedicationStatusRecord(DrugStatusRecord): + """ + Record suggesting exposure to aspirin + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'drug_type': {'any_of': [{'equals_string': 'ATC:A10'}], + 'name': 'drug_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + drug_type: str = Field(default=..., description="""A CURIE from RxNorm""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'ATC:A10'}], + 'domain_of': ['DrugStatusRecord'], + 'slot_uri': 'bdchm:drug_concept'} }) + age_at_drug_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of drug exposure""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + age_at_drug_record: Quantity = Field(default=..., description="""Age of participant when record of the drug was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medication list. """, json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + route_of_administration: Optional[RouteAdminEnum] = Field(default=None, description="""Routes of drug administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + dose: Optional[Quantity] = Field(default=None, description="""Amount of drug per administration""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + frequency: Optional[Quantity] = Field(default=None, description="""How often e.g. 2 per day""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + indication: Optional[str] = Field(default=None, description="""Condition/reason for drug (SNOMED, ICD, Mondo, HPO, etc)""", json_schema_extra = { "linkml_meta": {'domain_of': ['DrugStatusRecord']} }) + + +class PacemakerStatusRecord(ProcedureStatusRecord): + """ + Record of having a pacemaker implanted + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'procedure_type': {'any_of': [{'equals_string': 'OMOP:54772840'}, + {'equals_string': 'NCIT:C99998'}], + 'name': 'procedure_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + procedure_type: str = Field(default=..., description="""A CURIE from OMOP""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'OMOP:54772840'}, + {'equals_string': 'NCIT:C99998'}], + 'domain_of': ['ProcedureStatusRecord'], + 'slot_uri': 'bdchm:procedure_concept'} }) + collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) + age_at_procedure_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_record: Quantity = Field(default=..., description="""Age of participant when record of the procedure was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medical history.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + + +class CoronaryAngioplastyStatusRecord(ProcedureStatusRecord): + """ + Record of having a coronary angioplasty + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'procedure_type': {'any_of': [{'equals_string': 'OMOP:4184832'}], + 'name': 'procedure_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + procedure_type: str = Field(default=..., description="""A CURIE from OMOP""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'OMOP:4184832'}], + 'domain_of': ['ProcedureStatusRecord'], + 'slot_uri': 'bdchm:procedure_concept'} }) + collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) + age_at_procedure_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_record: Quantity = Field(default=..., description="""Age of participant when record of the procedure was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medical history.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + + +class CoronaryBypassStatusRecord(ProcedureStatusRecord): + """ + Record of having a coronary artery bypass graft + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/clinical-microschemas', + 'slot_usage': {'procedure_type': {'any_of': [{'equals_string': 'OMOP:4336464'}], + 'name': 'procedure_type'}}}) + + subject_identifier: str = Field(default=..., description="""An identifier for the subject of the datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'ConditionStatusRecord', + 'DrugStatusRecord', + 'ProcedureStatusRecord']} }) + procedure_type: str = Field(default=..., description="""A CURIE from OMOP""", json_schema_extra = { "linkml_meta": {'any_of': [{'equals_string': 'OMOP:4336464'}], + 'domain_of': ['ProcedureStatusRecord'], + 'slot_uri': 'bdchm:procedure_concept'} }) + collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) + age_at_procedure_start: Optional[Quantity] = Field(default=None, description="""Age of the subject at the start of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_end: Optional[Quantity] = Field(default=None, description="""Age of the subject at the end of the procedure""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + age_at_procedure_record: Quantity = Field(default=..., description="""Age of participant when record of the procedure was collected. This slot can accommodate an \"age at encounter\" where the participant was asked for their medical history.""", json_schema_extra = { "linkml_meta": {'domain_of': ['ProcedureStatusRecord']} }) + + class Relativity(ConfiguredBaseModel): """ Mixin providing slots for bundling measured, predicted, and percent predicted values with their normal limits. @@ -1845,7 +2219,10 @@ class HumanFvcRecord(Context, Relativity, ClinicalMeasurementRecord): measurement_type: str = Field(default=..., description="""A CURIE from OBA, OMOP, or LOINC""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:observation_type'} }) measurement_value: HumanFvcQuantity = Field(default=..., description="""The \"value\" in the observation key/value pair""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) - unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'Variable'], + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) method: Optional[MethodEnum] = Field(default=None, description="""The method used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord'], 'slot_uri': 'bdchm:method_type'} }) instrument: Optional[InstrumentEnum] = Field(default=None, description="""The instrument used for the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ConditionStatusRecord']} }) @@ -1855,7 +2232,9 @@ class HumanFvcRecord(Context, Relativity, ClinicalMeasurementRecord): body_position: Optional[BodyPositionEnum] = Field(default=None, description="""The body position during measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) context: Optional[ContextEnum] = Field(default=None, description="""The context of the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) collected_by: Optional[CollectedByEnum] = Field(default=None, description="""Who collected the measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'ProcedureStatusRecord']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) age_at_measurement: Quantity = Field(default=..., description="""Age of the subject at the time of measurement""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) study_site: Optional[str] = Field(default=None, description="""Institution name, clinic name, or other indication of where a measurement was taken geographically""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) absolute_time: Optional[datetime ] = Field(default=None, description="""Calendar date when a measurement was taken""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord']} }) @@ -2128,7 +2507,8 @@ class Entity(ConfiguredBaseModel): """ Any resource that has its own identifier """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'class_uri': 'schema:Thing', + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'abstract': True, + 'class_uri': 'schema:Thing', 'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) 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'} }) @@ -2144,35 +2524,62 @@ class Variable(Entity): 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'], + 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 SingleContinuousVariable(Variable): + """ + Represents a single entry in a data dictionary of a variable with a continuous value + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) + + source_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the variable in their system. In most cases this will be a phv value.""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + file_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the file or data table in their system. In most cases this will be a pht value""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + file_name: Optional[str] = Field(default=None, description="""Name of file containing variable data""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + variable_name: Optional[str] = Field(default=None, description="""The name of the variable according to the original data provider Corresponds to the VARNAME field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + source_variable_description: Optional[str] = Field(default=None, description="""Description of the variable provided by the original data provider Corresponds to the VARDESC field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) + minimum_value: Optional[Decimal] = Field(default=None, description="""The lowest value present in the data for this variable. Corresponds to the MIN field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable']} }) + maximum_value: Optional[Decimal] = Field(default=None, description="""The highest value present in the data for this variable. Corresponds to the MAX field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable']} }) + resolution: Optional[int] = Field(default=None, description="""The number of decimal places a measurement is represented in the data. Corresponds to the RESOLUTION field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable']} }) + missing_value: Optional[list[MissingValue]] = Field(default=None, description="""Sentinel value to indicate a missing value or other data nuance""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) + alert_values: Optional[list[AlertValue]] = 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': ['SingleContinuousVariable']} }) + comment: Optional[str] = Field(default=None, description="""Any text comment provided by the original data provider. Corresponds to the COMMENT field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + 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']} }) 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 SingleVariable(Variable): +class SingleCategoricalVariable(Variable): """ - Represents a single entry in a data dictionary + Represents a single entry in a data dictionary of a variable with a categorical value """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) - source_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the variable in their system. In most cases this will be a phv value.""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - file_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the file or data table in their system. In most cases this will be a pht value""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - file_name: Optional[str] = Field(default=None, description="""Name of file containing variable data""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - variable_name: Optional[str] = Field(default=None, description="""The name of the variable according to the original data provider Corresponds to the VARNAME field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - source_variable_description: Optional[str] = Field(default=None, description="""Description of the variable provided by the original data provider Corresponds to the VARDESC field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', 'SingleVariable']} }) - minimum_value: Optional[Decimal] = Field(default=None, description="""The lowest value present in the data for this variable. Corresponds to the MIN field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - maximum_value: Optional[Decimal] = Field(default=None, description="""The highest value present in the data for this variable. Corresponds to the MAX field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - resolution: Optional[int] = Field(default=None, description="""The number of decimal places a measurement is represented in the data. Corresponds to the RESOLUTION field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - coded_values: Optional[str] = Field(default=None, description="""Pipe-delimited string of allowable values. Should only be used if the data_type is enum. Corresponds to VALUES field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - missing_value: Optional[list[MissingValue]] = Field(default=None, description="""Sentinel value to indicate a missing value or other data nuance""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) - comment: Optional[str] = Field(default=None, description="""Any text comment provided by the original data provider. Corresponds to the COMMENT field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleVariable']} }) + source_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the variable in their system. In most cases this will be a phv value.""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + file_id: Optional[str] = Field(default=None, description="""Identifier used by the organization providing the variable to BDC to uniquely identify the file or data table in their system. In most cases this will be a pht value""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + file_name: Optional[str] = Field(default=None, description="""Name of file containing variable data""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + variable_name: Optional[str] = Field(default=None, description="""The name of the variable according to the original data provider Corresponds to the VARNAME field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + source_variable_description: Optional[str] = Field(default=None, description="""Description of the variable provided by the original data provider Corresponds to the VARDESC field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + data_type: Optional[DataTypeEnum] = Field(default=None, description="""The data type of the observation""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'SingleCategoricalVariable']} }) + missing_value: Optional[list[MissingValue]] = Field(default=None, description="""Sentinel value to indicate a missing value or other data nuance""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) + coded_values: Optional[list[EnumValue]] = Field(default=None, description="""List of allowable values. Should only be used if the data_type is enum. Corresponds to VALUES field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleCategoricalVariable']} }) + comment: Optional[str] = Field(default=None, description="""Any text comment provided by the original data provider. Corresponds to the COMMENT field in dbGAP""", json_schema_extra = { "linkml_meta": {'domain_of': ['SingleContinuousVariable', 'SingleCategoricalVariable']} }) 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'} }) @@ -2184,14 +2591,18 @@ class CompoundVariable(Variable): 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) + row_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']} }) + documentation_metadata: Optional[list[DocumentationVariable]] = Field(default=None, description="""List of metadata elements that derive from study documentation or descriptive information in the data dictionary""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} }) + alert_value: Optional[list[AlertValue]] = 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'} }) @@ -2203,13 +2614,16 @@ class IntegratedVariable(Variable): 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) integrates: Optional[list[str]] = Field(default=None, description="""List of variables combined in the IntegratedVariable""", json_schema_extra = { "linkml_meta": {'domain_of': ['IntegratedVariable']} }) 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'} }) @@ -2219,8 +2633,8 @@ class MissingValue(Entity): """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) - indicator_char: Optional[str] = Field(default=None, description="""Sentinel value used to add information to a datum or indicate a missing datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue']} }) - indicator_meaning: Optional[str] = Field(default=None, description="""Meaning of the indicator character verbatim from original data provider when possible""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue']} }) + indicator_char: Optional[str] = Field(default=None, description="""Value used to add information to a datum, indicate a missing datum, or give a specific answer""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) + indicator_meaning: Optional[str] = Field(default=None, description="""Meaning of the indicator character verbatim from original data provider when possible""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) 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'} }) @@ -2230,8 +2644,20 @@ class AlertValue(Entity): """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) - indicator_char: Optional[str] = Field(default=None, description="""Sentinel value used to add information to a datum or indicate a missing datum""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue']} }) - indicator_meaning: Optional[str] = Field(default=None, description="""Meaning of the indicator character verbatim from original data provider when possible""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue']} }) + indicator_char: Optional[str] = Field(default=None, description="""Value used to add information to a datum, indicate a missing datum, or give a specific answer""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) + indicator_meaning: Optional[str] = Field(default=None, description="""Meaning of the indicator character verbatim from original data provider when possible""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) + 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 EnumValue(Entity): + """ + One possible answer in a list of enumerated values + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) + + indicator_char: Optional[str] = Field(default=None, description="""Value used to add information to a datum, indicate a missing datum, or give a specific answer""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) + indicator_meaning: Optional[str] = Field(default=None, description="""Meaning of the indicator character verbatim from original data provider when possible""", json_schema_extra = { "linkml_meta": {'domain_of': ['MissingValue', 'AlertValue', 'EnumValue']} }) + indicator_type: Optional[str] = Field(default=None, description="""CURIE describing the meaning of the indicator""", json_schema_extra = { "linkml_meta": {'domain_of': ['EnumValue']} }) 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'} }) @@ -2241,7 +2667,35 @@ class MetadataVariable(Entity): """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) - microschema_slot: Optional[ClinicalMicroschemaEnum] = Field(default=None, description="""The slot that the variable identified in the variable path should go""", json_schema_extra = { "linkml_meta": {'domain_of': ['MetadataVariable']} }) + microschema_slot: Optional[ClinicalMicroschemaEnum] = Field(default=None, description="""The slot that the variable identified in the variable path should go""", json_schema_extra = { "linkml_meta": {'domain_of': ['MetadataVariable', 'DocumentationVariable']} }) + 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 DocumentationVariable(Entity): + """ + Information derived from study documentation or text in a data dictionary that provides essential metadata for a variable + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library', + 'rules': [{'postconditions': {'slot_conditions': {'contr_vocab': {'name': 'contr_vocab', + 'range': 'InstrumentEnum'}}}, + 'preconditions': {'slot_conditions': {'microschema_slot': {'equals_string': 'instrument', + 'name': 'microschema_slot'}}}}, + {'postconditions': {'slot_conditions': {'contr_vocab': {'name': 'contr_vocab', + 'range': 'MethodEnum'}}}, + 'preconditions': {'slot_conditions': {'microschema_slot': {'equals_string': 'method_type', + 'name': 'microschema_slot'}}}}, + {'postconditions': {'slot_conditions': {'contr_vocab': {'any_of': [{'pattern': '^MONDO:\\d{7}$'}, + {'pattern': '^HP:\\d{7}$'}], + 'name': 'contr_vocab'}}}, + 'preconditions': {'slot_conditions': {'microschema_slot': {'equals_string': 'condition_concept', + 'name': 'microschema_slot'}}}}, + {'postconditions': {'slot_conditions': {'contr_vocab': {'name': 'contr_vocab', + 'range': 'ProvenanceEnum'}}}, + 'preconditions': {'slot_conditions': {'microschema_slot': {'equals_string': 'condition_provenance', + 'name': 'microschema_slot'}}}}]}) + + contr_vocab: Optional[str] = Field(default=None, description="""Value from an enum""", json_schema_extra = { "linkml_meta": {'domain_of': ['DocumentationVariable']} }) + microschema_slot: Optional[ClinicalMicroschemaEnum] = Field(default=None, description="""The slot that the variable identified in the variable path should go""", json_schema_extra = { "linkml_meta": {'domain_of': ['MetadataVariable', 'DocumentationVariable']} }) 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'} }) @@ -2254,14 +2708,18 @@ class CompoundHeight002(CompoundVariable): 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) + row_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']} }) + documentation_metadata: Optional[list[DocumentationVariable]] = Field(default=None, description="""List of metadata elements that derive from study documentation or descriptive information in the data dictionary""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} }) + alert_value: Optional[list[AlertValue]] = 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'} }) @@ -2274,14 +2732,18 @@ class CompoundHeight001(CompoundVariable): 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) + row_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']} }) + documentation_metadata: Optional[list[DocumentationVariable]] = Field(default=None, description="""List of metadata elements that derive from study documentation or descriptive information in the data dictionary""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} }) + alert_value: Optional[list[AlertValue]] = 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'} }) @@ -2293,13 +2755,61 @@ class IntegratedHeight001(IntegratedVariable): 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) integrates: Optional[list[str]] = Field(default=None, description="""List of variables combined in the IntegratedVariable""", json_schema_extra = { "linkml_meta": {'domain_of': ['IntegratedVariable']} }) 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'], + 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 CompoundAsthma001(CompoundVariable): + """ + A record of participant asthma status + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library', + 'instantiates': ['AsthmaStatusRecord']}) + + 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], + 'slot_uri': 'bdchm:unit'} }) + row_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']} }) + documentation_metadata: Optional[list[DocumentationVariable]] = Field(default=None, description="""List of metadata elements that derive from study documentation or descriptive information in the data dictionary""", json_schema_extra = { "linkml_meta": {'domain_of': ['CompoundVariable']} }) + alert_value: Optional[list[AlertValue]] = 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']} }) + 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 IntegratedAsthma001(IntegratedVariable): + """ + Participant asthma status containing data from multiple studies + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/bdc-variable-library'}) + + 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']} }) + unit: Optional[str] = Field(default=None, description="""A unit from UCUM""", json_schema_extra = { "linkml_meta": {'domain_of': ['ClinicalMeasurementRecord', + 'SingleContinuousVariable', + 'CompoundVariable', + 'IntegratedVariable'], 'slot_uri': 'bdchm:unit'} }) + integrates: Optional[list[str]] = Field(default=None, description="""List of variables combined in the IntegratedVariable""", json_schema_extra = { "linkml_meta": {'domain_of': ['IntegratedVariable']} }) + 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']} }) 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'} }) @@ -2347,6 +2857,15 @@ class ResearchStudy(Entity): HumanBasophilCountRecord.model_rebuild() HumanBasophilCountRecord001.model_rebuild() HumanBasophilCountRecord002.model_rebuild() +AsthmaStatusRecord.model_rebuild() +HeartFailureStatusRecord.model_rebuild() +ObesityStatusRecord.model_rebuild() +AspirinStatusRecord.model_rebuild() +BetaBlockerStatusRecord.model_rebuild() +DiabetesMedicationStatusRecord.model_rebuild() +PacemakerStatusRecord.model_rebuild() +CoronaryAngioplastyStatusRecord.model_rebuild() +CoronaryBypassStatusRecord.model_rebuild() Relativity.model_rebuild() Context.model_rebuild() HumanFvcRecord.model_rebuild() @@ -2371,13 +2890,18 @@ class ResearchStudy(Entity): HumanBasophilCountQuantity002.model_rebuild() Entity.model_rebuild() Variable.model_rebuild() -SingleVariable.model_rebuild() +SingleContinuousVariable.model_rebuild() +SingleCategoricalVariable.model_rebuild() CompoundVariable.model_rebuild() IntegratedVariable.model_rebuild() MissingValue.model_rebuild() AlertValue.model_rebuild() +EnumValue.model_rebuild() MetadataVariable.model_rebuild() +DocumentationVariable.model_rebuild() CompoundHeight002.model_rebuild() CompoundHeight001.model_rebuild() IntegratedHeight001.model_rebuild() +CompoundAsthma001.model_rebuild() +IntegratedAsthma001.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 30cfc9f..45f4e5a 100644 --- a/src/bdc_variable_library/schema/bdc_variable_library.yaml +++ b/src/bdc_variable_library/schema/bdc_variable_library.yaml @@ -32,11 +32,12 @@ default_range: string imports: - linkml:types - https://raw.githubusercontent.com/linkml/linkml-microschema-profile/v0.3.0/src/linkml_microschema_profile/schema/linkml_microschema_profile - - https://raw.githubusercontent.com/linkml/clinical-microschemas/v0.0.2/src/clinical_microschemas/schema/clinical_microschemas + - https://raw.githubusercontent.com/linkml/clinical-microschemas/v0.0.3/src/clinical_microschemas/schema/clinical_microschemas classes: Entity: + abstract: true description: >- Any resource that has its own identifier class_uri: schema:Thing @@ -52,12 +53,12 @@ classes: - variable_description - concept_type - variable_label - - unit - SingleVariable: + SingleContinuousVariable: is_a: Variable description: >- - Represents a single entry in a data dictionary + Represents a single entry in a data dictionary of a variable with a continuous + value slots: - source_id - file_id @@ -68,8 +69,25 @@ classes: - minimum_value - maximum_value - resolution - - coded_values - missing_value + - unit + - alert_values + - comment + + SingleCategoricalVariable: + is_a: Variable + description: >- + Represents a single entry in a data dictionary of a variable with a categorical + value + slots: + - source_id + - file_id + - file_name + - variable_name + - source_variable_description + - data_type + - missing_value + - coded_values - comment CompoundVariable: @@ -79,7 +97,9 @@ classes: slots: - cde_id - bdchm_type - - metadata + - unit + - row_metadata + - documentation_metadata - alert_value IntegratedVariable: @@ -91,6 +111,7 @@ classes: slots: - cde_id - bdchm_type + - unit - integrates MissingValue: @@ -108,6 +129,15 @@ classes: slots: - indicator_char - indicator_meaning + + EnumValue: + is_a: Entity + description: >- + One possible answer in a list of enumerated values + slots: + - indicator_char + - indicator_meaning + - indicator_type MetadataVariable: is_a: Entity @@ -117,6 +147,50 @@ classes: microschema slots: - microschema_slot + + DocumentationVariable: + is_a: Entity + description: >- + Information derived from study documentation or text in a data dictionary + that provides essential metadata for a variable + slots: + - contr_vocab + - microschema_slot + rules: + - preconditions: + slot_conditions: + microschema_slot: + equals_string: instrument + postconditions: + slot_conditions: + contr_vocab: + range: InstrumentEnum + - preconditions: + slot_conditions: + microschema_slot: + equals_string: method_type + postconditions: + slot_conditions: + contr_vocab: + range: MethodEnum + - preconditions: + slot_conditions: + microschema_slot: + equals_string: condition_concept + postconditions: + slot_conditions: + contr_vocab: + any_of: + - pattern: "^MONDO:\\d{7}$" + - pattern: "^HP:\\d{7}$" + - preconditions: + slot_conditions: + microschema_slot: + equals_string: condition_provenance + postconditions: + slot_conditions: + contr_vocab: + range: ProvenanceEnum CompoundHeight002: is_a: CompoundVariable @@ -138,6 +212,18 @@ classes: is_a: IntegratedVariable description: >- Height variable containing data from multiple studies, normalized to cm + + CompoundAsthma001: + is_a: CompoundVariable + description: >- + A record of participant asthma status + instantiates: + - AsthmaStatusRecord + + IntegratedAsthma001: + is_a: IntegratedVariable + description: >- + Participant asthma status containing data from multiple studies ResearchStudy: is_a: Entity @@ -145,6 +231,8 @@ classes: description: >- Name of research study that produced the variable + + slots: id: identifier: true @@ -196,11 +284,6 @@ slots: description: >- The number of decimal places a measurement is represented in the data. Corresponds to the RESOLUTION field in dbGAP - coded_values: - range: string - description: >- - Pipe-delimited string of allowable values. Should only be used if the data_type - is enum. Corresponds to VALUES field in dbGAP missing_value: range: MissingValue multivalued: true @@ -230,29 +313,51 @@ slots: range: BdchmTypeEnum description: >- Entity type from BDCHM that defines the variable type - metadata: + row_metadata: range: MetadataVariable multivalued: true inlined: true inlined_as_list: true description: >- List of variable identifiers providing metadata for a compound variable + documentation_metadata: + range: DocumentationVariable + multivalued: true + inlined: true + inlined_as_list: true + description: >- + List of metadata elements that derive from study documentation or descriptive + information in the data dictionary alert_value: range: AlertValue multivalued: true + inlined: true + inlined_as_list: true + description: >- + List of values that provide extra optional information about a variable. + Often this is used to indicate a violation of QA/QC + alert_values: + range: AlertValue + multivalued: true + inlined: true + inlined_as_list: true description: >- List of values that provide extra optional information about a variable. Often this is used to indicate a violation of QA/QC indicator_char: range: string description: >- - Sentinel value used to add information to a datum or indicate a missing - datum + Value used to add information to a datum, indicate a missing datum, or give + a specific answer indicator_meaning: range: string description: >- Meaning of the indicator character verbatim from original data provider when possible + indicator_type: + range: uriorcurie + description: >- + CURIE describing the meaning of the indicator microschema_slot: range: ClinicalMicroschemaEnum description: >- @@ -262,6 +367,18 @@ slots: multivalued: true description: >- List of variables combined in the IntegratedVariable + coded_values: + range: EnumValue + multivalued: true + inlined: true + inlined_as_list: true + description: >- + List of allowable values. Should only be used if the data_type is enum. + Corresponds to VALUES field in dbGAP + contr_vocab: + range: string + description: >- + Value from an enum enums: @@ -280,7 +397,7 @@ enums: ClinicalMicroschemaEnum: description: >- - A list of slots describing clinical measurements in microschema + A list of slots describing clinical data in microschema permissible_values: subject_identifier: measurement_type: @@ -298,3 +415,15 @@ enums: age_at_measurement: study_site: absolute_time: + condition_type: + associated_evidence: + age_at_condition_start: + age_at_condition_end: + age_at_condition_record: + condition_status: + condition_provenance: + condition_concept: + condition_severity: + relationship_to_participant: + method_type: + diff --git a/src/docs/templates/class.md.jinja2 b/src/docs/templates/class.md.jinja2 new file mode 100644 index 0000000..493218a --- /dev/null +++ b/src/docs/templates/class.md.jinja2 @@ -0,0 +1,290 @@ +--- +search: + boost: {% if element.deprecated %}0.5{% else %}10.0{% endif %} +--- + +{%- if element.title %} + {%- set title = element.title ~ ' (' ~ element.name ~ ')' -%} +{%- else %} + {%- if gen.use_class_uris -%} + {%- set title = element.name -%} + {%- else -%} + {%- set title = gen.name(element) -%} + {%- endif -%} +{%- endif -%} + +{% macro compute_range(slot) -%} + {%- if slot.any_of or slot.exactly_one_of -%} + {%- for subslot_range in schemaview.slot_range_as_union(slot) -%} + {{ gen.link(subslot_range) }} + {%- if not loop.last -%} +  or 
+ {%- endif -%} + {%- endfor -%} + {%- else -%} + {{ gen.link(slot.range) }} + {%- endif -%} +{% endmacro %} + +# Class: {{ title }} {% if element.deprecated %} (DEPRECATED) {% endif %} + +{%- if header -%} +{{ header }} +{%- endif -%} + +{% if element.description %} +{% set element_description_lines = element.description.split('\n') %} +{% for element_description_line in element_description_lines %} +_{{ element_description_line }}_ +{% endfor %} +{% endif %} + +
+ +{% if element.abstract %} +* __NOTE__: this is an abstract class and should not be instantiated directly +{% endif %} + +URI: {{ gen.uri_link(element) }} + +{% if diagram_type == "er_diagram" %} +```{{ gen.mermaid_directive() }} +{{ gen.mermaid_diagram([element.name]) }} +``` +{% elif diagram_type == "plantuml_class_diagram" %} +```puml +{{ gen.mermaid_diagram([element.name]) }} +``` +{% else %} +{% include "class_diagram.md.jinja2" %} +{% endif %} + +{% if schemaview.class_parents(element.name) or schemaview.class_children(element.name, mixins=False) %} + +## Inheritance +{{ gen.inheritance_tree(element, mixins=True) }} +{% else %} + +{% endif %} + +{%- set has_class_props = element.class_uri or element.tree_root or element.mixin + or element.subclass_of or element.union_of or element.disjoint_with + or element.slot_names_unique or element.represents_relationship + or element.children_are_mutually_disjoint %} + +{%- if has_class_props %} +## Class Properties + +| Property | Value | +| --- | --- | +{%- if element.class_uri %} +| Class URI | {{ gen.uri_link(element.class_uri) }} | +{%- endif %} +{%- if element.mixin %} +| Mixin | Yes | +{%- endif %} +{%- if element.tree_root %} +| Tree Root | Yes | +{%- endif %} +{%- if element.slot_names_unique %} +| Slot Names Unique | Yes | +{%- endif %} +{%- if element.represents_relationship %} +| Represents Relationship | Yes | +{%- endif %} +{%- if element.subclass_of %} +| Subclass Of | {{ gen.links(element.subclass_of) | join(', ') }} | +{%- endif %} +{%- if element.union_of %} +| Union Of | {{ gen.links(element.union_of) | join(', ') }} | +{%- endif %} +{%- if element.disjoint_with %} +| Disjoint With | {{ gen.links(element.disjoint_with) | join(', ') }} | +{%- endif %} +{%- if element.children_are_mutually_disjoint %} +| Children Are Mutually Disjoint | Yes | +{%- endif %} + +{% endif %} +## Slots + +| Name | Cardinality and Range | Description | Inheritance | +| --- | --- | --- | --- | +{% if gen.get_direct_slots(element)|length > 0 %} +{%- for slot in gen.get_direct_slots(element) -%} +| {{ gen.link(slot) }} | {{ gen.cardinality(slot) }}
{{ compute_range(slot) }} | {{ slot.description|enshorten }} | direct | +{% endfor -%} +{% endif -%} +{% if gen.get_indirect_slots(element)|length > 0 %} +{%- for slot in gen.get_indirect_slots(element) -%} +| {{ gen.link(slot) }} | {{ gen.cardinality(slot) }}
{{ compute_range(slot) }} | {{ slot.description|enshorten }} | {{ gen.links(gen.get_slot_inherited_from(element.name, slot.name))|join(', ') }} | +{% endfor -%} +{% endif %} + +{%- if element.unique_keys %} +## Unique Keys + +{% for uk in element.unique_keys.values() %} +### {{ uk.unique_key_name }} + +**Unique key slots:** {{ uk.unique_key_slots | join(', ') }} +{%- if uk.consider_nulls_inequal %} + +Considers null values as inequal +{%- endif %} +{% endfor %} +{% endif %} + +{%- if element.defining_slots %} +## Defining Slots + +This class is defined by the following slots: + +{% for slot_name in element.defining_slots %} +* {{ gen.link(slot_name) }} +{%- endfor %} +{% endif %} + +{%- set has_expressions = element.any_of or element.all_of or element.exactly_one_of + or element.none_of or element.slot_conditions %} + +{%- if has_expressions %} +
+Expressions & Logic + +{%- if element.any_of %} +#### Any Of + +The class must satisfy at least one of: + +{%- for expr in element.any_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.all_of %} +#### All Of + +The class must satisfy all of: + +{%- for expr in element.all_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.exactly_one_of %} +#### Exactly One Of + +The class must satisfy exactly one of: + +{%- for expr in element.exactly_one_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.none_of %} +#### None Of + +The class must not satisfy any of: + +{%- for expr in element.none_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.slot_conditions %} +#### Slot Conditions + +{%- for slot_name, conditions in element.slot_conditions.items() %} +- **{{ gen.link(slot_name) }}**: {{ conditions }} +{%- endfor %} +{%- endif %} + +
+{% endif %} + +{% if schemaview.is_mixin(element.name) %} +## Mixin Usage + +| mixed into | description | +| --- | --- | +{% for c in schemaview.class_children(element.name, is_a=False) -%} +| {{ gen.link(c) }} | {{ schemaview.get_class(c).description|enshorten }} | +{% endfor %} +{% endif %} + +{% if schemaview.usage_index().get(element.name) %} +## Usages + +| used by | used in | type | used | +| --- | --- | --- | --- | +{% for usage in schemaview.usage_index().get(element.name) -%} +| {{ gen.link(usage.used_by) }} | {{ gen.link(usage.slot) }} | {{ usage.metaslot }} | {{ gen.link(usage.used) }} | +{% endfor %} +{% endif %} + +{% if element.rules %} +## Rules + +{% for rule in gen.classrule_to_dict_view(element) %} +### {{ rule.title }} + +| Rule Applied | Preconditions | Postconditions | Elseconditions | +|--------------|---------------|----------------|----------------| +{% for key in rule.preconditions|default({}, true) -%} +| {{ key }} | +{%- if rule.preconditions[key] is defined -%} +```{{ rule.preconditions[key] }}``` +{%- else -%} +{% endif %} | +{%- if rule.postconditions and rule.postconditions[key] is defined -%} +```{{ rule.postconditions[key] }}``` +{%- else -%} +{% endif %} | +{%- if rule.elseconditions and rule.elseconditions[key] is defined -%} +```{{ rule.elseconditions[key] }}``` +{%- else -%} +{% endif %} | +{% endfor %} + +{% endfor %} +{% endif %} + +{% include "common_metadata.md.jinja2" %} + +{% if gen.example_object_blobs(element.name) -%} +## Examples +{% for name, blob in gen.example_object_blobs(element.name) -%} +### Example: {{ name }} + +```yaml +{{ blob }} +``` +{% endfor %} +{% endif %} + +## LinkML Source + + + +### Direct + +
+```yaml +{{ gen.yaml(element) }} +``` +
+ +### Induced + +
+```yaml +{{ gen.yaml(element, inferred=True) }} +``` +
+ +{%- if footer -%} +{{ footer }} +{%- endif -%} + +
diff --git a/src/docs/templates/class_diagram.md.jinja2 b/src/docs/templates/class_diagram.md.jinja2 new file mode 100644 index 0000000..95c2e98 --- /dev/null +++ b/src/docs/templates/class_diagram.md.jinja2 @@ -0,0 +1,76 @@ +{% macro slot_relationship(element, slot) %} + {% if slot.range is not none %} + {% set range_element = gen.name(schemaview.get_element(slot.range)) %} + {% set relation_label = gen.name(slot) %} + {{ gen.name(element) }} --> "{{ gen.cardinality(slot) }}" {{ range_element }} : {{ relation_label }} + click {{ range_element }} href "{{ gen.link_mermaid(schemaview.get_element(slot.range)) }}" + {% endif %} +{% endmacro %} + +{% if schemaview.class_parents(element.name) and schemaview.class_children(element.name) %} +```{{ gen.mermaid_directive() }} + classDiagram + class {{ gen.name(element) }} + click {{ gen.name(element) }} href "{{ gen.link_mermaid(element) }}" + {% for s in schemaview.class_parents(element.name)|sort(attribute='name') -%} + {{ gen.name(schemaview.get_element(s)) }} <|-- {{ gen.name(element) }} + click {{ gen.name(schemaview.get_element(s)) }} href "{{ gen.link_mermaid(schemaview.get_element(s)) }}" + {% endfor %} + + {% for s in schemaview.class_children(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} <|-- {{ gen.name(schemaview.get_element(s)) }} + click {{ gen.name(schemaview.get_element(s)) }} href "{{ gen.link_mermaid(schemaview.get_element(s)) }}" + {% endfor %} + + {% for s in schemaview.class_induced_slots(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} : {{ gen.name(s) }} + {% if s.range is not none and s.range not in gen.all_type_object_names() %} + {{ slot_relationship(element, s) }} + {% endif %} + {% endfor %} +``` +{% elif schemaview.class_parents(element.name) %} +```{{ gen.mermaid_directive() }} + classDiagram + class {{ gen.name(element) }} + click {{ gen.name(element) }} href "{{ gen.link_mermaid(element) }}" + {% for s in schemaview.class_parents(element.name)|sort(attribute='name') -%} + {{ gen.name(schemaview.get_element(s)) }} <|-- {{ gen.name(element) }} + click {{ gen.name(schemaview.get_element(s)) }} href "{{ gen.link_mermaid(schemaview.get_element(s)) }}" + {% endfor %} + {% for s in schemaview.class_induced_slots(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} : {{ gen.name(s) }} + {% if s.range is not none and s.range not in gen.all_type_object_names() %} + {{ slot_relationship(element, s) }} + {% endif %} + {% endfor %} +``` +{% elif schemaview.class_children(element.name) %} +```{{ gen.mermaid_directive() }} + classDiagram + class {{ gen.name(element) }} + click {{ gen.name(element) }} href "{{ gen.link_mermaid(element) }}" + {% for s in schemaview.class_children(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} <|-- {{ gen.name(schemaview.get_element(s)) }} + click {{ gen.name(schemaview.get_element(s)) }} href "{{ gen.link_mermaid(schemaview.get_element(s)) }}" + {% endfor %} + {% for s in schemaview.class_induced_slots(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} : {{ gen.name(s) }} + {% if s.range is not none and s.range not in gen.all_type_object_names() %} + {{ slot_relationship(element, s) }} + {% endif %} + {% endfor %} +``` +{% else %} +```{{ gen.mermaid_directive() }} + classDiagram + class {{ gen.name(element) }} + click {{ gen.name(element) }} href "{{ gen.link_mermaid(element) }}" + {% for s in schemaview.class_induced_slots(element.name)|sort(attribute='name') -%} + {{ gen.name(element) }} : {{ gen.name(s) }} + {% if s.range is not none and s.range not in gen.all_type_object_names() %} + {{ slot_relationship(element, s) }} + {% endif %} + {% endfor %} +``` +{% endif %} diff --git a/src/docs/templates/common_metadata.md.jinja2 b/src/docs/templates/common_metadata.md.jinja2 new file mode 100644 index 0000000..cdc0598 --- /dev/null +++ b/src/docs/templates/common_metadata.md.jinja2 @@ -0,0 +1,142 @@ +{% if element.categories %} +## Categories + +{% for cat in element.categories %} +* {{ cat }} +{%- endfor %} + +{% endif %} +{% if element.keywords %} +## Keywords + +{% for kw in element.keywords %} +* {{ kw }} +{%- endfor %} + +{% endif %} +{% if element.in_subset %} +## In Subsets + +{% for subset in element.in_subset %} +* {{ gen.link(subset) }} +{%- endfor %} + +{% endif %} +{% if element.aliases %} +## Aliases + +{% for alias in element.aliases %} +* {{ alias }} +{%- endfor %} +{% endif %} + +{% if element.examples %} +## Examples + +| Value | +| --- | +{% for x in element.examples -%} +| {{ x.value }} | +{% endfor %} +{% endif -%} + +{% if element.comments -%} +## Comments + +{% for x in element.comments -%} +* {{ x }} +{% endfor %} +{% endif -%} + +{% if element.todos -%} +## TODOs + +{% for x in element.todos -%} +* {{ x }} +{% endfor %} +{% endif -%} + +{% if element.see_also -%} +## See Also + +{% for x in element.see_also -%} +* {{ gen.uri_link(x) }} +{% endfor %} +{% endif -%} + +{% if element.notes -%} +## Notes + +{% for note in element.notes -%} +* {{ note }} +{% endfor %} +{% endif -%} + +{% if element.alt_descriptions %} +## Alternative Descriptions + +{% for source, alt_desc in element.alt_descriptions.items() %} +* **{{ source }}**: {{ alt_desc.description }} +{%- endfor %} +{% endif %} + +## Identifier and Mapping Information + +{%- set has_admin_metadata = element.status or (element.rank is not none and element.rank != 1000) %} + +{%- if has_admin_metadata %} +### Administrative Metadata + +{% if element.status -%} +**Status:** {{ element.status }} +{% endif -%} +{% if element.rank is not none and element.rank != 1000 -%} +**Rank:** {{ element.rank }} +{% endif -%} + +{% endif %} +{% if element.id_prefixes %} +### Valid ID Prefixes + +Instances of this class *should* have identifiers with one of the following prefixes: +{% for p in element.id_prefixes %} +* {{ p }} +{% endfor %} + +{% endif %} + +{% if element.annotations %} +### Annotations + +| property | value | +| --- | --- | +{% for a in element.annotations -%} +{%- if a|string|first != '_' -%} +| {{ a }} | {{ element.annotations[a].value }} | +{% endif -%} +{% endfor %} +{% endif %} + +{% if element.from_schema or element.imported_from %} +### Schema Source + +{% if element.from_schema %} +* from schema: {{ element.from_schema }} +{% endif %} +{% if element.imported_from %} +* imported from: {{ element.imported_from }} +{% endif %} +{% endif %} + +{% if schemaview.get_mappings(element.name).items() -%} +## Mappings + +| Mapping Type | Mapped Value | +| --- | --- | +{% for m, mt in schemaview.get_mappings(element.name).items() -%} +{% if mt|length > 0 -%} +| {{ m }} | {{ mt|join(', ') }} | +{% endif -%} +{% endfor %} + +{% endif -%} diff --git a/src/docs/templates/enum.md.jinja2 b/src/docs/templates/enum.md.jinja2 new file mode 100644 index 0000000..07ccd5b --- /dev/null +++ b/src/docs/templates/enum.md.jinja2 @@ -0,0 +1,203 @@ +--- +search: + boost: {% if element.deprecated %}0.5{% else %}2.0{% endif %} +--- + +{%- if element.title and element.title != element.name %} + {%- set title = element.title ~ ' (' ~ element.name ~ ')' -%} +{%- else %} + {%- set title = gen.name(element) -%} +{%- endif -%} + +{# Render an EnumExpression / AnonymousEnumExpression as a Markdown sub-list. + Walks the selector slots defined on `enum_expression` in the LinkML metamodel + (reachable_from, concepts, code_set, matches, pv_formula, inherits) and + formats each as a top-level bullet with any modifier fields nested below. #} +{% macro render_enum_expression(expr) -%} +{%- if expr.reachable_from %} +- **Reachable from**{% if expr.reachable_from.source_ontology %} {{ gen.uri_link(expr.reachable_from.source_ontology) }}{% endif %} +{%- if expr.reachable_from.source_nodes %} + - Source nodes: {{ expr.reachable_from.source_nodes | join(', ') }} +{%- endif %} +{%- if expr.reachable_from.relationship_types %} + - Via relationships: {{ expr.reachable_from.relationship_types | join(', ') }} +{%- endif %} +{%- if expr.reachable_from.is_direct %} + - Direct descendants only +{%- endif %} +{%- if expr.reachable_from.include_self %} + - Includes the source node itself +{%- endif %} +{%- if expr.reachable_from.traverse_up %} + - Traverses upward (ancestors) +{%- endif %} +{%- endif %} +{%- if expr.concepts %} +- **Concepts:** {{ expr.concepts | join(', ') }} +{%- endif %} +{%- if expr.code_set %} +- **Code set:** {{ gen.uri_link(expr.code_set) }} +{%- if expr.code_set_tag %} + - Tag: {{ expr.code_set_tag }} +{%- endif %} +{%- if expr.code_set_version %} + - Version: {{ expr.code_set_version }} +{%- endif %} +{%- endif %} +{%- if expr.matches %} +- **Matches identifier pattern** `{{ expr.matches.identifier_pattern }}` +{%- if expr.matches.source_ontology %} + - Source ontology: {{ gen.uri_link(expr.matches.source_ontology) }} +{%- endif %} +{%- endif %} +{%- if expr.pv_formula %} +- **Permissible value formula:** {{ expr.pv_formula }} +{%- endif %} +{%- if expr.inherits %} +- **Inherits from:** {{ gen.links(expr.inherits) | join(', ') }} +{%- endif %} +{% endmacro %} + +# Enum: {{ title }} {% if element.deprecated %} (DEPRECATED) {% endif %} + +{% if element.description %} +{% set element_description_lines = element.description.split('\n') %} +{% for element_description_line in element_description_lines %} +_{{ element_description_line }}_ +{% endfor %} +{% endif %} + +
+ +URI: {{ gen.uri_link(element) }} + +{%- if element.enum_uri %} + +**Enum URI:** {{ gen.uri_link(element.enum_uri) }} +{% endif %} + +{%- set has_enum_source = element.code_set or element.pv_formula or element.reachable_from + or element.matches or element.concepts %} + +{%- if has_enum_source %} +## Enumeration Source + +{%- if element.code_set %} +**Code Set:** {{ gen.uri_link(element.code_set) }} + +{%- if element.code_set_tag %} +- **Tag:** {{ element.code_set_tag }} +{%- endif %} +{%- if element.code_set_version %} +- **Version:** {{ element.code_set_version }} +{%- endif %} +{%- endif %} + +{%- if element.pv_formula %} +**Permissible Value Formula:** {{ element.pv_formula }} +{%- endif %} + +{%- if element.reachable_from %} +**Reachable From:** + +{%- if element.reachable_from.source_ontology %} +- **Source:** {{ gen.link(element.reachable_from.source_ontology) }} +{%- endif %} +{%- if element.reachable_from.source_nodes %} +- **Nodes:** {{ element.reachable_from.source_nodes | join(', ') }} +{%- endif %} +{%- if element.reachable_from.relationship_types %} +- **Via:** {{ element.reachable_from.relationship_types | join(', ') }} +{%- endif %} +{%- endif %} + +{%- if element.matches %} +**Matches:** + +- **Expression:** `{{ element.matches.string_expression }}` +{%- endif %} + +{%- if element.concepts %} +**Concepts:** {{ gen.uri_links(element.concepts) | join(', ') }} +{%- endif %} + +{% endif %} + +{% if element.permissible_values -%} +{%- set has_pv_extras = namespace(found=false) -%} +{%- for pv in element.permissible_values.values() -%} + {%- if pv.title or pv.is_a or pv.mixins or pv.deprecated -%} + {%- set has_pv_extras.found = true -%} + {%- endif -%} +{%- endfor -%} +## Permissible Values + +{%- if has_pv_extras.found %} +| Value | Meaning | Description | Additional Info | +| --- | --- | --- | --- | +{% for pv in element.permissible_values.values() -%} +| {{ pv.text }} | {{ pv.meaning }} | {{ pv.description|enshorten }} | +{%- if pv.title %} Title: {{ pv.title }}
{% endif -%} +{%- if pv.is_a %} Is-A: {{ gen.link(pv.is_a) }}
{% endif -%} +{%- if pv.mixins %} Mixins: {{ gen.links(pv.mixins) | join(', ') }}
{% endif -%} +{%- if pv.deprecated %} **DEPRECATED**{% if pv.deprecated_element_has_exact_replacement %} (use {{ gen.link(pv.deprecated_element_has_exact_replacement) }}){% endif %}{% endif -%} + | +{% endfor %} +{%- else %} +| Value | Meaning | Description | +| --- | --- | --- | +{% for pv in element.permissible_values.values() -%} +| {{ pv.text }} | {{ pv.meaning }} | {{ pv.description|enshorten }} | +{% endfor %} +{%- endif %} +{% else %} +_This is a dynamic enum_ +{% endif %} + +{%- set has_enum_ops = element.inherits or element.include or element.minus %} + +{%- if has_enum_ops %} +## Enumeration Operations + +{%- if element.inherits %} +**Inherits From:** {{ gen.links(element.inherits) | join(', ') }} +{%- endif %} + +{%- if element.include %} +**Includes:** +{% for expr in element.include -%} +{{ render_enum_expression(expr) }} +{%- endfor %} +{%- endif %} + +{%- if element.minus %} +**Excludes:** +{% for expr in element.minus -%} +{{ render_enum_expression(expr) }} +{%- endfor %} +{%- endif %} + +{% endif %} + +{% set slots_for_enum = schemaview.get_slots_by_enum(element.name) %} +{% if slots_for_enum is defined and slots_for_enum|length > 0 -%} +## Slots + +| Name | Description | +| --- | --- | +{% for s in schemaview.get_slots_by_enum(element.name) -%} +| {{ gen.link(s) }} | {{ s.description|enshorten }} | +{% endfor %} +{% endif %} + +{% include "common_metadata.md.jinja2" %} + +## LinkML Source + +
+```yaml +{{ gen.yaml(element) }} +``` +
+ +
diff --git a/src/docs/templates/index.md.jinja2 b/src/docs/templates/index.md.jinja2 new file mode 100644 index 0000000..fe14498 --- /dev/null +++ b/src/docs/templates/index.md.jinja2 @@ -0,0 +1,62 @@ +# {% if schema.title %}{{ schema.title }}{% else %}{{ schema.name }}{% endif %} + +{% if schema.description %}{{ schema.description }}{% endif %} + +URI: {{ schema.id }} + +Name: {{ schema.name }} + +{% if include_top_level_diagram %} + +## Schema Diagram + +```{{ gen.mermaid_directive() }} +{{ gen.mermaid_diagram() }} +``` +{% endif %} + +## Classes + +| Class | Description | +| --- | --- | +{% if gen.hierarchical_class_view -%} +{% for u, v in gen.class_hierarchy_as_tuples() -%} +| {{ " "|safe*u*8 }}{{ gen.link(schemaview.get_class(v), True) }} | {{ schemaview.get_class(v).description|enshorten }} | +{% endfor %} +{% else -%} +{% for c in gen.all_class_objects()|sort(attribute=sort_by) -%} +| {{ gen.link(c, True) }} | {{ c.description|enshorten }} | +{% endfor %} +{% endif %} + +## Slots + +| Slot | Description | +| --- | --- | +{% for s in gen.all_slot_objects()|sort(attribute=sort_by) -%} +| {{ gen.link(s, True) }} | {{ s.description|enshorten }} | +{% endfor %} + +## Enumerations + +| Enumeration | Description | +| --- | --- | +{% for e in gen.all_enum_objects()|sort(attribute=sort_by) -%} +| {{ gen.link(e, True) }} | {{ e.description|enshorten }} | +{% endfor %} + +## Types + +| Type | Description | +| --- | --- | +{% for t in gen.all_type_objects()|sort(attribute=sort_by) -%} +| {{ gen.link(t, True) }} | {{ t.description|enshorten }} | +{% endfor %} + +## Subsets + +| Subset | Description | +| --- | --- | +{% for ss in schemaview.all_subsets().values()|sort(attribute='name') -%} +| {{ gen.link(ss, True) }} | {{ ss.description|enshorten }} | +{% endfor %} diff --git a/src/docs/templates/index.tex.jinja2 b/src/docs/templates/index.tex.jinja2 new file mode 100644 index 0000000..782b712 --- /dev/null +++ b/src/docs/templates/index.tex.jinja2 @@ -0,0 +1,26 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} + +\title{ {{ gen.latex(gen.schema_title()) }} } + +\begin{document} + +{{ schema.description }} + +URI: {{ gen.latex(schema.id) }} +Name: {{ gen.latex(schema.name) }} + +\subsection{Classes}\label{classes} + +\begin{tabular}{ |c|c| } + \hline + Class & Description \\\\ + \hline + +{% for c in schemaview.all_classes().values()|sort(attribute='name') -%} +{{ gen.latex(c.name) }} & {{ gen.latex(c.description) }} \\\\ +{% endfor %} + \hline +\end{tabular} + +\end{document} diff --git a/src/docs/templates/schema.md.jinja2 b/src/docs/templates/schema.md.jinja2 new file mode 100644 index 0000000..847c58b --- /dev/null +++ b/src/docs/templates/schema.md.jinja2 @@ -0,0 +1,5 @@ +# {{ schema.name }} {% if schema.deprecated %} (DEPRECATED) {% endif %} + +{{ schema.description }} + +URI: {{ schema.id }} diff --git a/src/docs/templates/slot.md.jinja2 b/src/docs/templates/slot.md.jinja2 new file mode 100644 index 0000000..5066e41 --- /dev/null +++ b/src/docs/templates/slot.md.jinja2 @@ -0,0 +1,490 @@ +--- +search: + boost: {% if element.deprecated %}0.5{% else %}5.0{% endif %} +--- + +{%- if element.title %} + {%- set title = element.title ~ ' (' ~ element.name ~ ')' -%} +{%- else %} + {%- if gen.use_slot_uris -%} + {%- set title = element.name -%} + {%- else -%} + {%- set title = gen.name(element) -%} + {%- endif -%} +{%- endif -%} + +{% macro compute_range(slot) -%} + {%- if slot.any_of or slot.exactly_one_of -%} + {%- for subslot_range in schemaview.slot_range_as_union(slot) -%} + {{ gen.link(subslot_range) }} + {%- if not loop.last -%} +  or 
+ {%- endif -%} + {%- endfor -%} + {%- else -%} + {{ gen.link(slot.range) }} + {%- endif -%} +{% endmacro %} + +# Slot: {{ title }} {% if element.deprecated %} (DEPRECATED) {% endif %} + +{%- if header -%} +{{ header }} +{%- endif -%} + +{% if element.description %} +{% set element_description_lines = element.description.split('\n') %} +{% for element_description_line in element_description_lines %} +_{{ element_description_line }}_ +{% endfor %} +{% endif %} + +
+ +{% if element.abstract %} +* __NOTE__: this is an abstract slot and should not be populated directly +{% endif %} + +URI: {{ gen.uri_link(element) }} + +{%- if element.alias %} +Alias: {{ element.alias }} +{% endif -%} + +{% if schemaview.slot_parents(element.name) or schemaview.slot_children(element.name, mixins=False) %} + +## Inheritance + +{{ gen.inheritance_tree(element, mixins=True) }} +{% else %} + +{% endif %} + +{% set classes_by_slot = schemaview.get_classes_by_slot(element, include_induced=True) %} +{% if classes_by_slot %} + +## Applicable Classes + +| Name | Description | Modifies Slot | +| --- | --- | --- | +{% for c in classes_by_slot -%} +| {{ gen.link(c) }} | {{ schemaview.get_class(c).description|enshorten }} | {% if c in schemaview.get_classes_modifying_slot(element) %} yes {% else %} no {% endif %} | +{% endfor %} + +{% endif %} + +{% if schemaview.is_mixin(element.name) %} +## Mixin Usage + +| mixed into | description | range | domain | +| --- | --- | --- | --- | +{% for s in schemaview.slot_children(element.name, is_a=False) -%} +| {{ gen.link(s) }} | {{ schemaview.get_slot(s).description|enshorten }} | {{ schemaview.get_slot(s).range }} | {{ schemaview.get_classes_by_slot(schemaview.get_slot(s))|join(', ') }} | +{% endfor %} +{% endif %} + +## Properties + +### Type and Range + +| Property | Value | +| --- | --- | +| Range | {{ compute_range(element) }} | +{%- if element.domain %} +| Domain | {{ gen.link(element.domain) }} | +{%- endif %} +{%- if element.domain_of %} +| Domain Of | {{ gen.links(element.domain_of) | join(', ') }} | +{%- endif %} +{%- if element.slot_uri %} +| Slot URI | {{ gen.uri_link(element.slot_uri) }} | +{%- endif %} +{%- if element.slot_group %} +| Slot Group | {{ gen.link(element.slot_group) }} | +{%- endif %} +{%- if element.is_grouping_slot %} +| Is Grouping Slot | Yes | +{%- endif %} + +### Cardinality and Requirements + +| Property | Value | +| --- | --- | +{%- if element.required %} +| Required | Yes | +{%- elif element.recommended %} +| Recommended | Yes | +{%- endif %} +{%- if element.multivalued %} +| Multivalued | Yes | +{%- endif %} +{%- if element.minimum_cardinality is not none %} +| Minimum Cardinality | {{ element.minimum_cardinality }} | +{%- endif %} +{%- if element.maximum_cardinality is not none %} +| Maximum Cardinality | {{ element.maximum_cardinality }} | +{%- endif %} +{%- if element.exact_cardinality is not none %} +| Exact Cardinality | {{ element.exact_cardinality }} | +{%- endif %} + +{%- if element.multivalued and (element.list_elements_unique is not none or element.list_elements_ordered is not none) %} +### List/Collection Properties + +| Property | Value | +| --- | --- | +{%- if element.list_elements_unique is not none %} +| Elements Must Be Unique | {% if element.list_elements_unique %}Yes{% else %}No{% endif %} | +{%- endif %} +{%- if element.list_elements_ordered is not none %} +| Elements Are Ordered | {% if element.list_elements_ordered %}Yes{% else %}No{% endif %} | +{%- endif %} + +{% endif %} +{%- set has_slot_chars = element.key or element.identifier or element.designates_type + or element.inherited or element.readonly or element.ifabsent or element.owner + or element.shared or element.is_class_field or element.is_usage_slot + or element.usage_slot_name or element.singular_name or schemaview.is_mixin(element.name) %} + +{%- if has_slot_chars %} +### Slot Characteristics + +| Property | Value | +| --- | --- | +{%- if element.singular_name %} +| Singular Name | {{ element.singular_name }} | +{%- endif %} +{%- if element.key %} +| Key | Yes | +{%- endif %} +{%- if element.identifier %} +| Identifier | Yes | +{%- endif %} +{%- if element.designates_type %} +| Designates Type | Yes | +{%- endif %} +{%- if element.inherited %} +| Inherited | Yes | +{%- endif %} +{%- if element.readonly %} +| Readonly | Yes | +{%- endif %} +{%- if element.ifabsent %} +| If Absent | `{{ element.ifabsent }}` | +{%- endif %} +{%- if element.owner %} +| Owner | {{ gen.link(element.owner) }} | +{%- endif %} +{%- if element.shared %} +| Shared | Yes | +{%- endif %} +{%- if element.is_class_field %} +| Is Class Field | Yes | +{%- endif %} +{%- if element.is_usage_slot %} +| Is Usage Slot | Yes | +{%- endif %} +{%- if element.usage_slot_name %} +| Usage Slot Name | {{ element.usage_slot_name }} | +{%- endif %} +{%- if schemaview.is_mixin(element.name) %} +| Mixin | Yes | +{%- endif %} + +{% endif %} +{%- set has_basic_constraints = element.minimum_value is not none or element.maximum_value is not none or element.pattern %} + +{%- if has_basic_constraints %} +### Value Constraints + +| Property | Value | +| --- | --- | +{%- if element.minimum_value is not none %} +| Minimum Value | {{ element.minimum_value|int }} | +{%- endif %} +{%- if element.maximum_value is not none %} +| Maximum Value | {{ element.maximum_value|int }} | +{%- endif %} +{%- if element.pattern %} +| Regex Pattern | `{{ element.pattern }}` | +{%- endif %} + +{% endif %} +{%- set has_advanced_constraints = element.structured_pattern or element.equals_string + or element.equals_string_in or element.equals_number or element.enum_range + or element.unit or element.implicit_prefix %} + +{%- if has_advanced_constraints %} +
+Additional Constraints + +{%- if element.structured_pattern %} +**Structured Pattern:** + +- **Syntax:** `{{ element.structured_pattern.syntax }}` +- **Interpolated:** {{ element.structured_pattern.interpolated }} +{%- if element.structured_pattern.partial_match %} +- **Partial Match:** Yes +{%- endif %} +{%- endif %} + +{%- if element.equals_string %} +**Must Equal:** `{{ element.equals_string }}` +{%- endif %} + +{%- if element.equals_string_in %} +**Must Be One Of:** {{ element.equals_string_in | join(', ') }} +{%- endif %} + +{%- if element.equals_number %} +**Must Equal:** {{ element.equals_number }} +{%- endif %} + +{%- if element.enum_range %} +**Enumeration Range:** {{ gen.link(element.enum_range) }} +{%- endif %} + +{%- if element.unit %} +**Unit:** + +| Property | Value | +| --- | --- | +{%- if element.unit.symbol %} +| symbol | {{ element.unit.symbol }} | +{%- endif %} +{%- if element.unit.abbreviation %} +| abbreviation | {{ element.unit.abbreviation }} | +{%- endif %} +{%- if element.unit.descriptive_name %} +| descriptive_name | {{ element.unit.descriptive_name }} | +{%- endif %} +{%- if element.unit.ucum_code %} +| ucum_code | {{ element.unit.ucum_code }} | +{%- endif %} +{%- if element.unit.derivation %} +| derivation | {{ element.unit.derivation }} | +{%- endif %} +{%- if element.unit.iec61360code %} +| iec61360code | {{ element.unit.iec61360code }} | +{%- endif %} +{%- if element.unit.has_quantity_kind %} +| has_quantity_kind | {{ gen.uri_link(element.unit.has_quantity_kind) }} | +{%- endif %} +{%- if element.unit.exact_mappings %} +| exact_mappings | {% for m in element.unit.exact_mappings %}{{ gen.uri_link(m) }}{% if not loop.last %}, {% endif %}{% endfor %} | +{%- endif %} +{%- endif %} + +{%- if element.implicit_prefix %} +**Implicit Prefix:** {{ element.implicit_prefix }} +{%- endif %} + +
+{% endif %} + +{%- set has_rel_props = element.symmetric or element.asymmetric or element.reflexive + or element.locally_reflexive or element.irreflexive or element.transitive + or element.inverse or element.transitive_form_of or element.reflexive_transitive_form_of + or element.role or element.relational_role %} + +{%- if has_rel_props %} +
+Relationship Properties + +| Property | Value | +| --- | --- | +{%- if element.symmetric %} +| Symmetric | Yes | +{%- endif %} +{%- if element.asymmetric %} +| Asymmetric | Yes | +{%- endif %} +{%- if element.reflexive %} +| Reflexive | Yes | +{%- endif %} +{%- if element.locally_reflexive %} +| Locally Reflexive | Yes | +{%- endif %} +{%- if element.irreflexive %} +| Irreflexive | Yes | +{%- endif %} +{%- if element.transitive %} +| Transitive | Yes | +{%- endif %} +{%- if element.inverse %} +| Inverse | {{ gen.link(element.inverse) }} | +{%- endif %} +{%- if element.transitive_form_of %} +| Transitive Form Of | {{ gen.link(element.transitive_form_of) }} | +{%- endif %} +{%- if element.reflexive_transitive_form_of %} +| Reflexive Transitive Form Of | {{ gen.link(element.reflexive_transitive_form_of) }} | +{%- endif %} +{%- if element.role %} +| Role | {{ element.role }} | +{%- endif %} +{%- if element.relational_role %} +| Relational Role | {{ element.relational_role }} | +{%- endif %} + +
+{% endif %} + +{%- set has_advanced = element.path_rule or element.disjoint_with + or element.children_are_mutually_disjoint or element.subproperty_of + or element.array or element.bindings or element.type_mappings + or element.value_presence or element.range_expression %} + +{%- if has_advanced %} +
+Advanced Properties + +{%- if element.subproperty_of %} +**Subproperty Of:** {{ gen.link(element.subproperty_of) }} +{%- endif %} + +{%- if element.path_rule %} +**Path Rule:** + +``` +{{ element.path_rule }} +``` +{%- endif %} + +{%- if element.disjoint_with %} +**Disjoint With:** {{ gen.links(element.disjoint_with) | join(', ') }} +{%- endif %} + +{%- if element.children_are_mutually_disjoint %} +**Children Are Mutually Disjoint:** Yes +{%- endif %} + +{%- if element.array %} +**Array Configuration:** + +- **Dimensions:** {{ element.array.dimensions | join(' x ') }} +{%- if element.array.exact_number_dimensions %} +- **Exact Dimensions Required:** Yes +{%- endif %} +{%- endif %} + +{%- if element.range_expression %} +**Range Expression:** {{ element.range_expression }} +{%- endif %} + +{%- if element.value_presence %} +**Value Presence:** {{ element.value_presence }} +{%- endif %} + +{%- if element.bindings %} +**Term Bindings:** + +{%- for binding in element.bindings %} +- {{ binding }} +{%- endfor %} +{%- endif %} + +{%- if element.type_mappings %} +**Type Mappings:** + +{%- for tm in element.type_mappings %} +- **Framework:** {{ tm.framework }}, **Mapping:** {{ tm.mapping }} +{%- endfor %} +{%- endif %} + +
+{% endif %} + +{%- set has_expressions = element.any_of or element.all_of or element.exactly_one_of + or element.none_of or element.equals_expression or element.has_member or element.all_members %} + +{%- if has_expressions %} +
+Expressions & Logic + +{%- if element.any_of %} +#### Any Of + +Value must satisfy at least one of: + +{%- for expr in element.any_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.all_of %} +#### All Of + +Value must satisfy all of: + +{%- for expr in element.all_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.exactly_one_of %} +#### Exactly One Of + +Value must satisfy exactly one of: + +{%- for expr in element.exactly_one_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.none_of %} +#### None Of + +Value must not satisfy any of: + +{%- for expr in element.none_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.equals_expression %} +#### Equals Expression + +`{{ element.equals_expression }}` +{%- endif %} + +{%- if element.has_member %} +#### Has Member + +{{ element.has_member }} +{%- endif %} + +{%- if element.all_members %} +#### All Members + +{{ element.all_members }} +{%- endif %} + +
+{% endif %} + +{% if schemaview.usage_index().get(element.name) %} +## Usages + +| used by | used in | type | used | +| --- | --- | --- | --- | +{% for usage in schemaview.usage_index().get(element.name) -%} +| {{ gen.link(usage.used_by) }} | {{ gen.link(usage.slot) }} | {{ usage.metaslot }} | {{ gen.link(usage.used) }} | +{% endfor %} +{% endif %} + +{% include "common_metadata.md.jinja2" %} + +## LinkML Source + +
+```yaml +{{ gen.yaml(element) }} +``` +
+ +{%- if footer -%} +{{ footer }} +{%- endif -%} + +
diff --git a/src/docs/templates/subset.md.jinja2 b/src/docs/templates/subset.md.jinja2 new file mode 100644 index 0000000..0a05161 --- /dev/null +++ b/src/docs/templates/subset.md.jinja2 @@ -0,0 +1,113 @@ +--- +search: + boost: {% if element.deprecated %}0.5{% else %}1.0{% endif %} +--- + + +# Subset: {{ gen.name(element) }} {% if element.deprecated %} (DEPRECATED) {% endif %} + +{%- if header -%} +{{ header }} +{%- endif -%} + +{% if element.description %} +{% set element_description_lines = element.description.split('\n') %} +{% for element_description_line in element_description_lines %} +_{{ element_description_line }}_ +{% endfor %} +{% endif %} + +
+ +URI: {{ gen.link(element) }} + +{% include "common_metadata.md.jinja2" %} + +{% set classes_in_subset = [] %} +{% set slots_in_subset = [] %} +{% set enums_in_subset = [] %} + +{# Collect classes, slots, and enumerations in subset #} +{% for c in gen.all_class_objects()|sort(attribute=sort_by) %} + {%- if element.name in c.in_subset %} + {% set _ = classes_in_subset.append(c) %} + {%- endif %} +{% endfor %} + +{% for s in gen.all_slot_objects()|sort(attribute=sort_by) %} + {%- if element.name in s.in_subset %} + {% set _ = slots_in_subset.append(s) %} + {%- endif %} +{% endfor %} + +{% for e in schemaview.all_enums().values() %} + {%- if element.name in e.in_subset %} + {% set _ = enums_in_subset.append(e) %} + {%- endif %} +{% endfor %} + +{% if classes_in_subset %} +## Classes in subset + +| Class | Description | +| --- | --- | +{% for c in classes_in_subset -%} +{%- if element.name in c.in_subset -%} +| {{ gen.link(c) }} | {{ c.description|enshorten }} | +{% endif -%} +{% endfor %} + +{% for c in classes_in_subset -%} +{%- if element.name in c.in_subset -%} + +{% set induced_slots = gen.class_induced_slots(c.name)|sort(attribute=sort_by) %} + +{%- set filtered_slots = [] -%} +{%- for s in induced_slots|sort(attribute=sort_by) -%} + {%- if element.name in s.in_subset or element.name in schemaview.get_slot(s.name).in_subset -%} + {% set _ = filtered_slots.append(s) %} + {%- endif -%} +{%- endfor %} + +{%- if filtered_slots|length > 0 -%} +### Slots from {{ gen.link(c) }} also in _{{ element.name }}_ + +| Name | Cardinality and Range | Description | +| --- | --- | --- | +{% for s in filtered_slots -%} +| {{ gen.link(s) }} | {{ gen.cardinality(s) }}
{{ gen.link(s.range) }} | {{ s.description|enshorten }} {% if s.identifier %}**identifier**{% endif %} | +{% endfor %} +{%- endif %} + +{%- endif %} +{% endfor %} + +{%- endif %} + +{% if slots_in_subset %} +## Slots in subset + +| Slot | Description | +| --- | --- | +{% for s in slots_in_subset|sort(attribute=sort_by) -%} +{%- if element.name in s.in_subset -%} +| {{ gen.link(s) }} | {{ s.description|enshorten }} | +{%- endif %} +{% endfor %} + +{%- endif %} + +{% if enums_in_subset %} +## Enumerations in subset + +| Enumeration | Description | +| --- | --- | +{% for e in enums_in_subset|sort(attribute='name') -%} +{% if element.name in e.in_subset -%} +| {{ gen.link(e) }} | {{ e.description|enshorten }} | +{%- endif %} +{% endfor %} + +{%- endif %} + +
diff --git a/src/docs/templates/type.md.jinja2 b/src/docs/templates/type.md.jinja2 new file mode 100644 index 0000000..642a6ba --- /dev/null +++ b/src/docs/templates/type.md.jinja2 @@ -0,0 +1,170 @@ +--- +search: + boost: {% if element.deprecated %}0.5{% else %}1.0{% endif %} +--- + +{%- if element.title and element.title != element.name %} + {%- set title = element.title ~ ' (' ~ element.name ~ ')' -%} +{%- else %} + {%- set title = gen.name(element) -%} +{%- endif -%} + +# Type: {{ title }} {% if element.deprecated %} (DEPRECATED) {% endif %} + +{% if element.description %} +{% set element_description_lines = element.description.split('\n') %} +{% for element_description_line in element_description_lines %} +_{{ element_description_line }}_ +{% endfor %} +{% endif %} + +
+ +URI: {{ gen.uri_link(element) }} + +## Type Properties + +| Property | Value | +| --- | --- | +{%- if element.typeof %} +| Type Of | {{ gen.link(element.typeof) }} | +{%- endif %} +{%- if element.base %} +| Base | `{{ element.base }}` | +{%- endif %} +{%- if element.uri %} +| Type URI | {{ gen.uri_link(element.uri) }} | +{%- endif %} +{%- if element.repr %} +| Representation | `{{ element.repr }}` | +{%- endif %} +{%- if element.union_of %} +| Union Of | {{ gen.links(element.union_of) | join(', ') }} | +{%- endif %} + +{%- set has_basic_constraints = element.minimum_value is not none or element.maximum_value is not none or element.pattern %} + +{%- if has_basic_constraints %} +## Value Constraints + +| Property | Value | +| --- | --- | +{%- if element.minimum_value is not none or element.maximum_value is not none %} +| Numeric Range | {{ gen.number_value_range(element) }} | +{%- endif %} +{%- if element.pattern %} +| Regex Pattern | `{{ element.pattern }}` | +{%- endif %} + +{% endif %} +{%- set has_advanced_constraints = element.structured_pattern or element.equals_string + or element.equals_string_in or element.equals_number or element.unit or element.implicit_prefix %} + +{%- if has_advanced_constraints %} +
+Additional Constraints + +{%- if element.structured_pattern %} +**Structured Pattern:** + +- **Syntax:** `{{ element.structured_pattern.syntax }}` +- **Interpolated:** {{ element.structured_pattern.interpolated }} +{%- if element.structured_pattern.partial_match %} +- **Partial Match:** Yes +{%- endif %} +{%- endif %} + +{%- if element.equals_string %} +**Must Equal:** `{{ element.equals_string }}` +{%- endif %} + +{%- if element.equals_string_in %} +**Must Be One Of:** {{ element.equals_string_in | join(', ') }} +{%- endif %} + +{%- if element.equals_number %} +**Must Equal:** {{ element.equals_number }} +{%- endif %} + +{%- if element.unit %} +**Unit:** + +| Property | Value | +| --- | --- | +{%- if element.unit.symbol %} +| symbol | {{ element.unit.symbol }} | +{%- endif %} +{%- if element.unit.abbreviation %} +| abbreviation | {{ element.unit.abbreviation }} | +{%- endif %} +{%- if element.unit.descriptive_name %} +| descriptive_name | {{ element.unit.descriptive_name }} | +{%- endif %} +{%- if element.unit.ucum_code %} +| ucum_code | {{ element.unit.ucum_code }} | +{%- endif %} +{%- if element.unit.derivation %} +| derivation | {{ element.unit.derivation }} | +{%- endif %} +{%- if element.unit.iec61360code %} +| iec61360code | {{ element.unit.iec61360code }} | +{%- endif %} +{%- if element.unit.has_quantity_kind %} +| has_quantity_kind | {{ gen.uri_link(element.unit.has_quantity_kind) }} | +{%- endif %} +{%- if element.unit.exact_mappings %} +| exact_mappings | {% for m in element.unit.exact_mappings %}{{ gen.uri_link(m) }}{% if not loop.last %}, {% endif %}{% endfor %} | +{%- endif %} +{%- endif %} + +{%- if element.implicit_prefix %} +**Implicit Prefix:** {{ element.implicit_prefix }} +{%- endif %} + +
+{% endif %} + +{%- set has_expressions = element.any_of or element.all_of or element.exactly_one_of or element.none_of %} + +{%- if has_expressions %} +
+Type Expressions + +{%- if element.any_of %} +**Any Of:** Value must satisfy at least one of these expressions + +{%- for expr in element.any_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.all_of %} +**All Of:** Value must satisfy all of these expressions + +{%- for expr in element.all_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.exactly_one_of %} +**Exactly One Of:** Value must satisfy exactly one of these expressions + +{%- for expr in element.exactly_one_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +{%- if element.none_of %} +**None Of:** Value must not satisfy any of these expressions + +{%- for expr in element.none_of %} +- {{ expr }} +{%- endfor %} +{%- endif %} + +
+{% endif %} + +{% include "common_metadata.md.jinja2" %} + +
diff --git a/tests/data/valid/CompoundAsthma001-001test.yaml b/tests/data/valid/CompoundAsthma001-001test.yaml new file mode 100644 index 0000000..210cc2e --- /dev/null +++ b/tests/data/valid/CompoundAsthma001-001test.yaml @@ -0,0 +1,21 @@ +id: FHSg3b0431phv00177516c +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:317009 +variable_label: "Asthma" +cde_id: CONDOR:00004 +bdchm_type: condition +documentation_metadata: + - id: dm:003 + contr_vocab: MONDO:0004979 + microschema_slot: condition_concept + - id: dm:004 + contr_vocab: working_diagnosis + microschema_slot: condition_provenance +row_metadata: + - id: FHSg3b0431phv00177516s + microschema_slot: condition_status + - id: FHSage2phv00177932s + microschema_slot: age_at_condition_record + - id: FHSshareidphv00177237s + microschema_slot: subject_identifier diff --git a/tests/data/valid/CompoundAsthma001-002test.yaml b/tests/data/valid/CompoundAsthma001-002test.yaml new file mode 100644 index 0000000..cfafcc3 --- /dev/null +++ b/tests/data/valid/CompoundAsthma001-002test.yaml @@ -0,0 +1,26 @@ +id: FHSg3a539phv00274119c +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:317009 +variable_label: "Asthma" +cde_id: CONDOR:00004 +bdchm_type: condition +documentation_metadata: + - id: dm:003 + contr_vocab: MONDO:0004979 + microschema_slot: condition_concept +row_metadata: + - id: FHSg3a539phv00274119s + microschema_slot: condition_status + - id: FHSg3a540phv00274120s + microschema_slot: condition_status + - id: FHSage1phv00177930s + microschema_slot: age_at_condition_record + - id: FHSshareidphv00273700s + microschema_slot: subject_identifier + - id: FHSg3a542phv00274122s + microschema_slot: age_at_condition_start + - id: FHSg3a543phv00274123s + microschema_slot: age_at_condition_end + - id: FHSg3a541phv00274121s + microschema_slot: condition_provenance \ No newline at end of file diff --git a/tests/data/valid/CompoundHeight001-test.yml b/tests/data/valid/CompoundHeight001-test.yml index 39813e4..8dd52c2 100644 --- a/tests/data/valid/CompoundHeight001-test.yml +++ b/tests/data/valid/CompoundHeight001-test.yml @@ -6,10 +6,17 @@ variable_label: "Height" cde_id: CONDOR:00003 bdchm_type: observation unit: https://units-of-measurement.org/cm -metadata: +row_metadata: - id: ARICABI5phv00294492s microschema_slot: measurement_value - id: ARICABI4phv00294491s microschema_slot: age_at_measurement - id: ARICSUBJECT_IDphv00294489s microschema_slot: subject_identifier +documentation_metadata: + - id: dm:001 + contr_vocab: wall_mounted_stadiometer + microschema_slot: instrument + - id: dm:002 + contr_vocab: anthropometry + microschema_slot: method_type diff --git a/tests/data/valid/CompoundHeight002-test.yaml b/tests/data/valid/CompoundHeight002-test.yaml index cff200f..8ae70c3 100644 --- a/tests/data/valid/CompoundHeight002-test.yaml +++ b/tests/data/valid/CompoundHeight002-test.yaml @@ -6,10 +6,17 @@ variable_label: "Height" cde_id: CONDOR:00001 bdchm_type: observation unit: https://units-of-measurement.org/%5Bin_i%5D -metadata: +row_metadata: - id: FHSg3b0483phv00177539s microschema_slot: measurement_value - id: FHSage2phv00177932s microschema_slot: age_at_measurement - id: FHSshareidphv00177237s microschema_slot: subject_identifier +documentation_metadata: + - id: dm:001 + contr_vocab: wall_mounted_stadiometer + microschema_slot: instrument + - id: dm:002 + contr_vocab: anthropometry + microschema_slot: method_type \ No newline at end of file diff --git a/tests/data/valid/SingleVariable-002test.yaml b/tests/data/valid/SingleCategoricalVariable-002test.yaml similarity index 92% rename from tests/data/valid/SingleVariable-002test.yaml rename to tests/data/valid/SingleCategoricalVariable-002test.yaml index d24cea3..6309326 100644 --- a/tests/data/valid/SingleVariable-002test.yaml +++ b/tests/data/valid/SingleCategoricalVariable-002test.yaml @@ -1,10 +1,11 @@ id: FHSshareidphv00177237s associated_study: FraminghamHeartStudy000007 variable_description: "Participant Identifier" +concept_type: OMOP:42528934 variable_label: "Participant Identifier" source_id: phv00177237v7p16 file_id: pht003094v9p16 file_name: e_exam_ex02_3b_0017s +data_type: uriorcurie variable_name: shareid source_variable_description: "Unique study participant identification number" -data_type: uriorcurie diff --git a/tests/data/valid/SingleVariable-005test.yaml b/tests/data/valid/SingleCategoricalVariable-005test.yaml similarity index 87% rename from tests/data/valid/SingleVariable-005test.yaml rename to tests/data/valid/SingleCategoricalVariable-005test.yaml index 8350661..a69dcfc 100644 --- a/tests/data/valid/SingleVariable-005test.yaml +++ b/tests/data/valid/SingleCategoricalVariable-005test.yaml @@ -2,9 +2,10 @@ id: ARICSUBJECT_IDphv00294489s associated_study: ARIC000280 variable_description: "Participant Identifier" variable_label: "Participant Identifier" +concept_type: OMOP:42528934 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 +data_type: string diff --git a/tests/data/valid/SingleCategoricalVariable-007test.yaml b/tests/data/valid/SingleCategoricalVariable-007test.yaml new file mode 100644 index 0000000..7d99f2c --- /dev/null +++ b/tests/data/valid/SingleCategoricalVariable-007test.yaml @@ -0,0 +1,26 @@ +id: FHSg3b0431phv00177516s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:317009 +variable_label: "Asthma" +source_id: phv00177516.v7.p16 +file_id: pht003094.v9 +file_name: e_exam_ex02_3b_0017s +variable_name: g3b0431 +source_variable_description: "Clinical Diagnostic Impression: Asthma" +data_type: enum +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +coded_values: + - id: cv:001 + indicator_char: "0" + indicator_meaning: "No" + - id: cv:002 + indicator_char: "1" + indicator_meaning: "Yes" + - id: cv:003 + indicator_char: "2" + indicator_meaning: "Maybe" +comment: "Clinical Diagnostic Impression ONLY. Not hard data. Use with caution. Not verified" \ No newline at end of file diff --git a/tests/data/valid/SingleCategoricalVariable-008test.yaml b/tests/data/valid/SingleCategoricalVariable-008test.yaml new file mode 100644 index 0000000..5804725 --- /dev/null +++ b/tests/data/valid/SingleCategoricalVariable-008test.yaml @@ -0,0 +1,22 @@ +id: FHSg3a539phv00274119s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:40766907 +variable_label: "Asthma" +source_id: phv00274119.v1.p16 +file_id: pht006005.v1 +file_name: e_exam_ex01_2_0813s +variable_name: g3a539 +source_variable_description: "Have you ever had asthma?" +data_type: enum +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +coded_values: + - id: cv:001 + indicator_char: "0" + indicator_meaning: "No" + - id: cv:002 + indicator_char: "1" + indicator_meaning: "Yes" \ No newline at end of file diff --git a/tests/data/valid/SingleCategoricalVariable-009test.yaml b/tests/data/valid/SingleCategoricalVariable-009test.yaml new file mode 100644 index 0000000..bd844ac --- /dev/null +++ b/tests/data/valid/SingleCategoricalVariable-009test.yaml @@ -0,0 +1,22 @@ +id: FHSg3a540phv00274120s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:40766908 +variable_label: "Asthma" +source_id: phv00274120.v1.p16 +file_id: pht006005.v1 +file_name: e_exam_ex01_2_0813s +variable_name: g3a540 +source_variable_description: "Asthma: Do you still have it?" +data_type: enum +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +coded_values: + - id: cv:004 + indicator_char: "0" + indicator_meaning: "No or never had it" + - id: cv:002 + indicator_char: "1" + indicator_meaning: "Yes" \ No newline at end of file diff --git a/tests/data/valid/SingleCategoricalVariable-010test.yaml b/tests/data/valid/SingleCategoricalVariable-010test.yaml new file mode 100644 index 0000000..0f00840 --- /dev/null +++ b/tests/data/valid/SingleCategoricalVariable-010test.yaml @@ -0,0 +1,22 @@ +id: FHSg3a541phv00274121s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:40766909 +variable_label: "Asthma" +source_id: phv00274121.v1.p16 +file_id: pht006005.v1 +file_name: e_exam_ex01_2_0813s +variable_name: g3a541 +source_variable_description: "Asthma: Was it diagnosed by a doctor or other health professional?" +data_type: enum +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +coded_values: + - id: cv:005 + indicator_char: "0" + indicator_meaning: "No or no asthma" + - id: cv:002 + indicator_char: "1" + indicator_meaning: "Yes" \ No newline at end of file diff --git a/tests/data/valid/SingleCategoricalVariable-013test.yaml b/tests/data/valid/SingleCategoricalVariable-013test.yaml new file mode 100644 index 0000000..0e0b3dc --- /dev/null +++ b/tests/data/valid/SingleCategoricalVariable-013test.yaml @@ -0,0 +1,11 @@ +id: FHSshareidphv00273700s +associated_study: FraminghamHeartStudy000007 +variable_description: "Participant Identifier" +concept_type: OMOP:42528934 +variable_label: "Participant Identifier" +source_id: phv00273700v1p16 +file_id: pht006005v1p16 +file_name: e_exam_ex01_2_0813s +variable_name: shareid +source_variable_description: "Unique study participant identification number" +data_type: string diff --git a/tests/data/valid/SingleVariable-001test.yaml b/tests/data/valid/SingleContinuousVariable-001test.yaml similarity index 100% rename from tests/data/valid/SingleVariable-001test.yaml rename to tests/data/valid/SingleContinuousVariable-001test.yaml diff --git a/tests/data/valid/SingleVariable-003test.yaml b/tests/data/valid/SingleContinuousVariable-003test.yaml similarity index 93% rename from tests/data/valid/SingleVariable-003test.yaml rename to tests/data/valid/SingleContinuousVariable-003test.yaml index e486c0c..b28abfe 100644 --- a/tests/data/valid/SingleVariable-003test.yaml +++ b/tests/data/valid/SingleContinuousVariable-003test.yaml @@ -3,6 +3,7 @@ associated_study: FraminghamHeartStudy000007 variable_description: "Participant age at exam 2" variable_label: "Participant Age" source_id: phv00177932v10p16 +concept_type: OMOP:4265453 file_id: pht003099v10p16 file_name: vr_dates_2022_a_1487s variable_name: age2 diff --git a/tests/data/valid/SingleVariable-004test.yaml b/tests/data/valid/SingleContinuousVariable-004test.yaml similarity index 100% rename from tests/data/valid/SingleVariable-004test.yaml rename to tests/data/valid/SingleContinuousVariable-004test.yaml diff --git a/tests/data/valid/SingleVariable-006test.yaml b/tests/data/valid/SingleContinuousVariable-006test.yaml similarity index 92% rename from tests/data/valid/SingleVariable-006test.yaml rename to tests/data/valid/SingleContinuousVariable-006test.yaml index 3a4ece7..84ac100 100644 --- a/tests/data/valid/SingleVariable-006test.yaml +++ b/tests/data/valid/SingleContinuousVariable-006test.yaml @@ -2,6 +2,7 @@ id: ARICABI4phv00294491s associated_study: ARIC000280 variable_description: "Participant age at visit 5" variable_label: "Participant Age" +concept_type: OMOP:4265453 source_id: phv00294491v3p3 file_id: pht006414v3p3 file_name: ABI diff --git a/tests/data/valid/SingleContinuousVariable-011test.yaml b/tests/data/valid/SingleContinuousVariable-011test.yaml new file mode 100644 index 0000000..aa4431e --- /dev/null +++ b/tests/data/valid/SingleContinuousVariable-011test.yaml @@ -0,0 +1,23 @@ +id: FHSg3a542phv00274122s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:40766910 +variable_label: "Asthma" +source_id: phv00274122.v1.p16 +file_id: pht006005.v1 +file_name: e_exam_ex01_2_0813s +variable_name: g3a542 +source_variable_description: "Asthma: At what age did it start?" +data_type: integer +unit: UCUM:a +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +alert_values: + - id: al:001 + indicator_char: "0" + indicator_meaning: "No asthma" + - id: al:002 + indicator_char: "1" + indicator_meaning: "1 year or less" \ No newline at end of file diff --git a/tests/data/valid/SingleContinuousVariable-012test.yaml b/tests/data/valid/SingleContinuousVariable-012test.yaml new file mode 100644 index 0000000..a412804 --- /dev/null +++ b/tests/data/valid/SingleContinuousVariable-012test.yaml @@ -0,0 +1,23 @@ +id: FHSg3a543phv00274123s +associated_study: FraminghamHeartStudy000007 +variable_description: "Asthma status" +concept_type: OMOP:40766911 +variable_label: "Asthma" +source_id: phv00274123.v1.p16 +file_id: pht006005.v1 +file_name: e_exam_ex01_2_0813s +variable_name: g3a543 +source_variable_description: "Asthma: If you no longer have it, at what age did it stop?" +data_type: integer +unit: UCUM:a +missing_value: + - id: mv:002 + indicator_char: "." + indicator_meaning: "Unknown" +alert_values: + - id: al:003 + indicator_char: "0" + indicator_meaning: "No or no asthma" + - id: al:004 + indicator_char: "88" + indicator_meaning: "N/A (still has asthma)" \ No newline at end of file diff --git a/tests/data/valid/SingleContinuousVariable-014test.yaml b/tests/data/valid/SingleContinuousVariable-014test.yaml new file mode 100644 index 0000000..bd7decf --- /dev/null +++ b/tests/data/valid/SingleContinuousVariable-014test.yaml @@ -0,0 +1,13 @@ +id: FHSage1phv00177930s +associated_study: FraminghamHeartStudy000007 +variable_description: "Participant age at exam 1" +variable_label: "Participant Age" +source_id: phv00177930v10p16 +file_id: pht003099v10p16 +file_name: vr_dates_2022_a_1487s +variable_name: age1 +source_variable_description: "Age at Exam 1" +data_type: integer +unit: UCUM:a +minimum_value: 5 +maximum_value: 83