Health Data Tool

Thai HospSearch

A geospatial drill-down navigator that unifies Thailand's scattered hospital, school, and village codes with the province → district → subdistrict administrative hierarchy — in one map, instead of several incompatible government portals.

Live App Health Data Public Health
Open Live App ↗
Thai HospSearch geospatial drill-down map of administrative and facility codes
Problem

Thailand's healthcare administrative data is scattered across incompatible registries: the Ministry of Public Health's facility-code system, school and village code registries, and the standard province/district/subdistrict area-code hierarchy — each queryable only through separate, non-interoperable government portals with no shared geospatial view. Cross-referencing a facility against its administrative area, or finding everything within a district, meant working across several disconnected lookups by hand.

Approach

Facility, school, and village codes are pulled from their respective Ministry of Public Health sources and normalized against a standard province/amphoe/tambon reference dataset, so every record resolves cleanly through the full hierarchy: region → province → district → subdistrict → facility. Direct lookup by raw area code is also supported.

The geospatial layer is a Leaflet.js drill-down map across four polygon layers (health regions, provinces, districts, subdistricts) — clicking a region loads its child polygons, with code and name tooltips on hover. The whole thing runs serverless: all source data is preprocessed into a single SQLite database at build time and queried entirely client-side in-browser via a WebAssembly SQLite engine, with no backend server involved.

Outcome

A live, publicly deployed personal utility rather than a one-off demo, covering tens of thousands of facility, school, and village records across all of Thailand's provinces and districts. The underlying dataset refreshes on a recurring schedule to stay current with source registries.

~44,000
Health facility / office records
~9,000
Subdistricts covered
~1,000
Districts covered
Tech Stack
Leaflet.js SQLite (client-side, WASM) Python (pandas) HTML / CSS / JavaScript Vercel