FDA / openfda

openFDA is a research project to provide open APIs, raw data downloads, documentation and examples, and a developer community for an important collection of FDA public datasets.
https://open.fda.gov
Creative Commons Zero v1.0 Universal
567 stars 131 forks source link

Device - Adverse Events API Endpoint: 2 FDA device code filter limit #167

Closed NINEam-t closed 2 years ago

NINEam-t commented 3 years ago

Querying for more than 2 values of device.device_report_product_code, returns values not included in the query. For example, https://api.fda.gov/device/event.json?search=(device.device_report_product_code:LPL+LPN+LPM)&limit=10 returns some master file records that do not have any device records with the searched FDA device codes (i.e. LPL, LPN, or LPM).

This does not seem to match the behavior described in the advanced-syntax guidance. I'm new to this API so please don't hesitate to let me know if I'm mistaken. Thanks!

dkrylovsb commented 3 years ago

Thank you for bringing this to our attention. We'll look into whether a documentation or code fix is in order; in the meantime this query will do what you're looking for:

https://api.fda.gov/device/event.json?search=(device.device_report_product_code.exact:LPL+device.device_report_product_code.exact:LPN+device.device_report_product_code.exact:LPM)&limit=10

dkrylovsb commented 2 years ago

So the correct query is https://api.fda.gov/device/event.json?search=device.device_report_product_code:(LPL+OR+LPN+OR+LPM)&limit=10. We will be pushing a documentation fix out shortly.

NINEam-t commented 2 years ago

Thanks!