Calvin
Calvin

Reputation: 11

How to use aqua.io API (for ICD-10 description to code)

I am doing a project for medical data mining ,and using a python api call Aqua.io ,the goal is to search for ICD code by their description.

The tutorial is not so clear for me,especially the parameters call 'client_options' and 'option'.

Tutorial The description of client option are below:

Client Options

The following options are available while instantiating a client:

base: Base url for the api
user_agent: Default user-agent for all requests
headers: Default headers for all requests
request_type: Default format of the request body

client = aqua_io.Client({ 'client_id': '09a8b7', 'client_secret': '1a2b3' }, client_options)  

I am not sure how to set this four parameters , are they all necessary?

I have try this way and came out an error:

TypeError: request() got an unexpected keyword argument 'request_type'

client = aqua_io.Client({ 'client_id': '****','client_secret': '***' },
{'base':'https://aqua.io','user_agent': '**', 'headers': 'XHTML', 'request_type': 'JSON'})

And if I only put parameter 'base' , it works.

client = aqua_io.Client({ 'client_id': '****','client_secret': '***' },{'base':'https://aqua.io'})

Similar question on parameter call method option,description is below:

Method Options

The following options are available while calling a method of an api:
headers: Headers for the request
query: Query parameters for the url
body: Body of the request
request_type: Format of the request body

When I run code like this, it came out an error:

TypeError: request() got an unexpected keyword argument 'request_type'

icd9 = client.icd9()
response = icd9.single_code("066-4",{'request_type':'json'})

Did anyone have experience of using this api ? Thanks !

Upvotes: 1

Views: 388

Answers (0)

Related Questions