DHIS2: Assign Value to a Data Element from another Data Element in the same event (Program Tracker)

Hi!

I am Juan and I am very new to the world of DHIS2.

I am currently configuring a tracker program in which, some Data Elements (Fields) within the same stage are not supposed to be seen by other users and some DEs should only be available as “read only”. I managed to solve the first using Hide/Show Program Rules, however, the second one appears to be out of my league of knowledge.

I tried the following approach:

  1. Program Rule that assigns a value to DE 2, as soon as DE1 is filled out by User 1 (Same value). User 2 then comes to action, he should be able to read DE2, and DE1 should not be seen, however, it appears that “Assign Value” does not assign values from different DE.

Any thoughts are very much welcome. Thanks in advance :smile:

3 Likes

Welcome to the community @JuanF96! :tada::tada:
I’m glad that you managed the first, and hopefully you’ll find a solution for the second. Please let me understand one thing, if DE1 has exactly the same value as DE2 then why are they two different data elements?

I suggest that you please explain more about the use case so that when one of the experts read it they will have a better understanding of the situation and not just the technical “how-to” side of it. :smiley:

Thanks!

Thank you for reading my message and for the warm welcome @Gassim

To provide more context, I am currently working on some kind of “Form”, in which users are required to answer a series of questions, and a second set of users are required to qualify those answers within the same form without being able to modify any of the responses done by the first set of users. This is happening within only one stage. So, my approach is:

Question 1

  1. DE1 = Answer to question 1 provided by first set of users.
  2. DE2 = Same answer provided within DE1 but using the “Assign Value”, since “assign value” automatically grays out the DE field, that will take care of ensuring that the second set of users is unable to modify the responses.

Thanks again for your time!

2 Likes

Hi @JuanF96 ,
You may decide to put the DEs in a separate section I.e DE1 and any other DE that needs to be reviewed by the other group. Use sharing settings to make the section only viewable by the group of users that shouldn’t be able to edit. By this way, you don’t need to create two DEs collecting same value.

1 Like

:smiley: Exactly what I was thinking! Thanks @Barnabas_Akumba! This solves the issue @JuanF96?

That sounds like a very interesting idea, I have not tried that approach yet, instead I found out I am able to assign values from program rule variables via a “concatenate”.

Either way, I will try that out and see what happens. Thanks to you both! @Gassim and @Barnabas_Akumba

Yes. It is possible to assign values to a DE but in your case, it means you will be having two DEs for the same value. That will be confusing during analytics and will store the data twice thereby leading to redundancy.

1 Like

I agree with @Barnabas_Akumba!

13 posts were split to a new topic: Assign DE value from an existing event to a new event (tracker)