Re: [Dhis2-users] [Dhis2-devs] WEB API Error in DHIS2.30

2018-04-20 Thread Edouard Lavaud
Hi there,

Starting from 2.29 the trackedEntity field has been renamed to
trackedEntityType.

Best,

Edouard

2018-04-20 4:44 GMT+02:00 Ocaya Stephen <stepho...@gmail.com>:

> Please note that 2.30 has not yet been officially released. But think the
> developers will look into fixing this issue.
>
> regards
>
> On Thu, Apr 19, 2018 at 11:17 PM, Adebusoye Anifalaje <
> bus...@baosystems.com> wrote:
>
>> Hi Mahdi,
>> I am forwarding your request to the user list. This is the appropriate
>> forum for asking these sort of questions.
>>
>> Best.
>> Busoye.
>>
>> -- Forwarded message -
>> From: mahdi asgari <mahdi.asg...@gmail.com>
>> Date: Thu, 19 Apr 2018 at 20:25
>> Subject: WEB API Error in DHIS2.30
>> To: <bus...@baosystems.com>
>>
>>
>> Hi dear adebusoye
>>
>> I am using dhis2 version 2.30, compiled from github (last version),
>> When i try to create trackedEntity, i get the following error
>> I seem's TrackedEntity has been removed from TrackedEntityInstance
>> how i can fix the problem.
>>
>> ERROR:
>> {"httpStatus":"Internal Server Error","httpStatusCode":500,"s
>> tatus":"ERROR","message":"Unrecognized field \"trackedEntity\" (class
>> org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance), not
>> marked as ignorable (14 known properties: \"trackedEntityInstance\",
>> \"lastUpdatedAtClient\", \"lastUpdated\", \"createdAtClient\",
>> \"trackedEntityType\", \"orgUnit\", \"inactive\", \"enrollments\",
>> \"featureType\", \"attributes\", \"deleted\", \"relationships\",
>> \"created\", \"coordinates\"])\n at [Source: {\"trackedEntityInstance\":
>> \"IKjF4BZg3hb\",\"trackedEntity\": \"nEenWmSyUEp\",\"orgUnit\":
>> \"iq6Pt6QzM4d\",\"trackedEntityType\": \"MCPQUTHX1Ze\",\"attributes\"
>> :[{\"attribute\":\"spFvx9FndA4\",\"value\":\"53\"},{\"
>> attribute\":\"w75KJ2mc4zz\",\"value\":\"\"},{\"
>> attribute\":\"hqtiQfZ66yc\",\"value\":\"??\"},{\"
>> attribute\":\"zDhUuAYrxNC\",\"value\":\"\"},{\"
>> attribute\":\"AuPLng5hLbE\",\"value\":\"51961113\"},{\"
>> attribute\":\"EO4ms2Ju3nf\",\"value\":\"1\"},{\"attribute\":
>> \"gHGyrwKPzej\",\"value\":\"2013-09-17\"},{\"attribute\":\
>> "P2cwLGskgxn\",\"value\":\"123\"},{\"attribute\":\"
>> Agywv2JGwuq\",\"value\":\"\"}],\"enrollments\":[{\"orgUnit\":
>> \"iq6Pt6QzM4d\",\"program\": \"LaWt5AR1tfl\",\"enrollmentDate\":
>> \"2013-09-17\",\"incidentDate\": \"2013-09-17\"}]}; line: 1, column: 59]
>> (through reference chain: org.hisp.dhis.dxf2.events.trac
>> kedentity.TrackedEntityInstance[\"trackedEntity\"])"}
>>
>> JSON DATA:
>> {"trackedEntityInstance": "IKjF4BZg3hb","orgUnit":
>> "iq6Pt6QzM4d","trackedEntity":"lp7Kq6QzS4d","trackedEntityType":
>> "MCPQUTHX1Ze","attributes":[{"attribute":"spFvx9FndA4","valu
>> e":"53","attribute":"w75KJ2mc4zz","value":"","attribute"
>> :"hqtiQfZ66yc","value":"??","attribute":"zDhUuAYrxNC","
>> value":"","attribute":"AuPLng5hLbE","value":"51961113","attribute":"
>> EO4ms2Ju3nf","value":"1","attribute":"gHGyrwKPzej","value":"
>> 2013-09-17","attribute":"P2cwLGskgxn","value":"123","
>> attribute":"Agywv2JGwuq","value":""}],"enrollments":[{"orgUnit":
>> "iq6Pt6QzM4d","program": "LaWt5AR1tfl","enrollmentDate":
>> "2013-09-17","incidentDate": "2013-09-17"}]}
>>
>> thanks in advanced
>> --
>> Forgive the typos. Using handheld device
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-d...@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> --
> *Stephen Ocaya*
> Tel: +256 393 217 892 | Mob: +256774558980
> www.stephocay.com
> SkypeID: stephocay
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-d...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
*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
___
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-11 Thread Edouard Lavaud
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 <em.hispviet...@gmail.com>:
> 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

___
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] Get number of days between two event dates in different program stages

2018-04-11 Thread Edouard Lavaud
Hi Rady,

I used a kind of hack for doing that:

I first used a program rule to copy the event_date into a new data
element of the program stage (so, yup, the date is kind of duplicated
in the stage).

However then I could create a program rule variable to fetch this date
I wanted, and compare it with another one.

Hope this could help.

Best,

Edouard

2018-04-11 6:39 UTC+02:00, Rady <tryr...@gmail.com>:
> Hello DHIS2 community,
>
> I have a doubt how to get number of days between two event dates in
> different program stages. For example,
> *d2:daysBetween(programstage1.V{event_date},programstage2.V{event_date})*.
>
> Anybody used to have experience on this? please help.
>
> Thanks,
> Rady
>


-- 
*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

___
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] DHIS2 login redirects to 404 page

2018-03-19 Thread Edouard Lavaud
Hi Nguza,

I didnt try yet the desktop version, but I am also experiencing this issue
with 2.28 (not the 29 so far).
It seems that the redirection after logging-in is buggy, on particular
conditions:

If I am not logged in, and try to access a specific page of DHIS2 (for
example the tracker capture app), it will first ask me to log in, and then
I have the same bug as you.
If I am not logged in, and try to access the main DHIS2 url (in my case "
http://localhost/;, nothing after), everything works fine.

So, does your user try to access directly a specific page of DHIS2 (maybe
using a shortcut, or with an automatically completed URL in the browser)?

If yes, I would suggest you to change the shortcut to the main DHIS2 url.
Then your user will go "manually" to the specific page s/he wants.

This is a work-around.
It does not change that there is bug that needs to be solved and you can
create a Jira issue about it.

Best,

Edouard



2018-03-19 8:51 GMT+02:00 Nguza Yikona <nguzajyikona@gmail.com>:

> Dear community,
>
> We're having a problem with an instance. After user performs a login
> attempt on the desktop version, DHIS2 redirects to the following page :
>
>
> https://domain.name*/api/files/fonts/LiberationSans-Bold-webfont.ttf*
>
> How do I get it to redirect to https://domain.name
> */dhis-web-dashboard-integration/index.html?*
>
> Thank you all in advance,
>
> Nguza
>
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-d...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
*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
___
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] Substract Days in program Rules

2018-03-18 Thread Edouard Lavaud
Hi Djibril,

You can actually use the d2 adddays function to substract days.
Just use a negative number.
For example d2:addDays(V{current_date}, -3) will return the date three days ago.

Best,

Edouard

2018-03-18 21:12 UTC+02:00, DJIBRIL Hakim <djib.ha...@gmail.com>:
> Hi,
> PLEASE how to do a substract Days from a date in program Rule, The resultat
> must be a date of course , I saw in documentation a D2:addDays() function.
> is there another for substractDays. if not what is the work around.
> Best.
>


-- 
*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

___
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] DHIS 2 on stackexchange

2018-03-13 Thread Edouard Lavaud
Hi Lars,

I have seen that reddit is also sometimes used for DHIS2 questions.

Out of curiosity, and I am sure it is a discussion you already had many
times:
Why DHIS2 doesnt have their own forum?
That is usually the case for open-source projects of that size, and it
would create a knowledge base.
The mailing list is not convinient, and Jira too technical & usually made
for the "official" team.

I did install last month a nodeBB forum for a friend and it is quite easy
and nice looking. For Q stuff there is Askbot, question2answer, praizaQA
etc

Thanks,

Edouard


2018-03-13 17:23 GMT+02:00 Lars Helge Ă˜verland <l...@dhis2.org>:

> Hi,
>
> as some of you have noticed we have a *dhis2* tag on the *ProWebmasters*
> community on StackExchange. This platform is for Q, meaning concrete
> questions with concrete answers (as opposed to e.g. the long conversations
> you can find on the mailing lists).
>
> There are currently several open and unanswered questions which you can
> find here:
>
> https://webmasters.stackexchange.com/questions/tagged/dhis2
>
> It's much appreciated if anyone would like to contribute by answering
> questions.
>
>
>
> best regards,
>
> Lars
>
>
>
> --
> Lars Helge Ă˜verland
> Technical lead, DHIS 2
> University of Oslo
> l...@dhis2.org
> https://www.dhis2.org
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-d...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
*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
___
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] Tracker - No default event date / report date in stage / event

2018-03-08 Thread Edouard Lavaud
Hi there,

We are afraid of data quality issues in our future tracker program with the
report date / event date of the stages / events (sorry, still unsure of the
terminology).

We are doing retrospective data entry and, knowing our data encoding team,
they will too often forget to change the report date (with DHIS2 it is set
by default to today's date).

The timeline of the events / stages is quite important so we would prefer
to just remove the default date to not mess up the analysis.

Any ideas how to do that? Or any work around?

So far I made a program rule:

if V{event_date} == V{current_date}
  Show warning on the first element of the stage. Something like "Are
you sure you entered the right report date?"

Improvement suggestions, unless I missed something :)

   - When designing a program stage, tick a box to have or not a default
   report date
   - Program rule to assign a value (or show warning, error etc...) to the
   report date (so far only data elements listed, but not the report date)


Thanks!

Edouard

PS: Just migrated to 2.29
___
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] Web API - Finding organization units assigned to a program

2018-02-28 Thread Edouard Lavaud
Oh great! Thanks Jason & Melaeke!
Works like a charm!

2018-02-28 11:06 GMT+02:00 Melaeke Serawit <smelaek...@gmail.com>:

> Hello,
>
> For finding all org units assigned to a specific program you could use :
>
> your-web-address/api/programs/the-program-id-you-want-to-
> view?fields=id,displayName,organisationUnits[id,displayName]
>
> This just shows you the id and the name of the organisation units. For
> more info you can take a look at the section "Metadata field filter" in the
> developer manual.
>
> Sincerely.
>
>
> On Wednesday, February 28, 2018, Edouard Lavaud <edouard.lav...@gmail.com>
> wrote:
>
>> Hi there,
>>
>> Using 2.28 and its web API, I need to find all the organisation units
>> which have been assigned a specific tracker program.
>>
>> Any idea how I could handle that? (I  could loop through all OU and test
>> them, but that is not super beautiful, isn't it?)
>>
>> Thanks!
>>
>> Edouard
>>
>


-- 
*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
___
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] Web API - Finding organization units assigned to a program

2018-02-28 Thread Edouard Lavaud
Hi there,

Using 2.28 and its web API, I need to find all the organisation units which
have been assigned a specific tracker program.

Any idea how I could handle that? (I  could loop through all OU and test
them, but that is not super beautiful, isn't it?)

Thanks!

Edouard
___
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