Re: [Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build revision b6e8cde

2017-08-09 Thread Georgi Chakarov
Hi Markus,

I was able to test this expression d2:yearsBetween(A{Date of Birth}, V{ 
enrollment _date})  <18
The problem was that my Date of Birth attribute was of value type AGE. Once I 
changed it to DATE the program rule started working.

Is there anything specific that needs to be taken into consideration when 
working with Age value type?

Regards,

Georgi

From: Markus Bekken [mailto:mar...@dhis2.org]
Sent: Wednesday, August 9, 2017 11:01 AM
To: Georgi Chakarov 
Cc: DHIS Users ; DHIS 2 Developers list 

Subject: Re: [Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working 
properly in 2.27 build revision b6e8cde

Hi there Georgi!
The expression
d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
should be the correct one. I would change the V{ enrollment _date} to 
V{enrollment _date}

Note that before the birth date is not entered, the expression will evaluate to 
0 - which will be less than 18.

Let me know how it goes.

Markus

9. aug. 2017 kl. 00.41 skrev Georgi Chakarov 
mailto:geo...@logicaloutcomes.net>>:

Hello all! Any thoughts on my email below from last week?

Thanks,

Georgi

From: Georgi Chakarov
Sent: Friday, August 4, 2017 1:01 PM
To: DHIS Users 
mailto:dhis2-users@lists.launchpad.net>>; DHIS 
2 Developers list 
mailto:dhis2-d...@lists.launchpad.net>>
Cc: Sara Gaudon mailto:s...@logicaloutcomes.net>>; 
Kristiyan Panayotov 
mailto:kristi...@logicaloutcomes.net>>
Subject: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build 
revision b6e8cde

Hello all!

I am trying to create a program rule based on Date of birth and Enrollment 
date. Basically, I want to hide one set of data elements if the client is below 
18 years old and another set of data elements if the client is above 18 years 
of age.

This is what I tried:
1)  (d2:daysBetween(A{Date of Birth}, V{enrollment_date})/365)  <18 
THIS DOES NOT WORK
2)  (d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})/365)  <18  
This actually works(hides the data element I want), but I don’t think it is 
the correct expression.
3)  d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
  I think that this is the correct expression, but it is executing the 
rule (does not hide the data element).

Do you think that there might be a bug in how these expressions work? If not, 
can someone guide me to the correct expression?

Thanks in advance,

Georgi





Georgi Chakarov, CIA | 
geo...@logicaloutcomes.net<mailto:geo...@logicaloutcomes.net> | +1-647-478-5634 
x 104 | LogicalOutcomes c/o Centre for Social Innovation, 720 Bathurst Street, 
Toronto Canada M5S 2R4 | You may unsubscribe from receiving commercial 
electronic messages from LogicalOutcomes by emailing 
i...@logicaloutcomes.net<mailto:i...@logicaloutcomes.net>

___
Mailing list: https://launchpad.net/~dhis2-users
Post to : 
dhis2-users@lists.launchpad.net<mailto: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


Re: [Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build revision b6e8cde

2017-08-09 Thread Georgi Chakarov
Thanks Markus! I will let you know once I test this.

From: Markus Bekken [mailto:mar...@dhis2.org]
Sent: Wednesday, August 9, 2017 11:01 AM
To: Georgi Chakarov 
Cc: DHIS Users ; DHIS 2 Developers list 

Subject: Re: [Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working 
properly in 2.27 build revision b6e8cde

Hi there Georgi!
The expression
d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
should be the correct one. I would change the V{ enrollment _date} to 
V{enrollment _date}

Note that before the birth date is not entered, the expression will evaluate to 
0 - which will be less than 18.

Let me know how it goes.

Markus

9. aug. 2017 kl. 00.41 skrev Georgi Chakarov 
mailto:geo...@logicaloutcomes.net>>:

Hello all! Any thoughts on my email below from last week?

Thanks,

Georgi

From: Georgi Chakarov
Sent: Friday, August 4, 2017 1:01 PM
To: DHIS Users 
mailto:dhis2-users@lists.launchpad.net>>; DHIS 
2 Developers list 
mailto:dhis2-d...@lists.launchpad.net>>
Cc: Sara Gaudon mailto:s...@logicaloutcomes.net>>; 
Kristiyan Panayotov 
mailto:kristi...@logicaloutcomes.net>>
Subject: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build 
revision b6e8cde

Hello all!

I am trying to create a program rule based on Date of birth and Enrollment 
date. Basically, I want to hide one set of data elements if the client is below 
18 years old and another set of data elements if the client is above 18 years 
of age.

This is what I tried:
1)  (d2:daysBetween(A{Date of Birth}, V{enrollment_date})/365)  <18 
THIS DOES NOT WORK
2)  (d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})/365)  <18  
This actually works(hides the data element I want), but I don’t think it is 
the correct expression.
3)  d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
  I think that this is the correct expression, but it is executing the 
rule (does not hide the data element).

Do you think that there might be a bug in how these expressions work? If not, 
can someone guide me to the correct expression?

Thanks in advance,

Georgi





Georgi Chakarov, CIA | 
geo...@logicaloutcomes.net<mailto:geo...@logicaloutcomes.net> | +1-647-478-5634 
x 104 | LogicalOutcomes c/o Centre for Social Innovation, 720 Bathurst Street, 
Toronto Canada M5S 2R4 | You may unsubscribe from receiving commercial 
electronic messages from LogicalOutcomes by emailing 
i...@logicaloutcomes.net<mailto:i...@logicaloutcomes.net>

___
Mailing list: https://launchpad.net/~dhis2-users
Post to : 
dhis2-users@lists.launchpad.net<mailto: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


Re: [Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build revision b6e8cde

2017-08-09 Thread Markus Bekken
Hi there Georgi!
The expression
d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
should be the correct one. I would change the V{ enrollment _date} to 
V{enrollment _date}

Note that before the birth date is not entered, the expression will evaluate to 
0 - which will be less than 18.

Let me know how it goes.

Markus

> 9. aug. 2017 kl. 00.41 skrev Georgi Chakarov :
> 
> Hello all! Any thoughts on my email below from last week?
>  
> Thanks,
>  
> Georgi
>  
> From: Georgi Chakarov 
> Sent: Friday, August 4, 2017 1:01 PM
> To: DHIS Users ; DHIS 2 Developers list 
> 
> Cc: Sara Gaudon ; Kristiyan Panayotov 
> 
> Subject: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 
> build revision b6e8cde
>  
> Hello all!
>  
> I am trying to create a program rule based on Date of birth and Enrollment 
> date. Basically, I want to hide one set of data elements if the client is 
> below 18 years old and another set of data elements if the client is above 18 
> years of age.
>  
> This is what I tried:
> 1)  (d2:daysBetween(A{Date of Birth}, V{enrollment_date})/365)  <18   
>   THIS DOES NOT WORK
> 2)  (d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})/365)  <18
>   This actually works(hides the data element I want), but I don’t think 
> it is the correct expression.
> 3)  d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18  
> I think that this is the correct expression, but it is executing 
> the rule (does not hide the data element).
>  
> Do you think that there might be a bug in how these expressions work? If not, 
> can someone guide me to the correct expression?
>  
> Thanks in advance,
>  
> Georgi
>  
>  
>  
>  
>   
> Georgi Chakarov, CIA | geo...@logicaloutcomes.net 
>  | +1-647-478-5634 x 104 | LogicalOutcomes 
> c/o Centre for Social Innovation, 720 Bathurst Street, Toronto Canada M5S 2R4 
> | You may unsubscribe from receiving commercial electronic messages from 
> LogicalOutcomes by emailing i...@logicaloutcomes.net 
> 
>  
> ___
> 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


[Dhis2-users] FW: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build revision b6e8cde

2017-08-08 Thread Georgi Chakarov
Hello all! Any thoughts on my email below from last week?

Thanks,

Georgi

From: Georgi Chakarov
Sent: Friday, August 4, 2017 1:01 PM
To: DHIS Users ; DHIS 2 Developers list 

Cc: Sara Gaudon ; Kristiyan Panayotov 

Subject: d2: daysbetween AND d2:yearsbetween not working properly in 2.27 build 
revision b6e8cde

Hello all!

I am trying to create a program rule based on Date of birth and Enrollment 
date. Basically, I want to hide one set of data elements if the client is below 
18 years old and another set of data elements if the client is above 18 years 
of age.

This is what I tried:

1)  (d2:daysBetween(A{Date of Birth}, V{enrollment_date})/365)  <18 
THIS DOES NOT WORK

2)  (d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})/365)  <18  
This actually works(hides the data element I want), but I don't think it is 
the correct expression.

3)  d2:yearsBetween(A{Date of Birth}, V{ enrollment _date})  <18
  I think that this is the correct expression, but it is executing the 
rule (does not hide the data element).

Do you think that there might be a bug in how these expressions work? If not, 
can someone guide me to the correct expression?

Thanks in advance,

Georgi





Georgi Chakarov, CIA | 
geo...@logicaloutcomes.net | +1-647-478-5634 
x 104 | LogicalOutcomes c/o Centre for Social Innovation, 720 Bathurst Street, 
Toronto Canada M5S 2R4 | You may unsubscribe from receiving commercial 
electronic messages from LogicalOutcomes by emailing 
i...@logicaloutcomes.net

___
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