← Back to team overview

dhis2-devs team mailing list archive

Re: Program rule actions of type ASSIGN not working on SCHEDULED events

 

Hi!

Any feedback on this issue so far? In case it is of any help, I noticed the
following. When updating one dataelement in an event that was directly
added (sign + in the user interface of the Tracker Capture) the payload
generated was:

   1.
   {"event":"donHXNZZSoH","orgUnit":"ElSpSqucvZg","program":"ORvg6A5ed7z","programStage":"tmsr4EJaSPz",
   *"status":"ACTIVE"*
   ,"trackedEntityInstance":"v3YvuAkhpWs","dataValues":[{"dataElement":"xMYPMdmM3aY","value":5,"providedElsewhere":false}]}


On the contrary, when updating the same dataelement in an event filled out
after being scheduled (first scheduled, then assigned a date and filled
out), the resulting payload was:

   1.
   {"event":"Ev4dLx6ujXm","orgUnit":"ElSpSqucvZg","program":"ORvg6A5ed7z","programStage":"tmsr4EJaSPz",
   *"status":"SCHEDULE"*
   ,"trackedEntityInstance":"v3YvuAkhpWs","dataValues":[{"dataElement":"iiRV3pv52oc","value":5,"providedElsewhere":false}]}


It seems that the flag/property status is not updated to ACTIVE once the
previous scheduled event is filled out and maybe this might be the cause of
not executing programRuleActions (if there is some conditional code
checking the *status*).

Many thanks in advance!
Alejandro


On Thu, Nov 10, 2016 at 10:05 AM, Victor Garcia <vgarciabnz@xxxxxxxxx>
wrote:

> Hi all,
>
> we have noticed a buggy behavior when using program rule actions of type
> ASSIGN in scheduled events. The program rule is correctly evaluated, but
> the program rule action does not assign the desired value to the
> dataelement in that event. This happens only when the event is created
> using the visit scheduler. If the event is created using the "Add new
> event" button the program rule action works fine.
>
> The steps to reproduce the issue:
> 1. Create a programRuleVariable of type "DATAELEMENT_CURRENT_EVENT" with
> the dataelement we want to copy.
> 2. Create a programRule limited to that programStage.
> 3. Assign a programRuleAction of type ASSIGN, with the previously crated
> programRuleVariable as the "data" and a dataelement as the target.
>
> I couldn't access demo server to reproduce the issue (it seems that admin
> password has been changed), but I did in dev server and created an example
> that you can easily verify until it is reset tonight. It is in the program
> "WHO RMNCH Tracker", in the stage "Postpartum care visit". I added a new
> dataelement called "Copy HIV test result" just below "HIV test result" that
> copies its value. You can verify that if the stage is created using the
> "Add event button" the value is correctly copied; but it the stage is added
> using the visit scheduler, the value is not copied.
>
> If there is doubt please let me know.
>
> Thank you!
>
> Víctor
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

References