phenopacket_mapper.data_standards package
This submodule defines the data standards used in the project.
- class phenopacket_mapper.data_standards.Coding(system: str, code: str, display: str = None, text: str = None)[source]
Bases:
object
Data class for Code
- class phenopacket_mapper.data_standards.CodeableConcept(coding: List[Coding], text: str = None)[source]
Bases:
object
Data class for CodeableConcept
- class phenopacket_mapper.data_standards.DataModel(data_model_name: str, fields: List[DataField], resources: List[CodeSystem])[source]
Bases:
object
This class defines a data model for medical data using DataField
- resources: List[CodeSystem]
- class phenopacket_mapper.data_standards.DataField(name: str, section: str, description: str, data_type: List[type | CodeSystem | str], required: bool = True, specification: str = None, ordinal: str = None)[source]
Bases:
object
This class defines fields used in the definition of a DataModel
- data_type: List[type | CodeSystem | str]
- class phenopacket_mapper.data_standards.DataModelInstance(data_model: DataModel, values: List[DataFieldValue])[source]
Bases:
object
This class defines an instance of a DataModel, i.e. a record in a dataset
- values: List[DataFieldValue]
- class phenopacket_mapper.data_standards.DataFieldValue(field: DataField, value: int | float | str | bool | Date | CodeSystem)[source]
Bases:
object
This class defines the value of a DataField in a DataModelInstance
- class phenopacket_mapper.data_standards.CodeSystem(name: str, namespace_prefix: str, url: str = None, iri_prefix: str = None, version: str = '0.0.0', synonyms: ~typing.List[str] = <factory>)[source]
Bases:
object
Data class for a CodeSystem
- version: str
List typical alternative abbreviations or names for the resource, to better parse its usage (e.g. ‘HPO’ for the Human Phenotype Ontology, even if its name space prefix is commonly ‘HP’)
- set_version(value) CodeSystem [source]
- class phenopacket_mapper.data_standards.Date(year: int = 0, month: int = 0, day: int = 0, hour: int = 0, minute: int = 0, second: int = 0)[source]
Bases:
object
Data class for Date
- iso_8601_datestring() str [source]
Returns the date in ISO 8601 format
Example: “2021-06-02T16:52:15Z” Format: “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” Definition: The format for this is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is
always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required.
- formatted_string(fmt: str) str [source]
Returns the date in the specified format
- Parameters:
fmt – the format as a string to return the date in
- Returns:
the date in the specified format