Skip to main content

utils

Utility functions for federated protocols.

Module

Functions

add_patient_metadata_columns

def add_patient_metadata_columns(    row_dict: dict,    datasource: FileSystemIterableSource,    file_path: str,)> None:

Add patient metadata columns to row dict for medical datasources only.

Specifically, add the patient ID column if available in the datasource's cache. This function is used to add the metadata to the error report for failed batches/individual files, and should be called at the end of a task. We only allow retrieving from cache since at the end of the task all files should have been processed and cached. If a specific file is not found then it would indicate an issue with the respective file.

Arguments

  • row_dict: The dictionary to add columns to
  • datasource: The datasource instance
  • file_path: File path to extract metadata for