This code accompanies the following paper:
Delos Reyes, R., Capurro, D., & Geard, N. (2024). Modelling patient trajectories in emergency department simulations using retrospective patient cohorts. Computers in Biology and Medicine. https://doi.org/10.1016/j.compbiomed.2024.109147
Setting up the environment
- Download anaconda
- Run
conda env create --name edabm -f edabm.yaml
- Run
conda activate edabm
Getting the required data
- Download the following datasets (they require credentialed access which can be requested at the provided websites)
- Store the unzipped datasets inside the data folder
- data/ed
- data/hosp
- data/icu
Preprocessing the data
Open the following Jupyter notebooks in the following order and run all cells:
generate_patient_data.ipynb
# To exclude patient records with invalid valuesgenerate_event_logs.ipynb
# To convert the records to event logsgenerate_model_parameters.ipynb
# To generate the parameters needed to run the ED simulation modelgenerate_mci_frequency.ipynb
# To generate modified parameters for experiment 3 (mass casualty incident scenarios)
Running the experiments
- Run
chmod u+x ./run.sh
- Run
./run.sh
Generating the figures
Open the following Jupyter notebooks and run all cells:
plot_results_exp1.ipynb
plot_results_exp2.ipynb
plot_results_exp3.ipynb
plot_results_supplementary.ipynb