Introduction to ESP for Infectious Disease Surveillance

Information about Electronic Medical Records Support for Public Health (ESP) used by the Massachusetts Department of Public Health (DPH) for infectious disease surveillance and health outcome monitoring, and to support evaluation of public health policy and response.

What is ESP?

Electronic Medical Records Support for Public Health (ESP) is an open-source software application used by the Massachusetts Department of Public Health (DPH) for infectious disease surveillance, health outcome monitoring, and to support evaluation of public health policies and programs.1  ESP makes it possible for healthcare facilities to provide DPH with controlled access to their electronic health record (EHR) data to examine or evaluate specific health indicators for priority infections and conditions, obtain robust understanding of factors contributing to incidence or epidemiologic trends, and to obtain data urgently needed to inform public health response as may be necessitated by an outbreak or emerging pathogen. 

ESP provides participating healthcare facilities and their providers with data and tools to inform local health assessment and quality improvement initiatives. ESP also provides tools to assist healthcare providers with clinical quality management.  

What capabilities does ESP have?

Data Queries: To obtain robust understanding of factors contributing to incidence or epidemiological trends, DPH may require personal, demographic, clinical, epidemiologic, or laboratory information in addition to data reported to DPH through routine clinical case and/or laboratory reporting. In such instances, DPH employs ESP data queries to efficiently and rapidly gather and report such disease surveillance data, ad hoc.  In such circumstances, DPH notifies facilities of implementation of supplemental reporting. This typically requires little to no extra work for facilities since the necessary data are typically already in ESP. 

ESP data are standardized in values and format across participating healthcare facilities, thereby enhancing validity and applicability. ESP analyses provide insight into issues of public health importance beyond reportable disease, such as screening practices. Analysis can be performed at the state or local level and focus on all people, or on subgroups of interest filtered by demographics (e.g., race and ethnicity, age), town or neighborhood, behavioral factors (e.g., smoking), and/or comorbidities.

Participating healthcare facilities and their providers can also run custom queries against their ESP data to inform local assessment, planning, and quality improvement initiatives, or to answer other local analytic and evaluative questions which may be of value. DPH can facilitate support to healthcare facilities for query writing.

Below are some examples of analyses performed from ESP data queries. Additional analyses and associated publications may be accessed through the ESP website.

  • Assessment of the frequency of diagnoses of alpha-gal syndrome (mammalian meat allergy), prior to this becoming a reportable condition in Massachusetts. We identified 400 diagnoses since 2021, with a large increase in 2025.
  • Ongoing analysis is in progress to study serious outcomes of respiratory infections among populations of interest including those with underlying conditions and by vaccination status
  • Evaluation of DPH’s revised clinical guidance on syphilis screening during pregnancy. Findings support revised guidance has been impactful both in terms of provider compliance and detection of syphilis cases in pregnancy that may otherwise have been missed.
  • Examination of the use and impact of doxycycline for STI post-exposure prophylaxis. Identified a large increase in DoxyPEP use starting in 2023 and confirmed that doxy PEP reduces the occurrence of STIs both in people who received a prescription as well as among those who have not received a prescription.
  • Evaluation of how changing the way Lyme disease test results are reported in the EHR can decrease inappropriate antibiotic prescribing for possible Lyme disease
  • Developed a surveillance algorithm for COVID-like illness
  • Evaluated the impact of a best practice alert for Expedited Partner Therapy in patients with new diagnoses of chlamydia on EPT utilization, tests for reinfection, and reinfections
  • Examination of the extent to which increases in gonorrhea in Massachusetts were potentially attributable to more testing vs more infections

Reports for Clinical Quality Management: DPH has configured ESP to identify individuals at increased risk for HIV and other sexually transmitted infections (STIs) who would most benefit from HIV PrEP, DoxyPEP, mpox vaccination, and HIV/STI testing. An HIV/STI risk detection algorithm is implemented in a healthcare facility’s ESP server and enables ESP to generate a report of all patients who meet a prespecified probability of acquiring an STI or HIV infection in the coming year, and who therefore may be eligible for PrEP, doxyPEP, mpox vaccination, and/or HIV/STI testing.  The user interface allows recording of the disposition of efforts to engage patients. This gives healthcare providers an additional tool to use to identify and engage patients eligible for PrEP, DoxyPEP, mpox vaccinations, and HIV/STI testing, and a means to monitor the success of interdisciplinary care teams in promoting these preventive strategies. 

Aggregate Data Analysis and Visualization: DPH has configured ESP for aggregate reporting and population-level analysis of infectious disease data not typically available through routine reporting mechanisms, including social determinants of health, associated health conditions, and preventive services (e.g., recommended services, vaccinations) which are critical to understanding the impact and trajectory of infectious conditions and for advancing health equity. 

The Massachusetts Platform for Analyzing and Graphing Infections (MAGIC) is a web-based, interactive tool for visualization of aggregated ESP data. MAGIC provides timely, high-level summaries and analyses of specific health measures of interest to public health practitioners and others charged with population health management.

  • Heat maps can be used to view rates geographically
  • Infection and screening outcomes can be stratified by population characteristics such as age, race and ethnicity, gender, and other outcomes in the Demographics and Comorbidities module
  • Timeseries graphs can be aggregated and viewed by month or by year and can be viewed as patient counts or as incidence rates
  • Continuity of care displays summarize patient engagement and retention in care and enable generation of patient level information for select conditions to support clinical management
  • Respiratory Viral Infection Like Illness (RAVIOLI) module supports weekly surveillance for respiratory viral infections, including organisms not reportable to DPH. This syndromic system has been built into MAGIC, providing near real-time insight into what respiratory viruses are circulating in Massachusetts.

How does ESP work?

Facilities set up a physical or cloud-based ESP server which populates with nightly extracts of structured data from their EHR including diagnoses, laboratory test results, preventive services, prescriptions, and other variables associated with infectious conditions. ESP runs behind a healthcare facility’s firewall and applies condition identification algorithms to these data, thereby efficiently “flagging” infectious conditions. 

ESP extracts and organizes EHR data into a standard format and into multiple data tables containing data such as vital signs and diagnoses.  This ensures that condition definitions are applied consistently across facilities, thereby ensuring comparability and consistency across facilities.  Validated case detection algorithms are applied by ESP to the data tables to correctly identify infectious conditions, and data are assembled for analysis. Extracted data for ad hoc queries are sent securely to DPH in the form of a flat file. Deidentified and aggregate data are sent weekly to MAGIC via secure, automated feed.   

How is implementation of ESP accomplished?

The general steps for implementation include:

  1. Build the ESP server and install ESP on the server
  2. Create data extract and load on to the ESP server
  3. Initiate daily data loading
  4. Map data for case detection
  5. Initiate processing of ESP data for case detection
  6. Validation and ongoing quality assurance of ESP data

DPH provides guidance and facilitates technical support in all phases of installation, implementation, and maintenance. 

Technical information including specifications and requirements, detection algorithms, and an implementation toolkit is available on the ESP Health website.  For additional information and questions about implementing ESP, please contact us at DPH-BIDLS-ESPMAGIC-Communication@mass.gov.

1The ESP surveillance platform was developed and implemented by the DPH in collaboration with the Department of Population Medicine, Harvard Pilgrim Health Care Institute, and clinical partners. ESP software is open source and is compatible with different electronic health record systems. Information about ESP, including code and technical specifications is available on the ESP Health website.

Help Us Improve Mass.gov  with your feedback

Please do not include personal or contact information.
Feedback