Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
millerg23 wants to merge39 commits intomain
base:main
Choose a base branch
Loading
from1858_ncictcaev6

Conversation

@millerg23
Copy link
Collaborator

@millerg23millerg23 commentedSep 26, 2025
edited
Loading

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 themain branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to thetidyverse style guide. Runstyler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - SeeUnit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow thedeprecation guidance?
  • Review theCheat Sheet. Make any required updates to it by editing the fileinst/cheatsheet/admiral_cheatsheet.pptx and 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.)
  • Update to all relevant roxygen headers and examples, including keywords and families. Refer to thecategorization of functions to tag appropriate keyword/family.
  • Rundevtools::document() so all.Rd files in theman folder and theNAMESPACE file in the project root are updated appropriately
  • Address any updates needed for vignettes and/or templates
  • UpdateNEWS.md under the header# admiral (development version) if the changes pertain to a user-facing function (i.e. it has an@export tag) or documentation aimed at users (rather than developers). A Developer Notes section is available inNEWS.md for tracking developer-facing issues.
  • Build admiral sitepkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Address or fix all lintr warnings and errors -lintr::lint_package()
  • RunR CMD check locally and address all errors and warnings -devtools::check()
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@github-actions
Copy link

github-actionsbot commentedSep 26, 2025
edited
Loading

Code Coverage

PackageLine RateHealth
admiral100%
Summary100% (5738 / 5751)

@millerg23
Copy link
CollaboratorAuthor

@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 scriptatoxgr_sources.
So we would have a JSON file for each set of criteria. Let me know what you think, and then I can do the rest, including NCICTCAEv6.

Copy link
Collaborator

@bundfussrbundfussr left a 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.

millerg23 reacted with thumbs up emoji
Copy link
Collaborator

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?

Copy link
CollaboratorAuthor

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)

Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
CollaboratorAuthor

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.

Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
CollaboratorAuthor

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?

Copy link
Collaborator

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?

@bms63

This comment was marked as resolved.

@millerg23
Copy link
CollaboratorAuthor

millerg23 commentedSep 30, 2025
edited
Loading

@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.
@bms63 regarding the work around handling the JSON files, can I leave that to you, to create appropriate tickets, as this can be an additional, separate piece of work.
I have found editting the JSON files directly quite easy, for ERRORs found I just updated the JSON file, I didn't go back to the xlslx file for edits.

@millerg23
Copy link
CollaboratorAuthor

@bms63@bundfussr@manciniedoardo the criteria for CREATININE INCREASED in NCICTCAEv6 causes a slight issue with how we have things set up currently.
For Grade 2 we have the following (its similar for grade 3).

>1.5 - 3.0 x if baseline is below LLN; >1.5 - 3.0 x ULN

This is to createATOXGRH derivation, so we would normally pass in "H" or "HIGH" for the input parameterabnormal_indicator, as normally for ATOXGRH we would look atupper limit of normal (and for ATOXGRL we would look atlower limit of normal).

So we need a way to pass in value of "L" or "LOW" to checkBNRIND against for ATOXGRH.

For me the easiest way to do this, is to replace the argumentabnormal_indicator inderive_var_atoxgr_dir with 2 arguments,low_indicator andhigh_indicator, but this would break backward compatibility.
The change is only required if you are using NCICTCAEv6 criteria.

Maybe worth a discusssion at one of our regular meetings?

@bundfussrbundfussr linked an issueOct 27, 2025 that may beclosed by this pull request
@manciniedoardo
Copy link
Collaborator

@bms63@bundfussr@manciniedoardo the criteria for CREATININE INCREASED in NCICTCAEv6 causes a slight issue with how we have things set up currently. For Grade 2 we have the following (its similar for grade 3).

>1.5 - 3.0 x if baseline is below LLN; >1.5 - 3.0 x ULN

This is to createATOXGRH derivation, so we would normally pass in "H" or "HIGH" for the input parameterabnormal_indicator, as normally for ATOXGRH we would look atupper limit of normal (and for ATOXGRL we would look atlower limit of normal).

So we need a way to pass in value of "L" or "LOW" to checkBNRIND against for ATOXGRH.

For me the easiest way to do this, is to replace the argumentabnormal_indicator inderive_var_atoxgr_dir with 2 arguments,low_indicator andhigh_indicator, but this would break backward compatibility. The change is only required if you are using NCICTCAEv6 criteria.

Maybe worth a discusssion at one of our regular meetings?

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) {
Copy link
Collaborator

@bms63bms63Nov 7, 2025
edited
Loading

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?

Copy link
CollaboratorAuthor

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")
Copy link
Collaborator

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.

Copy link
CollaboratorAuthor

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"))
Copy link
Collaborator

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?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

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.

Copy link
CollaboratorAuthor

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.

@bms63bms63 changed the title1858 add json file for NCICTCAEv5 for CV unitsCloses #1858 add json file for NCICTCAEv5 for CV unitsNov 7, 2025
@bms63
Copy link
Collaborator

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
Copy link
Collaborator

Hey@millerg23 - do you think we can finish this one up soon?

@millerg23
Copy link
CollaboratorAuthor

@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 I need to update the NEWS page, but if you want to do it, please go ahead, you will make it sound more grand than me!! Not a problem though if you don't have time.

@bms63
Copy link
Collaborator

@copilot can you make a grandiose news item for News.md following the News.md convention summarizing the awesomeness of this PR.

Copilot reacted with eyes emoji

Copy link
Contributor

CopilotAI commentedDec 3, 2025

@bms63 I've opened a new pull request,#2914, to work on those changes. Once the pull request is ready, I'll request review from you.

@millerg23
Copy link
CollaboratorAuthor

@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 parametershigh_indicator,low_indicator (or previouslyabnormal indicator

@manciniedoardo
Copy link
Collaborator

manciniedoardo commentedDec 4, 2025
edited
Loading

@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 parametershigh_indicator,low_indicator (or previouslyabnormal indicator

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
Copy link
CollaboratorAuthor

@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 parametershigh_indicator,low_indicator (or previouslyabnormal indicator

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.

Added a comment in the ADLB template script, also added a bit about Creatinine Increased in Grading Vignette, as this usesBNRIND also.
Let me know if any other updates required.

* 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
Copy link
Collaborator

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bms63bms63bms63 left review comments

@bundfussrbundfussrbundfussr left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

General Issue: Investigate CTCAE v6

5 participants

@millerg23@bms63@manciniedoardo@bundfussr

[8]ページ先頭

©2009-2025 Movatter.jp