Completion Rates for Imported data using CSV

Hello Community,
Just checking if anyone has a way out of managing reporting rates/marking data sets that have been imported via CSV as complete so as to generate accurate reporting rates. I know it is a tough one requiring a script…just checking to see if anyone has been able to fix this.

Thank you.

@Stevekonah,

I hope it’s an easy process using the API. The required parameters are ‘period’, ‘dataSet’, ‘organisationUnit’, and ‘attributeOptionCombo’, so if you could get the list together in a spreadsheet and then putting them together in the XML format as below then all you need is to send a POST request to the /api/33/completeDataSetRegistrations (Data Validation - DHIS2 Documentation)

<completeDataSetRegistrations xmlns="http://dhis2.org/schema/dxf/2.0">
  <completeDataSetRegistration period="200810" dataSet="eZDhcZi6FLP"
    organisationUnit="qhqAxPSTUXp" attributeOptionCombo="bRowv6yZOF2" storedBy="imported"/>
  <completeDataSetRegistration period="200811" dataSet="eZDhcZi6FLP"
    organisationUnit="qhqAxPSTUXp" attributeOptionCombo="bRowv6yZOF2" storedBy="imported"/>
</completeDataSetRegistrations>

Hope this helps! :+1:

1 Like

Thank you very much Gassim. Let me give it a try then get back to you. Cheers.

1 Like

You’re welcome! Did you try it? Thanks!

Also, I thought it might be helpful to add that you can use the JSON format instead of the XML, here’s an example:
{“completeDataSetRegistrations”:[{“period”:“202203”,“dataSet”:“BfMAe6Itzgt”,“organisationUnit”:“g8upMTyEZGZ”,“attributeOptionCombo”:“HllvX50cXC0”,“date”:“2010-05-25”,“storedBy”:“imported”,“completed”:true},{“period”:“202203”,“dataSet”:“BfMAe6Itzgt”,“organisationUnit”:“y77LiPqLMoq”,“attributeOptionCombo”:“HllvX50cXC0”,“date”:“2010-04-18”,“storedBy”:“imported”,“completed”:true}]}

Please feel free to post back to the community with updates/questions! :blush: