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

Where should the dataset be placed in order to run the api locally? #118

Closed evgakis closed 4 years ago

evgakis commented 4 years ago

Hi, to everyone, I would like to ask about where should I place the dataset which will be downloaded from here https://open.fda.gov/downloads/

I have downloaded locally the code from this link https://github.com/FDA/openfda

And there are many folders and subfolders there. Where is the folder where the data should be placed in? For example I would like to call the following url and get results localhost:8000/drug/event.json?api_key=&search=exists:(patient.drug.openfda.generic_name)+AND+patient.reaction.reactionmeddrapt.exact:("CONFUSIONAL%20STATE")+AND+exists:(patient.reaction.reactionmeddrapt.exact)+AND+receiptdate:([1989-06-30+TO+2020-02-13])&limit=1&skip=0

Right now I have achieved to run the api but I cannot get results as it is shown in the following screenshot. image

while the api that I run locally produces the following errors while running image

Another question is if the right place to download the data is from here https://open.fda.gov/downloads/ I see there a lot of files and I don't see a file with the whole info.

for example image

From what I have understood, I should write code in order to retrieve the data using the following json file? https://api.fda.gov/download.json

Is there something ready for this?

beckyconning commented 4 years ago

I'm having this same problem. @dkrylovsb any ideas?

evgakis commented 4 years ago

@beckyconning maybe the files should be placed in a folder that should be declared in elasticsearch.yml for example path.data: /etc/elasticsearch/data Could anybody give some additional info if this is correct and how to proceed?

beckyconning commented 4 years ago

@evgakis did you ever work this out? i couldn't make heads or tails of it.

evgakis commented 4 years ago

Hi Becky! No, I have left this the last month and I worked with other things. I don't know If I can work this out.

Στις Τετάρτη, 15 Απριλίου 2020, 02:51:08 μ.μ. EEST, ο χρήστης Becky Conning <notifications@github.com> έγραψε:  

@evgakis did you ever work this out? i couldn't make heads or tails of it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dkrylovsb commented 4 years ago

The indexes in Elasticsearch are created and populated by running Python pipelines, source code for which is provided in this repository. The pipelines "know" how to obtain the data they need. However, running all pipelines is currently infeasible because many of the pipelines require data only available to FDA. Only some pipelines can be run by the general public.

dkrylovsb commented 4 years ago

More information on how to run openFDA locally (select pipelines only) is here: https://github.com/FDA/openfda/pull/133