Existing record (spl_id) now showing not found
kevplx opened this issue · comments
We are storing spl_id in our DB and using it as primary key in the api.
But after some time now, when we search it via the api, we get the following response:
{
"error": {
"code": "NOT_FOUND",
"message": "No matches found!"
}
}
In this use case, we used the following spl_id: a732f55b-9001-34b8-e053-2a95a90a23ab
URL used for searching medicine:
https://api.fda.gov/drug/ndc.json?api_key=xxxxxx&search=spl_id:a732f55b-9001-34b8-e053-2a95a90a23ab
Not sure why that id is no longer available. But it was when it was first pulled from the external api into our local DB.
Any help will be appreciated.
SPL ID changes whenever a newer version of the drug label is released. The ID you have referenced above -- a732f55b-9001-34b8-e053-2a95a90a23ab
-- corresponds to FLUOXETINE capsule label Version 2 released on Jul 6, 2020. That SPL ID had remained active until Oct 21, 2020 when Version 3 was released and effectively replaced the active SPL ID with a new value: b09c1a58-6cfb-172a-e053-2a95a90ae508
. FDA NDC maintains only active SPL IDs, which is why you are getting "No matches found!" on the older value. The new URL would be https://api.fda.gov/drug/ndc.json?search=spl_id:b09c1a58-6cfb-172a-e053-2a95a90ae508
SPL Set ID could be a better candidate for the primary key depending on the nature of your project. SPL Set ID remains the same across different versions of a drug label: https://api.fda.gov/drug/ndc.json?search=openfda.spl_set_id.exact:8d2f3dfd-d8a7-dfc6-e053-2995a90a23f8
SPL ID changes whenever a newer version of the drug label is released. The ID you have referenced above --
a732f55b-9001-34b8-e053-2a95a90a23ab
-- corresponds to FLUOXETINE capsule label Version 2 released on Jul 6, 2020. That SPL ID had remained active until Oct 21, 2020 when Version 3 was released and effectively replaced the active SPL ID with a new value:b09c1a58-6cfb-172a-e053-2a95a90ae508
. FDA NDC maintains only active SPL IDs, which is why you are getting "No matches found!" on the older value. The new URL would be https://api.fda.gov/drug/ndc.json?search=spl_id:b09c1a58-6cfb-172a-e053-2a95a90ae508SPL Set ID could be a better candidate for the primary key depending on the nature of your project. SPL Set ID remains the same across different versions of a drug label: https://api.fda.gov/drug/ndc.json?search=openfda.spl_set_id.exact:8d2f3dfd-d8a7-dfc6-e053-2995a90a23f8
Ah...just what I needed. I didn't realize there was a field called SPL Set ID until I actually searched and found openfda.spl_set_id.
I will try this out. Thanks for the quick response!