The function can be called into a .with_columns() statement. It will reference the dataframe’s status column and output a cleaned version of it.
Parameters
wdrs_test_perf_col:str
test performed column
Examples
import polars as plimport wadoh_subtyping.transform as tffrom wadoh_raccoon.utils import helpersdf = pl.DataFrame({"ResultTextConclusion": ["Influenza A(2009 H1N1) virus detected by RT-PCR {65}", "Influenza B/Victoria lineage detected by RT-PCR {91}", "Inconclusive - sample below limit of detection of test {61}","Influenza B virus detected by RT-PCR {59}" ]})# run the functiondf = ( df .with_columns( TEST_PERFORMED_DESC=tf.col_test_performed_desc(wdrs_test_perf_col='ResultTextConclusion') ))# here's a table of the resultshelpers.gt_style(df_inp=df)
index
ResultTextConclusion
TEST_PERFORMED_DESC
0
Influenza A(2009 H1N1) virus detected by RT-PCR {65}
PCR/Nucleic Acid Test (NAT, NAAT, DNA)
1
Influenza B/Victoria lineage detected by RT-PCR {91}
PCR/Nucleic Acid Test (NAT, NAAT, DNA)
2
Inconclusive - sample below limit of detection of test {61}
None
3
Influenza B virus detected by RT-PCR {59}
PCR/Nucleic Acid Test (NAT, NAAT, DNA)
WDRS Variable Mapping
Below are all distinct options in WDRS for the WDRS_TEST_PERFORMED variable and how the values map to LIMS data.
LIMS-ResultTextConclusion
WDRS_TEST_PERFORMED
Inconclusive {50}
Direct fluorescent antibody (DFA) / Immunohistochemistry (IHC)
Influenza A virus detected by RT-PCR {58}
Manual Review
Influenza A(2009 H1N1) virus detected by RT-PCR {65}