Skip to contents

Retrieves all Drug Identification Numbers (DINs) from the Health Canada Drug Product Database (DPD) using the RESTful API endpoint /drug/drugproduct.

Only the DIN column is returned, renamed as din for convenience.

Usage

get_hc_din()

Source

Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html

Value

A tibble with a single column:

  • din: The Drug Identification Number

Details

This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.

If the API request fails or returns an error status code, the function returns NULL with an informative message.

Note

Requires an internet connection.

Examples

if (interactive()) {
  get_hc_din()
}