wdrs_test_performed

transform.wdrs_test_performed(wdrs_test_perf_col: str)

WDRS Test Performed

Usage

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 pl
import wadoh_subtyping.transform as tf
from wadoh_raccoon.utils import helpers

df = 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 function
df = (
    df
    .with_columns(
        WDRS_TEST_PERFORMED=tf.wdrs_test_performed(wdrs_test_perf_col='ResultTextConclusion')
    )
)

# here's a table of the results
helpers.gt_style(df_inp=df)
index ResultTextConclusion WDRS_TEST_PERFORMED
0 Influenza A(2009 H1N1) virus detected by RT-PCR {65} G_PCR
1 Influenza B/Victoria lineage detected by RT-PCR {91} G_PCR
2 Inconclusive - sample below limit of detection of test {61} None
3 Influenza B virus detected by RT-PCR {59} G_PCR

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} PCR/Nucleic Acid Test (NAT, NAAT, DNA)
Influenza A(H3) virus detected by RT-PCR {64} Rapid test (rapid EIA)
Influenza B virus detected by RT-PCR {59} Viral culture (isolation)
Other, specify