Skip to content

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)

@samussiah samussiah requested a review from Copilot April 9, 2025 13:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 13 changed files in this pull request and generated no comments.

Files not reviewed (9)
  • DESCRIPTION: Language not supported
  • R/getDefaultData.R: Language not supported
  • R/getDefaultSettings.R: Language not supported
  • R/getSDTMTiming.R: Language not supported
  • R/getTiming.R: Language not supported
  • R/profileApp.R: Language not supported
  • data-raw/mapping.R: Language not supported
  • data-raw/mapping_adam.csv: Language not supported
  • data-raw/mapping_sdtm.csv: Language not supported

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.

3 participants