Skip to content

nhsengland/AmbModelOpen

Repository files navigation

Amb-Model-Open

NHS England Digital Analytics and Research Team (DART)

About the Project

status: experimental

This repository holds code for AmbModelOpen: A discrete event simulation of ambulance resources. The methodological approach and project specifics can be seen in the MkDocs documentation.

Project Stucture

  • The main code is found in the src folder
  • More information about the code usage can be found in the model card
  • Documentation is created by MkDocs (publicly hosted at nhsengland.github.io/AmbModelOpen/) or can be locally loaded as follows
    • Open Anaconda Prompt
    • Navigate to main repository folder (local) with cd {my_relative_path/.../AmbModel}
    • Install mkdocs pip install mkdocs
    • Install material:
      • pip install mkdocs-material
      • extension for reading xls tables: pip install mkdocs-table-reader-plugin ; pip install openpyxl
    • Type mkdocs serve
    • This will provide a locally hosted html link of the sort http://xxx.x.x:8000/ . Copy and open in browser.
    • The install steps can be skipped in further loads

Built With

R v3.6.1

Getting Started

Installation

To get a local copy up and running follow these simple steps.

To clone the repo:

git clone https://github.com/nhsengland/ambmodelopen

Launch the ambsim.Rproj file in a suitable IDE (e.g. RStudio).

The required packages are stored in src/packages.R.

Usage

RSimmer generates entities to follow set trajectories. The entities in this case are patients requiring emergency transport to an emergency department whilst the trajectory covers the ambulance allocation, transportation and handover to the emergency department. Both generator and trajectory are defined in src/trajectories. The trajectory can be viewed using the library simmer.plot and the command plot(patient) if the trajectory is run outside of it's funtion.

The main run of the model is controlled by main.R which defines the simulation configuration and any static or scenario input parameters. The model can be run over a grid of scenarios for nreps number of replications.

Post processing visualisations and saving of outputs then finishes the run with outputs saved to the Output folder (gitignored). Example outputs can be found in the example_output folder. The folder src_processminingviz includes an additional script that uses process mining package bupaR to enable visualisation of the event logs created, including some key metrics.

Datasets

The main data sources used in this work are the Computer Aided Dispatch (CAD) System to inform job cycle times of ambulances and a linkage with the Emergency Care Data Set (ECDS) to address handover.

Roadmap

See the Issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidance.

License

Unless stated otherwise, the codebase is released under the MIT Licence. This covers both the codebase and any sample code in the documentation.

See LICENSE for more information.

The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.

Contact

To find out more about DART and Data Science at NHS England visit the Data Science Signposting Website or get in touch at datascience@nhs.net.