Dear Community,
I have implemented a tracker program where I have configured option sets for two data elements of interest. One data element is Sex with Male and Female options. Another data element is Antibiotics Used with more than 150 options as shown on the image below.
The client want a program indicators of these antibiotics used by Male and Female. I have read widely in DHIS2 documentations and watched Youtube tutorials. So far what I have learnt is that I have to create a program indicator for each antibiotics used by male resulting to about 150+ male program indicators. I will also be required to create other 150+ female program indicators.
This just one type of the report and I have similar reports that need same configuration.
PLEASE HELP. Do we have another way of generating these program indicators.
I understand your situation as creating all these manually sounds like an unnecessary task. There are so many ways to automate them but the more automated it becomes the more development is required such as using Python code and the API; however, I can suggest a step that any user can make use.
Instead of creating the Program Indicator 150+ times, you’d only need to create one program indicator and then use the Import / Export app to export it. Once exported as JSON, only keep the required program indicator and delete all the other info. In a spread sheet you can paste in the first column everything in the JSON up until the field that needs to be given a name and so on until the fields for the one program indicator in one row are complete then repeat that in the second row for each program indicator.
For example, see the screenshot below the fields in yellow are the ones that will change for each program indicator while the ones that are in white are the ones that remain unchanged:
Note that when copying from the spreadsheet directly it will add quotes so to over come that make use of the additional columns in the spreadsheet and paste the following expression =SUBSTITUTE(A1,char(10),char(13)) (more info here) Additionally, you will need to do some cleaning such as Find and Replace the additional space that’s added for each column, see screenshot:
When the JSON file is ready, you can use the Import / Export app to import the file. Good luck!
I hope this helps. It is possible that other community members or experts could provide you with a python script or even create a web app for this task… but this is what I can come up with at the moment and I hope it helps. Please let me know how it goes or if you found a better solution.