Skip to content

Commit

Permalink
Closes #2561 update ADEG template (#2565)
Browse files Browse the repository at this point in the history
* #2561 Update ADEG template flags

* #2561 Doc: Update NEWS
  • Loading branch information
jeffreyad authored Nov 18, 2024
1 parent 08074a1 commit 8f72bb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions inst/templates/ad_adeg.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
)
)
Expand Down Expand Up @@ -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 ----
Expand Down

0 comments on commit 8f72bb1

Please sign in to comment.