submitting_lab

transform.submitting_lab(submitter: str)

Submitting Lab

Return a column with the value in the submitter column. - Note: The name for the submitter col is ‘submitter’ for all 3 data sources/pathways (e.g. PHL, ELR, MFT)’) Name of column: SUBMITTING_LAB

Usage

The function can be called into a .with_columns() statement.

Parameters

submitter : str

name of submitter

Examples

Note: the submitting lab column uses reference codes from WDRS. There is a long list of reference codes, but not all labs have a reference code. Also, LIMS may not have standard naming conventions for labs. Therefore we need to map labs to their reference codes as best as we can, but then for labs that are not on the list, default their code to 27782022 and use the text field SUBMITTER_OTHER to fill in the lab name from LIMS

import polars as pl
import polars.selectors as cs
import wadoh_subtyping.transform as tf
from wadoh_raccoon.utils import helpers

# Main DataFrame (df)
data = pl.DataFrame({
    "SubmittingLab": [
        "Labcorp - Seattle Cherry Hill",
        "Providence Reg Med Ctr - Everett",
        "University of Washington Medical Center",
        "Some Random Lab"
    ]
})

df = (
    data
    .with_columns(
        SUBMITTER = tf.submitting_lab(submitter="SubmittingLab"),
    )
    .with_columns(
        SUBMITTER_OTHER = tf.submitter_other(
            submitting_lab='SUBMITTER',
            submitter='SubmittingLab'
        )
    )
)

helpers.gt_style(df_inp=df)
index SubmittingLab SUBMITTER SUBMITTER_OTHER
0 Labcorp - Seattle Cherry Hill 6130705570 None
1 Providence Reg Med Ctr - Everett 85742 None
2 University of Washington Medical Center 88215 None
3 Some Random Lab 27782022 Some Random Lab