Skip to content
Bits & Flames Fyron Documentation GitHub
DocsFHIR REST parameters

FHIR REST: complete parameter reference

Back to the workflow guide

Use this page when you know the operation and need every argument, its actual Python default and its interactions. Signatures and parameter coverage are generated from the current source; descriptions explain operational choices.

Version scope: Fyron 0.3.20b8 (Beta 8). The reporting, deadline, naming and validation options below require Beta 5 or newer; they are not available in previously published Beta 4 packages.

Reading the tables

  • Required means the Python signature has no default. A default of None can still require environment configuration or a value from the resource.
  • Keyword only arguments must be passed by name. Boolean options accept Python True / False; None is a separate inherit/unset choice where documented.
  • Use the workflow guide for setup, authentication, return schemas and safe restarts. FHIR params and SQL schemas are site-specific; this page lists Fyron arguments, not every parameter a remote service might support.
  • These clients support with ... as client: and close(); they close owned resources and keep borrowed HTTP sessions open.

Function index

Constructor

FHIRRestClient

Signature reference (use the workflow guide for runnable calls):

python
def FHIRRestClient(
    base_url=None,
    auth_url=None,
    auth=None,
    num_processes=4,
    request_timeout=30,
    request_params=None,
    bearer_token=None,
    log_requests=False,
    log_request_urls=False,
    extra_headers=None,
    retries=None,
    return_fhir_obj=False,
    token_auth_method=None,
    cache_ttl_seconds=300,
    cache_max_entries=1000,
    *,
    worker_auth_timeout=120,
    parallel_job_timeout=300,
):
    ...
ParameterTypePython defaultPurpose and accepted options
base_urlOptional[str]NoneService base URL. None falls back to FHIR_BASE_URL. Documents use it only to resolve relative URLs; absolute URLs work without it.
auth_urlOptional[str]NoneLogin/token endpoint for Fyron’s existing environment username/password mechanism. Use shared Auth for OIDC issuer discovery, device flow or service accounts; this argument is not a universal OAuth selector.
authOptional[Union[Auth, requests.Session]]NoneAn existing Fyron Auth or requests.Session. Borrowed sessions stay open and retain their configuration. Use a service-approved authentication method.
num_processesint4Worker process count. Use 1 while learning. FHIR uses it for parallel fetch/conversion; DICOM uses it for DataFrame downloads with supported worker authentication. Guard spawned script entrypoints.
request_timeoutint30Positive seconds for each network connect/read wait. This is not a whole-extraction deadline. DICOM also accepts None to retain unbounded request waits.
request_paramsOptional[Dict[str, Any]]NoneDefault FHIR query-parameter dictionary merged into every request; per-query values override matching defaults.
bearer_tokenOptional[str]NoneOptional static access token; otherwise FHIR_TOKEN may apply. A static token does not renew. Shared Auth/session authentication takes precedence when already configured.
log_requestsboolFalseEnable controlled request timing/status events with the shared Fyron logger. Never prints query values, tokens, URLs or response bodies.
log_request_urlsboolFalseCompatibility option for controlled activity events. Actual URLs are never printed.
extra_headersOptional[Dict[str, str]]NoneAdditional HTTP headers applied per request, leaving a borrowed session unchanged. Do not log or publish credential-bearing values.
retriesOptional[Retry]NoneAn optional urllib3.util.retry.Retry GET policy. None selects Fyron’s bounded default, including 429/502/503/504 and Retry-After. Existing retry-capable caller adapters retain their own policy. No automatic SQL or write retries.
return_fhir_objboolFalseWrap fetched resources/bundles as FHIRObj rather than plain dictionaries. Normal DataFrame processing still uses the conversion helpers.
token_auth_methodOptional[str]NoneFor Fyron’s existing username/password token mechanism: "basic" or "post". This is not a universal OAuth password grant.
cache_ttl_secondsint300In-memory GET response lifetime in seconds. Zero disables caching; a cached response is not proof the source has remained unchanged.
cache_max_entriesint1000Maximum entries in the in-memory response cache; zero disables it. No response cache is written to disk.
worker_auth_timeout (keyword only)float120Positive finite seconds a worker may wait for parent-coordinated authentication.
parallel_job_timeout (keyword only)Optional[float]300Positive finite worker execution deadline in seconds, excluding queue wait; None disables it. FHIR and DICOM have different constructor defaults, shown in the table.

close

close

Signature reference (use the workflow guide for runnable calls):

python
def close(
):
    ...

No arguments. Closes owned resources; call once work has finished.

fetch bundles

fetch_bundles

Signature reference (use the workflow guide for runnable calls):

python
def fetch_bundles(
    resource_type,
    params=None,
    max_pages=-1,
    show_progress=True,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.

fetch bundles parallel

fetch_bundles_parallel

Signature reference (use the workflow guide for runnable calls):

python
def fetch_bundles_parallel(
    resource_type,
    param_list,
    max_pages=-1,
    show_progress=True,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
param_listSequence[Dict[str, Any]]RequiredSequence of separate FHIR query dictionaries; each becomes an independent fetch job.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.

fetch bundles partitioned

fetch_bundles_partitioned

Signature reference (use the workflow guide for runnable calls):

python
def fetch_bundles_partitioned(
    resource_type,
    partition_param,
    start,
    end,
    params=None,
    frequency='YS',
    window_days=None,
    max_pages_per_partition=-1,
    show_progress=True,
    parallel_fetch=False,
    auto_sort=True,
    sort='_id',
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
partition_paramstrRequiredActual server-supported FHIR date search parameter, e.g. "recorded-date", "date" or "_lastUpdated". It describes the chosen resource date, not necessarily clinical onset.
startUnion[str, pd.Timestamp]RequiredInclusive first boundary, supplied as a date/date-time string or pandas Timestamp. Use consistent timezone semantics.
endUnion[str, pd.Timestamp]RequiredExclusive final boundary. Must be later than start; do not describe this as an inclusive end date.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
frequencystr'YS'Pandas date frequency such as "MS" (monthly) or "YS" (yearly). Ignored when window_days is supplied.
window_daysOptional[int]NoneOptional positive fixed window width in days; overrides the calendar frequency.
max_pages_per_partitionint-1Page limit within each window: positive integer, -1 for all available pages, 0 for no request. Not a limit across all windows.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
auto_sortboolTrueAdd the selected sort unless an explicit _sort is already supplied in params. Requires server support; sorting does not prove completeness.
sortstr'_id'FHIR _sort expression used by auto_sort, normally "_id"; select a server-supported stable sort.

bundles to dataframe

bundles_to_dataframe

Signature reference (use the workflow guide for runnable calls):

python
def bundles_to_dataframe(
    bundles,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    per_bundle_metadata=None,
):
    ...
ParameterTypePython defaultPurpose and accepted options
bundlesIterable[Dict[str, Any] | FHIRObj]RequiredIterable of already retrieved Bundle dictionaries/FHIRObj objects to convert. Conversion materializes the iterable; it does not fetch more pages.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
per_bundle_metadataOptional[List[Dict[str, Any]]]NoneAdvanced: list of dictionaries aligned one-to-one with bundles. Values are attached to every output row; conflicting output names raise.

query to dataframe partitioned

query_to_dataframe_partitioned

Signature reference (use the workflow guide for runnable calls):

python
def query_to_dataframe_partitioned(
    resource_type,
    partition_param,
    start,
    end,
    params=None,
    frequency='YS',
    window_days=None,
    max_pages_per_partition=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    include_partition_columns=True,
    deduplicate_by=None,
    auto_sort=True,
    sort='_id',
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
partition_paramstrRequiredActual server-supported FHIR date search parameter, e.g. "recorded-date", "date" or "_lastUpdated". It describes the chosen resource date, not necessarily clinical onset.
startUnion[str, pd.Timestamp]RequiredInclusive first boundary, supplied as a date/date-time string or pandas Timestamp. Use consistent timezone semantics.
endUnion[str, pd.Timestamp]RequiredExclusive final boundary. Must be later than start; do not describe this as an inclusive end date.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
frequencystr'YS'Pandas date frequency such as "MS" (monthly) or "YS" (yearly). Ignored when window_days is supplied.
window_daysOptional[int]NoneOptional positive fixed window width in days; overrides the calendar frequency.
max_pages_per_partitionint-1Page limit within each window: positive integer, -1 for all available pages, 0 for no request. Not a limit across all windows.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
include_partition_columnsboolTrueAttach explicit window/grid metadata to returned rows. Metadata names must not collide with result columns.
deduplicate_byOptional[Union[str, Sequence[str]]]NoneA result-column name or ordered list of names used for explicit duplicate removal. None retains repeated rows. Choose resource IDs deliberately; do not deduplicate clinical observations by patient alone.
auto_sortboolTrueAdd the selected sort unless an explicit _sort is already supplied in params. Requires server support; sorting does not prove completeness.
sortstr'_id'FHIR _sort expression used by auto_sort, normally "_id"; select a server-supported stable sort.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

query to dataframe

query_to_dataframe

Signature reference (use the workflow guide for runnable calls):

python
def query_to_dataframe(
    resource_type,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_params=None,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_paramsOptional[Sequence[Dict[str, Any]]]NoneOptional sequence of query dictionaries for independent parallel FHIR searches. None performs one search with params. Inspect job-level completeness.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

query from dataframe

query_from_dataframe

Signature reference (use the workflow guide for runnable calls):

python
def query_from_dataframe(
    df,
    resource_type,
    column_map,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    param_prefix=None,
    include_column_map_columns=False,
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
dfpd.DataFrameRequiredInput pandas DataFrame. Column labels must be unique; mapped identifiers must meet the method’s missing-value rules. Preserve identifier strings and leading zeros.
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
column_mapDict[str, str]RequiredFHIR search parameter → input DataFrame column, e.g. {"subject": "patient_id"}. Each input row creates a query; null, blank or empty-list keys are rejected.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
param_prefixOptional[Dict[str, str]]NoneOptional mapping from FHIR search parameter to a prefix, e.g. {"subject": "Patient/"}. Original input values are retained when metadata is requested.
include_column_map_columnsboolFalseCopy original mapped input columns into each returned row. Works with parallel fetch/custom processing; collisions with output columns raise.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

query df

query_df

Signature reference (use the workflow guide for runnable calls):

python
def query_df(
    resource_type,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_params=None,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_paramsOptional[Sequence[Dict[str, Any]]]NoneOptional sequence of query dictionaries for independent parallel FHIR searches. None performs one search with params. Inspect job-level completeness.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

search df

search_df

Signature reference (use the workflow guide for runnable calls):

python
def search_df(
    resource_type,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_params=None,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_paramsOptional[Sequence[Dict[str, Any]]]NoneOptional sequence of query dictionaries for independent parallel FHIR searches. None performs one search with params. Inspect job-level completeness.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

query df partitioned

query_df_partitioned

Signature reference (use the workflow guide for runnable calls):

python
def query_df_partitioned(
    resource_type,
    partition_param,
    start,
    end,
    params=None,
    frequency='YS',
    window_days=None,
    max_pages_per_partition=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    include_partition_columns=True,
    deduplicate_by=None,
    auto_sort=True,
    sort='_id',
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
partition_paramstrRequiredActual server-supported FHIR date search parameter, e.g. "recorded-date", "date" or "_lastUpdated". It describes the chosen resource date, not necessarily clinical onset.
startUnion[str, pd.Timestamp]RequiredInclusive first boundary, supplied as a date/date-time string or pandas Timestamp. Use consistent timezone semantics.
endUnion[str, pd.Timestamp]RequiredExclusive final boundary. Must be later than start; do not describe this as an inclusive end date.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
frequencystr'YS'Pandas date frequency such as "MS" (monthly) or "YS" (yearly). Ignored when window_days is supplied.
window_daysOptional[int]NoneOptional positive fixed window width in days; overrides the calendar frequency.
max_pages_per_partitionint-1Page limit within each window: positive integer, -1 for all available pages, 0 for no request. Not a limit across all windows.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
include_partition_columnsboolTrueAttach explicit window/grid metadata to returned rows. Metadata names must not collide with result columns.
deduplicate_byOptional[Union[str, Sequence[str]]]NoneA result-column name or ordered list of names used for explicit duplicate removal. None retains repeated rows. Choose resource IDs deliberately; do not deduplicate clinical observations by patient alone.
auto_sortboolTrueAdd the selected sort unless an explicit _sort is already supplied in params. Requires server support; sorting does not prove completeness.
sortstr'_id'FHIR _sort expression used by auto_sort, normally "_id"; select a server-supported stable sort.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

search df partitioned

search_df_partitioned

Signature reference (use the workflow guide for runnable calls):

python
def search_df_partitioned(
    resource_type,
    partition_param,
    start,
    end,
    params=None,
    frequency='YS',
    window_days=None,
    max_pages_per_partition=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    include_partition_columns=True,
    deduplicate_by=None,
    auto_sort=True,
    sort='_id',
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
partition_paramstrRequiredActual server-supported FHIR date search parameter, e.g. "recorded-date", "date" or "_lastUpdated". It describes the chosen resource date, not necessarily clinical onset.
startUnion[str, pd.Timestamp]RequiredInclusive first boundary, supplied as a date/date-time string or pandas Timestamp. Use consistent timezone semantics.
endUnion[str, pd.Timestamp]RequiredExclusive final boundary. Must be later than start; do not describe this as an inclusive end date.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
frequencystr'YS'Pandas date frequency such as "MS" (monthly) or "YS" (yearly). Ignored when window_days is supplied.
window_daysOptional[int]NoneOptional positive fixed window width in days; overrides the calendar frequency.
max_pages_per_partitionint-1Page limit within each window: positive integer, -1 for all available pages, 0 for no request. Not a limit across all windows.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
include_partition_columnsboolTrueAttach explicit window/grid metadata to returned rows. Metadata names must not collide with result columns.
deduplicate_byOptional[Union[str, Sequence[str]]]NoneA result-column name or ordered list of names used for explicit duplicate removal. None retains repeated rows. Choose resource IDs deliberately; do not deduplicate clinical observations by patient alone.
auto_sortboolTrueAdd the selected sort unless an explicit _sort is already supplied in params. Requires server support; sorting does not prove completeness.
sortstr'_id'FHIR _sort expression used by auto_sort, normally "_id"; select a server-supported stable sort.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

query df from

query_df_from

Signature reference (use the workflow guide for runnable calls):

python
def query_df_from(
    df,
    resource_type,
    column_map,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    param_prefix=None,
    include_column_map_columns=False,
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
dfpd.DataFrameRequiredInput pandas DataFrame. Column labels must be unique; mapped identifiers must meet the method’s missing-value rules. Preserve identifier strings and leading zeros.
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
column_mapDict[str, str]RequiredFHIR search parameter → input DataFrame column, e.g. {"subject": "patient_id"}. Each input row creates a query; null, blank or empty-list keys are rejected.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
param_prefixOptional[Dict[str, str]]NoneOptional mapping from FHIR search parameter to a prefix, e.g. {"subject": "Patient/"}. Original input values are retained when metadata is requested.
include_column_map_columnsboolFalseCopy original mapped input columns into each returned row. Works with parallel fetch/custom processing; collisions with output columns raise.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

search df from

search_df_from

Signature reference (use the workflow guide for runnable calls):

python
def search_df_from(
    df,
    resource_type,
    column_map,
    params=None,
    max_pages=-1,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
    parallel_fetch=False,
    param_prefix=None,
    include_column_map_columns=False,
    show_progress=True,
    *,
    return_report=False,
):
    ...
ParameterTypePython defaultPurpose and accepted options
dfpd.DataFrameRequiredInput pandas DataFrame. Column labels must be unique; mapped identifiers must meet the method’s missing-value rules. Preserve identifier strings and leading zeros.
resource_typestrRequiredFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.
column_mapDict[str, str]RequiredFHIR search parameter → input DataFrame column, e.g. {"subject": "patient_id"}. Each input row creates a query; null, blank or empty-list keys are rejected.
paramsOptional[Dict[str, Any]]NoneFHIR search-parameter dictionary, e.g. {"_count": 100, "code": "demo"}. Available clinical parameters/codes are defined by the server. DataFrame row mappings override matching base filters.
max_pagesint-1Maximum pages per query: positive integer, -1 for all available pages, 0 for no request. A page cap is not an empty match.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.
parallel_fetchboolFalseFetch input queries/partitions concurrently when workers are available. Separate from use_multiprocessing, which controls conversion.
param_prefixOptional[Dict[str, str]]NoneOptional mapping from FHIR search parameter to a prefix, e.g. {"subject": "Patient/"}. Original input values are retained when metadata is requested.
include_column_map_columnsboolFalseCopy original mapped input columns into each returned row. Works with parallel fetch/custom processing; collisions with output columns raise.
show_progressboolTrueDisplay a progress bar. Units depend on the operation: pages, partitions, input queries or download tasks. Disable for noninteractive jobs; CLI quiet/no-progress/JSON settings disable bars.
return_report (keyword only)boolFalseFalse keeps the normal data return. True returns {"data": ..., "report": ...}. Read the return-format section below for the client-specific report tables.

bundles to df

bundles_to_df

Signature reference (use the workflow guide for runnable calls):

python
def bundles_to_df(
    bundles,
    process_function=None,
    fhir_paths=None,
    mode='flatten',
    use_multiprocessing=True,
):
    ...
ParameterTypePython defaultPurpose and accepted options
bundlesIterable[Dict[str, Any] | FHIRObj]RequiredIterable of already retrieved Bundle dictionaries/FHIRObj objects to convert. Conversion materializes the iterable; it does not fetch more pages.
process_functionOptional[ProcessFunc]NoneCustom bundle processor for mode="custom". Accepts a bundle and returns a dictionary of output-table names to lists of row dictionaries.
fhir_pathsOptional[Sequence[Union[str, Tuple[str, str]]]]NoneSequence of FHIRPath strings or (output_name, expression) pairs. Expressions are resource-relative. Providing paths selects the path extractor and overrides a custom process_function.
modestr'flatten'"flatten" uses standard flattening; "custom" requires a processor unless fhir_paths supplies the extractor. Other values raise.
use_multiprocessingboolTrueConvert bundles in worker processes when the configured process count exceeds one. Custom processors must be importable/pickleable; use a guarded entrypoint.

create resource

create_resource

Signature reference (use the workflow guide for runnable calls):

python
def create_resource(
    resource,
    resource_type=None,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resourceDict[str, Any]RequiredA validated FHIR R4 resource dictionary. It must agree with an explicitly supplied resource type.
resource_typeOptional[str]NoneFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.

update resource

update_resource

Signature reference (use the workflow guide for runnable calls):

python
def update_resource(
    resource,
    resource_id=None,
    resource_type=None,
):
    ...
ParameterTypePython defaultPurpose and accepted options
resourceDict[str, Any]RequiredA validated FHIR R4 resource dictionary. It must agree with an explicitly supplied resource type.
resource_idOptional[str]NoneLogical FHIR resource ID for update. None uses the ID in the resource; an update requires an ID.
resource_typeOptional[str]NoneFHIR resource type such as "Patient", "Observation" or "ImagingStudy". Supported resource/search combinations depend on the server.

submit bundle

submit_bundle

Signature reference (use the workflow guide for runnable calls):

python
def submit_bundle(
    bundle,
):
    ...
ParameterTypePython defaultPurpose and accepted options
bundleDict[str, Any]RequiredValidated FHIR transaction Bundle to submit to the server base URL. Collection bundles are not accepted for submission.

Return formats and limits

Fetch methods yield bundles. DataFrame methods return a DataFrame or a dictionary of tables according to conversion output; return_report=True wraps data with report.rows and report.summary. A failure raises. Write methods return FHIRWriteResult metadata. An exhausted page sequence is not proof against hidden server caps.

Sensitive outputs: result paths, identifiers, URLs and detailed reports belong in approved research storage. Progress logs use controlled labels and counts.

Return to the workflow guide for worked examples.