Skip to contents

Retrieves information on all drug products listed in the Health Canada Drug Product Database (DPD) using the RESTful API endpoint /drug/drugproduct.

Optionally, a partial product name can be provided to filter the results to products that contain the search term in their brand name.

Usage

get_hc_drug_products(name = NULL)

Source

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

Arguments

name

Optional. A character string representing a partial or complete name of the drug product to filter results. If omitted, returns all available products.

Value

A tibble with the following columns:

  • drug_code: Unique code identifying the drug product

  • class_name: Class of drug (e.g., Human, Veterinary)

  • din: Drug Identification Number (DIN)

  • brand_name: Brand or trade name of the product

  • number_of_ais: Number of active ingredients

  • ai_group_no: Active ingredient group number

  • company_name: Manufacturer name

  • last_update_date: Date of last update in the database

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, returns no matches, or returns an error status code, the function returns NULL with an informative message.

Note

Requires an internet connection.

See also

Examples

# \donttest{
  # This function requires an internet connection and downloads data from Health Canada

  # Retrieve all products
  get_hc_drug_products()
#> # A tibble: 57,685 × 8
#>    drug_code class_name din    brand_name number_of_ais ai_group_no company_name
#>        <int> <chr>      <chr>  <chr>      <chr>         <chr>       <chr>       
#>  1       225 Human      00000… PLACIDYL … 1             0107593001  ABBOTT LABO…
#>  2       226 Human      00000… PLACIDYL … 1             0107593002  ABBOTT LABO…
#>  3       114 Human      00000… NEMBUTAL … 1             0106017001  ABBOTT LABO…
#>  4      1169 Human      00000… ERYTHROCI… 1             0105708004  ABBOTT LABO…
#>  5      1168 Human      00000… ERYTHROCI… 1             0105708002  ABBOTT LABO…
#>  6      2576 Human      00000… NEMBUTAL … 1             0106017003  ABBOTT LABO…
#>  7      3698 Human      00000… EES-200    1             0105708009  AMDIPHARM L…
#>  8      1101 Human      00000… ERYTHROCI… 1             0105714005  ABBOTT LABO…
#>  9       113 Human      00000… COLCHICIN… 1             0107264001  ABBOTT LABO…
#> 10       705 Human      00000… ERYTHROCI… 1             0105708003  ABBOTT LABO…
#> # ℹ 57,675 more rows
#> # ℹ 1 more variable: last_update_date <chr>

  # Retrieve products matching a partial name
  get_hc_drug_products("acetaminophen")
#> # A tibble: 316 × 8
#>    drug_code class_name din    brand_name number_of_ais ai_group_no company_name
#>        <int> <chr>      <chr>  <chr>      <chr>         <chr>       <chr>       
#>  1     11334 Human      00361… ACETAMINO… 1             0102009001  STANLEY PHA…
#>  2      2727 Human      00382… ACETAMINO… 1             0102009001  PRO DOC LIM…
#>  3      2728 Human      00386… ACETAMINO… 1             0102009002  PRO DOC LIM…
#>  4      3219 Human      00417… LIFE ACET… 1             0102009001  SHOPPERS DR…
#>  5      5031 Human      00420… ACETAMINO… 1             0102009002  SHOPPERS DR…
#>  6      4503 Human      00448… ACETAMINO… 1             0102009001  DUCHESNAY I…
#>  7      4502 Human      00448… ACETAMINO… 1             0102009002  DUCHESNAY I…
#>  8      4733 Human      00544… APO-ACETA… 1             0102009001  APOTEX INC  
#>  9      4734 Human      00545… APO-ACETA… 1             0102009002  APOTEX INC  
#> 10      5476 Human      00549… ACETAMINO… 1             0102009002  CELLCHEM PH…
#> # ℹ 306 more rows
#> # ℹ 1 more variable: last_update_date <chr>
# }