AI for Diabetes, at your reach
Tags: machinelearning, android, ios, serverless
Published: 2020-05-10 00:48:32

More than **400 millions of people** colive with Diabetes everyday. Most of them use Apps quite often, and with no doubt, the most important App for them is the one that helps them **manage their disease**.

#What can the diabetic patient do with current Apps?

Surprisingly, most of these Apps do little more than register the glucose values and draw some graphs. Just a few provide advice about diet and exercise routines. And even these ones usually give standard pieces of information, with no or little customization for each user.

Well, this can clearly be **improved**.

What about predicting glucose ups and downs? Diabetic patients know that everything they do about their disease is aimed at avoiding these dangerous values.

How many Apps for diabetes are able to **predict the glucose levels for each user** in advance?

#Preventive healthcare for Diabetes

This feature has extraordinary applications in many research activities around Diabetes, buy let's focus here on the patients.

Adding the prediction of future glucose levels to your App functionalities, will multiply its value and would be an extraordinary **aid to improve the user's quality of life**.

The good news are that in Nubentos API Store, you can find the MedicsenAPI: a superfast API that allows you to remotely use their **machine learning-based algorythm** to predict the future glucose curve specific for each user.

Medicsen is a spanish startup focus on chronic diseases. They have recently been awarded with the first prize in the **Virtual South Summit for Health & Wellbeing** (yes, these guys know what they do).

Though their core business is the new generation of non-invasive medical device for diabetic patients, they have found the opportunity to share their core technology with the community of software developers through Nubentos API Marketplace.


#MedicsenAPI, a closer look

In particular, MedicsenAPI receives a **json** file in the request, such as the following sample:

```json
{
"Inputs": {
"predictor_input": {
"ColumnNames": [
"time",
"glucose",
"cho_simple",
"cho_complex",
"ins_fast",
"ins_slow",
"mass"
],
"Values": [
["2019/08/05 16:00", 120, 10, 40, 3.5, 0, 75],
["2019/08/05 16:15", 121, 0, 0, 0, 0, 75],
["2019/08/05 17:35", 132, 0, 0, 0, 0, 75],
["2019/08/05 18:45", 0, 0, 0, 0, 20, 75],
["2019/08/05 19:00", 140, 0, 0, 0, 0, 0]
]
}
},
"GlobalParameters": {}
}
```

Each row contains the glucose lecture, the ingested carbohydrates (simple and complex) and the injected insulin dose (fast and slow acting insulin).

When sending this request, MedicsenAPI returns the following response:

```json
{
"Results": {
"predictor_output": {
"type": "DataTable",
"value": {
"ColumnNames": [
"pred0",
"pred15",
"pred30",
"pred45",
"pred60",
"pred75",
"pred90",
"pred105",
"pred120",
"pred135",
"pred150",
"pred165",
"pred180",
"time"
],
"ColumnTypes": [
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Object"
],
"Values": [ [
”104.009263669471”,
”96.2364046604062",
"99.2647391878364",
"102.744641274917",
"106.089699255478",
"108.584562644434",
"110.679614334562",
"112.167824226935",
"113.470337538897",
"114.435026850847",
"115.118934184411",
"115.570538408333",
"115.831295991142",
"8/5/2019 7:00:00 PM" ]
]
}
}
}
}
```

Which contains the predicted glucose levels for the next 180 minutes, in 15 minutes intervals. Medicsen guys inform that **the most accurate results are within the first hour** ("pred60"), and beyond that, values should be treated with caution.

[You can access the MedicsenAPI here](https://apimarket.nubentos.com/store/apis/info?name=MedicsenAPI&version=1.0.2&provider=josecarlos-AT-medicsen.com&tenant=medicsen.com&utm_source=devto&utm_medium=MedicsenAPI&utm_campaign=channel&utm_content=post).

You will find all their subscriptions plans,  the API documentation, our online test console to easily learn how it works before coding, and our ten SDKs available.

To be able to run a test, please remember that:
1. You have to create an **application** and **generate the keys for production**
2. MedicsenAPI has **no sandbox endpoint** since their algorythm returns the same values for the same input, thus a sandbox endpoint would return the same response as the production endpoint.
3. Since they don't need to store any information, it makes no sense to publish a sandbox environment.

And that's all for now. We have more good news like these ones, and we will tell you about them quite soon. So **don't miss our posts!**

Thank you for reading and take care!