Function to get the baseline lab value

baseline function for bilirubin and creatinine

baseline function for GFR and Platelets

get_baseline(.data, labvalue, patientid, result_day, onset_type, blood)

# S3 method for bili
get_baseline(.data, labvalue, patientid, result_day, onset_type, blood)

# S3 method for plate
get_baseline(.data, labvalue, patientid, result_day, onset_type, blood)

Arguments

.data

Your dataset

labvalue

Your lab value, can be bilirubin, creatinine, GFR, or platelets

patientid

A column denoting a unique patient identifier

result_day

A Date column denoting when a lab resulted

onset_type

A character value denoting if an encounter is community or hospital onset

blood

A POSIXct indicating the blood culture time

Examples

if (FALSE) { data <- get_baseline(creat, result_day = lab_results, .blood = blood_data) }