Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hospital Service Area Optimization and Climate–Health Analysis

License: MIT Python 3.8+

Code and public/synthetic data accompanying the GeoHealth manuscript on delineating hospital service areas (HSAs) when patient residence data are unavailable. The workflow combines facility locations and patient volumes, gridded population, administrative boundaries, satellite climate products, probabilistic population allocation, and climate–health models.

The publication analysis uses the version 7 INF-FOOTPRINT configuration. Version 6 is the original greedy solution; version 7 adds anchor promotion/demotion quality control; version 8 additionally creates satellite-bubble boundaries. HSA_FINAL.ipynb generates all three boundary bundles so that downstream sensitivity analyses can select a version explicitly.

Public data and privacy

The repository contains only:

  • synthetic patient datasets whose names begin with SYNMODINF_ or SYNMODNCD_;
  • public administrative boundary files;
  • public WorldPop population rasters;
  • public calendar, reporting-gap, sanitation, and derived HSA-metadata tables.

Real patient data are not included. .gitignore blocks filenames beginning with data/INF_ or data/NCD_, credentials, generated outputs, and unlisted notebooks. The synthetic files reproduce the pipeline structure and selected statistical properties but must not be used as substitutes for real outcome data in substantive epidemiological inference.

Repository contents

Jordan-hsa-optimization/
├── data/
│   ├── SYNMODINF_*.csv
│   ├── SYNMODNCD_*.csv
│   ├── adm_boundaries/*.gpkg
│   ├── jordan_boundary.gpkg
│   ├── jordan_governorates.gpkg
│   ├── jor_ppp_2020_UNadj.tif
│   ├── jor_ppp_2020_constrained.tif
│   ├── jmp_2025_jordan_governorate.csv
│   ├── hsa_metadata.csv
│   ├── jordan_islamic_calendar.csv
│   └── reporting_gaps.csv
├── dlnm/
│   ├── __init__.py
│   └── dlnm_crossbasis.py
├── out/.gitkeep
├── HSA_FINAL.ipynb
├── Population_Allocation_Probabilistic_v2.ipynb
├── GEE_local_Climate_Features_by_Facilities.ipynb
├── GEE_local_HSA_Weekly_Climate_Lagged.ipynb
├── GEE_local_HSA_Weekly_Climate_Lagged_chunked.ipynb
├── GEE_local_HSA_Daily_Climate.ipynb
├── Generate_Modeling_Dataset.ipynb
├── Generate_Daily_Modeling_Dataset.ipynb
├── run_climate_health_modeling.ipynb
├── run_dlnm_primary_sensitivity.py
├── run_pipeline.py
├── 08_climate_ar_decomposition.py … 16_within_hsa_heterogeneity.py
├── supporting Python modules
├── requirements.txt
├── DATA_FLOW_ANALYSIS.md
└── SETUP_INSTRUCTIONS.md

out/ is intentionally empty in Git except for .gitkeep; all generated boundaries, intermediate panels, model results, figures, and run metadata are written there.

Installation

git clone https://github.com/izaslavsky/Jordan-hsa-optimization.git
cd Jordan-hsa-optimization
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Earth Engine and Google Drive setup is described in SETUP_INSTRUCTIONS.md.

Reproducing the workflow

The workflow has two phases because Earth Engine exports require an authenticated, interactive step.

Phase 1: facility climate, HSA delineation, and population allocation

  1. Run GEE_local_Climate_Features_by_Facilities.ipynb and save its CSV in out/.
  2. Run the first two local pipeline steps:
python run_pipeline.py \
  --network SYNMODINF \
  --hsa-mode footprint \
  --boundary-version v7 \
  --disease-focus diarrheal \
  --only-steps 1,2

HSA_FINAL.ipynb writes versioned HSA boundary bundles; population allocation then assigns each population cell to one admissible HSA using the gravity model.

Phase 2: HSA climate, weekly models, and the daily modeling panel

  1. Run GEE_local_HSA_Weekly_Climate_Lagged.ipynb and GEE_local_HSA_Daily_Climate.ipynb for the selected boundary version. Use the chunked weekly notebook if an Earth Engine export exceeds memory limits.
  2. Run the remaining local pipeline steps:
python run_pipeline.py \
  --network SYNMODINF \
  --hsa-mode footprint \
  --boundary-version v7 \
  --disease-focus diarrheal \
  --study-start 2022-07-01 \
  --study-end 2024-01-31 \
  --week-start 2019-01-07 \
  --week-end 2024-01-29 \
  --ml-start-date 2022-06-27 \
  --ml-end-date 2024-01-29 \
  --only-steps 3,4,5

Publication DLNM

The manuscript-reported daily explanatory analysis is generated by the standalone reproducibility runner, not by an HSA-specific forecasting notebook:

python run_dlnm_primary_sensitivity.py

It fits:

  • a primary quasi-Poisson distributed-lag non-linear model using all 19 v7 INF-FOOTPRINT HSAs; and
  • a sensitivity model retaining the nine HSAs with a mean of at least one diarrheal visit per day.

The primary cohort fixes the precipitation spline knots, the median nonzero reference, the 90th-percentile nonzero contrast, and representative sanitation values used in both analyses. Machine-readable outputs are written to out/modeling/daily_dlnm_primary_sensitivity_v7/.

Main algorithm and modeling components

  • HSA construction: multi-objective greedy facility selection balancing coverage, facility volume, accessibility, spatial overlap, and climatic diversity.
  • Version 7 refinement: iterative anchor promotion/demotion and replacement while preserving the population-coverage target.
  • Population allocation: gravity-based cell allocation with distance/radius admissibility and major-facility safeguards.
  • Weekly evaluation: autoregressive and seasonal baselines, climate-augmented models, anomaly models, and sensitivity analyses.
  • Daily explanatory evaluation: a 0–14-day precipitation cross-basis with sanitation effect modification, following the distributed-lag non-linear modeling framework.

See DATA_FLOW_ANALYSIS.md for exact inputs and outputs at each step.

Citation

@software{zaslavsky_jordan_hsa_optimization_2026,
  author = {Zaslavsky, Ilya},
  title  = {Hospital Service Area Optimization and Climate--Health Analysis},
  year   = {2026},
  url    = {https://github.com/izaslavsky/Jordan-hsa-optimization}
}

License

MIT License; see LICENSE.

About

Optimizing Hospital Service Area (HSA) delineation in Jordan using population-weighted greedy algorithms with climate-informed facility selection

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages