Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #2484 Used restrict_derivation() with AVISITN > 0 to restrict CHG and PCHG to post-baseline records #2488

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ repo
reproducibility
rlang
roche
Rothstein
roxygen
scalable
signif
Expand Down
2 changes: 1 addition & 1 deletion inst/templates/ad_adcm.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ adcm <- adcm %>%
# Derive Follow-Up flag
mutate(FUPFL = if_else(ASTDT > TRTEDT, "Y", NA_character_)) %>%
# Derive ANL01FL
# This variable is sponsor specific and may be used to indicate particular
# This variable is producer specific and may be used to indicate particular
# records to be used in subsequent derivations or analysis.
mutate(ANL01FL = if_else(ONTRTFL == "Y", "Y", NA_character_)) %>%
# Derive 1st Occurrence of Preferred Term Flag
Expand Down
16 changes: 12 additions & 4 deletions inst/templates/ad_adeg.R
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,18 @@ adeg <- adeg %>%
source_var = ANRIND,
new_var = BNRIND
) %>%
# Calculate CHG
derive_var_chg() %>%
# Calculate PCHG
derive_var_pchg()
# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
# The decision on how to populate pre-baseline and baseline values of CHG is left to the sponsor.
We have chosen to not populate pre-baseline records.

I think sponsor rather than producer should be used. What do you think? If agree can you update the other comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think producer is a more inclusive term (e.g. CROs are typically vendors, not sponsors) but happy to change if all agree.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure producer sounds good.

Suggested change
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
# The decision on how to populate pre-baseline and baseline values of CHG is left to the producer.

restrict_derivation(
derivation = derive_var_chg,
filter = AVISITN > 0
) %>%
# Calculate PCHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of PCHG is left to producer choice
restrict_derivation(
derivation = derive_var_pchg,
filter = AVISITN > 0
)

## ANL01FL: Flag last result within an AVISIT and ATPT for post-baseline records ----
adeg <- adeg %>%
Expand Down
17 changes: 12 additions & 5 deletions inst/templates/ad_adlb.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,18 @@ adlb <- adlb %>%
source_var = ANRIND,
new_var = BNRIND
) %>%
# Calculate CHG
derive_var_chg() %>%
# Calculate PCHG
derive_var_pchg()

# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
restrict_derivation(
derivation = derive_var_chg,
filter = AVISITN > 0
) %>%
# Calculate PCHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of PCHG is left to producer choice
restrict_derivation(
derivation = derive_var_pchg,
filter = AVISITN > 0
)

## Calculate lab grading ----

Expand Down
8 changes: 7 additions & 1 deletion inst/templates/ad_adpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,13 @@ adpc_base <- adpc_dtype %>%
filter = ABLFL == "Y"
)

adpc_chg <- derive_var_chg(adpc_base)
# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
adpc_chg <- restrict_derivation(
adpc_base,
derivation = derive_var_chg,
filter = AVISITN > 0
)

# ---- Add ASEQ ----

Expand Down
17 changes: 12 additions & 5 deletions inst/templates/ad_advs.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,18 @@ advs <- advs %>%
source_var = ANRIND,
new_var = BNRIND
) %>%
# Calculate CHG
derive_var_chg() %>%
# Calculate PCHG
derive_var_pchg()

# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
restrict_derivation(
derivation = derive_var_chg,
filter = AVISITN > 0
) %>%
# Calculate PCHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of PCHG is left to producer choice
restrict_derivation(
derivation = derive_var_pchg,
filter = AVISITN > 0
)

## ANL01FL: Flag last result within an AVISIT and ATPT for post-baseline records ----
advs <- advs %>%
Expand Down
8 changes: 7 additions & 1 deletion vignettes/pk_adnca.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,13 @@ adpc_base <- adpc_dtype %>%
filter = ABLFL == "Y"
)

adpc_chg <- derive_var_chg(adpc_base)
# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
adpc_chg <- restrict_derivation(
adpc_base,
derivation = derive_var_chg,
filter = AVISITN > 0
)

# ---- Add ASEQ ----

Expand Down
14 changes: 12 additions & 2 deletions vignettes/questionnaires.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,18 @@ adgdssf <- adgdssf %>%
source_var = AVAL,
new_var = BASE
) %>%
derive_var_chg() %>%
derive_var_pchg() %>%
# Calculate CHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of CHG is left to producer choice
restrict_derivation(
derivation = derive_var_chg,
filter = AVISITN > 0
) %>%
# Calculate PCHG for post-baseline records
# The decision on how to populate pre-baseline and baseline values of PCHG is left to producer choice
restrict_derivation(
derivation = derive_var_pchg,
filter = AVISITN > 0
) %>%
# Derive sequence number
derive_var_obs_number(
by_vars = exprs(STUDYID, USUBJID),
Expand Down
Loading