Skip to content

[Review view] SDTM Phase 3: Shiny app integration#1330

Draft
Gero1999 wants to merge 1 commit into
mainfrom
sdtm-phase3-shiny-integration
Draft

[Review view] SDTM Phase 3: Shiny app integration#1330
Gero1999 wants to merge 1 commit into
mainfrom
sdtm-phase3-shiny-integration

Conversation

@Gero1999

Copy link
Copy Markdown
Collaborator

⚠️ Review-only PR — do not merge

This is a review view into the SDTM changes from #1318. It isolates the Shiny app integration for focused code review. The actual merge will happen via #1318.

Depends on Phase 1 (#1328) and Phase 2 (#1329).

Scope

Upload step (data_upload.R)

  • ADNCA/SDTM radio toggle
  • SDTM mode: 3 file inputs — PC (required), EX (required), subject-level (optional, multi-file merged by STUDYID+USUBJID)
  • Default SDTM example data (pc_example, ex_example, dm_example) loaded when no files uploaded
  • Settings restore switches the radio toggle
  • Extracted helpers: .read_sdtm_domain(), .read_subject_level_files(), .build_sdtm_result()

Mapping step (data_mapping.R)

  • SDTM-specific mapping panel with 4 sections: SDTM General, PC Concentrations, EX Dosing, Supplemental Variables
  • All SDTM input IDs prefixed with sdtm_ to avoid collisions with 6 shared ADNCA variable names
  • Panel visibility via shinyjs::hidden()/toggle() (not conditionalPanel)
  • SDTM processing: renames columns → calls sdtm_to_PKNCAdata() → stores PKNCAdata → returns conc data for filtering
  • Extracted helpers: .populate_adnca_inputs(), .populate_sdtm_inputs(), .get_adnca_metabolite_selection()

NCA pipeline (tab_data.R)

  • pknca_data reactive branches on mode: SDTM retrieves PKNCAdata from mapping step; ADNCA uses existing pipeline

Export (zip-utils.R)

  • SDTM mode exports PC/EX/DM as separate RDS files
  • Uses script_template_sdtm.R with column mapping applied from session settings

Settings (nca_setup.R, get_session_code.R)

  • Settings YAML includes input_mode and sdtm_metabolites
  • get_settings_code() auto-selects template based on input_mode

Files changed

File Change
inst/shiny/modules/tab_data/data_upload.R +309 lines — SDTM upload path, helpers
inst/shiny/modules/tab_data/data_mapping.R +478 lines — SDTM mapping panel, helpers
inst/shiny/modules/tab_data.R +36 lines — orchestration
inst/shiny/functions/zip-utils.R +31 lines — SDTM export
inst/www/templates/script_template_sdtm.R +120 lines — new template
R/get_session_code.R +16 lines — template selection
inst/shiny/modules/tab_nca/nca_setup.R +6 lines — settings payload
.lintr template exclusion

What to review

  • Upload flow: file validation, error handling, settings restore
  • Mapping panel: input ID collision avoidance (sdtm_ prefix), column rename logic
  • Data flow: sdtm_raw → mapping → sdtm_to_PKNCAdata() → filtering → NCA
  • Export: separate RDS files, script template with mapping
  • Edge cases: missing DM, partial uploads, metabolite selection

- Upload step: ADNCA/SDTM radio toggle, separate file inputs for
  PC (required), EX (required), subject-level (optional multi-file)
- Mapping step: SDTM-specific panel with sections (SDTM General,
  PC Concentrations, EX Dosing, Supplemental Variables)
- NCA pipeline: SDTM path calls sdtm_to_PKNCAdata() at mapping step
- Export: SDTM mode exports PC/EX/DM as separate RDS files with
  dedicated script template applying column mapping
- Settings: records input_mode and sdtm_metabolites
- Default SDTM example data loaded when no files uploaded

Co-authored-by: Ona <no-reply@ona.com>
@Gero1999 Gero1999 mentioned this pull request May 27, 2026
17 tasks
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.

1 participant