Exposure dashboard¶
exposure_dashboard.py reads the two files written by exposure extraction, exposure_codes.csv and exposure_extractions.csv, and writes self-contained HTML dashboards that open in any browser with no network connection.
Open the summary demo Module source (exposure_dashboard.py)
Two files with different audiences¶
| File | Written | Contents | Where it belongs |
|---|---|---|---|
exposure_dashboard.html |
Always | Counts only. Participant counts below k (default 5) are held back for cell size | reports/; review in full before sharing |
exposure_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 exposure category, with the ECTO term where one is filled in |
| Coded records | Each matching ICD-10-CM code with its title, 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) |
| ECTO mapping | Every category with its ECTO term, curation status and the note on which term to look up |
| Excerpts | Review file only |
Text candidates include negated and family-history mentions until a reviewer has read them, so the share with a context cue is the first column to check for each pattern.
Running it¶
run_all.py writes the summary to reports/exposure_dashboard.html and, with --with-excerpts, the review file to restricted/. To run it on its own:
python pipeline/exposure_dashboard.py --codes restricted/exposure_codes.csv \
--extractions restricted/exposure_extractions.csv \
--out reports/exposure_dashboard.html --k 5
| Option | Default | Effect |
|---|---|---|
--codes |
./exposure_codes.csv |
Coded matches |
--extractions |
./exposure_extractions.csv |
Text candidates |
--out |
./exposure_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/.
Related pages¶
- Exposure extraction: codes, patterns, ECTO terms and output columns
- Device dashboard: the same layout for equipment
- Participant identifiers: what each output holds