How It Was Built · Diagnosis & Flu Explorer

The Diagnosis & Flu Explorer is an interactive app: a visitor picks a facility, month, age group and diagnosis category, and gets that facility's top diagnoses, month-over-month changes and a flu-season view compared with real CDC data. Behind it is the same tested pipeline as every project in this portfolio. The full source is in the public repository on GitHub.

1. Sources

Two very different inputs, which is the point:

No Results

The visit data has realistic structure: each facility type (emergency, urgent care, family medicine, pediatrics, internal medicine, community health center) has its own diagnosis mix and age mix, and each diagnosis has its own seasonality: flu in winter, allergies in spring, injuries in summer, school physicals in July and August, immunizations in the fall.

2. Cleaning diagnosis codes

Real EHR extracts store the same ICD-10 code several ways: J11.1, j11.1, J111, J11.1. Staging normalizes every code (trim, upper-case, restore the decimal after the third character) and only then checks it against the reference table. Formatting problems are fixed and kept; codes that are missing or still not valid after cleanup are set aside and counted. Duplicates, unknown facilities and impossible dates are flagged the same way. Every row ends with exactly one dq_status, and a test fails the run if more than 2% of rows are rejected.

3. Lining up internal and public data

CDC reports flu by MMWR epidemiological week (Sunday to Saturday, numbered YYYYWW). The fetch script converts each epiweek to its starting Sunday, and the staging model buckets every visit into the same Sunday-start week, so the facility's weekly flu share and Georgia's ILI rate join on a shared calendar. Flu seasons are assigned October through September by each week's mid-week date, so the partial weeks at the edges land in the right season.

If the CDC source can't be reached, the fetch step writes an empty file instead of failing, the pipeline still publishes, and the app shows a "CDC data unavailable" note for that refresh.

4. Models

No Results

Flu alert baseline. For each facility: mean off-season (June to September) weekly flu share plus two standard deviations, with a 1% floor so a few sporadic summer cases can't trigger it. This is the same approach CDC uses to define the start and end of a flu season, and it produces 17 to 22 alert weeks per season, in line with a typical real season.

5. Tests

29 tests run on this project alone: unique and not-null keys, relationships from every visit to a valid facility and a valid ICD-10 code, accepted values on every status, unique grains on every rollup (including a check that each facility-month has exactly one diagnosis at each rank), 0-to-1 range checks on every share, and the 2% rejection threshold.

6. The app

The last pipeline step exports the marts to a single compact JSON file (about 240 KB). The app is one static HTML page that loads it and does all filtering, ranking and month-over-month math in the browser, so it loads instantly, needs no server, and costs nothing to host. Charts are hand-built SVG with hover and keyboard tooltips; the color palette was checked for colorblind-safe separation.