Skip to contents

Define a function to map the disposition status. To be used as an input for derive_var_disposition_status().

Usage

format_eoxxstt_default(status)

Arguments

status

the disposition variable used for the mapping (e.g. DSDECOD).

Value

A character vector derived based on the values given in status: "NOT STARTED" if status is "SCREEN FAILURE" or "SCREENING NOT COMPLETED", "COMPLETED" if status is "COMPLETED", "DISCONTINUED" if status is not in ("COMPLETED","SCREEN FAILURE", "SCREENING NOT COMPLETED") nor NA, "ONGOING" otherwise.

Details

Usually this function can not be used with %>%.

Author

Samia Kabi

Examples

library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
data("admiral_dm")
data("admiral_ds")

admiral_dm %>%
  derive_var_disposition_status(
    dataset_ds = admiral_ds,
    new_var = EOSSTT,
    status_var = DSDECOD,
    format_new_var = format_eoxxstt_default,
    filter_ds = DSCAT == "DISPOSITION EVENT"
  ) %>%
  select(STUDYID, USUBJID, EOSSTT)
#> # A tibble: 306 x 3
#>    STUDYID      USUBJID     EOSSTT      
#>    <chr>        <chr>       <chr>       
#>  1 CDISCPILOT01 01-701-1015 COMPLETED   
#>  2 CDISCPILOT01 01-701-1023 DISCONTINUED
#>  3 CDISCPILOT01 01-701-1028 COMPLETED   
#>  4 CDISCPILOT01 01-701-1033 DISCONTINUED
#>  5 CDISCPILOT01 01-701-1034 COMPLETED   
#>  6 CDISCPILOT01 01-701-1047 DISCONTINUED
#>  7 CDISCPILOT01 01-701-1057 NOT STARTED 
#>  8 CDISCPILOT01 01-701-1097 COMPLETED   
#>  9 CDISCPILOT01 01-701-1111 DISCONTINUED
#> 10 CDISCPILOT01 01-701-1115 DISCONTINUED
#> # … with 296 more rows