# GLP-1 Safety Atlas

A pharmacovigilance portfolio application using **real public FAERS reports**, actual product-label records and primary published research. No synthetic patient records or substitute counts.

## What is included

- Interactive reporting dashboard for semaglutide, tirzepatide and liraglutide.
- Drug role, reported sex and seriousness filters; receipt-month trends, reported reaction terms, individual report inspection and CSV export.
- Data quality assessment with missingness, report versions and duplicate-flag limitations.
- Twenty-one exploratory reporting odds ratios with 95% confidence intervals and transparent contingency counts, against the full same-period FAERS background.
- Semaglutide–gastric emptying investigation, source-linked clinical evidence and current label context.
- Eight sensitivity definitions: suspect exposure, alternative backgrounds, country, seriousness and monthly receipt periods.
- Three full-text reviews of real published clinical cases.
- Structured targeted literature search, fourteen candidate decisions and nine included publications, including null findings.
- Reproducible acquisition pipeline, source manifest, analysis protocol and validation checks.

The three selected ingredients are not the whole GLP-1 class. Tirzepatide is a dual GIP/GLP-1 receptor agonist. Results are reporting patterns, not incidence, confirmed causality or comparative medicine safety.

## Run locally

Requires Python 3.11+ and an internet connection for the initial extraction. The acquisition pipeline uses the system curl executable and Python standard library; the dashboard has no external JavaScript dependencies.

```sh
python3 pipeline/build.py
python3 pipeline/enhance.py
python3 pipeline/assessment.py
python3 -m unittest discover -s tests -v
python3 -m http.server 8765 --directory dist --bind 127.0.0.1
```

Open http://127.0.0.1:8765. The checked-in public snapshot can be served without rerunning acquisition. Run through HTTP, rather than double-clicking index.html.

## Reproducibility

The initial snapshot covers initial FDA receipt from **1 January to 31 March 2025**. Every API request has a recorded URL, retrieval timestamp, source update date and SHA-256 checksum in `dist/data/manifest.json`. Original response payloads are retained under `data/raw/` locally and excluded from source control. The public normalized snapshot, counts and provenance are included in the repository and source download.

Cached requests are reused. To refresh, move the existing `data/raw` directory aside and rerun the pipeline. Do not mix old and new queries; validation rejects inconsistent update dates and count discrepancies. The fixed date period can still change with follow-ups and source corrections. Archived raw payloads are needed for bit-for-bit reconstruction of a historical snapshot; re-querying later is not guaranteed to reproduce it.

## Analytical choices

The unit is the public report ID. Descriptive processing retains the highest available version per ID. Different report IDs can still refer to the same clinical case. The FDA duplicate flag is preserved; the project does not claim validated cross-ID deduplication.

The baseline ROR uses any reported role and same-period API counts. Eight sensitivity definitions are separately documented on their own page. Dashboard filters do not change the ROR. The background includes all matching public FDA reports, not just the selected ingredients. Multi-drug co-occurrence does not prove attribution. Exact reaction terms do not represent validated diagnoses or grouped MedDRA queries.

See [analysis protocol](docs/PROTOCOL.md), [safety assessment](docs/ASSESSMENT.md), [portfolio case study](docs/CASE_STUDY.md) and the app's Methods & sources view.

## Skills demonstrated

Public safety-data retrieval; drug-name mapping; structured-report inspection; data quality assessment; exploratory disproportionality analysis; targeted primary-literature appraisal; safety assessment writing; reproducible analysis; interactive visualization.

This is independent portfolio work, not professional case processing, a regulatory submission, a complete literature review or a validated PV production system. Users should be able to explain the analytical choices and limitations before listing these skills.

## Data and sources

[openFDA adverse event documentation](https://open.fda.gov/apis/drug/event/), [openFDA labeling](https://open.fda.gov/apis/drug/label/), [FDA data terms](https://open.fda.gov/terms/), [EMA GVP](https://www.ema.europa.eu/en/human-regulatory-overview/post-authorisation/pharmacovigilance-post-authorisation/good-pharmacovigilance-practices-gvp).

Published literature is cited and briefly paraphrased; full journal articles are not redistributed. FDA labels in this snapshot reflect retrieved product-listing submissions, which may differ from currently distributed or FDA-approved labeling. Label dates may be later than the report period and cannot establish historical listedness.

## Cloudflare deployment

The static site is deployed to Cloudflare Pages as `glp1-safety-atlas`. Output is `dist/`; no server runtime or API key is required by visitors. After regenerating the documents and source download and completing validation, deploy with Wrangler 4.148.0:

```sh
wrangler pages deploy dist --project-name glp1-safety-atlas --branch main --commit-dirty=true
```

This project was created directly on Pages; subsequent deployments reuse the existing Pages project. Cloudflare account credentials remain in the user's normal Wrangler configuration and are excluded from the repository and downloadable source. The public bundle contains normalized public FDA data and brief cited literature appraisals; raw journal full texts and acquisition caches are excluded.
