Intern Project
Healthcare Associated Infection Simulator
Fred McElwee spent two months this autumn exploring how to model healthcare associated infections.
Background
Healthcare associated infections (HAIs), also known as hospital or healthcare acquired infections, can develop either as a direct result of healthcare interventions such as medical or surgical treatment, or from being in contact with a healthcare setting. HAIs pose a serious risk to patients, staff and visitors. They can cause significant morbidity to those infected and incur significant costs for the NHS. As a result, infection prevention and control are a key priority for the NHS.
It is expensive, time consuming and often impractical to conduct trials on policies and interventions. Fred was challenged with creating a cost-effective way to assess the effect of different interventions in the spread of hospital acquired infections.
Developing a hospital acquired infection simulator
The first step was to model or simulate the spread of an infection within a hospital. Fred decided to use GAMA Platform, an open-source development environment for GAML, an agent-based modelling language.
Agent based modelling simulates the actions and interactions of agents (individual and/or collective entities) to understand the behaviour of a system. Due to the complexity of the hospital setting, agent-based modelling is an effective method of simulating the spread of infection within a healthcare system.
Using GAMA, Fred created a simulator that models the movement of people (agents) within a hospital and the spread of an infection amongst them, with an output of the number of infected people and the level of infectivity of each room within the hospital. The simulator can test different interventions, such as masking policies, to evaluate their effectiveness in reducing the spread of HAIs and to evaluate their cost-benefit.
The hospital acquired infection simulator was developed in 5 stages:
- Creating a 3D model of a hospital
- Modelling the behaviour of people in a hospital
- Modelling the spread of an infection in a hospital
- Bringing everything together to create a HAI simulator
- Using the HAI simulator to evaluate strategies to reduce HAIs
Creating a 3D model of a hospital
Shapefile shape format (.shp) files can be in uploaded into GAMA to give information about the place you are trying to simulate. A shapefile is a geospatial vector data storage format for storing the location, shape and attributes of geographic features.
Shapefiles for the hospital floorplan and walls, hospital beds, benches and lifts were created in QGIS, an open source geographic information system (GIS) software.
Modelling the behaviour of people in a hospital
The programming language used in GAMA is GAML – a cross between object-oriented programming languages (such as Java) and agent based modelling languages (such as Netlogo).
Agents:
- Nurses
- Doctors
- Administrators
- Porters
- Patients
- Visitors
Behaviours:
- Shift times (specified start and finish times plus randomness of an hour either side of the time)
- Using the toilet
- Waiting in a waiting room
- Getting a lift from one floor to another
- Undergoing a procedure
- Transporting a patient in a hospital bed
Modelling the spread of an infection in a hospital
The most common hospital HAIs in the UK include those caused by Methicillin-Resistant Staphylococcus Aureus (MRSA) and Clostridium difficile (C. difficile). To model the spread of these, three modes of infection were incorporated into the model:
- Close contact between people
- Aerosol transmission within a room
- Touching surfaces (e.g door handles)
Bringing everything together to create a HAI simulator
Fred’s HAI simulator is made up of 3 elements:
- GAMA files (.gml) with all the code that defines the simulator
- QGIS file where the shapes that make up the healthcare provider building(s) such floorplans, benches and lifts are defined
- A user interface (displayed in the image below)
- Left pane: An interactive dashboard for adjusting simulator parameters (e.g. number of infected people at start of simulation)
- Middle pane: A 2D reconstruction of what is being modelled, people moving (different colour different role), red blob when they get infected, yellow blob when they are exposed and blue blob when they are recovering
- Top right pane: A graph with number of people infected (y-axis) over time (x-axis) both overall and by mode of infection
- Bottom right pane: A heatmap of the infectivity of a room which is determined by the number of infected people in the room and the area of the room
Using the HAI simulator to evaluate strategies to reduce HAIs
One of the main aims of the project was to be able to evaluate interventions on their ability to reduce HAIs in a cost-effective manner.
Fred explored evaluating the efficacy of mandatory mask wearing on reducing healthcare associated infections. To this end, Fred created mask wearing parameters which can be adjusted in the user interface as toggles. These parameters include defining which agents (doctors, nurses e.t.c.) are mandated to wear masks (True/False toggles) and by how much the infectivity by aerosol transmission and close contact is reduced when an agent is wearing a mask (as a percentage).
To be able to compare two different scenarios defined by different parameters, the HAI simulator is able to run two simulations with different parameters in parallel to compare the spread of infection over time. In the video below, the user defines the parameters for two scenarios, one with no mandatory mask wearing and one with mandatory mask wearing for doctors, nurses, inpatients, outpatients, cleaners and visitors where infection by aerosol transmission or close contact by mask wearing is set as being reduced by 95%. The user then starts the simulation with 5 infected people and after 14 hours (under 2 minutes of simulation time) the number of infected people is reduced by 18% where mandatory mask wearing was implemented.
2022-11-17 09-57-21-2.mp4
No Description
To use the HAI simulator to assess the cost-benefit of implementing HAI reduction strategies, Fred used his health economist background to develop an incremental cost-effectiveness chart. This new feature allows repeat simulations to be performed for multiple individual strategies with unique pre-defined parameters. The average number of infected people at the end of the simulations is used to calculate the incremental cost and incremental Quality-Adjusted Life Years (QALYs) displayed on the chart.
The incremental cost (y-axis) represents the change in cost (the cost of the strategy implementation plus the number of infected people multiplied by the cost of each agent being ill) caused by a strategy. The incremental QALYs (x-axis) represents the change in disease burden (the number of infected people multiplied by a value from 0-1 representing the percentage decrease in quality of life of each agent when infected) caused by a strategy.
In the below screenshot, the cost effectiveness for 3 different strategies with 500 simulations is represented. The lower the incremental cost and the higher the incremental QALYs (closer to zero) the better the strategy.
Final presentation
At the end of the two months Fred presented his progress to HDI and his presentation and demo can be seen in the video below.
Internship2022_HAI_finalpresentation_compiled.mp4
No Description
Future plans
Calibration of the model using real-world data is the next step with the aim of informing real-world decisions in the healthcare setting. Important necessary real-world data includes:
- Behavioural data (i.e. people movement) to accurately model the events that can potentially lead to infection transmission over time
- Infection models for each of the common infection species to accurately model the spread of infection over time
- Costings (i.e. staff salary, equipment) to accurately simulate and compare the cost-benefit of different implementation strategies
Individual HAI simulators are required for each healthcare provider (i.e. hospital) using their unique floorplans and relevant infrastructure (doors, lifts, benches etc.); the number of each type of agent (doctors, nurses, inpatients etc.) and information on regular behaviours (shifts, visiting hours etc.).
In addition, the ability to accurately reproduce a real-world healthcare-associated infection event would assist in confirming the validity of the HAI simulator.