← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Skip-logic on Events with Option Codes - can't seem to get it to work...

 

Here are the specifics of the skip logic to see if anyone can spot if I've
made a mistake.

The CE-Discharge variable represents a discharge method data element that
is an option-set with 4 values.

Absconded, MODDIS_ABSC
Transferred, MODDIS_TRANS
Died, MODDIS_DIED
Discharged, MODDIS_DISCH

simple rule is #{CE-Discharge} != 'MODDIS_TRANS' then hide some extra
transfer detailed they want to capture.

there is another similar rule but for the MODDIS_DIED option.

Let me know if I am missing something.



On 13 June 2017 at 10:09, David Hagan <david.hagan@xxxxxxxxxxxxx> wrote:

> Thanks Markus,
>
> Yes, we made sure we set that ... here's the return from the API call...
> will do some further testing to see if we can figure this out.
>
> <programRuleVariable name="CE-Discharge">
> <programRuleVariableSourceType>DATAELEMENT_CURRENT_EVENT</
> programRuleVariableSourceType>
> <useCodeForOptionSet>true</useCodeForOptionSet>
> </programRuleVariable>
>
> By the way, we had a go with 2.27 last night so we could get access to the
> new Rules interface ... got to say we love it :-). Had to roll back though
> because the org tree wasn't displaying in the data entry or event capture
> screens but would display once we did a 'search' for the root node. Haven't
> had time to document this or fully test things as we are on a deadline.
>
> Cheers
>
> David
>
>
> On 13 June 2017 at 09:41, Markus Bekken <markus@xxxxxxxxx> wrote:
>
>> Hi David!
>> There is a flag when you create the source field that lets you control
>> wether the value or code should be used in the comparisons. Unfortunately
>> the source fields is not editable once created until version 2.27 onwards.
>> You can check the settings of your source field in the API:
>>
>> https://play.dhis2.org/release1/api/programRuleVariables?
>> paging=none&fields=name,programRuleVariableSourceType,useCod
>> eForOptionSet&filter=name:eq:*(sourceFieldName)*
>>
>> Also - what is the source type of the source field that behaves
>> inconsistently?
>>
>> Markus
>>
>> 13. jun. 2017 kl. 08.32 skrev David Hagan <david.hagan@xxxxxxxxxxxxx>:
>>
>> Hi,
>>
>> Version: 2.26Build revision: a9c5994Build date: 2017-06-11 06:43
>> Has anyone else had problems with inconsistency in the execution of
>> skip-logic rules for Events? Sometimes the rules seems to work on the
>> 'value' ... sometimes they don't seem to work. But what I really need
>> (since we are doing this in two languages) is the rule to fire off the Code
>> for an Option Set (simple drop-down data-element with 4 values).
>> Any known issues with this?
>> Cheers
>> David
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>

Follow ups

References