untoldone / bloomapi

Create APIs out of public datasources
https://www.bloomapi.com/documentation/public-data
MIT License
89 stars 29 forks source link

Error with certain NPI "TypeError: Cannot set property 'taxonomy' of undefined" #44

Closed marks closed 10 years ago

marks commented 10 years ago

I am getting the following error when hitting the JSON endpoint of NPI 1003160391 locally. I get a 502 bad gateway error when using the bloomapi.com endpoint.

Will try to look into this myself but want to make sure it's documented here too.

mba62:bloomapi mark$ node make server
2013-12-21T22:14:30.024Z - info: starting bloomapi
2013-12-21T22:14:30.322Z - info: listening on port 3000

XXX/bloomapi/lib/sources/npi/fields.js:146
          set[meta.set - 1][tkey] = tvalue;
                                  ^
TypeError: Cannot set property 'taxonomy' of undefined
    at Object.npiFields.transformField (XXX/bloomapi/lib/sources/npi/fields.js:146:35)
    at Object.npiFields.processRecord (XXX/bloomapi/lib/sources/npi/fields.js:162:12)
    at XXX/bloomapi/lib/sources/npi/fields.js:172:29
    at Array.forEach (native)
    at Object.npiFields.process (XXX/bloomapi/lib/sources/npi/fields.js:171:13)
    at null.callback (XXX/bloomapi/lib/api/server.js:136:25)
    at Query.handleReadyForQuery (XXX/bloomapi/node_modules/pg/lib/query.js:84:10)
    at null.<anonymous> (XXX/bloomapi/node_modules/pg/lib/client.js:148:19)
    at EventEmitter.emit (events.js:117:20)
    at null.<anonymous> (XXX/bloomapi/node_modules/pg/lib/connection.js:97:12)