- Notifications
You must be signed in to change notification settings - Fork85
Closes #1858 add json file for NCICTCAEv5 for CV units#2867
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
github-actionsbot commentedSep 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
millerg23 commentedSep 26, 2025
@bundfussr@bms63 please take a look at the JSON file, I have put each line of the case statement in a variable, so JSON file more readable. I then just concatenate them together and put a case statement around it in script |
bundfussr left a comment
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.
Structure looks good to me.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
how is this file created?
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 created it all in xlsx file, then generated the JSON, for the NCICTCAEv6, I will probably take a copy of the NCICTCAEv5 JSON file and edit that.
Below is code I used to read in xlsx and output JSON:
library(readxl)library(jsonlite)library(dplyr)# Define file pathsxls_file_path <- "data-raw/adlb_grading/adlb_grading_spec2.xlsx"json_file_path <- "data-raw/adlb_grading/ncictcaev5_cv.json"ncictcaev5_cv <- read_excel(xls_file_path, sheet = "NCICTCAEv5_CV") %>% filter(!is.na(GRADE_NA_CODE)) %>% select(-GRADE_CRITERIA_CODE) %>% mutate( GRADE_NA_CODE = gsub("[\r\n]", " ", GRADE_NA_CODE), GRADE_1_CODE = gsub("[\r\n]", " ", GRADE_1_CODE), GRADE_2_CODE = gsub("[\r\n]", " ", GRADE_2_CODE), GRADE_3_CODE = gsub("[\r\n]", " ", GRADE_3_CODE), GRADE_4_CODE = gsub("[\r\n]", " ", GRADE_4_CODE) )# Convert the data frame to a JSON stringjson_ncictcaev5 <- toJSON(ncictcaev5_cv, pretty = TRUE)write(json_ncictcaev5, file = json_file_path)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'm wondering is there an easier way to edit the JSON file (not by hand!! ) and not use xlsx anymore?
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.
Maybe we could add some functions to{pharmaverse4devs} which convert the JSON file to csv or xls and back to JSON. Then you could use excel or similar apps for larger edits.
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.
Yeah the idea would be to remove xlsx from our repo, and just maintain the JSON files, but as Stefan suggests you can read the JSON file in, and output in whatever format you prefer, then create a JSON file again.
I split the case statement up, so it is easier to read and update, hence I would just update the JSON file going forward, but appreciate others might want to use a different format to view the information.
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 like the idea of making some functions for this and adding to pharmaverse4devs or maybe even pharmaverseutils since users might be interested?
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.
So the outcome here is the function just lives in the data-raw for now?
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.
@bms63@bundfussr are there any further actions for this? If so, maybe separate issues?
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.
@bms63 , maybe a topic for the deep-dive meeting on Monday?
This comment was marked as resolved.
This comment was marked as resolved.
millerg23 commentedSep 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@bundfussr@bms63 thanks for initial input. I will get JSON files created for existing criteria we have, can maybe have a further QC then. I will then work on NCICTCAEv6, once current criteria organised. |
millerg23 commentedOct 24, 2025
@bms63@bundfussr@manciniedoardo the criteria for CREATININE INCREASED in NCICTCAEv6 causes a slight issue with how we have things set up currently. >1.5 - 3.0 x if baseline is below LLN; >1.5 - 3.0 x ULN This is to create So we need a way to pass in value of "L" or "LOW" to check For me the easiest way to do this, is to replace the argument Maybe worth a discusssion at one of our regular meetings? |
manciniedoardo commentedOct 30, 2025
Discussion from this week's call: team agrees with the breaking change as proposed by@millerg23, especially as the deprecation cycle is quite slow now so the impact will be reduced in the short-medium term. Lab grading vignette should also be updated to explain that this is relevant for v6 only. |
| # avoid having to list {fromJSON} in "Imports" and instead get away with just | ||
| # listing it in "Depends". | ||
| atoxgr_json_to_dataframe <- function(dataset, json_file) { |
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 know this isn't exported and NOT directly made available to the public - but should we write some tests for this? I'm NOT clear on how to do that, but this seems to be a critical function to help us created the ctcae stuff?? WDYT?
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.
@bms63 if you still think this is required, could it be a separate issue?
| readxl::read_excel(sheet = "NCICTCAEv5") %>% | ||
| dplyr::mutate(GRADE_CRITERIA_CODE = gsub("[\r\n]", " ", GRADE_CRITERIA_CODE)) | ||
| ## NCICTCAEv4 for SI units | ||
| json_file_path_v4 <- paste0(json_file_path, "ncictcaev4.json") |
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've been usingfile.path() instread ofpaste0 for stuff like this. Much clearer to me.
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.
Done.
| ## Save metadata for each criteria | ||
| save(atoxgr_criteria_ctcv4, file = paste0(save_file_path, "ctcv4.rda")) |
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.
file.path() for these as well?
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.
Done.
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.
Should there be a new section for the NCICTCAEv5 CV units stuff in the lab grading vignette.
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 am not sure, but would suggest a spearate issue for this.
bms63 commentedNov 7, 2025
What an epic PR@millerg23 !! Looking good. What are you think for the news? We have deprecation, new ctcae info, json as a backbone, possible lab vignette and more!?!? woooo!! |
bms63 commentedNov 18, 2025
Hey@millerg23 - do you think we can finish this one up soon? |
millerg23 commentedDec 3, 2025
@bms63@manciniedoardo I updated lab grading Vignette, would be great of you could review. I also noticed I had missed "Creatinine Clearance decreased", which I have now added. For this lab test I have set grade to be missing when AVAL < 10, I have asked our lab experts in Roche if this is most conservative approach, it doesn't seem right set it to zero when its clearly a very abnormal result. |
bms63 commentedDec 3, 2025
@copilot can you make a grandiose news item for News.md following the News.md convention summarizing the awesomeness of this PR. |
millerg23 commentedDec 4, 2025
@bms63@manciniedoardo@bundfussr did we agree to update ADLB template script to use NCICTCAEv5 instead of NCICTCAEv4? As currently for NCICTCTAEv4 we don't need the input parameters |
manciniedoardo commentedDec 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
from memory we said we'd at least write a comment saying that if you're using version x, you have to make the following changes/use the following arguments etc. |
millerg23 commentedDec 11, 2025
Added a comment in the ADLB template script, also added a bit about Creatinine Increased in Grading Vignette, as this uses |
* Initial plan* Add comprehensive NEWS.md entry for lab grading enhancements (#1858)Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>* Tone down NEWS.md entry - remove grand language and condense contentCo-authored-by: bms63 <10111024+bms63@users.noreply.github.com>---------Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>Co-authored-by: Ben Straub <ben.x.straub@gsk.com>
bms63 commentedDec 11, 2025
I think most of my comments were minor - I'm not super aware of Lab stuff. Should we ask a Lab person to take a look from Roche or GSK to take a look? Probably not the best time with the holidays. |
Uh oh!
There was an error while loading.Please reload this page.
Thank you for your Pull Request! We have developed this task checklist from theDevelopment Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
mainbranch until you have checked off each task.styler::style_file()to style R and Rmd filesinst/cheatsheet/admiral_cheatsheet.pptxand re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.)devtools::document()so all.Rdfiles in themanfolder and theNAMESPACEfile in the project root are updated appropriatelyNEWS.mdunder the header# admiral (development version)if the changes pertain to a user-facing function (i.e. it has an@exporttag) or documentation aimed at users (rather than developers). A Developer Notes section is available inNEWS.mdfor tracking developer-facing issues.pkgdown::build_site()and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.lintr::lint_package()R CMD checklocally and address all errors and warnings -devtools::check()