pharmaverse / admiralpeds

Admiral Package Extension for Pediatric Clinical Trials
https://pharmaverse.github.io/admiralpeds/
Apache License 2.0
13 stars 3 forks source link

closes #36 Update of the test data with the values for children #39

Closed remikk closed 5 months ago

remikk commented 6 months ago

Update of birthdate to represent child subject; complete partial date; update height, weight and bmi to values typical for children.

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

rossfarrugia commented 6 months ago

@remikk I think you missed the intention of this issue so i've tried to re-write the issue more clearly here: https://github.com/pharmaverse/admiralpeds/issues/36. I was hoping to see code such as the following for dm_peds:

library(dplyr)
library(admiral)
library(pharmaversesdtm)

# Read input test data from pharmaversesdtm ----
data("dm")

# Convert blank to NA ----
dm <- convert_blanks_to_na(dm)

# Subset to first 5 patients only (which is enough for our examples) ----
dm_subset <- dm %>%
  filter(USUBJID %in% c("01-701-1015", "01-701-1023", "01-701-1028",
                        "01-701-1033", "01-701-1034"))

# Add birth dates/age realistic for pediatrics in line with treatment dates ----
dm_peds <- dm_subset %>%
  mutate(BRTHDTC = case_when(
    USUBJID == "01-701-1015" ~ "2013-01-02",
    USUBJID == "01-701-1023" ~ "2010-08-05",
    USUBJID == "01-701-1028" ~ "2010-07-19",
    USUBJID == "01-701-1033" ~ "2014-01-01",
    USUBJID == "01-701-1034" ~ "2014-06-01"
  )) %>%
  mutate(AGE = case_when(
    USUBJID == "01-701-1015" ~ 1,
    USUBJID == "01-701-1023" ~ 2,
    USUBJID == "01-701-1028" ~ 3,
    USUBJID == "01-701-1033" ~ 0,
    USUBJID == "01-701-1034" ~ 0
  ))

# Variable labels ----
attr(dm_peds$BRTHDTC, "label") <- "Date/Time of Birth"

# Label dataset ----
attr(dm_peds, "label") <- "Demographics"

# Save dataset ----
usethis::use_data(dm_peds, overwrite = TRUE)

The reason I used dates from 2010 - 2014 is aligning with the patients dates in {pharmaversesdtm} dm data, as if we make these dates work then you shouldn't have to subsequently update the vs dates. You'll just need to update the VSORRES/VSSTRESC/VSSTRESN to make the readings more realistic to heights/weights/bmi/head circumference of children.

Please try this out and if you agree commit these updates and then try similar for vs_peds.