Skip to content

MESuRS-Lab/BloodPaTH

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BloodPaTH : Bloodborne Pathogens Transmission in Hospitals

Introduction

The BloodPaTh package allows the investigation of bloodborne pathogens transmission within healthcare settings using longitudinal retrospective data. The main function BloodPaTH_model() is an agent-based model (coded in C++) that simulates :

  • i. the movements of patients between wards within the hospital,
  • ii. the dynamics of medical devices (contamination, use and reuse of devices as well as the variation of sterile devices availability), and
  • iii. the dynamics of pathogen transmission in patients undergoing different types of invasive procedures (following an SEI model).

More details about the model are available in An agent-based model to simulate the transmission dynamics of bloodborne pathogens within hospitals.

Installation

The BloodPaTH package can be installed in two ways :

  • 1. Installing the latest release (recommended) : Simply run the following command line within your R session :
devtools::install_github("phenriot/BloodPaTH")
  • 2. Choosing your release version : After downloading the BloodPaTH_0.x.tar.gz file, install it in your R environment using the following command line:
tools::Rcmd("INSTALL BloodPaTH_0.x.tar.gz")

NB : You will need te following packages to proceed : tools, devtools, truncnorm, mc2d, RcppArmadillo, Rcpp ($\geq$ 1.0.12)

How does it work (v0.2-alpha) ?

List of model parameters

  • time_step : time-step (must be expressed in hours; example : if time step is 1 minute, inform 1/60) | type = float
  • t : simulation time (must be expressed in hours; example : if simulation time is 1 year, inform 24*365 = 8,760) | type = float
  • pathogen : bloodborne pathogen type (must be "HCV", "HBV" or "custom"; if "custom" then the parameter dist_risk needs to be informed; The "HIV" option is coming soon) | type = string
  • min_e_phase : minimum value of the eclipse phase (must be expressed in hours) | type = float
  • max_e_phase : maximum value of the eclipse phase (must be expressed in hours) | type = float
  • nb_patients : number of patients | type = integer
  • nb_wards : number of wards within the healthcare setting | type = integer
  • nb_adm : number of admission routes (i.e, most of the time the number of departments) | type = integer
  • adm_prob : probability of admission in each of the admission route (must be the same size as nb_adm ; this vector needs to sum to 1) | type = float vector
  • init_prob : probability of first admission in each of the wards depending on the admission route. (matrix of size nb_adm * nb_wards) | type = float matrix
  • prev_type : you can either inform a prevalence at the admission route level ("admission route") or at a ward level ("ward") | type = string
  • prev_init : prevalences upon admission (if prev_type = "admission route", it needs to be the same size as nb_adm ; if prev_type = "ward", it needs to be the same size as nb_wards) | type = float vector
  • WT_matrix : merged transition matrices for all admission routes; the list_to_combined_matrices R function helps to convert a list of transition matrices as follows → list_to_combined_matrices(input = your_list, type = 1, nb_wards = nb_wards) . Transition matrices must be of size (nb_wards+1) * (nb_wards+1) (i.e, include an extra row and an extra column for the "discharged" event) | type = float matrix
  • nb_procedures : number of procedure types performed within the healthcare setting (must include the "no procedure event"; example : if there are 10 different types of procedures perfomed within the hospital then inform 10+1 = 11) | type = integer
  • procedure_names : vector of procedure names | type = string vector
  • nb_devices : number of different device types used within the healthcare setting | type = integer
  • device_names : vector of device names | type = string vector
  • nb_devices_new : initial number of new sterile devices in each ward; matrix of size nb_wards * nb_devices | type = integer matrix
  • nb_devices_used : initial number of non-sterile devices (previously used) in each ward; matrix of size nb_wards * nb_devices | type = integer matrix
  • nb_devices_contaminated : initial number of non-sterile and contaminated devices in each ward; matrix of size nb_wards * nb_devices | type = integer matrix
  • refill_quantities : quantity of devices to add to the pool of sterile devices for each type at each refill event; matrix of size nb_wards * nb_devices | type = integer matrix
  • refill_freq : refill frequency for each type of device in each ward (must be expressed in hours); matrix of size nb_wards * nb_devices | type = integer matrix
  • table_procedures_devices : correspondence table between procedures (first column) and devices (second column). Its size depend on the number of associations between procedures and devices (example : if you have 2 types of procedures and 3 types of devices, if each type of device is used during each type of procedure, the table will have 2*3=6 rows and will be → matrix(data = c(1,1,1,2,1,3,2,1,2,2,2,3), ncol = 2,byrow = T,dimnames = list(c(),c('ID procedure','ID device'))) ) | type = integer matrix
  • sterilization_prob : efficient sterilization probability for each type of device (might evolve to a matrix of ward-specific probabilities in the future) | type = float vector
  • PPM_matrix : merged matrices of probabilities of undergoing different procedures (columns) within each ward (rows); the list_to_combined_matrices R function helps to convert a list of probability matrices as follows → list_to_combined_matrices(input = your_list, type = 2, nb_procedures = nb_procedures) . These probability matrices must be of size nb_wards * nb_procedures | type = float matrix
  • dist_risk : parameters of the distributions of the of risk of getting infected for each of the procedures. The first three columns correspond to the values of the parameters of these distributions and the fourth to the name of these distributions (log-normal : "lnorm", gaussian :"norm" or PERT : "pert"). Only the two first columns are used for the log-normal and normal distributions (for $\mu$ and $\sigma^2$); all columns are used for the PERT distribution (for $a$, $b$ and $c$). This data frame needs to have nb_procedures rows; the last corresponds to the risk of getting infected when undergoing no procedure (which is 0), then it can be defined as something like → rbind(your_dist_risk_data_frame,c(0,0,NA,"lnorm")) | type = data frame
  • intervention : should an intervention occur to reduce the burden of infections ? Can either be "none", "upon-admission" or "ward-level". The upon-admission intervention corresponds to a systematic screening of patients upon-admission at the healthcare setting level with a probability of prob_screening. The ward-level intervention corresponds to a systematic screening of patients entering for the first time the most at risk wards (defined with the parameter at_risk_wards) with a probabilty of prob_screening. For each case, the probability of efficient sterilization for devices used on positive screened patients is set to 1. | type = string
  • prob_screening : probability of patient screening upon-admission at a healthcare setting or ward level. | type = float
  • at_risk_wards : vector of the most at risk wards (i.e, wards in which we want to set an intervention); the wards needs to be informed as integers, corresponding to their rank (or ID). | type = integer vector
  • output : should the output be "simple" or "detailed" (the second option is not implemented yet). | type = string
  • id_sim : simulation ID; this is used to facilitate replication of results and to make baseline and intervention scenarios comparable. If you are running multiple simulations, you will need to inform this parameter with the simulation number to allow replication. | type = integer

Model output (simple)

  • incidence : gives the incidence at each time-step at a setting level for the baseline scenario. | type = integer vector
  • incidence_intervention : gives the incidence at each time-step at a setting level if an intervention is implemented (incidence = incidence_intervention if intervention = "none"). | type = integer vector
  • susceptible_patients : gives the number of susceptible patients at each time step a setting level. | type = integer vector
  • susceptible_patients_intervention : gives the number of susceptible patients at each time step a setting level if an intervention is implemented (susceptible_patients = susceptible_patients_intervention if intervention = "none"). | type = integer vector
  • wards_events = ...
  • wards_events_intervention = ...
  • wards_susceptible = ...
  • wards_susceptible_intervention = ...
  • contaminated_devices = ...
  • contaminated_devices_intervention = ...
  • used_devices = ...
  • used_devices_intervention = ...
  • infection_events_devices=...
  • infection_events_devices_intervention=...
  • count_patients_hospital=...
  • newly_admitted_patients=...
  • count_admissions_wards=...
  • count_tests=...
  • newly_contaminated_patients=...
  • newly_contaminated_patients_intervention=...

Model output (detailed)

... Coming soon ...

Visualisation of the results

... Coming soon ...

NB: This package is an alpha version and is still under development. A Shiny app is currently being developped.

Application

You will find an application of the model within the Application folder.

The model_application_example.R file allows you to understand what are the parameters of the model and to use it to investigate the spread of HCV in a synthetic healthcare setting (see below).

To run the code you will need to download the Data example folder, in which you will find synthetic data :

  • List_Transition_Matrices.rds : An RDS file containing a list of 2 transition matrices between wards of size 29x29
  • List_Proc_Prob_Matrices.rds : An RDS file containing a list of 2 matrices of probabilites of undergoing a set of procedures while being hospitalized in each of the wards (size : 28x10)
  • association_devices_procedures.csv : A CSV file summarising the association between devices (column 'ID_devices') and procedures (column 'ID_procedures')
  • risk_dist.csv : A CSV file detailing the parameters of the distribution of the risk of getting infected for each type of procedure

NB: You will have to change the path when loading the data within you R session.

Analyses_PlosCompBiol_paper.R is the R file summarising all the analyses performed to obtain the results presented in An agent-based model to simulate the transmission dynamics of bloodborne pathogens within hospitals. Unfortunately, it cannot be used in its current form because the data used in this project is considered sensitive and cannot be shared publicly.

Contact

If you have any questions, please reach the author Paul Henriot

About

An R package to simulate bloodborne pathogens transmission in hospitals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • R 54.4%
  • C++ 45.6%