fhirpack.extraction.base module#

class fhirpack.extraction.base.BaseExtractorMixin[source]#

Bases: object

getAbsolutePaths(paths: list[str], input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, searchParams: dict | None = None, params: dict | None = None)[source]#
getConversionPath(sourceType: str, targetType: str) Tuple[str, str][source]#

Retrieve the needed FHIR searchParams (field) and the respective path for a {sourceType:targetType} pair from the handler ditcionary

Parameters:
  • sourceType (str) – Resource type the method is operating on.

  • targetType (str) – Desired Resource type.

Returns:

Field and path in the handler dictionary.

Return type:

Tuple(str, str)

getDICOMInstances(input: list[str] | None = None, operateOnCol: str = 'data', resultInCol: str | None = None, params: dict | None = None, inPlace: dict = False)[source]#
getFromFiles(input: list[str])[source]#

Generate a Frame object from FHIR resources stored in json files.

Parameters:

input – List of files containing json fhir resources.

Returns:

Frame object storing the FHIR resources.

Return type:

Frame

getReferences(input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, params: dict | None = None, ignoreFrame: bool = False, raw: bool = False)[source]#

Gets all the References found in the input Resources

Parameters:
  • input (Union[list[str], list[SyncFHIRReference], list[SyncFHIRResource], None]) – Input resources. Defaults to None.

  • params (Union[dict, None]) – Additional parameters. Defaults to None.

  • ignoreFrame (Union[bool, None]) – Whether to ignore the frame. Defaults to False.

  • raw (Union[bool, None]) – If True, the method will return the raw result. Defaults to False.

getResources(input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, searchParams: dict | None = None, params: dict | None = None, resourceType: str | None = None, metaResourceType: str | None = None, ignoreFrame: bool = False, raw: bool = False, progressSuffix: str = '')[source]#

This method retrieves FHIR resources based on the provided resource type.

Parameters:
  • input (Union[list[str], list[SyncFHIRReference], list[SyncFHIRResource], None]) – IDs, references or resources of the desired FHIR resources.

  • searchParams (dict) – FHIR search parameters to execute a search. Only valid FHIR parameters for the specified resource type can be used. This can not be combined with input.

  • params (Union[dict, None]) – Additional parameters.

  • resourceType (Union[str, None]) – Type of the desired FHIR resources.

  • metaResourceType (Union[str, None]) – Used to avoid conflicts when non-standard fhir resources are used.

  • ignoreFrame (Union[str, None]) – True when data inside the Frame object should be ignored.

  • raw (Union[str, None]) – True when the raw output should be returned.

Returns:

Frame object containing the desired FHIR resources.

Return type:

Frame

getURLBytes(input: list[str] | None = None, operateOnCol: str = 'data', resultInCol: str | None = None, params: dict = {})[source]#
searchResources(input: list[str] | list[fhirpy.lib.SyncFHIRReference] | list[fhirpy.lib.SyncFHIRResource] | None = None, searchParams: dict | None = None, params: dict | None = None, resourceType: str | None = None, metaResourceType: str | None = None, ignoreFrame: bool = True, raw: bool = False, progressSuffix: str = '')[source]#

Execute a FHIR search based on the provided resource type and search parameters.

Parameters:
  • input (Union[ list[str], list[SyncFHIRReference], list[SyncFHIRResource],) – Not implemented.

  • searchParams (Union[dict, None]) – FHIR search parameters to execute a search.

  • params (Union[dict, None]) – Additional parameters.

  • resourceType (Union[str, None]) – Type of the desired FHIR resource.

  • metaResourceType (Union[str, None]) – Used to avoid conflicts when non-standard fhir resources are used.

  • ignoreFrame (Union[str, None]) – True when data inside the Frame object should be ignored.

  • raw (Union[str, None]) – True when the raw output should be returned.

Returns:

Frame object containing the desired FHIR resources.

Return type:

Frame