Adding program rule based on option set code DHIS 2.30

Hi,

I have created some forms for mental health evaluation wherein we have codes for each response. For example likely to be has 0 not likely to be has 1. I need to add scores(code for option set) based on the replies for 5-6 questions.

Is it possible to do? Please help.
DHIS version 2.30

Images added for reference.

2 Likes

Jasmine,

I’m not 100% sure what you are actually asking here…

Assuming that this is a Tracker/Event Program, and assuming that the option set you are defining will be used as an option set for attribute(s)/dataelement(s) of type Text, then note the following:

Firstly, DHIS2 do not store the name of such option values in the trackedentityattributevalue table (for tracked entity attributes) or the trackedentitydatavalue table (for data elements) - it will always store the CODE as you have defined it above, even if the values DISPLAYED in both Tracker/Event capture and in e.g. Event Reports will be the name.

Secondly, when you create e.g. program rules using program variables, you can choose whether such program variables will use the name or the code (just NOTE that the Android App currently only supports program variable using codes, not names). So if you specify that a program variable will use codes, then e.g. any related program rule filter expression will have to use codes and not names.

Thirdly, when you create program indicators (typically counts of different option values), you will normally use the option value codes in filter expressions.

As I said, I’m not sure what you are actually looking for here… Do you want to see the codes instead of the names when capturing data? Do you want to see the codes instead of names when running e.g. Event Reports or similar?

Regards
Calle

3 Likes

Thanks @Calle_Hedberg… This worked… I basically had to show the option set values during entry and perform calculations based on the option set code to generate a total score.

2 Likes