
Get a Drug Product by DIN from Health Canada Drug Product Database
Source:R/get_hc_drug_by_din.R
get_hc_drug_by_din.RdRetrieves detailed information for a specific drug product listed in the
Health Canada Drug Product Database (DPD) using the RESTful API endpoint
/drug/drugproduct?din=<DIN>.
This includes details such as the Drug Identification Number (DIN), product name, class, number of active ingredients, company name, and update date.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
Value
A tibble with the following columns:
drug_code: Unique code identifying the drug productclass_name: Class of drug (e.g., Human, Veterinary)din: DIN assigned by Health Canadabrand_name: Brand or trade name of the productnumber_of_ais: Number of active ingredientsai_group_no: Active ingredient group numbercompany_name: Manufacturer namelast_update_date: Date of last update in the database
Returns NULL if the resource is unavailable or if an error occurs.
Details
Sends a GET request to the Health Canada Drug Product Database API. Supports caching via the memoise package and enforces a rate limit between successive API requests.
If the DIN does not exist or the API returns an error, the function
returns NULL with an informative message.
The function fails gracefully when internet resources are unavailable, including SSL certificate errors, network timeouts, or server issues.