# Project: Develop an Android mobile application for newborn clinical decision support

**URL:** <https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909>\
**Category:** Google Summer of Code\
**Tags:** gsoc2021-project, android, mhbs, gsoc2021\
**Created:** [January 27, 2021, 6:00am UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909 "2021-01-27T06:00:07Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Benndip](https://forums.librehealth.io/user_avatar/forums.librehealth.io/benndip/32/1626_2.png) [@Benndip](https://forums.librehealth.io/u/Benndip)\
**Post date:** [April 2, 2021, 2:38pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/114 "2021-04-02T14:38:21Z")

</div>

But I have a worry now. I am trying to insert data but I keep getting the Error below… I have gone through the docs over and over but I’m missing something. @Darshpreet2000 please can you help me??? or any one else??

 ![Screenshot from 2021-04-02 15-31-39](https://forums.librehealth.io/uploads/default/original/2X/5/5610f52ede10688ba5b52b47101a9f45568b4d28.png)

---

<div class="post-metadata">

**Author:** ![Darshpreet2000](https://forums.librehealth.io/user_avatar/forums.librehealth.io/darshpreet2000/32/1172_2.png) [@Darshpreet2000](https://forums.librehealth.io/u/Darshpreet2000)\
**Post date:** [April 2, 2021, 3:15pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/115 "2021-04-02T15:15:53Z")

</div>

> [@Benndip](#):
>
> I am trying to insert data but I keep getting the Error below… I have gone through the docs over and over but I’m missing something

It requires organization unit Id in which data will be inserted & also the program Id in which you want to insert it, in the API as a parameter

API Query is like this to fetch Data , GET Request

`https://play.dhis2.org/2.35.3/api/29/events.json?orgUnit=ImspTQPwCqd&program=ZGksV1GvIlO`

 ![dhis2](https://forums.librehealth.io/uploads/default/original/2X/7/7c84c89a0f65739b0416d72329ffda9a862bb2d7.png)

To get orgId & programId you can get it from the url

> [@Benndip](#):
>
> receive data from there using the Tracker web API.

Please do a GET Request once on the API I shared it will fetch all the events with data

Also the database resets every night , so the API may not work after few hours & you may need to recreate the program & events

One more thing I think we don’t need to insert On-Call Data using App because it will be done by the facility administrator using website, we just need to fetch it

---

<div class="post-metadata">

**Author:** ![Benndip](https://forums.librehealth.io/user_avatar/forums.librehealth.io/benndip/32/1626_2.png) [@Benndip](https://forums.librehealth.io/u/Benndip)\
**Post date:** [April 2, 2021, 3:24pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/116 "2021-04-02T15:24:12Z")

</div>

Thank you very much. It works well now I understand. Thank you for adding the two last lines…haha, I almost forgot that.

---

<div class="post-metadata">

**Author:** ![Darshpreet2000](https://forums.librehealth.io/user_avatar/forums.librehealth.io/darshpreet2000/32/1172_2.png) [@Darshpreet2000](https://forums.librehealth.io/u/Darshpreet2000)\
**Post date:** [April 2, 2021, 5:28pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/117 "2021-04-02T17:28:31Z")

</div>

I have a doubt regarding how to classify baby as normal, problem,

please tell if this way is correct to implement it

The Tracked Entity Instance (Child) will have a hidden attribute `classification` from user when the user will enter baby’s Examinations result such as Temperature, Skin color changes etc, we can set this variable as Problem or Normal based on the data entered in app automatically.

Other way I thought was to use indicators in DHIS2 but there is not a direct API to fetch indicator values

if anyone has any idea on this then please discuss

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 2, 2021, 5:36pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/118 "2021-04-02T17:36:13Z")

</div>

I think whenever doctor will do the baby’s assessments, there we can ask the status of baby(normal, problem or danger) during each assessment.

> [@Darshpreet2000](#):
>
> there is not a direct API to fetch indicator values

there is [DHIS 2 Demo - Sierra Leone](https://play.dhis2.org/dev/api/33/indicators)

---

<div class="post-metadata">

**Author:** ![Darshpreet2000](https://forums.librehealth.io/user_avatar/forums.librehealth.io/darshpreet2000/32/1172_2.png) [@Darshpreet2000](https://forums.librehealth.io/u/Darshpreet2000)\
**Post date:** [April 2, 2021, 5:43pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/119 "2021-04-02T17:43:36Z")

</div>

> [@ankithans](#):
>
> > [@Darshpreet2000](#):
> >
> > there is not a direct API to fetch indicator values
> 
> there is [Login app | DHIS2](https://play.dhis2.org/dev/api/33/indicators)

I tried this & it only shows indicators name & not their value , I read from here that Indicator values are not saved in tables, DHIS2 calculate indicators on the fly from analytics.

> **[Web API : Get Indicator Value](https://community.dhis2.org/t/web-api-get-indicator-value/2947/5)**
>
> Dear Julhas, Thank you very much. I actually needed orgUnitId to call web-api. Iused the following code to get it done. Seems to work on data entry screen. var ouselect = $(‘.selected’).attr(‘href’); var orgid = ouselect.match(/“(\[^”\]+)"/)\[1\]; ...

> [@ankithans](#):
>
> I think whenever doctor will do the baby’s assessments, there we can ask the status of baby(normal, problem or danger) during each assessment.

Yes, I think this can be a possible option

@sunbiz please suggest how classification should be done?

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 2, 2021, 5:53pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/120 "2021-04-02T17:53:18Z")

</div>

> [@Darshpreet2000](#):
>
> I read from here that Indicator values are not saved in tables, DHIS2 calculate indicators on the fly from analytics

okayy you are right, I even tried this query `api/33/indicators?fields=:all` got everything but not value.

```json
{
            "code": "IN_52462",
            "lastUpdated": "2013-03-21T11:17:44.926",
            "id": "ReUHfIn0pTQ",
            "href": "https://play.dhis2.org/dev/api/33/indicators/ReUHfIn0pTQ",
            "created": "2012-11-05T09:16:29.054",
            "name": "ANC 1-3 Dropout Rate",
            "shortName": "ANC 1-3 Dropout Rate",
            "publicAccess": "rw------",
            "displayName": "ANC 1-3 Dropout Rate",
            "description": "Indicates the percentage of clients dropping out between the 1st and the 3rd ANC visit. Calculated as the difference between ANC1 and ANC3 by the ANC 1 visits.",
            "displayShortName": "ANC 1-3 Dropout Rate",
            "externalAccess": false,
            "displayNumeratorDescription": "ANC1-ANC3",
            "denominatorDescription": "Total 1st ANC visits",
            "periodOffset": 0,
            "displayDenominatorDescription": "Total 1st ANC visits",
            "numeratorDescription": "ANC1-ANC3",
            "displayDescription": "Indicates the percentage of clients dropping out between the 1st and the 3rd ANC visit. Calculated as the difference between ANC1 and ANC3 by the ANC 1 visits.",
            "dimensionItem": "ReUHfIn0pTQ",
            "sharing": {
                "owner": "GOLswS44mh8",
                "external": false,
                "users": {},
                "userGroups": {},
                "public": "rw------"
            },
            "displayFormName": "ANC 1-3 Dropout Rate",
            "url": "",
            "numerator": "#{fbfJHSPpUQD.pq2XI5kz2BY}+#{fbfJHSPpUQD.PT59n8BQbqM}-#{Jtf34kNZhzP.pq2XI5kz2BY}-#{Jtf34kNZhzP.PT59n8BQbqM}",
            "denominator": "#{fbfJHSPpUQD.pq2XI5kz2BY}+#{fbfJHSPpUQD.PT59n8BQbqM}",
            "annualized": false,
            "favorite": false,
            "dimensionItemType": "INDICATOR",
            "access": {
                "read": true,
                "update": true,
                "externalize": false,
                "delete": true,
                "write": true,
                "manage": true
            },
            "indicatorType": {
                "id": "bWuNrMHEoZ0"
            },
            "createdBy": {
                "displayName": "Tom Wakiki",
                "id": "GOLswS44mh8",
                "username": "system"
            },
            "user": {
                "displayName": "Tom Wakiki",
                "id": "GOLswS44mh8",
                "username": "system"
            },
            "favorites": [],
            "translations": [
                {
                    "property": "SHORT_NAME",
                    "locale": "en_GB",
                    "value": "ANC Dropout Rate"
                },
                {
                    "property": "DESCRIPTION",
                    "locale": "en_GB",
                    "value": "Indicates the percentage of clients dropping out between the 1st and the 3rd ANC visit. Calculated as the difference between ANC1 and ANC3 by the ANC 1 visits."
                },
                {
                    "property": "SHORT_NAME",
                    "locale": "fr",
                    "value": " Taux d'abandon d'ANC 1-3"
                },
                {
                    "property": "NAME",
                    "locale": "fr",
                    "value": " Taux d'abandon d'ANC 1-3"
                },
                {
                    "property": "NAME",
                    "locale": "en_GB",
                    "value": "ANC Dropout Rate"
                }
            ],
            "userGroupAccesses": [],
            "attributeValues": [],
            "indicatorGroups": [
                {
                    "id": "oehv9EO3vP7"
                },
                {
                    "id": "YTeRMLGtger"
                }
            ],
            "userAccesses": [],
            "dataSets": [],
            "legendSets": []
        },

```

---

<div class="post-metadata">

**Author:** ![muarachmann](https://forums.librehealth.io/user_avatar/forums.librehealth.io/muarachmann/32/2291_2.png) [@muarachmann](https://forums.librehealth.io/u/muarachmann)\
**Post date:** [April 2, 2021, 11:41pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/121 "2021-04-02T23:41:57Z")

</div>

Nice work folks. Keep up the good spirits and team work.

---

<div class="post-metadata">

**Author:** ![sunbiz](https://forums.librehealth.io/user_avatar/forums.librehealth.io/sunbiz/32/395_2.png) [@sunbiz](https://forums.librehealth.io/u/sunbiz)\
**Post date:** [April 2, 2021, 11:43pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/122 "2021-04-02T23:43:28Z")

</div>

You are calling the wrong API resources. Data Values ([1.73 Tracker Web API](https://docs.dhis2.org/master/en/developer/html/webapi_tracker_api.html#webapi_events)) should be called, particularly for the trackedEntityInstance (i.e. the baby) - [1.73 Tracker Web API](https://docs.dhis2.org/master/en/developer/html/webapi_tracker_api.html)

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 3, 2021, 5:33am UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/123 "2021-04-03T05:33:54Z")

</div>

Okay @sunbiz , so in general I should do something like this

> `/api/33/enrollments?ou=DiszpKrYNg8&program=IpHINAT79UW&trackedEntityInstance=uhubxsfLanV`

> `/api/33/events?orgUnit=DiszpKrYNg8&program=IpHINAT79UW&trackedEntityInstance=uhubxsfLanV`

---

<div class="post-metadata">

**Author:** ![abhinav12k](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav12k/32/1532_2.png) [@abhinav12k](https://forums.librehealth.io/u/abhinav12k)\
**Post date:** [April 3, 2021, 6:54am UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/124 "2021-04-03T06:54:30Z")

</div>

@Darshpreet2000

It would be better to have status(normal/problem/danger) as a parameter which can be filled at the time of filling assessment by the staff. I think it would be better than trusting a hard coded formula. Later we can easily filter out babies based on this parameter.

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 3, 2021, 1:56pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/125 "2021-04-03T13:56:32Z")

</div>

Hi mentors, I would like to get my proposal reviewed. I have submitted a draft on GSoC website, can you please give me feedbacks, So that I can improve on it.

Thank you!

---

<div class="post-metadata">

**Author:** ![Darshpreet2000](https://forums.librehealth.io/user_avatar/forums.librehealth.io/darshpreet2000/32/1172_2.png) [@Darshpreet2000](https://forums.librehealth.io/u/Darshpreet2000)\
**Post date:** [April 4, 2021, 7:01am UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/126 "2021-04-04T07:01:29Z")

</div>

Hello mentors, I have shared a draft proposal please provide your valuable feedback on the same so that I can improve it more, I am open for any Feedback & discussion on the same

Thankyou

---

<div class="post-metadata">

**Author:** ![abhinav12k](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav12k/32/1532_2.png) [@abhinav12k](https://forums.librehealth.io/u/abhinav12k)\
**Post date:** [April 4, 2021, 3:11pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/127 "2021-04-04T15:11:53Z")

</div>

> [@Darshpreet2000](#):
>
> > [@Benndip](#):
> >
> > I am trying to insert data but I keep getting the Error below… I have gone through the docs over and over but I’m missing something
> 
> It requires organization unit Id in which data will be inserted & also the program Id in which you want to insert it, in the API as a parameter

I have a small doubt in this, by using the API with organisation unit and program as parameters we receive the same output as we have on a **get request** but we should be receiving an **import summary** as per the documentation. I examined the response also this doesn’t insert the new trackedentity(in our case **baby** ) inside the program. Can anyone please verify this?

I am using the following end point -

`{{BASE_URL}}trackedEntityInstances?ou=kbGqmM6ZWWV&program=m26bppPG9T4`

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 4, 2021, 4:21pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/128 "2021-04-04T16:21:00Z")

</div>

I think inside the program, these are events, not the tracked entities. I am also somewhat confused here but to insert an event, I used this API

 ![image](https://forums.librehealth.io/uploads/default/original/2X/1/166f37f75bbfbf6c69b63effab0486b40314a5ae.png)

---

<div class="post-metadata">

**Author:** ![Darshpreet2000](https://forums.librehealth.io/user_avatar/forums.librehealth.io/darshpreet2000/32/1172_2.png) [@Darshpreet2000](https://forums.librehealth.io/u/Darshpreet2000)\
**Post date:** [April 4, 2021, 4:32pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/129 "2021-04-04T16:32:32Z")

</div>

> [@abhinav12k](#):
>
> . I examined the response also this doesn’t insert the new trackedentity(in our case **baby** ) inside the program. Can anyone please verify this?

To create a tracked entity & to enroll it in a program use the following Endpoint only with POST

`https://play.dhis2.org/2.35.3/api/trackedEntityInstances`

I inserted Following JSON Object & it was successfully inserted in your created program

`{ "trackedEntityType":"WPvWotSmBRe", "orgUnit": "kbGqmM6ZWWV", "attributes": [{ "attribute": "YbX0CbYP0HO", "value": "Mrs ABCD EFGH" }], "enrollments": [{ "orgUnit": "kbGqmM6ZWWV", "program": "m26bppPG9T4", "enrollmentDate": "2021-04-03", "incidentDate": "2021-04-03" }] }`

---

<div class="post-metadata">

**Author:** ![abhinav12k](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav12k/32/1532_2.png) [@abhinav12k](https://forums.librehealth.io/u/abhinav12k)\
**Post date:** [April 4, 2021, 4:39pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/131 "2021-04-04T16:39:42Z")

</div>

By using the events endpoint you will get the items you inserted in **Event Capture Program** not the **Tracker capture program** Also by making a post request at this endpoint it will add events into the Event Capture Program not Tracker capture program(which we are going to use for babies). Reference - [1.73 Tracker Web API](https://docs.dhis2.org/master/en/developer/html/webapi_tracker_api.html#webapi_events)

`For events with registration, a tracked entity instance identifier is required, read about how to get this in the section about the trackedEntityInstances resource.`

---

<div class="post-metadata">

**Author:** ![abhinav12k](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav12k/32/1532_2.png) [@abhinav12k](https://forums.librehealth.io/u/abhinav12k)\
**Post date:** [April 4, 2021, 5:11pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/132 "2021-04-04T17:11:00Z")

</div>

Thanks @Darshpreet2000. Found my mistake i was using **“trackedEntity”** instead of **“trackedEntityType”** 😅 Now the data is successfully inserted into the program.

Also can you please modify your previous answer as it might confuse others this one →

> [@Darshpreet2000](#):
>
> It requires organization unit Id in which data will be inserted & also the program Id in which you want to insert it, in the API as a parameter

---

<div class="post-metadata">

**Author:** ![ankithans](https://forums.librehealth.io/user_avatar/forums.librehealth.io/ankithans/32/1797_2.png) [@ankithans](https://forums.librehealth.io/u/ankithans)\
**Post date:** [April 4, 2021, 5:16pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/133 "2021-04-04T17:16:48Z")

</div>

@abhinav12k @Darshpreet2000 can you see the inserted data in the dashboard? Like I am inserting and import was successfull, but it’s not updating in the dashboard. Can you help?

---

<div class="post-metadata">

**Author:** ![abhinav12k](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav12k/32/1532_2.png) [@abhinav12k](https://forums.librehealth.io/u/abhinav12k)\
**Post date:** [April 4, 2021, 5:21pm UTC](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909/134 "2021-04-04T17:21:01Z")

</div>

In which program you are inserting? You need to specify the `enrollments` to enroll the data into the program.

[Previous page](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909.md?page=5)

[Next page](https://forums.librehealth.io/t/project-develop-an-android-mobile-application-for-newborn-clinical-decision-support/3909.md?page=7)
