Skip to content

Commit

Permalink
feat: #2484 Updated CHG/PCHG comments and restrict_derivation call to…
Browse files Browse the repository at this point in the history
… notify that as per ADaM IG, the decision on how to populate pre-baseline and baseline values of CHG/PCHG is left to producer choice.
  • Loading branch information
steventing12 committed Aug 23, 2024
1 parent 406af67 commit d372084
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
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
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
3 changes: 2 additions & 1 deletion inst/templates/ad_advs.R
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,18 @@ advs <- advs %>%
new_var = BNRIND
) %>%
# 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 %>%
restrict_derivation(
Expand Down

0 comments on commit d372084

Please sign in to comment.