FDA / openfda

openFDA is an FDA 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
569 stars 131 forks source link

drug adverse event schema bug #139

Closed maksle closed 4 years ago

maksle commented 4 years ago

The schema says

"drugrecurrence": {
   "properties": {
       "drugrecuraction": {
            "type": "string"
        }
    }
}, ...

But the data looks like (see https://api.fda.gov/drug/event.json?search=safetyreportid:14340262&limit=1)

[{
  "drugrecuraction": "Urticaria"
},
 {
   "drugrecuraction": "Type III immune complex mediated reaction"
 },
 {
   "drugrecuraction": "Drug intolerance"
 },
 {
   "drugrecuraction": "Dyspnoea"
 }
],

The schema should say

"drugrecurence": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "drugrecuraction": {
        "type": "string"
      }
    }
  }
}

EDIT -- The schema appears correct for some records: https://api.fda.gov/drug/event.json?search=safetyreportid:17394804&limit=1 So the data/schema is not consistent

maksle commented 4 years ago

In addition, the following keys are objects in the data and correctly have a "properties" attribute in the schema but do not have a {"type": "object"} attribute in the schema: "summary", "patientdeath", "receiver", "reportduplicate"

maksle commented 4 years ago

Also the drug/event schema is not in the xml returned at https://download.open.fda.gov/

dkrylovsb commented 4 years ago

Thank you for bringing these issues to our attention; they have been fixed.

Please note that https://download.open.fda.gov/ does bucket listing, which is limited by AWS to 1,000 elements, which is why the schema isn't in the list (it is actually in the bucket)