fhirpack.transformation.base module#
- class fhirpack.transformation.base.BaseTransformerMixin[source]#
Bases:
object
- gatherDates(input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, recursive: bool = False, params: dict | None = None)[source]#
Extracts dates from resources.
- Parameters:
- Raises:
NotImplementedError – If input and isFrame are provided.
- Returns:
List of dates.
- Return type:
Union[list, pd.DataFrame]
- gatherKeys(params: dict | None = None, input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None)[source]#
Extracts all keys(without values) found in the given input.
- gatherReferences(references: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, recursive: bool = False)[source]#
Extracts all the FHIR references as Resources from the input resources and returns them in a Frame.
- Parameters:
- Raises:
NotImplementedError – If references and isFrame are both True.
- Returns:
FHIRPACK Frame with the referencer and referencee of the references.
- Return type:
- gatherSimplePaths(paths: list[str], columns: list[str] | None = None, input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, params: dict = {})[source]#
Extracts the elements from the given paths and returns them as a Frame.
- Parameters:
- Returns:
FHIRPACK Frame object storing the resource elements in the respective rows.
- Return type:
- gatherText(input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, typeLookUps: list | None = None, lookUps: list | None = None, mapped: bool = False, includeMeta: bool = False, includeEmpty: bool = False, defaultLookUps: bool = True, includeDuplicates: bool = False)[source]#
Extracts text from resources by look-ups.
- Parameters:
input – Data to extract text from.
resourceType – The type is used the include type specific lookups.
lookUps (Union[list, None]) – List of lookups to include in the text extraction.
mapped (Union[str, None]) – Store text labels as dictionary keys.
includeMeta (Union[str, None]) – Include the resource meta data.
includeEmpty (Union[str, None]) – Include empty Text for labels.
defaultLookUps (Union[str, None]) – Include the list of default Lookups.
includeDuplicates (Union[str, None]) – Include duplicated Test string.
- gatherValuesForKeys(keys: list[str], input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, params: dict | None = None)[source]#
Extracts the values(without keys) for the given keys from the input resources.
- Parameters:
- Raises:
NotImplementedError – If input and isFrame are provided.
- Returns:
List of values for keys.
- Return type:
Union[list, pd.DataFrame]