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

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??

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

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

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

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

1 Like

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

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.

there is DHIS 2 Demo - Sierra Leone

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.

Yes, I think this can be a possible option

@sunbiz please suggest how classification should be done?

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

{
            "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": []
        },

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

5 Likes

You are calling the wrong API resources. Data Values (1.73 Tracker Web API) should be called, particularly for the trackedEntityInstance (i.e. the baby) - 1.73 Tracker Web API

1 Like

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

@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.

1 Like

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!

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

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

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

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" }] }

2 Likes

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

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

2 Likes

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

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

1 Like

@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?

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