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

Calculate study timing given sdtm data. #14

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Calculate study timing given sdtm data. #14

wants to merge 5 commits into from

Conversation

samussiah
Copy link
Collaborator

No description provided.

getDefaultSettings <- function(standard) {
settings <- list()

if (standard == 'sdtm') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be able to use safetyGraphics::makeMapping to do this. Let me see if i can get it working.

R/profileApp.R Outdated
Comment on lines 37 to 61
## Calculate study timing.
if (standard == 'sdtm') {
data$aes <- getTiming(
params = list(
data = data,
settings = settings,
standard = standard
),
'aes',
domainStartDate = settings$aes$stdt_col,
domainEndDate = settings$aes$endt_col
)
settings$aes$stdy_col <- paste0(settings$aes$stdt_col, '_dy')
settings$aes$endy_col <- paste0(settings$aes$endt_col, '_dy')

data$labs <- getTiming(
params = list(
data = data,
settings = settings,
standard = standard
),
'labs',
domainDate = settings$labs$dt_col
)
settings$labs$dy_col <- paste0(settings$labs$dt_col, '_dy')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should treat this more like a utility function. Let's move this to a separate function (getSDTMTiming) and have the user call it before starting the app. That way we can use the day variable in other safetyGraphics modules as well if needed. Something like:

sdtm <- getDefaultData(standard="sdtm") %>% getSDTMTiming
safetyGraphicsApp(data=sdtm)
# or profileApp(data=sdtm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants