# rcpch/npdar architecture

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

- Interactive diagram: https://gitdiagram.com/rcpch/npdar
- Repository: https://github.com/rcpch/npdar

## Overview

npdar is an R package of utilities for National Paediatric Diabetes Audit analysis. Analysts use its functions to assess blood pressure, protect small-count data, summarise longitudinal records and categorical measures, identify audit periods, and visualise correlations. The README documents these capabilities and their outputs, but no source excerpts were provided, so the graph shows only documented analyst-to-function use and does not infer internal calls or data flow.

Main entry points: [`R/bp_family.R`](https://github.com/rcpch/npdar/blob/master/R/bp_family.R) (BP assessment), [`R/get_masked.R`](https://github.com/rcpch/npdar/blob/master/R/get_masked.R) (Privacy masking), [`R/get_ultimate.R`](https://github.com/rcpch/npdar/blob/master/R/get_ultimate.R) (Longitudinal selection), [`R/get_frequency.R`](https://github.com/rcpch/npdar/blob/master/R/get_frequency.R) (Categorical frequencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bp["Blood Pressure"]
  node_bp_assess["BP assessment<br/>[bp_family.R]"]
  node_bp_parts["BP component functions<br/>[bp_family.R]"]
end

subgraph group_stats["Statistical Utilities"]
  node_masking["Privacy masking<br/>[get_masked.R]"]
  node_ultimate["Longitudinal selection<br/>[get_ultimate.R]"]
  node_frequency["Categorical frequencies<br/>[get_frequency.R]"]
end

subgraph group_audit["Audit Periods"]
  node_audit_year["Audit year identification"]
end

subgraph group_visual["Visualisation"]
  node_correlation["Correlation visualisation<br/>[plot_corr_matrix.R]"]
end

node_analyst(("Analyst"))

node_analyst -->|"assesses BP"| node_bp_assess
node_analyst -->|"computes BP measures"| node_bp_parts
node_analyst -->|"masks counts"| node_masking
node_analyst -->|"selects values"| node_ultimate
node_analyst -->|"summarises categories"| node_frequency
node_analyst -->|"identifies periods"| node_audit_year
node_analyst -->|"visualises correlations"| node_correlation

click node_bp_assess "https://github.com/rcpch/npdar/blob/master/R/bp_family.R"
click node_bp_parts "https://github.com/rcpch/npdar/blob/master/R/bp_family.R"
click node_masking "https://github.com/rcpch/npdar/blob/master/R/get_masked.R"
click node_ultimate "https://github.com/rcpch/npdar/blob/master/R/get_ultimate.R"
click node_frequency "https://github.com/rcpch/npdar/blob/master/R/get_frequency.R"
click node_audit_year "https://github.com/rcpch/npdar/blob/master/R/audit_year_family.R"
click node_correlation "https://github.com/rcpch/npdar/blob/master/R/plot_corr_matrix.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_bp_assess,node_bp_parts toneBlue
class node_masking,node_ultimate,node_frequency toneAmber
class node_audit_year toneMint
class node_correlation toneRose
class node_analyst toneIndigo
```

## Components

### Blood Pressure

- [BP assessment](https://github.com/rcpch/npdar/blob/master/R/bp_family.R): `R/bp_family.R`
- [BP component functions](https://github.com/rcpch/npdar/blob/master/R/bp_family.R): `R/bp_family.R`

### Statistical Utilities

- [Privacy masking](https://github.com/rcpch/npdar/blob/master/R/get_masked.R): `R/get_masked.R`
- [Longitudinal selection](https://github.com/rcpch/npdar/blob/master/R/get_ultimate.R): `R/get_ultimate.R`
- [Categorical frequencies](https://github.com/rcpch/npdar/blob/master/R/get_frequency.R): `R/get_frequency.R`

### Audit Periods

- [Audit year identification](https://github.com/rcpch/npdar/blob/master/R/audit_year_family.R): `R/audit_year_family.R`

### Visualisation

- [Correlation visualisation](https://github.com/rcpch/npdar/blob/master/R/plot_corr_matrix.R): `R/plot_corr_matrix.R`

### Other components

- **Analyst**

## Connections

- Analyst → BP assessment: assesses BP (evidence: `README.md`)
- Analyst → BP component functions: computes BP measures (evidence: `README.md`)
- Analyst → Privacy masking: masks counts (evidence: `README.md`)
- Analyst → Longitudinal selection: selects values (evidence: `README.md`)
- Analyst → Categorical frequencies: summarises categories (evidence: `README.md`)
- Analyst → Audit year identification: identifies periods (evidence: `README.md`)
- Analyst → Correlation visualisation: visualises correlations (evidence: `README.md`)
