View source: R/get_fda_adverse_events.R
| get_fda_adverse_events | R Documentation |
Retrieves adverse event reports from the FDA Adverse Event Reporting System (FAERS)
that match a specific drug name using the RESTful API endpoint
/drug/event.json?search=<drug_name>.
This includes details such as the safety report ID, receive date, serious status, patient information, drug details, and adverse reactions for each reported adverse event related to pharmaceutical products.
get_fda_adverse_events(drug_name)
drug_name |
A character string representing the name of the drug. |
This function sends a GET request to the FDA openFDA 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:
report_id: Unique identifier for the adverse event report
date_received: Date FDA received the report
country: Country where event occurred
serious: Is it serious? ("Yes", "No", or original API value / NA)
adverse_reactions: List of adverse reactions reported (separated by semicolons) or NA
patient_sex: Patient sex ("Male", "Female", "Unknown", original API value, or NA)
patient_age: Patient age at onset (as returned by API) or NA
Requires an internet connection.
FDA Adverse Event Reporting System (FAERS) via openFDA: https://open.fda.gov/apis/drug/event/
GET,
fromJSON,
as_tibble
# Esta función requiere conexión a internet y descarga datos de la FDA
get_fda_adverse_events("aspirin")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.