HI Abyot ,
Thankyou for your constructive feedbacks and time.
Yes, I owe you a brief explanation.
Abyot , this are the step I followed to save a dataSetValues into a given dataset. The whole idea for doing this is submitting a complete data entry using API.
For example in my case Laboratory Checklist Forms as we see on data entry form below screen.
We have visits that could run 1-5 and i modeled that as visits on datasets category combination option and visits is set as attribute and its perfectly working. That was what I need, 5 different dimension of data element values.
Now, I have this ODK application with detailed and large forms on it, which some of them are not even able (my experience) not able to be developed as they are in DHIS2. So due to time and resource the best fit is to model them using ODK and submit data necessary for visualization/scoring into DHIS2 per visits dimension.
Thus, to work with the API I used the following endpoint which i believe handy in my situation.
http://197.156.76.44:8080/api/dataValueSets
As per the documentation of DHIS2 API here ;https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html
I have used the following JSON style:
{
"dataSet": "dataSetID",
"completeDate": "date",
"period": "period",
"orgUnit": "orgUnitID",
"attributeOptionCombo": "aocID",
"dataValues": [
{
"dataElement": "dataElementID",
"categoryOptionCombo": "cocID",
"value": "1",
"comment": "comment1"
},
{
"dataElement": "dataElementID",
"categoryOptionCombo": "cocID",
"value": "2",
"comment": "comment2"
},
{
"dataElement": "dataElementID",
"categoryOptionCombo": "cocID",
"value": "3",
"comment": "comment3"
}
]
}
I have used the following API working inspection on my broweser to find out codes for AttributeOption,ComboOptions…etc as shown below
When i manually enter data DHIS2 calls the
e.g dataValues end point and send the attribute options as the following code , which i have used the same code in my API integration applicaiton.
de:v5IRd4L2b9G
co:HllvX50cXC0
ds:Ow7CNQwgZm3
ou:EENDe38Diwq
pe:2020Q1
value:2
cc:MyTZiEZdtsx
cp:SRFu8JYasHM <== I presume this the attribute options that i have used.
I have used below inspection to identify their UID’s for attributes ? DHIS2 API uses it internally?
I have checked that by inspecting the source of attributOptionCombo box on dataset as follows:

Then I have formulated my code as follows: my json to test a single data save from my API to DHIS2 through the API endpoint mentioned above.
{
“dataSet”: “Ow7CNQwgZm3”,
“completeDate”: “2020-06-18”,
“period”: “2020Q1”,
“orgUnit”: “OTJusq4oEbn”,
“categoryOptionCombo”: “HllvX50cXC0”,
“attributeOptionCombo”: “SRFu8JYasHM”
“dataValues”: [
{ “dataElement”: “v5IRd4L2b9G”, “value”: “55”,“categoryOptionCombo”:“HllvX50cXC0”,“comment”: “DanielAdenew Commeted on this” },
]
}
And DHIS2 shows :
// 20200624035703
// http://localhost:3000/labchecklist
{
“responseType”: “ImportSummary”,
“status”: “SUCCESS”,
“importOptions”: {
“idSchemes”: {
},
"dryRun": false,
"async": false,
"importStrategy": "CREATE_AND_UPDATE",
"mergeMode": "REPLACE",
"reportMode": "FULL",
"skipExistingCheck": false,
"sharing": false,
"skipNotifications": false,
"datasetAllowsPeriods": false,
"strictPeriods": false,
"strictDataElements": false,
"strictCategoryOptionCombos": false,
"strictAttributeOptionCombos": false,
"strictOrganisationUnits": false,
"requireCategoryOptionCombo": false,
"requireAttributeOptionCombo": false,
"skipPatternValidation": false,
"ignoreEmptyCollection": false,
"force": false
},
“description”: “Import process completed successfully”,
“importCount”: {
“imported”: 0,
“updated”: 1,
“ignored”: 0,
“deleted”: 0
},
“dataSetComplete”: “2020-06-18”
}
and some time it does even show me the following error message , as attribue i m using is not found.
I have run psql update incase anything for the AttributeOptions.
// 20200624043928
// http://localhost:3000/labchecklist
{
“responseType”: “ImportSummary”,
“status”: “WARNING”,
“importOptions”: {
“idSchemes”: {
},
"dryRun": false,
"async": false,
"importStrategy": "CREATE_AND_UPDATE",
"mergeMode": "REPLACE",
"reportMode": "FULL",
"skipExistingCheck": false,
"sharing": false,
"skipNotifications": false,
"datasetAllowsPeriods": false,
"strictPeriods": false,
"strictDataElements": false,
"strictCategoryOptionCombos": false,
"strictAttributeOptionCombos": false,
"strictOrganisationUnits": false,
"requireCategoryOptionCombo": false,
"requireAttributeOptionCombo": false,
"skipPatternValidation": false,
"ignoreEmptyCollection": false,
"force": false
},
“description”: “Import process completed successfully”,
“importCount”: {
“imported”: 0,
“updated”: 0,
“ignored”: 1,
“deleted”: 0
},
“conflicts”: [
{
“object”: “SRFu8JYasHM”,
“value”: “Attribute option combo not found or not accessible for writing data”
}
],
“dataSetComplete”: “2020-06-24”
and , when i checked on actual data-entery form values are not still shown .
Trackers:
I am much experienced with manipulation of Data Entry forms. I am new to Tracker concept and Didn’t know How I Can achieve similar outcomes using Trackers ?. If you send some links/examples to review I would appreciate it.
Summery of my Question:
-
Does this have related impact with my version of DHIS2 being 2.30.1
-
Why the internal API codes for AttributeOption UID’s i presume doesn’t work from, while i followed
the same style with DHIS2 API works like i showed to you above when DHIS2 send data Values per attribute Options ?
-
What else method should i look through to save bulk data Sets , if there is any other end point to do this job ?
Thank you very much!
Daniel Adenew