Re: [Dhis2-devs] Issues with Upgrade from DHIS 2.26 to DHIS 2.27

2017-11-30 Thread Jhansi Reddy Karee
Hi Morten,

Thanks for fixing the enrollments and trackedEntityInstance APIs to
continue to return the lastUpdated and created timestamps.

We are still not able to figure out on how can we provide translations for
legends through legendSet web API.

The only way we are able to translate legends is through POST '
/api/25/metadata' call.

> Even for contained objects like legends, you still translate in the same
way, just add a array called translations on the legend, and fill in your
props.
Could you give more details on this or point us to an endpoint.

Thanks,
Jhansi





On Fri, Nov 24, 2017 at 9:40 AM, Morten Olav Hansen 
wrote:

> Please try again with latest 227
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Thu, Nov 23, 2017 at 11:00 AM, Morten Olav Hansen 
> wrote:
>
>> > Legends are now directly contained in the object where they are used,
>>> so no need to reference by UIDs anymore, translations should also be put
>>> directly in the legend payload.
>>> We see that we may translate the legends through POST '/api/25/metadata'
>>> call.
>>> Is there any other way to translate legends? Can you point us to an
>>> appropriate API?
>>>
>>
>> The translations are now directly a part of the payload itself, you can
>> see that if you try and translate any part of dhis2, then go to
>> /api/type/ID and you will see the translations directly contained in the
>> payload itself.
>>
>> As an example, you can have a look here:
>> https://play.dhis2.org/dev/api/dataElements.json?fields=id,
>> displayName,translations
>>
>> the translation object itself is built up of: property (can be NAME,
>> SHORT_NAME, DESCRIPTION, and FORM_NAME for data elements), locale, value.
>>
>> Even for contained objects like legends, you still translate in the same
>> way, just add a array called translations on the legend, and fill in your
>> props.
>>
>> > created/lastUpdated should not be gone, I think thats a bug, I will
>>> look into it.
>>> From this, we understand that the lastUpdated and created timestamps
>>> also must be available along with lastUpdatedAtClient and
>>> createdAtClient timestamps in the response. Could you confirm if it is
>>> true.
>>>
>>
>> Both created, createdAtClient, lastUpdated, lastUpdatedAtClient will be
>> there. Created/lastUpdated will be read-only, while *AtClient can be
>> changed by the client (mostly for usage in offline systems)
>>
>>
>>>
>>>  In DHIS 2.27, the enrollments and trackedEntityInstance API responses
>>> are returning the lastUpdatedAtClient and createdAtClient timestamps
>>> only. Because of this, we think the lastUpdated and created timestamps have
>>> been renamed to lastUpdatedAtClient and createdAtClient. If this is the
>>> case, we think that the data in lastUpdated and created must be
>>> migrated to lastUpdatedAtClient and createdAtClient. If yes, could you
>>> point us to any such migration script?
>>>
>>> Thanks,
>>> Madhoolika/Jhansi
>>>
>>>
>>> On Wed, Nov 22, 2017 at 8:12 AM, Morten Olav Hansen 
>>> wrote:
>>>
 Hi Jhansi

 Legends are now directly contained in the object where they are used,
 so no need to reference by UIDs anymore, translations should also be put
 directly in the legend payload.

 created/lastUpdated should not be gone, I think thats a bug, I will
 look into it.

 --
 Morten Olav Hansen
 Senior Engineer, DHIS 2
 University of Oslo
 http://www.dhis2.org

 On Tue, Nov 21, 2017 at 1:18 PM, Jhansi Reddy Karee <
 jhans...@thoughtworks.com> wrote:

> Hello Team,
>
> Did you get a chance to take a look at DHIS 2.27 upgrade issues?
>
> Thanks,
> Jhansi
>
>
>
>
> On Wed, Nov 15, 2017 at 12:14 PM, Mani Madhoolika Bulusu <
> mbul...@thoughtworks.com> wrote:
>
>>
>> Hello team,
>>
>> We are planning an upgrade from DHIS 2.26 to DHIS 2.27, and
>> encountered the following blockers during analysis:
>>
>>- In DHIS 2.26, we were entering the legend translations using
>>PUT '/api/25/legends/{someLegendId}/translations.json'. In DHIS
>>2.27 this URL is failing with 404 error code. Could you point us to 
>> an end
>>point for translating the legends in DHIS 2.27?
>>- In DHIS 2.27, Enrollments and TrackedEntityInstance APIs are
>>returning lastUpdatedAtClient and createdAtClient timestamps instead 
>> of
>>lastUpdated and created timestamps. On upgrading DHIS from 2.26 to 
>> 2.27, we
>>are not getting lastUpdatedAtClient and createdAtClient timestamps 
>> for the
>>Enrollments and TrackedEntityInstances created in DHIS 2.26. Could you
>>point us to a migration script to migrate the lastUpdated and created 
>> to
>>lastUpdatedAtClient and createdAtClient, if any.
>>
>> Let us know if you need more 

Re: [Dhis2-devs] what wrong with import metadata?

2017-11-30 Thread Ramón José Jiménez Pomareta
Hello !

I have a workaround for this,

I THINK this error raises when the users or the usergroups that appears in
the metadata dont exists in the target platform. If you don't want or you
cant have these users/usergroups in the target platform you have to export
without sharing settings (as Olav proposed)

but

if you export something with dependencies (where you cannot export without
sharing) you have to remove it from the xml/json exported.

the problem is that you  will remove all the sharing settings of all the
dependencies (maybe some dataelements are shared between more than one
dataset and removing that would not be a good idea).

If you still can deal with that risk, here are two regular expressions to
remove that easily (only for xml, you can adapt to json):

(.|\n)+?(?=)
(.|\n)+?(?=)

Hope this workaround helps in the meantime...

2017-11-30 15:36 GMT+01:00 林晓东 :

> No more news
>
>
>
>
> --
> 此致
>
> easy
>
> 莫愁前路无知己,天下谁人不识君。
>
> At 2017-11-28 17:18:50, "Ramón José Jiménez Pomareta" 
> wrote:
>
> Hello,
>
> I have also the same problem exporting and importing a legendSet through
> the API. (GET and POST/PUT).
>
> Do you have any news ? Thanks !
>
> 2017-10-27 11:21 GMT+02:00 Ramón José Jiménez Pomareta 
> :
>
>> I had the same issue importing groups "with sharing". Do you know what is
>> happening? I'ts going to be corrected? Thank you !
>>
>> 2017-06-08 6:12 GMT+02:00 Morten Olav Hansen :
>>
>>> Hi
>>>
>>> I'm looking into it, but could you try to export without sharing, and
>>> see if that helps?
>>>
>>> --
>>> Morten Olav Hansen
>>> Senior Engineer, DHIS 2
>>> University of Oslo
>>> http://www.dhis2.org
>>>
>>> On Wed, Jun 7, 2017 at 10:03 PM, 林晓东  wrote:
>>>
 hi,all
  Here is the error of my importing from export file at dhis2.org demo.
  (windows10, dhis2 2.27,jdk.1.8)
 what's mean?


 * INFO  2017-06-07 23:00:37,958 [Level: INFO, category:
 METADATA_IMPORT, time: Wed Jun 07 23:00:37 CST 2017, message: (admin)
 Creating 894 object(s) of type DataElement] (InMemoryNotifier.java
 [taskScheduler-6])
 * ERROR 2017-06-07 23:00:38,802 Unexpected error occurred in scheduled
 task. (TaskUtils.java [taskScheduler-6])
 org.hibernate.TransientObjectException: object references an unsaved
 transient instance - save the transient instance before flushing:
 org.hisp.dhis.user.UserGroup
 at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifie
 rIfNotUnsaved(ForeignKeys.java:279)
 at org.hibernate.type.EntityType.getIdentifier(EntityType.java:
 462)
 at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:
 281)
 at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:
 291)
 at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:322)
 at org.hibernate.persister.entity.AbstractEntityPersister.findD
 irty(AbstractEntityPersister.java:4204)
 at org.hibernate.event.internal.DefaultFlushEntityEventListener
 .dirtyCheck(DefaultFlushEntityEventListener.java:528)
 at org.hibernate.event.internal.DefaultFlushEntityEventListener
 .isUpdateNecessary(DefaultFlushEntityEventListener.java:215)
 at org.hibernate.event.internal.DefaultFlushEntityEventListener
 .onFlushEntity(DefaultFlushEntityEventListener.java:142)
 at org.hibernate.event.internal.AbstractFlushingEventListener.f
 lushEntities(AbstractFlushingEventListener.java:216)
 at org.hibernate.event.internal.AbstractFlushingEventListener.f
 lushEverythingToExecutions(AbstractFlushingEventListener.java:85)
 at org.hibernate.event.internal.DefaultAutoFlushEventListener.o
 nAutoFlush(DefaultAutoFlushEventListener.java:44)
 at org.hibernate.internal.SessionImpl.autoFlushIfRequired(Sessi
 onImpl.java:1264)
 at org.hibernate.internal.SessionImpl.list(SessionImpl.java:178
 0)
 at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:3
 63)
 at org.hisp.dhis.deletedobject.hibernate.HibernateDeletedObject
 Store.query(HibernateDeletedObjectStore.java:162)
 at org.hisp.dhis.deletedobject.hibernate.HibernateDeletedObject
 Store.delete(HibernateDeletedObjectStore.java:71)
 at org.hisp.dhis.deletedobject.DefaultDeletedObjectService.dele
 teDeletedObjects(DefaultDeletedObjectService.java:65)
 at sun.reflect.GeneratedMethodAccessor619.invoke(Unknown
 Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
 thodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsin
 gReflection(AopUtils.java:333)
 at 

Re: [Dhis2-devs] what wrong with import metadata?

2017-11-30 Thread 林晓东
No more news





--

此致

easy

莫愁前路无知己,天下谁人不识君。

At 2017-11-28 17:18:50, "Ramón José Jiménez Pomareta"  wrote:

Hello,


I have also the same problem exporting and importing a legendSet through the 
API. (GET and POST/PUT).


Do you have any news ? Thanks !


2017-10-27 11:21 GMT+02:00 Ramón José Jiménez Pomareta :

I had the same issue importing groups "with sharing". Do you know what is 
happening? I'ts going to be corrected? Thank you !


2017-06-08 6:12 GMT+02:00 Morten Olav Hansen :

Hi


I'm looking into it, but could you try to export without sharing, and see if 
that helps?


-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org


On Wed, Jun 7, 2017 at 10:03 PM, 林晓东  wrote:

hi,all
 Here is the error of my importing from export file at dhis2.org demo.  
(windows10, dhis2 2.27,jdk.1.8)
what's mean?




* INFO  2017-06-07 23:00:37,958 [Level: INFO, category: METADATA_IMPORT, time: 
Wed Jun 07 23:00:37 CST 2017, message: (admin) Creating 894 object(s) of type 
DataElement] (InMemoryNotifier.java [taskScheduler-6])
* ERROR 2017-06-07 23:00:38,802 Unexpected error occurred in scheduled task. 
(TaskUtils.java [taskScheduler-6])
org.hibernate.TransientObjectException: object references an unsaved transient 
instance - save the transient instance before flushing: 
org.hisp.dhis.user.UserGroup
at 
org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:462)
at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)
at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)
at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:322)
at 
org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4204)
at 
org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)
at 
org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)
at 
org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)
at 
org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)
at 
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)
at 
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
at 
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1264)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1780)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
at 
org.hisp.dhis.deletedobject.hibernate.HibernateDeletedObjectStore.query(HibernateDeletedObjectStore.java:162)
at 
org.hisp.dhis.deletedobject.hibernate.HibernateDeletedObjectStore.delete(HibernateDeletedObjectStore.java:71)
at 
org.hisp.dhis.deletedobject.DefaultDeletedObjectService.deleteDeletedObjects(DefaultDeletedObjectService.java:65)
at sun.reflect.GeneratedMethodAccessor619.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at 
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy57.deleteDeletedObjects(Unknown Source)
at 
org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.handleCreates(DefaultObjectBundleService.java:228)
at 
org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 

Re: [Dhis2-devs] [Dhis2-users] Update Category option combination

2017-11-30 Thread Ifeanyi Okoye
Dear All,I have attached a screenshot showing what I had been trying to 
describe. Normally, the catcombo name does not show as part of the data element 
name in the dataset window, but in this case, it is showing up. However, in 
this case, this data element no longer has the catcombo associated with it. We 
had changed it when we were experiencing some difficulty with some of the items 
showing up on the form designer. However, the changes did not take effect until 
we had to remove this from the dataset and then add it back again.
Not sure what is causing this though...

Warm Regards, 

Ifeanyi

Read DrMaestro's Blog
www.ifeanyiokoye.com
 

On Wednesday, November 29, 2017, 8:02:48 AM GMT+1, Ifeanyi Okoye 
 wrote:  
 
 Dear Djibril,I actually don't think the issues are different. In our own case, 
we renamed category options but when you get to the form designer, what is 
showing up is the old name. Running maintenance did not help. Running data 
integrity showed that the changes made to some of the category option 
combinations did not take effect and we had to recreate all the ones that did 
not take effect.However, it wasn't until we removed the data element that had 
the category option combo (that wasn't changing) from the dataset, and then 
added it back, did the changes take effect. Not sure why this is happening, but 
give it a try and see what happens.

Warm Regards, 

Ifeanyi

Read DrMaestro's Blog
www.ifeanyiokoye.com
 

On Tuesday, November 28, 2017, 4:57:03 PM GMT+1, Djibril Dione 
 wrote:  
 
 Thanks Ifeanyi for the update.Our issue is a bit different here all is 
populating well on Data entry and people are capturing data. just that the 
category option combination names are not updated with the correct and we use 
those name in a complex completeness report script. 
Test step On Sierra Leon 2.27   
   -  I have renamed the dataelementcategoryoption "Improve access to clean 
water" to "IACW"
   -  then go to administration app > maintenance > select "Update category 
option combinations"  and click "perform maintenance".
   -  then I go to category option combination under maintenance (metadata) and 
search for "IACW" and could not find it but when you search for "Improve access 
to clean water" you get many that pop in. i.e: "AIDSRelief Consortium, Improve 
access to clean water" which supposes to be renamed to "AIDSRelief Consortium, 
IACW"
   - I create a sqlView that search on the categoryoptioncombo Table and I got 
the same result as the front end
so whenever you rename a categoryoption I believe that the category option 
combination name should also reflect the new name once an Update category 
option combinations is performed
On Tue, Nov 28, 2017 at 5:03 PM, Ifeanyi Okoye  wrote:

Just an update on this. 
Everything I tried initially did not work. I then went to the dataset editor 
window to remove the problematic data elements and once I filtered them, I 
found that each one of them had in parenthesis at the end of the name of the 
data element, the category option combo that was causing the issue. Once I 
removed and put it back, the issue was resolved.
I hope this helps somebody.
Thank you.

Warm Regards, 

Ifeanyi

Read DrMaestro's Blog
www.ifeanyiokoye.com
 

On Monday, November 27, 2017, 10:04:23 AM GMT+1, Ifeanyi Okoye 
 wrote:  
 
 Hello Lars,This is similar to the issue I raised on this platform last week.
What I noticed is that some data elements will carry the old category option 
combo even after it has been changed or updated. This affects the form designer 
and section forms. In our own case, everything refused to update. I ran 
maintenance severally with no effect whatsoever. 
I am posting the thread below as only one person weighed in on this:
Thread:

Hello Laura,Thank you for your response.
We are currently running the 22nd Nov (dbf5f18) build of version 2.27 which we 
upgraded to on Thursday, this past week but the issue is still persisting.
I have recreated the category option combination and applied it to the data 
element but the same issue is still persisting. When I do a metadata export 
from the API, the missing categories are not on the list. It is as though DHIS 
does not even create them for whatever reason.
I don't know if anyone can provide some insight on what we could do to fix this 
since upgrading did not help.
It's affecting our roll out plans.
Thank you once again.

Warm Regards, 

Ifeanyi

Read DrMaestro's Blog
www.ifeanyiokoye.com


On Tuesday, November 21, 2017, 10:21:58 PM GMT+1, Laura E. Lincks 
 wrote:

You may want to upgrade to the latest build. We had a similar problem with 2.27 
(on a build from August) and we just upgraded this very minute to the latest 
build 37edfc2 (Nov 8, 2017) and the problem appears fixed.

Laura E. Lincks
Database Manager/Developer
ICAP - Columbia University
Mailman School of 

Re: [Dhis2-devs] [Dhis2-users] National DHIS2 and R Integration

2017-11-30 Thread Mamadou Diao Diallo
Thank you Vieira and Olav for your answers,

I am referring to Malaria program, especially national dhis2 routine data
analysis with R.

Hope this is clear.

Diao

On Thu, Nov 30, 2017 at 12:10 PM, Don Vieira 
wrote:

> Hi Diao
>
>
> I have also consulted and worked along with JSI and MEASURE in Namibia and
> South Africa.
>
> The programs vary, NACS,WASH,HIV/ART etc.
>
>
> Which program you referring to and what aspects to improve?
>
>
> Regards
>
>
>
> [image: 1500893840547_email-signatures.jpg]
>
>
> --
> *From:* Dhis2-users  lists.launchpad.net> on behalf of Mamadou Diao Diallo <
> diao_dia...@gn.jsi.com>
> *Sent:* Thursday, November 30, 2017 1:56 PM
> *To:* DHIS 2 developers; dhis2-users
> *Subject:* [Dhis2-users] National DHIS2 and R Integration
>
> Hi all,
>
> I would like to improve a national health program during my internship
> with the R software and the national dhis2.
>
> But I lack of informations, ideas about possibilities, and all that can be
> useful to improve the program.
>
> Can you please share any links that can help me.
>
> Best regards.
>
> Diao
>
> --
> *DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District
> Health Information Software )*
>
>
> *Projet de Renforcement du Système d'Information Sanitaire en Guinée*
> *Phone : 623909413 | 662256106*
> *Skype : diawwdiallo*
> www.jsi.com
>



-- 
*DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District
Health Information Software )*


*Projet de Renforcement du Système d'Information Sanitaire en Guinée*
*Phone : 623909413 | 662256106*
*Skype : diawwdiallo*
www.jsi.com
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Dhis2-users] National DHIS2 and R Integration

2017-11-30 Thread Morten Olav Hansen
Hi

You don't say exactly which part you want to improve, but having a look at
Jasons github repo might be a good start [1]. At least it shows some
examples of working with the API using R.

[1] https://github.com/jason-p-pickering/dhis2-data-munging

-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org

On Thu, Nov 30, 2017 at 6:56 PM, Mamadou Diao Diallo  wrote:

> Hi all,
>
> I would like to improve a national health program during my internship
> with the R software and the national dhis2.
>
> But I lack of informations, ideas about possibilities, and all that can be
> useful to improve the program.
>
> Can you please share any links that can help me.
>
> Best regards.
>
> Diao
>
> --
> *DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District
> Health Information Software )*
>
>
> *Projet de Renforcement du Système d'Information Sanitaire en Guinée*
> *Phone : 623909413 | 662256106*
> *Skype : diawwdiallo*
> www.jsi.com
>
> ___
> Mailing list: https://launchpad.net/~dhis2-users
> Post to : dhis2-us...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] National DHIS2 and R Integration

2017-11-30 Thread Mamadou Diao Diallo
Hi all,

I would like to improve a national health program during my internship with
the R software and the national dhis2.

But I lack of informations, ideas about possibilities, and all that can be
useful to improve the program.

Can you please share any links that can help me.

Best regards.

Diao

-- 
*DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District
Health Information Software )*


*Projet de Renforcement du Système d'Information Sanitaire en Guinée*
*Phone : 623909413 | 662256106*
*Skype : diawwdiallo*
www.jsi.com
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp