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
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:
- Create a new data element with form name = BP
- Write Program Rule to show Systolic BP and Diastolic BP together
But this is creating a sync error:
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?
PROBLEM 2:
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?
PROBLEM 3:
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.
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?