phenopacket_mapper.utils.parsing.parse_value module

phenopacket_mapper.utils.parsing.parse_value.parse_value(value_str: str, resources: Tuple[CodeSystem, ...], compliance: Literal['strict', 'lenient'] = 'lenient') Coding | CodeableConcept | CodeSystem | str | bool | int | float | Date | type[source]

Parses a string representing a value to the appropriate type

This method acts as a wrapper for the parsing of different types of values. It tries to parse the value from different types in the following order: 1. Primitive data value (parse_primitive_data_value) 2. Date (parse_date) 3. Coding (parse_coding) 4. String (if nothing else worked)

Parameters:
  • value_str – String representation of the value

  • resources – List of CodeSystems to use for parsing the value

  • compliance – Compliance level for parsing the value

Returns:

The parsed value