# jcckwong/progrxn-bca architecture

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

- Interactive diagram: https://gitdiagram.com/jcckwong/progrxn-bca
- Repository: https://github.com/jcckwong/progrxn-bca

## Overview

PROGRxN-BCa is a Streamlit clinical risk-assessment app for non-muscle-invasive bladder cancer. The main patient workflow is to accept the disclaimer, enter and encode clinicopathological features, score them with the trained survival model, and view individualized progression-risk estimates alongside similar-patient outcomes. A separate researcher workflow provides a CSV template, data dictionary, and quality checks; the sampled validation page directs researchers to contact the study team rather than implementing validation metrics. The graph reflects sampled page behavior and documented capabilities; model artifacts are shown as inputs, not inspected internals.

Main entry points: [`pages/1_Use PROGRxN-BCa.py`](https://github.com/jcckwong/progrxn-bca/blob/main/pages/1_Use%20PROGRxN-BCa.py) (Patient input), [`Disclaimer.py`](https://github.com/jcckwong/progrxn-bca/blob/main/Disclaimer.py) (Disclaimer gate), [`model/risk scores.csv`](https://github.com/jcckwong/progrxn-bca/blob/main/model/risk%20scores.csv) (Cohort risk scores), [`pages/3_Validate PROGRxN-BCa (for researchers).py`](https://github.com/jcckwong/progrxn-bca/blob/main/pages/3_Validate%20PROGRxN-BCa%20(for%20researchers).py) (Cohort quality check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["App access"]
  node_disclaimer["Disclaimer gate<br/>[Disclaimer.py]"]
end

subgraph group_prediction["Risk prediction"]
  node_patient_form["Patient input"]
  node_model["Trained model<br/>[model.gz]"]
  node_risk_scores["Cohort risk scores<br/>[risk scores.csv]"]
  node_risk_results["Risk results"]
end

subgraph group_research["Research validation"]
  node_template_check["Cohort quality check"]
  node_data_dictionary["Data dictionary<br/>[dictionary.csv]"]
end

subgraph group_context["Study information"]
  node_about["Study information"]
end

node_user(("App user"))

node_user -->|"opens app"| node_disclaimer
node_disclaimer -->|"switches page"| node_patient_form
node_user -->|"enters features"| node_patient_form
node_patient_form -->|"loads and scores"| node_model
node_patient_form -->|"loads cohort scores"| node_risk_scores
node_patient_form -->|"renders estimates"| node_risk_results
node_risk_scores -->|"supplies comparators"| node_risk_results
node_user -->|"uploads cohort"| node_template_check
node_template_check -->|"reads definitions"| node_data_dictionary
node_user -->|"views study details"| node_about

click node_disclaimer "https://github.com/jcckwong/progrxn-bca/blob/main/Disclaimer.py"
click node_patient_form "https://github.com/jcckwong/progrxn-bca/blob/main/pages/1_Use%20PROGRxN-BCa.py"
click node_model "https://github.com/jcckwong/progrxn-bca/blob/main/model/model.gz"
click node_risk_scores "https://github.com/jcckwong/progrxn-bca/blob/main/model/risk%20scores.csv"
click node_risk_results "https://github.com/jcckwong/progrxn-bca/blob/main/pages/1_Use%20PROGRxN-BCa.py"
click node_template_check "https://github.com/jcckwong/progrxn-bca/blob/main/pages/3_Validate%20PROGRxN-BCa%20(for%20researchers).py"
click node_data_dictionary "https://github.com/jcckwong/progrxn-bca/blob/main/dictionary/dictionary.csv"
click node_about "https://github.com/jcckwong/progrxn-bca/blob/main/pages/2_About%20PROGRxN-BCa.py"

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_disclaimer,node_user toneBlue
class node_patient_form,node_model,node_risk_scores,node_risk_results toneAmber
class node_template_check,node_data_dictionary toneMint
class node_about toneRose
```

## Components

### App access

- [Disclaimer gate](https://github.com/jcckwong/progrxn-bca/blob/main/Disclaimer.py): `Disclaimer.py`

### Risk prediction

- [Patient input](https://github.com/jcckwong/progrxn-bca/blob/main/pages/1_Use%20PROGRxN-BCa.py): `pages/1_Use PROGRxN-BCa.py`
- [Trained model](https://github.com/jcckwong/progrxn-bca/blob/main/model/model.gz): `model/model.gz`
- [Cohort risk scores](https://github.com/jcckwong/progrxn-bca/blob/main/model/risk%20scores.csv): `model/risk scores.csv`
- [Risk results](https://github.com/jcckwong/progrxn-bca/blob/main/pages/1_Use%20PROGRxN-BCa.py): `pages/1_Use PROGRxN-BCa.py`

### Research validation

- [Cohort quality check](https://github.com/jcckwong/progrxn-bca/blob/main/pages/3_Validate%20PROGRxN-BCa%20(for%20researchers).py): `pages/3_Validate PROGRxN-BCa (for researchers).py`
- [Data dictionary](https://github.com/jcckwong/progrxn-bca/blob/main/dictionary/dictionary.csv): `dictionary/dictionary.csv`

### Study information

- [Study information](https://github.com/jcckwong/progrxn-bca/blob/main/pages/2_About%20PROGRxN-BCa.py): `pages/2_About PROGRxN-BCa.py`

### Other components

- **App user**

## Connections

- App user → Disclaimer gate: opens app (evidence: `Disclaimer.py`)
- Disclaimer gate → Patient input: switches page (evidence: `Disclaimer.py`)
- App user → Patient input: enters features (evidence: `pages/1_Use PROGRxN-BCa.py`)
- Patient input → Trained model: loads and scores (evidence: `pages/1_Use PROGRxN-BCa.py`)
- Patient input → Cohort risk scores: loads cohort scores (evidence: `pages/1_Use PROGRxN-BCa.py`)
- Patient input → Risk results: renders estimates (evidence: `pages/1_Use PROGRxN-BCa.py`)
- Cohort risk scores → Risk results: supplies comparators (evidence: `pages/1_Use PROGRxN-BCa.py`)
- App user → Cohort quality check: uploads cohort (evidence: `pages/3_Validate PROGRxN-BCa (for researchers).py`)
- Cohort quality check → Data dictionary: reads definitions (evidence: `pages/3_Validate PROGRxN-BCa (for researchers).py`)
- App user → Study information: views study details (evidence: `pages/2_About PROGRxN-BCa.py`)
