Skip to content

Tip: Retrieving MAUDE adverse event narratives in bulk (in 5 easy steps and just a few minutes)

February 24, 2011

If you ever need to search MAUDE (FDA’s database of adverse events with medical devices), chances are you might quickly find out one potentially aggravating aspect – retrieving a bulk number of records can be a royal pain.  (This has more to do with the technology underlying the database than data collection methods itself;  the interface does not allow more than 500 records to be returned and does not have an ability to export search results)

If you don’t have the patience, one way is to use third party solutions, which consists of taking the publicly available data from FDA and creating a more searchable database and/or interface than MAUDE.  (An example is the interface put together by the folks at FDAZilla.com)

But because the raw data files are readily available online, there are ways in which the data can be very quickly and easily searched – without installing any new software and just using what comes with your computer.

I recently had a request that I was able to fulfill in a matter of minutes thanks to a little bit of tech know-how.  For the sake of showing how it’s done as a tutorial, let’s assume our client is looking for all adverse event narratives (what is reported in the text of the event description) with robots or robotics from 2007-2009.

Here it is in just 5 easy steps:

Step One: Download the necessary narrative data files from the MAUDE download page (I’ve created a short link at http://snipr.com/fdamaude)

(FDA groups each year as a separate zip file, so you’ll have to download multiple files.  For our test case, we want to search 2007, 2008, and 2009 – so we’ll want to download foitext2007.zip, foitext2008.zip, and foitext2009.zip.)

Step Two: Unzip each of these files.

As you’ll read in the file documentation, each one of these files is in a delimited format – meaning that each row is an incident, with each field separated by a | sign.  The benefit is that you can then concatenate all of these files while preserving the data.

Step Three: Concatenate these into one big file.

For those with a Mac, there’s a command line program called cat which will concatenate multiple files into one file.  For ease of use, let’s name our combined file foitext20072009.zip.  The syntax for the cat command is:

cat filename1 filename2 filename3 > newfilename

where filename1 is the first file you want to use, filename 2 is the second file, filename3 is the third file, etc.

So the command to use here (you’ll do this in the Mac Terminal window) is:

cat foitext2007.txt foitext2008.txt foitext2009.txt > foitext20072009.txt

In Windows, you’ll want to do this in the Command Prompt and the command is:

copy /a foitext2007.txt + foitext2008.txt + foitext2009.txt foitext20072009.txt

Step Four:  Find those matching records.

Now that we have all of the 3 years’ data in one big text file, with each event in its own row, we need to find a way to search for our term, “robot.”  Thankfully, that’s really easy, as there’s a UNIX/Mac command for that called grep.  grep searches every row (line) of a file for a given word, phrase, or expression, and returns only those lines that match.

In this case, we would use the following command to look in the file foitext20072009.txt for the word robot (and all stemmed versions, essentially searching robot*) and put all of the matching lines in output.txt (note that the word is capitalized in the syntax below because grep is case sensitive by default – plus all descriptions in MAUDE are in CAPS:

grep ROBOT foitext20072009.txt > output.txt

(Windows command:  find “ROBOT” foitext20072009.txt > output.txt )

And you’re almost done.  Now all of the reports of adverse events in robots are now in your output.txt, one line per item, with fields delimited by the | character.

Step 5: Format it nicely.

Because our clients will likely prefer it in an Excel spreadsheet than a gobbledygook text file, simply open up Excel and import the file, making sure to identify | as a delimiter.  Now delete the columns which aren’t relevant – and that’s it – you’re done!

Once you are used to it, you can execute this in a matter of minutes (excluding download time), which will save you a lot of time and can make you look pretty smart ☺

(One note is that grep uses Regular Expressions in its search – which is why we could just search ROBOT and didn’t need to use additional characters, because it assumed that’s what was wanted.  If we wanted to add wildcard characteristics or have one- or two- character stemming, you can do that in Regular Expressions – the syntax is a little different.  It’s not too difficult to learn, though.  And once you learn it, it is very useful – not only is it powerful, but also precise.   Here’s a link for an introduction to Regular Expressions.

find in Windows works very similarly, although it does not accept anything close to wildcards at all.)

Advertisements
3 Comments leave one →
  1. Alexander Feng permalink
    February 28, 2011 2:11 pm

    In related news: FDA/CDRH announced plans for a MAUDE replacement by year’s end. Initial plans announced in 2009 were to merge MAUDE with the FDA Adverse Event Reporting System (FAERS) last year – but that didn’t occur, ostensibly because FAERS was also to be used for drug adverse events, and there weren’t enough commonalities between the two systems.

    http://www.fdanews.com/newsletter/article?issueId=14503&articleId=134591

  2. March 17, 2011 3:00 pm

    Thank you for this detailed explanation. I’ve been trying to figure out how to upload the MAUDE data files into Google Public Data Explorer. But am having trouble figuring how how to build out XML-based metadata that must be bundled with the CSV files (which in MAUDE’s case are “pipe” saparated values, right?). Do you have any ideas or suggestions?
    Hugo
    ICD User Group

  3. March 17, 2011 3:01 pm

    Oops, meant to say “separated”. Also, here’s a link to Google’s tool:
    http://www.google.com/publicdata/home

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: