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

Is there any way to connect products.product_number (001) with the related openfda.spl_set_id? #166

Closed jBesic closed 2 years ago

jBesic commented 3 years ago

For the example below, I have two products while there is three spl_set_id items. How can I say which product belongs to which spl_set_id?

Thank you all,

spl_set_id: [
    "fb4810ec-d26f-429d-b87c-5898a7870169",
    "62eda83d-d043-4c7e-8fcf-75d05efbf35b",
    "610022b7-7dc9-405a-a580-104657f43bdf"
]
products: [
    {
        product_number: "001",
        reference_drug: "Yes",
        brand_name: "SALAGEN",
        active_ingredients: [
            {
                name: "PILOCARPINE HYDROCHLORIDE",
                strength: "5MG"
            }
        ],
        reference_standard: "No",
        dosage_form: "TABLET",
        route: "ORAL",
        marketing_status: "Prescription",
        te_code: "AB"
    },
    {
        product_number: "002",
        reference_drug: "Yes",
        brand_name: "SALAGEN",
        active_ingredients: [
            {
                name: "PILOCARPINE HYDROCHLORIDE",
                strength: "7.5MG"
            }
        ],
        reference_standard: "Yes",
        dosage_form: "TABLET",
        route: "ORAL",
        marketing_status: "Prescription",
        te_code: "AB"
    }
]
dkrylovsb commented 2 years ago

You would have to query an additional openFDA endpoint. You could query the NDC endpoint using the SPL Set IDs provided and then match the returned results with what you have from the Drugs@FDA endpoint by keying on, for example, the brand_name and active_ingredients fields.

The NDC query for your specific example would be https://api.fda.gov/drug/ndc.json?search=openfda.spl_set_id.exact:(610022b7-7dc9-405a-a580-104657f43bdf+OR+fb4810ec-d26f-429d-b87c-5898a7870169+OR+62eda83d-d043-4c7e-8fcf-75d05efbf35b)&limit=10