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

Is run_check() looking for dataset "ae" and not "AE" ? #345

Open
jimrothstein opened this issue Jun 20, 2024 · 0 comments
Open

Is run_check() looking for dataset "ae" and not "AE" ? #345

jimrothstein opened this issue Jun 20, 2024 · 0 comments
Labels
question Further information is requested

Comments

@jimrothstein
Copy link
Collaborator

jimrothstein commented Jun 20, 2024



Problem:   sdtmchecks::run_check()  does not appear to work with dummy data only for AE 
To run properly, "ae" dataset must be populated.  Most other checks require "AE" be populated.


 suspect code?   in line containing parse
  
## fxn_in="AE=ae"
## parse(text = paste0(check, "(", fxn_in, ")"))
  
library(sdtmchecks)

### Pick a check (check_ae_aeacnoth):
metads = sdtmchecksmeta[sdtmchecksmeta$check == "check_ae_aeacnoth", ]
metads$check
#> [1] "check_ae_aeacnoth"

### Populate dummy AE
### "Assuming sdtm datasets are in your global environment"
   AE <- data.frame(
    USUBJID = 1:7,
    AETERM = 1:7,
    AESTDTC = 1:7,
    AEACNOTH = 1:7,
    AEACNOT1 = 1:7,
    AEACNOT2 = 1:7,
    AESPID = "FORMNAME-R:13/L:13XXXX"
   )

### check: pass
check_ae_aeacnoth(AE)
#> [1] TRUE

run 2 ways, (1) ae not in environment (2) ae=AE

rec1 <- run_check(
check = metads$check,
fxn_in = metads$fxn_in,
xls_title = metads$xls_title,
pdf_title = metads$pdf_title,
pdf_subtitle = metads$pdf_subtitle,
pdf_return = metads$pdf_return,
verbose = T
)

ae=AE

rec2 <- run_check(
check = metads$check,
fxn_in = metads$fxn_in,
xls_title = metads$xls_title,
pdf_title = metads$pdf_title,
pdf_subtitle = metads$pdf_subtitle,
pdf_return = metads$pdf_return,
verbose = T
)
identical(rec1, rec2)
#> [1] FALSE

rec1$notes
#> [1] "ATTENTION! Check was not run: AE does not exist or failed to read"
rec2$notes
#> [1] " "

rec1
#> $xls_title
#> [1] "AE AEACNOTH multiple"
#>
#> $pdf_title
#> [1] "Check for null AEACNOT[1/2] when AEACNOTH = 'MULTIPLE'"
#>
#> $pdf_subtitle
#> [1] "* This check looks for null AEACNOT[1/2] when AEACNOTH = 'MULTIPLE', which indicates a possible SDTMv mapping issue\n* NOTE: not all ongoing studies are adopting this approach for AE resolution and this may not be appropriate to query"
#>
#> $nrec
#> [1] 0
#>
#> $notes
#> [1] "ATTENTION! Check was not run: AE does not exist or failed to read"
#>
#> $msg
#> character(0)
#>
#> $data
#> data frame with 0 columns and 0 rows
rec2
#> $xls_title
#> [1] "AE AEACNOTH multiple"
#>
#> $pdf_title
#> [1] "Check for null AEACNOT[1/2] when AEACNOTH = 'MULTIPLE'"
#>
#> $pdf_subtitle
#> [1] "* This check looks for null AEACNOT[1/2] when AEACNOTH = 'MULTIPLE', which indicates a possible SDTMv mapping issue\n* NOTE: not all ongoing studies are adopting this approach for AE resolution and this may not be appropriate to query"
#>
#> $nrec
#> [1] 0
#>
#> $notes
#> [1] " "
#>
#> $msg
#> character(0)
#>
#> $data
#> data frame with 0 columns and 0 rows
Created on 2024-06-19 with reprex v2.1.0

Standard output and standard error

@sarabodach sarabodach added the question Further information is requested label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants