# zarathucorp/opencdisc architecture

> Architecture diagram of the GitHub repository zarathucorp/opencdisc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zarathucorp/opencdisc
- Repository: https://github.com/zarathucorp/opencdisc

## Overview

openCDISC is a Shiny application for exploring ADaM-like clinical-trial data and producing custom tables and figures. Its user-facing capabilities include data upload and filtering, table generation, population-level plots, and individual-patient exploration; the README highlights Kaplan–Meier, line, heatmap, box, and spaghetti plots. The graph preserves these distinct stages and the application shell. Source excerpts are limited to browser-side table-builder behavior, so most R-module connections are shown as unverified rather than asserted as inspected call paths.

Main entry points: [`R/mod_popExp.R`](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp.R) (Population explorer), [`R/mod_shiny_data_filter.R`](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_shiny_data_filter.R) (Data filtering), [`R/mod_tableGen.R`](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen.R) (Table generator), [`R/mod_indvExpPat.R`](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPat.R) (Patient timeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_shell["Shiny app shell<br/>[app_ui.R]"]
  node_server["App server<br/>[app_server.R]"]
end

subgraph group_data["Data workflow"]
  node_upload["Data upload<br/>[mod_dataUpload.R]"]
  node_select["Data selection<br/>[mod_selectData.R]"]
  node_filter["Data filtering"]
  node_comply["Data compliance<br/>[mod_dataComply.R]"]
end

subgraph group_tables["Table generation"]
  node_tablegen["Table generator<br/>[mod_tableGen.R]"]
  node_tableui["Table builder UI<br/>[mod_tableGen_ui.R]"]
  node_tablefuncs["Table statistics"]
  node_recipes["Table recipes<br/>[recipe.js]"]
end

subgraph group_population["Population exploration"]
  node_pop["Population explorer<br/>[mod_popExp.R]"]
  node_km["Kaplan–Meier<br/>[mod_popExp_km.R]"]
  node_heatmap["Correlation heatmap"]
  node_boxplot["Box plots"]
  node_lineplot["Line plots<br/>[mod_popExp_line.R]"]
  node_scatter["Scatter plots"]
  node_spaghetti["Spaghetti plots"]
end

subgraph group_individual["Individual exploration"]
  node_individual["Individual explorer<br/>[mod_indvExp_srv.R]"]
  node_patient["Patient timeline<br/>[mod_indvExpPat.R]"]
  node_events["Patient events"]
  node_visits["Patient visits"]
end

node_user(("Analyst"))

node_user -.->|"uses"| node_shell
node_shell -.->|"dispatches"| node_server
node_user -.->|"provides data"| node_upload
node_upload -.->|"makes available"| node_select
node_select -.->|"filters data"| node_filter
node_filter -.->|"supplies data"| node_tablegen
node_filter -.->|"supplies data"| node_pop
node_filter -.->|"supplies data"| node_individual
node_tablegen -.->|"presents builder"| node_tableui
node_tableui -->|"uses recipes"| node_recipes
node_tablegen -.->|"uses statistics"| node_tablefuncs
node_pop -.->|"offers analysis"| node_km
node_pop -.->|"offers analysis"| node_heatmap
node_pop -.->|"offers analysis"| node_boxplot
node_pop -.->|"offers analysis"| node_lineplot
node_pop -.->|"offers analysis"| node_scatter
node_pop -.->|"offers analysis"| node_spaghetti
node_individual -.->|"explores patients"| node_patient
node_patient -.->|"shows events"| node_events
node_patient -.->|"shows visits"| node_visits

click node_shell "https://github.com/zarathucorp/opencdisc/blob/main/R/app_ui.R"
click node_server "https://github.com/zarathucorp/opencdisc/blob/main/R/app_server.R"
click node_upload "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_dataUpload.R"
click node_select "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_selectData.R"
click node_filter "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_shiny_data_filter.R"
click node_comply "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_dataComply.R"
click node_tablegen "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen.R"
click node_tableui "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen_ui.R"
click node_tablefuncs "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen_fct_methods.R"
click node_recipes "https://github.com/zarathucorp/opencdisc/blob/main/inst/app/www/recipe.js"
click node_pop "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp.R"
click node_km "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_km.R"
click node_heatmap "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_heatCorr.R"
click node_boxplot "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_boxplot.R"
click node_lineplot "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_line.R"
click node_scatter "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_scatter.R"
click node_spaghetti "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_spaghetti.R"
click node_individual "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExp_srv.R"
click node_patient "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPat.R"
click node_events "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPatEvents.R"
click node_visits "https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPatVisits.R"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shell,node_server toneBlue
class node_upload,node_select,node_filter,node_comply toneAmber
class node_tablegen,node_tableui,node_tablefuncs,node_recipes toneMint
class node_pop,node_km,node_heatmap,node_boxplot,node_lineplot,node_scatter,node_spaghetti toneRose
class node_individual,node_patient,node_events,node_visits,node_user toneIndigo
```

## Components

### Application

- [Shiny app shell](https://github.com/zarathucorp/opencdisc/blob/main/R/app_ui.R): `R/app_ui.R`
- [App server](https://github.com/zarathucorp/opencdisc/blob/main/R/app_server.R): `R/app_server.R`

### Data workflow

- [Data upload](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_dataUpload.R): `R/mod_dataUpload.R`
- [Data selection](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_selectData.R): `R/mod_selectData.R`
- [Data filtering](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_shiny_data_filter.R): `R/mod_shiny_data_filter.R`
- [Data compliance](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_dataComply.R): `R/mod_dataComply.R`

### Table generation

- [Table generator](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen.R): `R/mod_tableGen.R`
- [Table builder UI](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen_ui.R): `R/mod_tableGen_ui.R`
- [Table statistics](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_tableGen_fct_methods.R): `R/mod_tableGen_fct_methods.R`
- [Table recipes](https://github.com/zarathucorp/opencdisc/blob/main/inst/app/www/recipe.js): `inst/app/www/recipe.js`

### Population exploration

- [Population explorer](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp.R): `R/mod_popExp.R`
- [Kaplan–Meier](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_km.R): `R/mod_popExp_km.R`
- [Correlation heatmap](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_heatCorr.R): `R/mod_popExp_heatCorr.R`
- [Box plots](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_boxplot.R): `R/mod_popExp_boxplot.R`
- [Line plots](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_line.R): `R/mod_popExp_line.R`
- [Scatter plots](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_scatter.R): `R/mod_popExp_scatter.R`
- [Spaghetti plots](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_popExp_spaghetti.R): `R/mod_popExp_spaghetti.R`

### Individual exploration

- [Individual explorer](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExp_srv.R): `R/mod_indvExp_srv.R`
- [Patient timeline](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPat.R): `R/mod_indvExpPat.R`
- [Patient events](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPatEvents.R): `R/mod_indvExpPatEvents.R`
- [Patient visits](https://github.com/zarathucorp/opencdisc/blob/main/R/mod_indvExpPatVisits.R): `R/mod_indvExpPatVisits.R`

### Other components

- **Analyst**

## Connections

- Analyst → Shiny app shell: uses
- Shiny app shell → App server: dispatches
- Analyst → Data upload: provides data
- Data upload → Data selection: makes available
- Data selection → Data filtering: filters data
- Data filtering → Table generator: supplies data
- Data filtering → Population explorer: supplies data
- Data filtering → Individual explorer: supplies data
- Table generator → Table builder UI: presents builder
- Table builder UI → Table recipes: uses recipes (evidence: `inst/app/www/recipe.js`)
- Table generator → Table statistics: uses statistics
- Population explorer → Kaplan–Meier: offers analysis
- Population explorer → Correlation heatmap: offers analysis
- Population explorer → Box plots: offers analysis
- Population explorer → Line plots: offers analysis
- Population explorer → Scatter plots: offers analysis
- Population explorer → Spaghetti plots: offers analysis
- Individual explorer → Patient timeline: explores patients
- Patient timeline → Patient events: shows events
- Patient timeline → Patient visits: shows visits
