Medical Devices Surveillance

A set of core functions for handling medical device event data in the context of post-market surveillance, pharmacovigilance, signal detection and trending, and regulatory reporting. Primary inputs are data on events by device and data on exposures by device. Outputs include: standardized device-event and exposure datasets, defined analyses, and time series.

Travis-CI Build Status

Why Use mds?

Medical device event data are messy.

Common challenges include:

  • Performing ongoing surveillance on messy data
  • Quickly answering simple questions such as:
    • Are events trending up?
    • How did my trends look 1 year ago? 2 years ago?
  • Incompatibility of various sources of device-events
  • Difficulty integrating exposures, a.k.a. denominator data
  • Understanding all the possible combinations to analyze
  • Application of disproportionality analysis (DPA)
  • Documentation of analyses in a auditable, reproducible way

How Do I Use mds?

The mds package provides a standardized framework to address these challenges:

  • Standardize events involving medical devices
  • Standardize exposures of the device (also known as opportunities for an event to occur, or event denominator)
  • Enumerate possible analyses in a flexible way
  • Generate times series of analyses for trending over time
  • Set up analyses for easy application of disproportionality analysis (DPA)
  • Save all files in lightweight R files for auditability, documentation, and reproducibility

Note on Statistical Algorithms

mds data and analysis standards allow for seamless application of various statistical trending algorithms via the mdsstat package (under development).

Raw Data to Trending in 4 Steps

The general workflow to go from data to trending over time is as follows:

  1. Use deviceevent() to standardize device-event data.
  2. Use exposure() to standardize exposure data (optional).
  3. Use define_analyses() to enumerate possible analysis combinations.
  4. Use time_series() to generate counts (and/or rates) by time based on your defined analyses.
# Step 1 - Device Events
de <- deviceevent(
  device_hierarchy=c("device_name", "device_class"),
  event_hierarchy=c("event_type", "medical_specialty_description"),
# Step 2 - Exposures (Optional step)
ex <- exposure(
# Step 3 - Define Analyses
da <- define_analyses(
# Step 4 - Time Series
ts <- time_series(

Plot Time Series of Counts and Rates

plot(ts[[4]], "rate", type='l')


mds 0.2.2


Potential updates

  • Feature allowing total events (concept of reporting fraction) as an exposure data frame
  • Facility for handling multiple events on the same actual occurrence (such as stroke and bleeding during the same operation)
  • Calculation of implant length (and improved handling of implantables overall)
  • Explicit implementation of the Unique Device Identifier (UDI)

mds 0.2.1

Implemented Updates

  • More descriptive define_analyses() and time_series() outputs, including explicit references to device, event, and covariate levels.
  • Alongside more explicit references, corresponding updates to nLabels attribute of time_series()
  • Outputs of define_analyses() and time_series() are clearer about the device and event one-up hierarchy levels
  • Updated plot() method to support updates to define_analyses() and time_series()

mds 0.2.0

Implemented Updates

  • Allow for list variable type in deviceevents() descriptors argument
  • Wrote time_series() examples in documentation & provided sample time series dataset called mds_ts
  • Better cross-referenced and linked documentation


  • exposure() total_events parameter now accepts integer class
  • deviceevent(): Drop records with missing device_levels at all hierarchy levels
  • deviceevent(): Drop records with missing event_levels
  • deviceevent(): Drop records with missing covariate levels
  • exposure(): Drop records with missing device_levels at all hierarchy levels
  • exposure(): Drop records with missing event_levels
  • exposure(): Drop records with missing match levels

mds 0.1.0

  • Initial Release. Yay!

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.3.2 by Gary Chung, a year ago

Browse source code at

Authors: Gary Chung [aut, cre]

Documentation:   PDF Manual  

GPL-3 license

Imports stats, parsedate, lubridate

Suggests testthat, knitr, rmarkdown

See at CRAN