Biogen-Inc / tidyCDISC

Demo the app here: https://bit.ly/tidyCDISC_app
https://biogen-inc.github.io/tidyCDISC/
GNU Affero General Public License v3.0
107 stars 38 forks source link

Add options for variables in recipe metadata #235

Closed Jeff-Thompson12 closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Merging #235 (0207326) into devel (dc990c5) will decrease coverage by 0.12%. The diff coverage is 0.00%.

:exclamation: Current head 0207326 differs from pull request most recent head dff0228. Consider uploading reports for the commit dff0228 to get more accurate results

@@            Coverage Diff             @@
##            devel     #235      +/-   ##
==========================================
- Coverage   19.38%   19.26%   -0.12%     
==========================================
  Files          54       54              
  Lines        4742     4771      +29     
==========================================
  Hits          919      919              
- Misses       3823     3852      +29     
Impacted Files Coverage Δ
R/mod_tableGen.R 0.00% <0.00%> (ø)
R/mod_tableGen_fct_param_opts.R 0.00% <0.00%> (ø)
R/mod_tableGen_fct_recipe_incl.R 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Jeff-Thompson12 commented 1 year ago

Can now make a table like this:

"test_1": {
  "title": "Test 1: Use ATPT",
  "blocks": [{"data":"ADVS", "variable":"DIABP", "var_arg":"ALL", "var_options_fn":"atpt", "statistic":"MEAN", "stat_arg":"ALL", "stat_options_fn":"avisit"}]
  }
Jeff-Thompson12 commented 1 year ago

I am converting this back to draft because I am realizing I need to make sure that the user can specify var_options and stat_options in the recipes JSON file.

Jeff-Thompson12 commented 1 year ago

All right. I think I have this working now. If you add a recipe like this:

"test_2": {
  "title": "Test 2: Use selection and options",
  "blocks": [{"data":"ADVS", "variable":"DIABP", "var_arg":"AFTER LYING DOWN FOR 5 MINUTES", "var_options":{"ATPT":["AFTER LYING DOWN FOR 5 MINUTES"]}, "statistic":"MEAN", "stat_arg":"Week 4", "stat_options":["Week 2", "Week 4", "Week 6"]}]
}

You will get the appropriate outputs in the table generator.

Snag_1653fc1d Snag_16544b95
Jeff-Thompson12 commented 1 year ago

@AARON-CLARK Did you get a chance to look at this PR yet?

Jeff-Thompson12 commented 1 year ago

(2) Validation. I know it would probably be some work, but can we check to make sure these metadata inputs make sense? I changed the var_options from your example to "7 minutes" and left everything else the same and the output came out like this.

Big problem with validation is that the block data is created separate from the dataset. For this specific case I can add in a check that the var_selection is contained in the var_options. There is the question of where this check should take place since the user could supply var_options_fn instead. Currently the output does suggest that something went wrong and maybe even suggests what that was: image

I do agree that instead of expanding upon the recipe metadata that the next step should be validation of what has already been built out though.

Jeff-Thompson12 commented 1 year ago

Also, did I do something wrong? I use your example yml that I edited with the new naming convention:

No, that's on me. I will fix it.