Skip to content

Commit

Permalink
#204 updates to fix avisitn and qbcscore
Browse files Browse the repository at this point in the history
  • Loading branch information
manciniedoardo committed Nov 10, 2023
1 parent 1cc5602 commit 1679fb6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions inst/templates/ad_advfq.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ advfq_qbcs <- advfq_qsg02 %>%
filter_add = PARAMCD %in% c("QSG01", "QSG02") & !is.na(AVAL),
set_values_to = exprs(
AVAL = sum(AVAL),
PARAMCD = "QBSCORE"
PARAMCD = "QBCSCORE"
)
)

Expand All @@ -234,11 +234,15 @@ advfq_visit <- advfq_qbcs %>%
!is.na(VISIT) ~ str_to_title(VISIT),
TRUE ~ NA_character_
),
AVISITN = as.numeric(case_when(
AVISITN = case_when(
VISIT == "BASELINE" ~ "0",
str_detect(VISIT, "WEEK") ~ str_trim(str_replace(VISIT, "WEEK", "")),
TRUE ~ NA_character_
))
str_detect(VISIT, "WEEK") ~ VISIT %>%
str_replace("WEEK", "") %>%
str_replace("\\(T\\)", "") %>%
str_trim(),

TRUE ~ NA
),
)

advfq_ontrt <- advfq_visit %>%
Expand Down

0 comments on commit 1679fb6

Please sign in to comment.