Combine multiple data elements and show in event summary on patient page | Android app

What I’m trying to do: Show a summary of past follow-up visits on patient page on Android so healthcare worker can quickly glance at the event and take the next decision.
Details in the video: DHIS2: combine multiple data elements and show in event summary | Android issue | Loom

sample patient page on android
This is a sample image only to show what I want to achieve

What’s the problem:
Some of the data makes more sense when shown together but they exist is separate data elements. Eg. Systolic BP and Diastolic BP are separate data elements (i.e data is captured in 2 different fields) but when looking at the Blood Pressure of a patient, it makes sense to see the data together as BP: 132 / 80

1st approach I tried:

  1. Create a new data element with form name = BP
  2. Write Program Rule to show Systolic BP and Diastolic BP together

But this is creating a sync error:
image (8)

I think it’s because, although the DE’s Systolic BP and Diastolic BP are defined as positive integers, when they are loaded onto a new DE ‘BP’, ‘.0’ gets added to the data.

The workaround I found for this:
Create 2 more data elements, for Systolic BP and Diastolic BP, to store rounded values and then display the rounded values.

I can’t figure out whyDHIS2 Android is adding that ‘.0’ to the DE?

There are different types of blood sugar measures that can be taken for a patient.

I want to show the entered blood sugar measure which comprises of 3 DE’s: Blood sugar numeric value + unit + type of measure

(in the image I only added 2 types of blood sugar readings out of 8 for testing)

But it creates the following error:

How do I get DHIS2 Android to show only the entered blood sugar reading without adding .0 and without showing 0 for DE’s that don’t have any data? Also, how is it calculating this the value ‘2090.0’ seen in the error message?

If I enable “Display in reports” the value displayed in event summary takes the code associated with the option set.

If I turn off ‘Use code for option set’ the text uses ‘name’ instead of code but it creates a sync error.
Screenshot 2024-06-03 at 8.57.19 PM

Is there a way to make the text more human reader friendly? d2 function does not seem to work in program rules.

Is this some Android issue? Is there a way around this to achieve what I want?

For problem 1, I followed exactly what @nancyesp suggested and it worked. BP values are showing fine now.

Nancy’s message:
Hi Tony! I’ve been testing and I am able to assign the values as you want with .0 and without it. The only difference is that I am using double quotes instead of single. I am also using the round function and it seems to work fine.
Maybe I need to take a look to your configuration to understand why it is not working.

1 Like

Hi @tonyjoy

Have you tried to use program indicator for this instead of a program rule?