Skip to content

Device dashboard

device_dashboard.py reads the two files written by device extraction, device_codes.csv and device_extractions.csv, and writes self-contained HTML dashboards that open in any browser with no network connection.

Open the summary demo Module source (device_dashboard.py)

Two files with different audiences

File Written Contents Where it belongs
device_dashboard.html Always Counts only. Participant counts below k (default 5) are held back for cell size reports/; review in full before sharing
device_dashboard_review.html Only with --with-excerpts Everything above plus up to three masked excerpts per text pattern, each from a different participant restricted/; stays with the review team

Excerpts have dates, long numbers, phone numbers and email addresses masked. Names and other free text can remain.

Tabs

Tab What it shows
By category Participants with a coded record, a text candidate, or either, for each equipment category. A participant counts once per category however many records mention it.
Coded records Each matching HCPCS, CPT or SNOMED CT code with its label, category and participant count
Text patterns Each text pattern with its category, participant and candidate counts, and the share of candidates with a context cue (possible negation, family history, uncertainty or history)
Excerpts Review file only

Coded and text evidence are counted separately because records from a health system's EHR often lack orders filled by outside DME suppliers. A category with text candidates and no codes is common, and an absence of codes is not an absence of equipment.

Running it

run_all.py writes the summary to reports/device_dashboard.html and, with --with-excerpts, the review file to restricted/. To run it on its own:

python pipeline/device_dashboard.py --codes restricted/device_codes.csv \
    --extractions restricted/device_extractions.csv \
    --out reports/device_dashboard.html --k 5
Option Default Effect
--codes ./device_codes.csv Coded matches
--extractions ./device_extractions.csv Text candidates
--out ./device_dashboard.html Summary file; the review file is written next to it
--k 5 Smallest participant count that is shown
--cohort-name ALS registry cohort Name in the header
--with-excerpts off Also write the restricted review file

When the review file is written next to the summary, move it into restricted/.