Skip to content

feat: add dose-normalised summary slides to PPT/QMD export (#1054)#1229

Open
bachapman wants to merge 16 commits intomainfrom
1054-enhancement/dose-norm-slides
Open

feat: add dose-normalised summary slides to PPT/QMD export (#1054)#1229
bachapman wants to merge 16 commits intomainfrom
1054-enhancement/dose-norm-slides

Conversation

@bachapman
Copy link
Copy Markdown
Collaborator

@bachapman bachapman commented Apr 16, 2026

Issue

Closes #1054

Description

Adds opt-in dose-normalised summary slides to the PPT/QMD export. Each dose group gains a Dose-Normalised Plot & Statistics slide showing a dose-normalised mean concentration-time plot alongside a summary statistics table (filtered to user-selected dose-norm parameters).

Key changes:

  • get_dose_esc_results() extended with dose_norm_parameters argument; computes dose_norm_meanplot and dose_norm_statistics per group using existing exploration_meanplot(..., line_type = "dose-normalized") and calculate_summary_stats() helpers
  • New Dose-normalised parameters virtual selector in the Customise Slides modal, grouped by parameter type (Concentration / AUC / AUMC), defaulting to CMAXD, AUCLSTD, AUCIFOD when available in the current run
  • Validation gates on whether dose-norm parameters are available — no spurious error when dose-norm params were not computed
  • Renders through both PPTX (officer-utils.R) and QMD (quarto-utils.R) export paths

Definition of Done

  • Dose-Normalised Plot & Statistics section appears in the Summary Slides tree of the Customise Slides modal
  • Dose-normalised parameters selector shows grouped choices and defaults to CMAXD / AUCLSTD / AUCIFOD
  • Exported PPTX and QMD each contain a dose-norm slide per group when the section is selected
  • No validation error fires when the NCA run does not include dose-norm parameters

How to test

  1. Run NCA with at least one dose-normalised parameter (e.g. CMAXD, AUCLSTD, AUCIFOD) selected
  2. Open Save Results → Export, enable slides, click Customise Slides
  3. Confirm Dose-Normalised Plot & Statistics appears under Summary Slides; tick it
  4. Confirm the Dose-normalised parameters selector appears, defaults to CMAXD/AUCLSTD/AUCIFOD, and groups choices by Concentration / AUC / AUMC
  5. Clear all selections from the Dose-normalised parameters selector — confirm a validation error appears and the Export button is disabled
  6. Export as PPTX — verify a dose-norm plot + stats slide is present for each group
  7. Export as QMD — verify the .qmd references dose_norm_meanplot and dose_norm_statistics
  8. Deselect the section, re-export — confirm dose-norm slides are absent
  9. Run NCA without dose-norm parameters — open Customise Slides and confirm no validation error appears

Contributor checklist

  • Code passes lintr checks
  • Code passes all unit tests
  • New logic covered by unit tests
  • New logic is documented
  • App or package changes are reflected in NEWS
  • Package version is incremented
  • R script works with the new implementation (if applicable)
  • Settings upload works with the new implementation (if applicable)
  • If any .scss change was done, run data-raw/compile_css.R

- Replace two `calculate_summary_stats()` calls with a single `all_stats_i`
  computation filtered twice into `stats_i` and `dose_norm_stats_i`
- Add missing `@param dose_norm_parameters` to `get_dose_esc_results()` roxygen
- Remove extra alignment spaces on `dose_norm_meanplot =` in output list
Add .add_pptx_dose_norm_slide() helper, wire it into .add_pptx_group_summary(),
extend .add_pptx_ind_slides() with dose_norm_ind_params support, and update
has_summary guard in .process_pptx_group_slides(). NULL guards ensure backward
compat with group data that lacks the new fields.
Extract .add_pptx_one_ind_slide() and .add_pptx_dose_norm_ind_slides()
from .add_pptx_ind_slides() to bring cyclomatic complexity from 23 to 15.
Extract .add_qmd_dose_norm_summary_slide(), .add_qmd_dose_norm_ind_slides(),
and .qmd_active_groups() helpers so that .add_qmd_summary_slides(),
.add_qmd_ind_slides(), and create_qmd_dose_slides() each stay within the
cyclocomp limit of 15.
- Gate dose-norm validation on available choices being non-empty so the
  error does not fire when no dose-norm parameters were computed in the run
- Add dose_norm_available_rv reactiveVal to persist available codes for
  the slide_validation reactive
- Group dose-norm parameter choices by unit_type (conc_dosenorm,
  auc_dosenorm, aumc_dosenorm) using .dose_norm_param_choices()
- Match virtualSelectInput styling (width, tags, descriptions) to the
  other three parameter selectors; remove dropboxWrapper
- Rename slide sections: "Dose-Normalised Plot & Statistics" (summary)
  and "Dose-Normalised Plots & Parameters" (individual) to better reflect
  content shown (#1054)
Dose-normalised individual slides (per-subject plots and parameter
tables) are out of scope for #1054. Remove ind_dose_norm_params and
ind_dose_norm_plots from the results builder, rendering helpers, and
slide tree. Only the summary-level dose-normalised plot + statistics
slide is retained.

Also rename virtual selector group labels to human-readable strings:
conc_dosenorm -> "Concentration (Dose Norm.)"
auc_dosenorm  -> "AUC (Dose Norm.)"
aumc_dosenorm -> "AUMC (Dose Norm.)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Dose normalised slides for the PPT

1 participant