Skip to content

bbiddick7/wi-bed-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wisconsin Psychiatric Bed & Acuity Registry — Prototype

North Bridge Solutions

Clinician bed search

A working prototype of a statewide registry that matches Chapter 51 emergency detention patients to appropriate psychiatric beds in real time, and captures the structured refusal data Wisconsin currently has no way to see.

What's here

  • schema.sql — DuckDB / Postgres schema. Eight tables, four analytics views, reference data seeded inline.
  • seed.py — synthetic data generator. Builds a calibrated 30-day dataset across 25 facilities and 72 counties.
  • app.py — Streamlit prototype with three audiences:
    • Clinician — bed search with structured matching and distance ranking
    • Facility — single-facility inventory + refusal patterns
    • DHS / County — statewide analytics on placement friction and transport burden
  • smoke_test.py — minimal end-to-end test of the schema and views.
  • requirements.txt — Python deps.

Run it

pip install -r requirements.txt
python seed.py           # builds registry.duckdb with 30 days of synthetic data
streamlit run app.py

The matching dimensions

A bed is not just a bed. The registry matches on:

  • Legal status (voluntary, Chapter 51 emergency detention, Chapter 51 final commitment, Chapter 55 protective placement, forensic NGI/IST, minor admission)
  • Age range
  • Acuity (1–5)
  • Medical complexity acceptance
  • Aggression / elopement risk ceiling
  • Substance use co-occurrence acceptance
  • Insurance posture (uninsured, Medicaid, Medicare)
  • Transport distance from county of origin

The analytics views

Each view answers a question Wisconsin currently cannot answer with structured data:

  • v_refusal_patterns — which facilities refuse the most, and why
  • v_county_transport_burden — how far each county's patients actually travel
  • v_placement_friction — refusals per patient before successful placement
  • v_current_bed_inventory — point-in-time bed availability with staleness flagging

Status

Prototype with synthetic data. The synthetic data is calibrated to mirror reported reality (state MHIs run >95% occupancy; northern rural counties show longer transport distances; clinical refusals dominate over capacity refusals).

About

Statewide psychiatric bed and acuity registry prototype for Wisconsin Chapter 51 emergency detention placement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages