-
Notifications
You must be signed in to change notification settings - Fork 14
Fix #475 - add flowchart #545
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
Conversation
@jwildfire - added a possible implementation but looking for any additional specs you can provide for what you'd like to see here. |
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-475 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-475 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-475 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample code isn't running for me :( No error thrown, but nothing rendering. Maybe add some examples/tests that call Visualize_Workflow
directly?
It's running for me, and it looks really nice! It would be a lot more intuitive if we had consistent verbiage. For instance, |
@jwildfire - the code to create a single flowchart is pretty nested inside library(DiagrammeR)
lAssessments <- MakeAssessmentList()
lData <- list(
dfSUBJ = clindata::rawplus_subj,
dfAE = clindata::rawplus_ae,
dfPD = clindata::rawplus_pd,
dfCONSENT = clindata::rawplus_consent,
dfIE = clindata::rawplus_ie
)
lTags <- list(
Study = "myStudy"
)
lMapping <- clindata::mapping_rawplus
ae_assessment <- RunAssessment(lAssessments$ae, lData = lData, lMapping = lMapping, lTags = lTags)
ae_assessment$lResults$flowchart
|
It's running for me, too, but I have to |
Running fine in RStudio - sorry for confusion! Will continue to a full review soon. |
R/util-RunAssessment.R
Outdated
node_df <- bind_rows(node_df, | ||
map_df(step$inputs, ~tibble( | ||
assessment = lAssessment$name, | ||
n_step = stepCount, | ||
name = step$name, | ||
inputs = .x, | ||
n_row = nrow(lData[[.x]]), | ||
n_col = ncol(lData[[.x]]))) %>% | ||
mutate(checks = result$lChecks$status, | ||
from = stepCount, | ||
to = length(lAssessment$workflow[[stepCount]]$inputs) + stepCount, | ||
n_row_end = ifelse(!is.null(result$newRows), result$newRows, NA)) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd vote to move this to Visualize_Workflow
if possible ...
R/util-RunAssessment.R
Outdated
lAssessment$lResults$flowchart <- Visualize_Workflow( | ||
lAssessment = lAssessment, | ||
lResult = result, | ||
dfNode = node_df | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result
is already embedded in lAssessment
, no? Seems like we can just pass lAssessment
and then have Visualize_Workflow
calculate node_df
R/util-FilterDomain.R
Outdated
if (bReturnChecks) { | ||
return(list(df = df, lChecks = checks)) | ||
if(!exists("newRows")) newRows <- NA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit confused about the need for this ... can we not just use nrow() on the dataset that is returned.
R/util-RunAssessment.R
Outdated
stepCount <- stepCount + 1 | ||
} | ||
} else { | ||
cli::cli_alert_warning("Workflow not found for {lAssessment$name} assessment - Skipping remaining steps") | ||
lAssessment$bStatus <- FALSE | ||
} | ||
|
||
if(lAssessment$bStatus) { | ||
lAssessment$lResults$flowchart <- Visualize_Workflow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a super strong opinion, but in my mind the flowchart fits better under lChecks
than lResults
. It's really more of a debugging/workflow tool than a part of the core KRI workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Let's discuss process for partial workflows after scrum.
Add to |
@jwildfire - I think this is as far as it makes sense to take things for now. Feel free to review again, wait to discuss further, or merge if it looks good. To run with complete data: study <- Study_Assess()
study$ae$lChecks$flowchart Error for subject-level data: lData <- list(
dfSUBJ = clindata::rawplus_subj %>% select(-SubjectID),
dfAE = clindata::rawplus_ae
)
x <- Study_Assess(lData = lData)
x$ae$lChecks$flowchart Error for domain-level/missing data:
lAssessments <- MakeAssessmentList()
lData <- list(
dfSUBJ = clindata::rawplus_subj,
dfAE = clindata::rawplus_ae %>% select(1)
)
lTags <- list(
Study = "myStudy"
)
lMapping <- clindata::mapping_rawplus
sae_assessment <- RunAssessment(lAssessments$sae, lData = lData, lMapping = lMapping, lTags = lTags)
sae_assessment$lChecks$flowchart |
More code to test if helpful: dfAE <- clindata::rawplus_ae
dfCONSENT <- clindata::rawplus_consent
dfIE <- clindata::rawplus_ie
dfPD <- clindata::rawplus_pd
dfSUBJ <- clindata::rawplus_subj
# AE missing SubjectID column
dfAE$SubjectID <- NULL
# Consent column CONSENT_VALUE has NA
dfCONSENT$CONSENT_VALUE[1:10] <- NA
# IE column IE_VALUE missing
dfIE$IE_VALUE <- NULL
lData <- list(
dfAE = dfAE,
dfCONSENT = dfCONSENT,
dfIE = dfIE,
dfPD = dfPD,
dfSUBJ = dfSUBJ
)
x <- Study_Assess(lData = lData)
x$ae$lChecks$flowchart
x$consent$lChecks$flowchart
x$ie$lChecks$flowchart |
Overview
Initial bare bones implementation for flowchart
Test Notes/Sample Code