[Dhis2-users] Ad blockers and DHIS2

2018-04-13 Thread Edward Robinson
Just a heads up to any users of uBlock Origin or other ad blockers, the "Easy 
List privacy" list by includes a blacklist entry for analytics.json as can be 
seen here:
https://easylist.to/easylist/easyprivacy.txt
This is included in uBlock Origin and may be included in others (Adblock, 
etc.).  If you have strange behaviour such as analytics not displaying (graphs, 
pivot tables, etc.), check to see if the workstation has an adblocker or other 
script blocker installed and whitelist your DHIS2 installation URL or turn the 
adblocker off for that URL.

Regards
Ed

___
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-users] [Dhis2-devs] Program rule for Age value type

2018-04-13 Thread Em Le Hong
Hi Edouard Lavaud,

Thanks for your guide. Actually I want the system to show an error message
if user enters value < 5 for the input field.
It's very easy to check if we use value type is Number or Date (for Date of
birth). But I really want to use Age value type because it's nice feature
for Tracker capture or Event capture.

Thanks,

On Wed, Apr 11, 2018 at 5:57 PM, Edouard Lavaud 
wrote:

> Hi Em Le Hong,
>
> If I well understand:
> You capture the age at a different moment than you would like the
> program rule to be executed?
>
> If no, program rule executed on the same stage as you capture the age:
>
> To be checked (never used the age value type so far), but age
> should
> be an integer. So you could just do: #{age_value_type} < 5
>
> If yes, program rule executed later on a different program stage:
>
> Well, first you would be better off taking a date rather than the
> age. The d2 functions you mentioned are only for comparing dates, but
> age is not a date.
>
> If you really want to use the age type, you have to convert it
> first
> in a date following the DHIS2 date pattern: -MM-DD
>
> For that, you need to choose how to approximate a date of birth.
> Will
> you use the first day of the year? the last day? the 30 of June? The
> day you collected the information?
> Then you have to use the diverse d2 functions to create your date
> of birth.
>
> As an example, in an enrollment form of a program I calculate the
> date of birth automatically (note that the age here is just a value
> type integer, and here all the program rules are performed in the same
> event: the enrollment):
>
> Program rule, priority 1, I calculate the age in days:
> A{Age at enrollment} * 365.25
> Program rule, priority 2, I calculate the date of birth according
> to
> the day of data capture
> d2:addDays(V{enrollment_date}, -#{Age at enrollment in
> days})
> Program rule, priority 3, I round the date of birth to the 15 of
> June
> d2:concatenate(d2:substring(#{Date of birth calculated},
> 0, 4), '-06-15')
>
>
> After that I obtain an approximate date of birth I can use in the
> d2
> date functions.
>
> Best,
>
> Edouard
>
> 2018-04-11 11:59 UTC+02:00, Em Le Hong :
> > Dear all,
> >
> > I create a tracker data element value type: Age
> >
> > For event program, I want to use program to check and show error if Age
> is
> > under 5
> > I tried 2 functions d2:yearsBetween; d2:daysBetween with the expression
> as
> > below but it doesn't work:
> >
> > d2:daysBetween(#{age_value_type}, V{event_date})
> > d2:yearsBetween(#{age_value_type}, V{event_date})
> >
> > I check the manual Table 21.13. Custom functions to use in a program rule
> > expression
> > https://docs.dhis2.org/2.29/en/user/html/configure_
> program_rule.html#create_program_rule
> >  and don't see any functions for Age value type.
> >
> > I created a ticket on DHIS2 Jira https://jira.dhis2.org/browse/
> DHIS2-3381
> >
> >
> > I'm really appreciated if anyone has experience on this can share.
> >
> >
> > Regards,
> >
> >
> >
> > --
> > *Em Le Hong*
> > DHIS2 Implementation| *HISP Vietnam *
> > em.hispviet...@gmail.com | *Skype:* em.hispviet...@gmail.com
> >
>
>
> --
> *Edouard Lavaud, *
>
>
>
> *MSc in Health Policy, Planning & FinancingMEng in
> TelecommunicationUniversity Diploma in ICT for Health*
> *Email:* edouard.lav...@gmail.com
> *Mobile:* 0033 6 7210 23 59
>



-- 
*Em Le Hong*
DHIS2 Implementation| *HISP Vietnam *
em.hispviet...@gmail.com | *Skype:* em.hispviet...@gmail.com
___
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-users] Program indicator expressions

2018-04-13 Thread Markus Bekken
Thanks Channara,
please report this as a bug in Jira.

Markus

> 13. apr. 2018 kl. 06:32 skrev channara rin :
> 
> Hi Markus,
> DHIS V2.28, Database:Postgresql
> 
> I tried like this too but i saw error in browser console and result display 
> "false". like below:
> 
> 
> 
> 
> On Thu, Apr 12, 2018 at 5:34 PM, Markus Bekken  > wrote:
> the below expression should work, yes :)
> 
> 
>> 12. apr. 2018 kl. 11:13 skrev Jane Greig > >:
>> 
>> So numeric would solve it for us?
>> That is, if the code for the option we want is numeric = 2 in all 3 data 
>> elements, this should work?:
>> d2:condition('#{qaDVwQUHD0j.g4bPEQ4a7WM} == 2 ',1,0) +
>> d2:condition('#{qaDVwQUHD0j.FFpJ2FZU7rJ} == 2 ',1,0) +
>> d2:condition('#{qaDVwQUHD0j.dLKjtfo7GD3} == 2 ',1,0)
>>  
>>   <>
>> From: Markus Bekken [mailto:mar...@dhis2.org ] 
>> Sent: 12 April 2018 19:09
>> To: Jane Greig >
>> Cc: dhis2-users@lists.launchpad.net 
>> Subject: Re: [Dhis2-users] Program indicator expressions
>>  
>> Ok, I understand - was fearing this could be the reason :) The codes need to 
>> be quoted when they are text-based, so the other short-term workaround I can 
>> think of is to use numeric codes.
>>  
>> Markus
>> 
>> 
>> 12. apr. 2018 kl. 11:06 skrev Jane Greig > >:
>>  
>> HI Markus
>> Thanks for your response. I thought that might be the problem. Unfortunately 
>> our use case is more complex than my example, so the filter workaround 
>> doesn’t help – we want the indicator to return a combined set of conditions. 
>> For example, 3 data elements all with the same option set for delivery of up 
>> to 3 babies for a pregnancy, to count not the event once, but 0, 1, 2 or 3 
>> live births (option ‘LB’) from the 3 data elements for baby outcome. It 
>> sounds like we will have to make numerous program indicators using filters, 
>> and then aggregate indicators to combine them. We were trying to avoid that!
>> Thanks
>> Jane
>>  
>>  
>> From: Markus Bekken [mailto:mar...@dhis2.org ] 
>> Sent: 12 April 2018 19:02
>> To: Jane Greig >
>> Cc: dhis2-users@lists.launchpad.net 
>> Subject: Re: [Dhis2-users] Program indicator expressions
>>  
>> Hi there Jane!
>> The problem with the below condition is that we are using single quotes 
>> inside a single quoted statement. This is not supported at the moment.
>>  
>> Not really knowing enough about the use case, I venture into suggeting a 
>> possible workaround: If you are able to use the condition below as a filter 
>> statement instead of an expression, you can change the aggregation type to 
>> "Count", and the expression to "V{event_count}". 
>>  
>> Markus
>> 
>> 
>> 
>> 10. apr. 2018 kl. 08:09 skrev Jane Greig > >:
>>  
>> Hi
>> Can anyone advise on whether program indicator expressions can use data 
>> elements with option sets? They do not appear in the list of data elements 
>> available, but it does not tell me my expression using the UID of one is 
>> invalid. However, it also does not give me a result. Example I am trying to 
>> use is:
>> d2:condition('#{qaDVwQUHD0j.g4bPEQ4a7WM} == 'LB' ',1,0)
>> to return a value of 1 if that condition is true, otherwise 0. Is that 
>> possible and I am just writing my expression wrongly? Even with a Boolean 
>> data element that does appear in the list of data elements, I could not get 
>> a result using == 1, == TRUE, == Yes.
>> Any guidance is appreciated.
>> Thanks
>> Jane
>>  
>> 
>> Jane Greig, PhD
>> Epidemiologist MSF-OCA 
>> Manson Unit, MSF-UK
>> 
>> 
>> 
>>  
>> ___
>> Mailing list: https://launchpad.net/~dhis2-users 
>> 
>> Post to : dhis2-users@lists.launchpad.net 
>> 
>> Unsubscribe : https://launchpad.net/~dhis2-users 
>> 
>> More help   : https://help.launchpad.net/ListHelp 
>> 
> 
> ___
> Mailing list: https://launchpad.net/~dhis2-users 
> 
> Post to : dhis2-users@lists.launchpad.net 
> 
> Unsubscribe : https://launchpad.net/~dhis2-users 
> 
> More help   : https://help.launchpad.net/ListHelp 
> 
> 
> 

___
Mailing list: https://launchpad.net/~dhis2-users
Post to :