# morioh/pharma-payments-prescription architecture

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

- Interactive diagram: https://gitdiagram.com/morioh/pharma-payments-prescription
- Repository: https://github.com/morioh/pharma-payments-prescription

## Overview

This repository is a CMS data-preprocessing and research project, not a complete analysis application. Its documented workflow loads 2024 Open Payments and Medicare Part D CSVs from Google Cloud Storage into PySpark RDDs, removes headers and malformed NPIs, then saves processed RDDs back to storage. The README also describes planned analyses of payment and prescribing patterns; joining and analysis are future work, not an implemented workflow. The notebook is listed but its contents were not excerpted, so edges reflect README documentation only.

Main entry points: [`notebooks/01_load_data.ipynb`](https://github.com/morioh/pharma-payments-prescription/blob/main/notebooks/01_load_data.ipynb) (Load and preprocess), [`README.md`](https://github.com/morioh/pharma-payments-prescription/blob/main/README.md) (Research questions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["CMS datasets"]
  node_payments["Open Payments CSV"]
  node_prescriptions["Part D CSV"]
end

subgraph group_processing["RDD preprocessing"]
  node_notebook["Load and preprocess<br/>[01_load_data.ipynb]"]
  node_processed_payments[("Processed payments")]
  node_processed_prescriptions[("Processed prescriptions")]
end

subgraph group_research["Research goals"]
  node_planned_analysis["Planned join and analysis<br/>[README.md]"]
  node_research_questions["Research questions<br/>[README.md]"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs"| node_notebook
node_payments -->|"loads"| node_notebook
node_prescriptions -->|"loads"| node_notebook
node_notebook -->|"saves"| node_processed_payments
node_notebook -->|"saves"| node_processed_prescriptions
node_research_questions -.->|"guides"| node_planned_analysis

click node_notebook "https://github.com/morioh/pharma-payments-prescription/blob/main/notebooks/01_load_data.ipynb"
click node_planned_analysis "https://github.com/morioh/pharma-payments-prescription/blob/main/README.md"
click node_research_questions "https://github.com/morioh/pharma-payments-prescription/blob/main/README.md"

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_payments,node_prescriptions toneBlue
class node_notebook,node_processed_payments,node_processed_prescriptions toneAmber
class node_planned_analysis,node_research_questions toneMint
class node_researcher toneIndigo
```

## Components

### CMS datasets

- **Open Payments CSV**
- **Part D CSV**

### RDD preprocessing

- [Load and preprocess](https://github.com/morioh/pharma-payments-prescription/blob/main/notebooks/01_load_data.ipynb): `notebooks/01_load_data.ipynb`
- **Processed payments**
- **Processed prescriptions**

### Research goals

- [Planned join and analysis](https://github.com/morioh/pharma-payments-prescription/blob/main/README.md): `README.md`
- [Research questions](https://github.com/morioh/pharma-payments-prescription/blob/main/README.md): `README.md`

### Other components

- **Researcher**

## Connections

- Researcher → Load and preprocess: runs (evidence: `README.md`)
- Open Payments CSV → Load and preprocess: loads (evidence: `README.md`)
- Part D CSV → Load and preprocess: loads (evidence: `README.md`)
- Load and preprocess → Processed payments: saves (evidence: `README.md`)
- Load and preprocess → Processed prescriptions: saves (evidence: `README.md`)
- Research questions → Planned join and analysis: guides (evidence: `README.md`)
