Skip to content

Enhancement: Custom naming and per-study-type selection for Partial Interval Calculations #1463

Description

@Gero1999

Description

The Partial Interval Calculations section (Parameter Selection tab) lets users define partial-AUC and related interval parameters (AUCINT, CAVGINT, RCAMINT, FREXINT, ...). Today each row has only three fields: Parameter, Start, End, and the interval is:

  1. always named with the standard auto-generated pattern (PPTESTCD_<start>-<end>, e.g. AUCINT_0-24), with no way to give it a meaningful label; and
  2. always calculated for every study type in the dataset, with no way to restrict it (e.g. compute a urine FREXINT interval only for Excretion Data).

This makes results harder to read and forces irrelevant calculations.

Proposed change

Extend each partial-interval row with two optional fields:

  1. Custom name — optional free-text label. When provided, it replaces the standard PPTESTCD_<start>-<end> name in the user-facing outputs (results table, descriptive statistics, plots, and ratio-parameter options). When empty, the current standard naming is kept. The underlying PKNCA parameter and CDISC PPTESTCD used for the actual calculation are unchanged.
  2. Study type — restrict which study type the interval is calculated for. Choices are All (default, current behaviour) plus each study type detected in the loaded data (via detect_study_types()). Selecting a specific type calculates that partial interval only for groups of that type. To target several specific types, add one row per type.

Both fields must round-trip through the settings YAML and the exported R script, so saved/restored settings and generated scripts reproduce the same intervals.

Affected areas

  • inst/shiny/modules/tab_nca/setup/settings.Rint_parameters schema (new custom_name, study_type columns), table columns, edit observers, help text, settings serialize/restore
  • R/intervals.Rupdate_main_intervals(): carry custom_name onto interval rows; filter each manual interval by study_type
  • Naming sites: R/utils.R (rename_interval_params), R/label_operators.R (add_label_attribute), R/pivot_wider_pknca_results.R, and ratio-parameter options
  • inst/www/templates/settings_template.yaml and inst/www/templates/script_template.R
  • R/zzz.R globalVariables if needed
  • Tests under tests/testthat/

Definition of Done

  • Each partial-interval row has optional Custom name and Study type fields in the UI
  • Custom name (when set) is used in results, descriptive stats, plots, and ratio options; empty falls back to the standard name
  • Study type restricts calculation to matching groups; All keeps current behaviour
  • Both fields are saved to and restored from the settings YAML
  • Both fields appear in and drive the exported R script
  • Backward compatible with existing settings files that lack the new columns
  • New logic covered by unit tests; NEWS + version bump

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions