Recall list
Health Canada publishes its recalls in a daily open-data file, but the affected models and lots are only on each recall's web page. The app keeps a local recall list: every medical device recall in that file, plus what its page says about models and lots. Matching products and stock always runs on this list.
The list is built once, here. After that, the scheduled refresh (every 12 hours unless your host changed it) and each site's Check for recalls now work in two steps:
- RSS feeds. They read Health Canada's medical devices and health products RSS feeds. A device recall there that isn't in the list yet is added and its page read straight away, hours before the open-data file lists it. One that was updated since it was read is read again.
- Open data. They download the open-data file, compare it with the list by recall number and Last updated date, and read only the pages of recalls that are new or updated, usually a handful. This step catches everything since the last refresh, including updates and archived recalls. A recall found by RSS earlier stays one entry when the file lists it.
A check normally finishes in under a minute.
What the page shows
The top line, Recall database last updated, is the newest of three times, shown in brackets after it: the last Health Canada open-data download, the last openFDA fetch and the last recall page read. All times are in UTC, or Never.
- Device recalls in the open data: live and archived medical device recalls in the last file downloaded.
- Live recalls parsed: how many live recalls have had their page read, out of the total, with the percentage.
- Live recalls pending: pages not read yet.
- Failed pages: pages that couldn't be read, or that Health Canada has removed. They are listed further down with the reason and how many times they were tried.
- New or updated, for the next check: recalls that changed upstream and are waiting for the next check.
- Archived recalls parsed: archived recalls whose page was read (only when you build with archived recalls).
- Last full build: when a build last read every live page.
- Open data last downloaded: when the list was last compared with Health Canada.
- Health Canada RSS last checked, under that line: when the feeds were last read, and how many new recalls the last check added from them.
- Possible gap: each feed shows only Health Canada's 3 newest recalls. When all of them were new at a check, there may have been more, so the page says so, with the date before which recalls may be missing. Nothing is lost: the next open-data file that lists them fills the gap and the note goes away. Health Canada regenerates that file nightly, around 02:15 UTC (late evening in Eastern time).
- openFDA recalls stored and when they were last fetched, and the product and stock matches across all sites.
Building the list
Build local recall list reads every pending page, one per second plus the time to read it (about 4,700 live recalls, a little under 2 hours). It reads new or updated recalls first, then those whose title matches a product, brand or vendor at some site, then the rest, newest first. Products and stock are matched when it ends.
- Include archived recalls reads the archived ones too, after the live ones (about 4,000 more pages). Archived recalls are closed, so they never raise a match; they are only there for completeness.
- Before you start, the page estimates how long it will take and when it should finish, in your device's time. While it runs it shows the pages read so far out of the total, a progress bar and an updated estimate. Progress is saved on the server, so it shows on any device and survives a page reload.
- Stop ends the build after the current page. Pages read so far are kept; press Build local recall list again to carry on where it stopped.
- If the server restarts during a build, another copy of the app carries on within about 10 minutes. The page says so while it waits.
- If Health Canada fails five pages in a row, the build pauses. It carries on by itself at the next 10-minute check, so within about 10 minutes.
- It shares the scheduled refresh's lock, so only one of them runs at a time across the installation.
Failed pages
A page that fails (Health Canada busy or down) or no longer exists is listed under Failed pages with its reason. The build skips failed pages so it doesn't keep asking for them. Retry failed pages reads only those. A recall that is updated upstream is read again by the next check either way.