Day 5 – potpourri

This post is a part of a series on drug shortages.

Today I went in a mishmash of directions. Let me walk you through it.

An R package for shortages

I began the day a bit grumpy so decided to do some yak shaving, and as is tradition with these sorts of things, I think it paid off. I had been meaning to figure out how to grab shortage data from the DSC database using R so that I could keep all of my code in one language (see, there’s the yak) in hopes of making this project more easily reproducible. So, I sat down and read Hadley’s lovely book on making R packages, and then built my own. I explain more about how to install it and how to use it in this post.


Since I was playing around with the entire dataset from the DSC, I was reminded of an entire chunk of it I hadn’t looked at yet: discontinuation reports. I spent an hour or so familiarizing myself with the information present in these reports. They are pretty sparse: essentially just drug information, a discontinuation date, and a reason field. There is no obvious link from shortage reports to discontinuation reports (i.e. when a shortage becomes a discontinuation). I’ll have to think more about what to do with this information.

In case you’re interested, here’s a quick breakdown of the number of reports from 2019 in the full database by status:

status                count
resolved              1775
active_confirmed      1025
discontinued          315
avoided_shortage      66
to_be_discontinued    60
anticipated_shortage  52
reversed              1

The Multi-Stakeholder Steering Committee on Drug Shortages in Canada

The website contains several documents from the the MSSC committee, and I had been meaning to read through them. Specifically, I read through the Protocol for Notification and Communication of Drug Shortages which lays out the agreements on how and when shortages of various kinds of shortages should be reported, and also the Preventing Drug Shortages document which aims to “identify, analyze, and propose strategies to mitigate and prevent the manufacturer-related causes of drug shortages in Canada.” My goal wasn’t to critique these documents but simply give them a once over and see if any interesting questions came up for me that I might be able to explore with the data I have.

Advanced warning

The Protocol document explains in detail the required timing of reporting. It boils down to this:

“[Manufacturers] must post this notification no less than six months in advance of an anticipated shortage or discontinuation, if possible, or otherwise within five days of becoming aware of its real or anticipated occurrence.”

Page 3, Section 1

Well, this is definitely something we can explore. Every shortage report has a creation date, so it’s simply a matter of looking at the duration between that date and the date a shortage begins. Here a histogram of those durations for 2019 shortages broken out by shortage reason:

The grey boxes represents the 6 month window before a shortage starts. The counts to the right of the grey box represent reports that were created with at least 6 months notice. Everything in the grey box was reported with less than 6 months notice, and everything to the left of the grey box were reports that came after the shortage started. Oops.

Timing of shortages

In the Strategies document, it’s stated without evidence that:

“While not every drug supply disruption will turn into a shortage, nearly all shortages are preceded by a disruption in supply.”

Page 8, Section 3.1

I wish there was a way to check this accurately. Unfortunately, as we’ve seen above, shortage reports are very often made very nearly at the time the shortage begins. We just don’t have the data.

Causes of drug shortages

In the Strategies document, there is a figure, taken from FDA data on the causes of shortages. Well, we can now produce a similar figure for Canadian drug shortages:

ATC number weirdness

In my digging around today, I came across some funny business in the atc_number column of the DSC data. The most specific ATC codes (fifth-level codes) refer to the chemical substance in the medication. Codes like this are 7 characters long. Always. Since the ATC classification system is a strict hierarchy, the codes are designed so that if you peel off characters at the end of the code, you end up with more general classifiers that lump together bigger classes of related drugs.

Every shortage report in the DSC is for a DIN (Drug Identification Number, i.e. it refers to a specific medication, by a specific manufacturer, in a specific formulation/dose), so that should mean that every shortage report has a 7 digit ATC code associated with it. Not so.

Here are the lengths of ATC codes for shortage reports in 2019:

ATC_code_length  count
4                2
5                2415
7                48
NA               10

That is, most reports do not have the most specific ATC code they could have. I’m not sure why this is. This is a problem for future-Jon to figure out. In any case, I can fetch the actual ATC code for every DIN from the Drug Product Database, so I’m not overly concerned. This issue does mean that I need to redo my earlier work on essential medicines and shortages once I have proper ATC codes.

1 Comment

Comments are closed.