module documentation

Module for importing and exporting CSV tables of patients with lymphatic patterns of progression into and from the Django database.

Exception ParsingError Exception raised when the parsing of an uploaded CSV fails due to missing data columns.
Function compute_hash Compute a hash vlaue from three patient-specific fields that must be removed due for respecting the patient's privacy.
Function export_to_pandas Export QuerySet of patients into a pandas DataFrame of the same format as it is needed for importing.
Function get_model_fields Get list of names of model fields and remove the ones provided via the remove argument.
Function import_from_pandas Import patients from pandas DataFrame.
Function nan_to_none Transform NaNs to None.
Function row2diagnoses Create Diagnose instances from row of DataFrame and add them to an existing Patient instance.
Function row2patient Create a Patient instance from a row of a DataFrame containing the appropriate information, as well as the dataset in which the information was uploaded.
Function row2tumors Create Tumor instances from row of a DataFrame and add them to an existing Patient instance.
Variable logger Undocumented
def compute_hash(*args):

Compute a hash vlaue from three patient-specific fields that must be removed due for respecting the patient's privacy.

def export_to_pandas(patients):

Export QuerySet of patients into a pandas DataFrame of the same format as it is needed for importing.

Parameters
patients:QuerySetUndocumented
def get_model_fields(model, remove=None):

Get list of names of model fields and remove the ones provided via the remove argument.

Parameters
modelUndocumented
remove:List[str]Undocumented
def import_from_pandas(data_frame, dataset, anonymize=None):

Import patients from pandas DataFrame.

Parameters
data_frame:pd.DataFrameUndocumented
dataset:models.DatasetUndocumented
anonymize:List[str]Undocumented
Returns
Tuple[int]Undocumented
def nan_to_none(sth):

Transform NaNs to None.

def row2diagnoses(row, patient):

Create Diagnose instances from row of DataFrame and add them to an existing Patient instance.

def row2patient(row, dataset):

Create a Patient instance from a row of a DataFrame containing the appropriate information, as well as the dataset in which the information was uploaded.

def row2tumors(row, patient):

Create Tumor instances from row of a DataFrame and add them to an existing Patient instance.

logger =

Undocumented