API Documentation Version 1.1


IOSHub Platform API

Welcome to the IOSHub  API documentation.

The IOSHub API allows you to access dataset resources within the IOSHub cloud in a simple, programmatic way using conventional HTTP requests. The endpoints are intuitive and powerful, allowing you to easily make calls to retrieve information or to execute actions, allowing you to script the complex actions that your situation requires. The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints. Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

For simple retrieval of information about case observation, object observation, or environment including Machine Learning, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying

In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered. In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered. Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed. If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently. 

In order to interact with the IOSHUB API, you or your application must authenticate. 
IOSHub API handles this through simple authentication inside header, this allows you to delegate access to your account in full or in read-only mode. The apikey token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair. Because of this, it is absolutely essential that you keep your apikey tokens secure.


Parameters

There are two different ways to pass parameters in a request with the API. When passing parameters to create or update an object, parameters should be passed as a query string containing the appropriate attribute names and values as key-value pairs. When you use this format, you should not specify that you are sending a JSON object in the header. This is done by remove the Content-Type header : application/json. This ensures that your request is interpreted correctly. Multiple query parameters are separated by the ampersand, " & ", when passing parameters to filter a response on GET requests, parameters can be passed using standard query attributes. In this case, the parameters would be embedded into the URI itself by appending a ? to the end of the URI and then setting each attribute with an equal sign. Attributes can be separated with a &.


Machine Learning

In IOSHub Platform we farming many brains, technically its  an engine as a web service who can respond to dynamic queries in real-time, you can ask prediction to existing brain, create a new brain and let it observ in an area. IOSHub Platform offers some time series algorythm which are :

  1. Autoregression

  2. ARIMA, AutoRegressive Integrated Moving Average

  3. Simple Average

  4. Moving Average

  5. Holt's Linear Trend

  6. Holt Winter

  7. And many more will come


By time being, we start to offer "Time Series Family" , time series is considered to be one of the less known skills in the analytics space, this is suitable for everyone for start, learn and test with less cost. What makes Time Series Special ?, well it is a collection of data points collected at constant time intervals. These are analyzed to determine the long term trend so as to forecast the future or perform some other form of analysis. 

You can find more information about how to create your own machine learning in the top of IOSHub API for Machine learning in this link.




Get Meta Location of Observation

Description

By sending GET requests to the /api/meta/location  endpoint, you can retrieve information about location of observation, this api call will get all location observation name, longitude, latitude ,id and topojson file location (if available)

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/meta/location

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present



Get Drug Meta Information

Description

By sending GET requests to the /api/meta/drugs  endpoint, you can retrieve information about  drug meta information about drug's name and drug's code

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/meta/drugs

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present


Get Meta Diagnose Code

Description

By sending GET requests to the /api/meta/diagnosecode  endpoint, you can retrieve information about diagnose code and diagnose code mean. the result name is on local language per point of observation but don't worry, mostly the observation point is use ICD 10 standar for diagnose code, so whatever the name is, the code is same. for example I10 in some local language is written as hipertensi primer where as in english is hypertension primary. This api call is use offset and limit parameters, which mean, in every success call will return 50 records

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/meta/diagnosecode?offset=5 will result record from 5 to 55

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present

  3. api error if no offset parameter  is present


Get Summary of Case

Description

By sending GET requests to the /api/summary/case   endpoint, you can retrieve information about summary of case, which is number of case per year, per location and or per diagnose code. Year must be in between 2011 to 2018

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls for all summary  https://med.ioshub.com/api/summary/case?location=14&year=2014

  • example of api calls for particular  summary  https://med.ioshub.com/api/summary/case?location=14&year=2014&diagnose=I20


Relational API : Meta Location and Meta Diagnose Code

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present

  3. api error if no location and year is present 


Get Summary of Drug

Description

By sending GET requests to the /api/summary/drug  endpoint, you can retrieve information about summary of drug distribution. Year must be in between 2011 to 2018

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls for all summary  https://med.ioshub.com/api/summary/drug?location=14&year=2014

  • example of api calls for particular  summary  https://med.ioshub.com/api/summary/drug?location=14&year=2014&drugcode=5


Relational API : Meta Location and Meta Diagnose Code

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present

  3. api error if no location and year is present 


General Case Query

Description

By sending GET requests to the /api/query/generalcase  endpoint, you can retrieve rich information about general case, this api call will get particular objects observation.

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/query/generalcase?offset=100&location=14&year=2017&diagnose_code=I10 will return 100 cases object observation of hipertension primary information (age, hamlet, dwelling,sex) and location (point observation, relation number, treatment number -if any- and date of case)

  • Parameter location, year, diagnose_code and offset are mandatory

  • Year must be in between 2011 to 2018

Relational API : Meta Location, Meta Diagnose Code and General Treatment Query

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present

  3. api error if no location, year, diagnose_code and offset is present


Get Engine of a Machine Learning

By sending GET requests to the /api/machine/engines  endpoint, you can retrieve information about available engine, this api call will get all engine's name. id, methode, algorhytm and status (offline or online), status is important, all machine learning API is depend on this status, for example, user can not creat a brain instance if methode choosen is offline. 

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/machine/engines

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present


Get Methode of a Machine Learning

By sending GET requests to the /api/machine/methode  endpoint, you can retrieve information about available methode of engine, this api call will get all engine's  methode and id all machine learning API is depend on this status, for example, user can not creat a brain instance if methode choosen is not available

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/machine/methode

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present


Get Brains

By sending GET requests to the /api/machine/brains  endpoint, you can retrieve information about available FREE brain instance, this api call will get  all brains id and name. the id is important because it used for interact with free brains

Parameters

  • Set http Headers "apikey" (your API Key) for example apikey:MMS876

  • example of api calls  https://med.ioshub.com/api/machine/brains

Return Values

  1. api success response is JSON dictionary

  2. api error if no http header "apikey' is present