This might be a vague question but i was wondering if anyone has tried to get the value of a data element from the oldest event from a program stage using a program rule or program rule variable.
Thanks
This might be a vague question but i was wondering if anyone has tried to get the value of a data element from the oldest event from a program stage using a program rule or program rule variable.
Thanks
Hi there @paleu256,
Some have a baseline program stage, where the first value is collected. If this is the case, you can use the source type “Data element for the newest event for a program stage”, and selecting the first program stage.
Otherwise you would have to create a rule that stores the first value in a separate helper field when it is first entered.
You could also send us a jira ticket on jira.dhis2.org and describe your use case - and we can look into building either a function or source type to accomodate the use case.
Best regards,
Markus
I’m having the same challenge. In my case, I have a repeatable stage where I store a value in each event and I would like to subtract the first and last event of that stage and assign it to another DE. In order to get the first (oldest) event I was thinking on having a PR that populates a PR variable. Then, when it comes to define the condition… I don’t have a clear idea. The most accurate condition I found was that the v{event_count} equal to 1 but still not perfect since one could start entering data from another stage.
Hi @barreda,
Have you found the solution to your problem? Iam interested to know if you got it.
Thanks
Hi @fernando unfortunately not, perhaps someone should write a JIRA with this request for Improvement.
@barreda and @fernando
That is a good suggestion. Please describe your use case(don’t leave out the functional detais) in a jira issue
All the solutions I can think of is “workarounds” for the missing functionality:
Markus