-
Notifications
You must be signed in to change notification settings - Fork 775
Add clinical trials search tool #777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}, | ||
) as response: | ||
if response.status == MALFORMATTED_QUERY_STATUS: | ||
# the 400s from clinicaltrials.gov are not JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind moving this comment to live with MALFORMATTED_QUERY_STATUS
, or renaming MALFORMATTED_QUERY_STATUS
to be CLINICAL_TRIALS_DIDNT_GIVE_JSON = 400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this comment is about the decoding, not the status (i.e. the code being 400 means it's malformed but the clinicaltrials.gov response isn't JSON in that case), so it really applies to running .json() vs. .text() on the response object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This upstreams FutureHouse's clinical trials search tool to make it open source. The tool is not turned on by default, but I'm going to make more docs on how to use the tool as well.
I also found many typing regressions -- I've added those back in where necessary.