diff --git a/NEWS.md b/NEWS.md index 34c9a86e56..2dff9806c6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ - Replace use of `data("sdtm")` with `sdtm <- pharmaverse::sdtm` in templates and vignettes. (#2498) - Remove `dthcaus_source()` calls in `ADSL` template because they are deprecated. (#2517) +- Update `ADEG` template to flag `ABLFL` and `ANL01FL` based on `DTYPE == "AVERAGE"` records. (#2561) ## Updates of Existing Functions diff --git a/inst/templates/ad_adeg.R b/inst/templates/ad_adeg.R index fe6f58914d..3be5b8bdc1 100644 --- a/inst/templates/ad_adeg.R +++ b/inst/templates/ad_adeg.R @@ -210,10 +210,7 @@ adeg <- adeg %>% # Calculate BASETYPE derive_basetype_records( basetypes = exprs( - "LAST: AFTER LYING DOWN FOR 5 MINUTES" = ATPTN == 815, - "LAST: AFTER STANDING FOR 1 MINUTE" = ATPTN == 816, - "LAST: AFTER STANDING FOR 3 MINUTES" = ATPTN == 817, - "LAST" = is.na(ATPTN) + "BASELINE DAY 1" = TRUE ) ) %>% # Calculate ABLFL @@ -226,7 +223,7 @@ adeg <- adeg %>% mode = "last" ), filter = ((!is.na(AVAL) | !is.na(AVALC)) & - ADT <= TRTSDT & !is.na(BASETYPE) & is.na(DTYPE) & + ADT <= TRTSDT & !is.na(BASETYPE) & DTYPE == "AVERAGE" & PARAMCD != "EGINTP" ) ) @@ -274,7 +271,7 @@ adeg <- adeg %>% new_var = ANL01FL, mode = "last" ), - filter = !is.na(AVISITN) & ONTRTFL == "Y" + filter = !is.na(AVISITN) & (ONTRTFL == "Y" | ABLFL == "Y") & DTYPE == "AVERAGE" ) ## Get treatment information ----