View source: R/get_hc_drug_products.R
| get_hc_drug_products | R Documentation |
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.
get_hc_drug_products(name = NULL)
name |
Optional. A character string representing a partial or complete name of the drug product to filter results. If omitted, returns all available products. |
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.
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
Requires an internet connection.
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
GET,
fromJSON,
as_tibble
# This function requires an internet connection and downloads data from Health Canada
# Retrieve all products
get_hc_drug_products()
# Retrieve products matching a partial name
get_hc_drug_products("acetaminophen")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.