Re: [Dhis2-devs] [Dhis2-users] Merge multiple orgUnits DHIS2 2.24

2017-01-10 Thread Jason Pickering
Hi there,
This functionality was removed from the core due to some issues with its
implementation.

I have created two SQL functions which may help you to merge organisation
units

1) https://github.com/dhis2/dhis2-utils/blob/master/
resources/sql/merge_orgunits.sql
2)
https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_site_with_data.sql

You may need to make some changes to these scripts to suit your version,
but we have used them on a few different production systems with success.

Hope this helps.

Regards,
Jason


On Tue, Jan 10, 2017 at 8:28 AM, Raminosoa Rabemanantsoa, Tantely <
tramino...@mikolo.org> wrote:

> Dear community,
>
> Do you find the way to merge multiple orgUnits into a single one in DHIS2
> 2.24. Do you have suggestions on doing this manually or via web API?
>
> Best,
>
> Tantely.
>
> *This message and its attachments are confidential and solely for the
> intended recipients. If received in error, please delete them and notify
> the sender via reply e-mail immediately.*
> ___
> 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
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
___
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] Merge multiple orgUnits DHIS2 2.24

2017-01-10 Thread Raminosoa Rabemanantsoa, Tantely
Dear Jason,

Thank you for your response. I will use those SQL scripts to merge multiple
orgUnits. I will be back in case of trouble.

Many thanks !

Tantely.

Le 10 janv. 2017 10:59 AM, "Jason Pickering" 
a écrit :

> Hi there,
> This functionality was removed from the core due to some issues with its
> implementation.
>
> I have created two SQL functions which may help you to merge organisation
> units
>
> 1) https://github.com/dhis2/dhis2-utils/blob/master/resource
> s/sql/merge_orgunits.sql
> 2) https://github.com/dhis2/dhis2-utils/blob/master/
> resources/sql/delete_site_with_data.sql
>
> You may need to make some changes to these scripts to suit your version,
> but we have used them on a few different production systems with success.
>
> Hope this helps.
>
> Regards,
> Jason
>
>
> On Tue, Jan 10, 2017 at 8:28 AM, Raminosoa Rabemanantsoa, Tantely <
> tramino...@mikolo.org> wrote:
>
>> Dear community,
>>
>> Do you find the way to merge multiple orgUnits into a single one in DHIS2
>> 2.24. Do you have suggestions on doing this manually or via web API?
>>
>> Best,
>>
>> Tantely.
>>
>> *This message and its attachments are confidential and solely for the
>> intended recipients. If received in error, please delete them and notify
>> the sender via reply e-mail immediately.*
>> ___
>> 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
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.picker...@gmail.com
> tel:+46764147049 <+46%2076%20414%2070%2049>
>

-- 
*This message and its attachments are confidential and solely for the 
intended recipients. If received in error, please delete them and notify 
the sender via reply e-mail immediately.*
___
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] Error on GIS

2017-01-10 Thread Mahbubul Alam
Dear Team,
Hope you doing well. we facing some problem with GIS on DHIS2 version 2.21
please see the attached screenshot for error details.

Plz help..



-- 
[image: http://iedcr.gov.bd/images/stories/logo_new.jpg]
Thanks
*Mahbubul Alam* | "*IT Consultant*" (GHSA Project)
Msc in CSE, Bsc in CSc. Associate Member of BCS.

*Institute of Epidemiology Disease Control & Research (IEDCR)*
www.iedcr.gov.bd
Mohakhali Dhaka.
___
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] How to reduce table columns

2017-01-10 Thread Paul Baloyi
I am new to DHIS2 andI have a data entry form which does not fit onto the 
screen below;

[cid:1ff26a80-d34c-43ed-ba0e-1ae6c7007c33]
I want to reduce the size of the columns and the text boxes so that that it 
fits properly.

Your assistance is greatly appreciated.

regards,

Paul
___
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] Extract CommCare cases and import into DHIS2

2017-01-10 Thread alexandre . vanobberghen
Hi,

We just wanted to share a simple tool to routinely extract cases from 
CommCare and load them as anonymous events into DHIS 2.

https://github.com/SwissTPH/commcare-cases-dhis2-events

Feedback is welcome



--
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error, please notify us immediately by 
reply e-mail and delete this message from your system.
--___
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] How to reduce table columns

2017-01-10 Thread Paul Baloyi
Dear Prosper,


I have checked the style on the source code and is, style="width:3em///" on 
each text box. Is it proper CSS to have tripple slashes '///' or  double 
slashes '//'.


regards,


Paul


From: Prosper BT 
Sent: Monday, January 9, 2017 4:49 PM
To: Paul Baloyi
Cc: DHIS 2 Developers list; DHIS 2 Users list
Subject: Re: [Dhis2-users] How to reduce table columns

Hi Paul,

You can add input text box sytle since the headings are short it will adjust 
the columns
style="width: 3em;"

Regards

Prosper Behumbiize, MPH
DHIS2 Implementation| HISP Uganda
+256 752 751 776 | +256 776 139 139
pros...@hispuganda.org | 
pros...@dhis2.org | Skype: prospertb

On Mon, Jan 9, 2017 at 5:29 PM, Paul Baloyi 
mailto:paul...@hotmail.com>> wrote:
I am new to DHIS2 andI have a data entry form which does not fit onto the 
screen below;

[cid:1ff26a80-d34c-43ed-ba0e-1ae6c7007c33]
I want to reduce the size of the columns and the text boxes so that that it 
fits properly.

Your assistance is greatly appreciated.

regards,

Paul

___
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] DataCapture

2017-01-10 Thread Guy Ekani
Hello Team, Happy New Year !

Please could you share the good DHIS2 Data Capture APK  that's working fine
with DHis 2.24#704143a

Sincerely,

-- 
=
EKANI Guy
___
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] Error on GIS

2017-01-10 Thread Bjørn Sandvik
Hi Mahbubul,

Google Maps have changed policies and this is fixed in DHIS 2.23 and above.
I would advice you to upgrade your DHIS 2 instance, as there are several
new GIS features in 2.23, 2.24 and 2.25 - and the upcoming 2.26. If you
still need to use DHIS 2.21, you can use the OpenStreetMap basemap.

Regards,
Bjørn

-- 
Bjørn Sandvik
GIS developer, DHIS 2
University of Oslo
www.dhis2.org


On Tue, Jan 10, 2017 at 9:58 AM, Mahbubul Alam  wrote:

>
> Dear Team,
> Hope you doing well. we facing some problem with GIS on DHIS2 version 2.21
> please see the attached screenshot for error details.
>
> Plz help..
>
>
>
> --
> [image: http://iedcr.gov.bd/images/stories/logo_new.jpg]
> Thanks
> *Mahbubul Alam* | "*IT Consultant*" (GHSA Project)
> Msc in CSE, Bsc in CSc. Associate Member of BCS.
>
> *Institute of Epidemiology Disease Control & Research (IEDCR)*
> www.iedcr.gov.bd
> Mohakhali Dhaka.
>
>
>
>
>
> ___
> 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


Re: [Dhis2-devs] [Dhis2-users] Error on GIS

2017-01-10 Thread Hannan Khan
Dear Mahbub

Google Map change there policy, as Bjørn already mentioned, upgrade to
upper version version.

As our Director General Health is instructed we are in process to work
together with IEDCR and we are in process to meet your director and
relevant person soon.

Also we can help you to upgrade your system. Please keep in touch.

Regards

On Tue, Jan 10, 2017 at 2:58 PM, Mahbubul Alam  wrote:

>
> Dear Team,
> Hope you doing well. we facing some problem with GIS on DHIS2 version 2.21
> please see the attached screenshot for error details.
>
> Plz help..
>
>
>
> --
> [image: http://iedcr.gov.bd/images/stories/logo_new.jpg]
> Thanks
> *Mahbubul Alam* | "*IT Consultant*" (GHSA Project)
> Msc in CSE, Bsc in CSc. Associate Member of BCS.
>
> *Institute of Epidemiology Disease Control & Research (IEDCR)*
> www.iedcr.gov.bd
> Mohakhali Dhaka.
>
>
>
>
>
> ___
> 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
>
>


-- 
Muhammad Abdul Hannan Khan
Secretary
HISP Bangladesh

T +880-2- 8816459, 8816412 ext 118
F +88 02 8813 875
M+88 01819 239 241
M+88 01534 312 066
E hann...@gmail.com
S hannan.khan.dhaka
B hannan-tech.blogspot.com
L https://bd.linkedin.com/in/hannankhan
___
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] DataCapture

2017-01-10 Thread Erling Fjelstad
Hello,
Have you tried the one on Google Play?

Regards,
Erling

On Tue, Jan 10, 2017 at 12:02 PM Guy Ekani  wrote:

> Hello Team, Happy New Year !
>
> Please could you share the good DHIS2 Data Capture APK  that's working
> fine with DHis 2.24#704143a
>
> Sincerely,
>
> --
> =
> EKANI Guy
>
>
> ___
> 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
>
___
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] how to set "scheduling automated aggregation"

2017-01-10 Thread Uwe Wahser
Dear Channara,

if you want to run aggregations at your own intervals you can trigger them via 
the web-api /api/25/resourceTables/analytics, e.g. with curl in a cron-job. (I 
am using a step in kettle after loading data).

https://ci.dhis2.org/docs/2.25/en/developer/html/dhis2_developer_manual_full.html#webapi_generating_resource_analytics_tables

However, you should make sure that you are not starting the processes again, 
while the first one is still running (at least that was my experience from one 
year ago). For this you should a) turn OFF automatic aggregation and/or b) 
verify the status of any previous aggregation via /api/25/system/tasks/ before 
triggering (haven't tested this one myself)

https://ci.dhis2.org/docs/2.25/en/developer/html/dhis2_developer_manual_full.html#d8566e10683

Not sure, though, whether all of these were available in 2.20 ...

Regards - Uwe

---

> Prosper BT  hat am 10. Januar 2017 um 07:24 geschrieben:
> 
> 
> Dear Cannara,
> 
> The automated aggregation is under Program/Attributes
> [image: Inline image 1]
> 
> Note that you cant trigger every 15 minutes with the above, its will only
> run when analytics run at midnight.
> 
> There may be ways to run a script that can trigger this every 15 minutes
> 
> Regards
> 
> Prosper Behumbiize, MPH
> DHIS2 Implementation| HISP Uganda
> +256 752 751 776 | +256 776 139 139
> pros...@hispuganda.org  | pros...@dhis2.org | Skype:
> prospertb
> 
> On Tue, Jan 10, 2017 at 6:03 AM, channara rin 
> wrote:
> 
> > dear prosper,
> > is version 2.20.
> > i want to set task schedule for running every 15mn
> >
> > On Mon, Jan 9, 2017 at 7:01 PM, Prosper BT  wrote:
> >
> >> Dear Channara,
> >>
> >> Do you mean aggregation form the query builder?
> >>
> >> Which version of DHIS2 are you using?
> >>
> >> Regards
> >>
> >>
> >>
> >> Prosper Behumbiize, MPH
> >> DHIS2 Implementation| HISP Uganda
> >> +256 752 751 776 | +256 776 139 139
> >> pros...@hispuganda.org  | pros...@dhis2.org | Skype:
> >> prospertb
> >>
> >> On Sun, Jan 8, 2017 at 10:40 AM, channara rin 
> >> wrote:
> >>
> >>> dear all,
> >>> do you know to to set schedule for run "scheduling automated
> >>> aggregation"?
> >>>
> >>> thank you
> >>> channara
> >>>
> >>> ___
> >>> 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-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


Re: [Dhis2-devs] DataCapture

2017-01-10 Thread Guy Ekani
Thank u Erling,

It seems that the one actualiy on Google Play don't synchronising with our
version of DHIS 2.24 #704143a

Sincerely,

=
EKANI Guy


On Tue, Jan 10, 2017 at 2:03 PM, Erling Fjelstad  wrote:

> Hello,
> Have you tried the one on Google Play?
>
> Regards,
> Erling
>
> On Tue, Jan 10, 2017 at 12:02 PM Guy Ekani  wrote:
>
>> Hello Team, Happy New Year !
>>
>> Please could you share the good DHIS2 Data Capture APK  that's working
>> fine with DHis 2.24#704143a
>>
>> Sincerely,
>>
>> --
>> =
>> EKANI Guy
>>
>>
>> ___
>> 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
>>
>


--
___
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] DHIS 2 (Version 2.23): Data doesn't display in DHIS Pivot table even after running analytics

2017-01-10 Thread Busoye Anifalaje
Hi Fred,

It is possible that the user has certain dimension restrictions for analytics.

Go to Apps -> Users. Select the user that is having problems visualising data 
in analytics. Edit the User.  Scroll down and select “Show more options”. 

You should see a section title “Available dimension restrictions for data 
analytics” (see attached). Check that there are no dimensions selected by 
mistake. If there are selected dimensions, try deselecting these from the user 
account and save. Run analytics to check  if  this resolves the problem.

If it doesn’t then it is possible that you may have other sharing protocols for 
the data you want to view.

Hope this helps.

- -



Busoye Anifalaje (PhD)
Director of Services (Principal), BAO Systems
UK: +44 7901-740-757 | US: +1 682-307-0986|
 bus...@baosystems.com  | 
http://www.baosystems.com  |
Skype: busoye | 2900 K Street, Suite 404, Washington D.C. 20007


> On 10 Jan 2017, at 18:32, Fredrick Onyango  wrote:
> 
> Hi All,
> 
> I'm not able to view data on the Pivot table.
> The data entered is however visible on the data entry screens and on the data 
> set report but not on the DHIS 2 Pivot Table.
> 
> I've cleared the cache on Mozilla/Chrome and run analytics.Data mart jobs are 
> scheduled to run every night at midnight.
> 
> Data is visible on PostgreSQL data value table.
> 
> Also noticed a message "(user) constrained by dimension" on the tomcat logs 
> when attempting to access data on the pivot.
> 
> Please assist,
> 
> Fred
> ___
> 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


Re: [Dhis2-devs] [Dhis2-users] DHIS 2 (Version 2.23): Data doesn't display in DHIS Pivot table even after running analytics

2017-01-10 Thread Busoye Anifalaje
Hi Fred,
I actually thought about it after sending the initial email. If the same user 
can see the data in data set reports, there really shouldn’t be a reason not to 
see the data in pivot tables unless there are parameters you have added in 
pivot tables which weren’t in the data set report. 

Can you shed some light on what kind of table you are trying to create? 
Indicators, data elements, category dimension, org unit group dimension etc

Cheers

- -



Busoye Anifalaje (PhD)
Director of Services (Principal), BAO Systems
UK: +44 7901-740-757 | US: +1 682-307-0986|
 bus...@baosystems.com  | 
http://www.baosystems.com  |
Skype: busoye | 2900 K Street, Suite 404, Washington D.C. 20007

> On 10 Jan 2017, at 19:28, Fredrick Onyango  wrote:
> 
> Thanks Busoye,
> 
> I appreciate the feedback.
> 
> I've checked the dimension restrictions for data analytics and none is 
> selected.
> 
> On the second option,are you referring to the 'sharing settings' on the data 
> elements?Kindly clarify.
> 
> Fred
> 
> 
> 
> On Tue, Jan 10, 2017 at 9:44 PM, Busoye Anifalaje  > wrote:
> Hi Fred,
> 
> It is possible that the user has certain dimension restrictions for analytics.
> 
> Go to Apps -> Users. Select the user that is having problems visualising data 
> in analytics. Edit the User.  Scroll down and select “Show more options”. 
> 
> You should see a section title “Available dimension restrictions for data 
> analytics” (see attached). Check that there are no dimensions selected by 
> mistake. If there are selected dimensions, try deselecting these from the 
> user account and save. Run analytics to check  if  this resolves the problem.
> 
> If it doesn’t then it is possible that you may have other sharing protocols 
> for the data you want to view.
> 
> Hope this helps.
> 
> - -
> 
> 
> 
> Busoye Anifalaje (PhD)
> Director of Services (Principal), BAO Systems
> UK: +44 7901-740-757 | US: +1 682-307-0986|
>  bus...@baosystems.com  | 
> http://www.baosystems.com  |
> Skype: busoye | 2900 K Street, Suite 404, Washington D.C. 20007
> 
> 
> 
>> On 10 Jan 2017, at 18:32, Fredrick Onyango > > wrote:
>> 
>> Hi All,
>> 
>> I'm not able to view data on the Pivot table.
>> The data entered is however visible on the data entry screens and on the 
>> data set report but not on the DHIS 2 Pivot Table.
>> 
>> I've cleared the cache on Mozilla/Chrome and run analytics.Data mart jobs 
>> are scheduled to run every night at midnight.
>> 
>> Data is visible on PostgreSQL data value table.
>> 
>> Also noticed a message "(user) constrained by dimension" on the tomcat logs 
>> when attempting to access data on the pivot.
>> 
>> Please assist,
>> 
>> Fred
>> ___
>> 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] SQL View to output all levels of orgUnits

2017-01-10 Thread Raminosoa Rabemanantsoa, Tantely
Dear Community,

I am trying to output a list of all the orgUnits from the SQLView (DHIS2
2.24). I would like to have all the information of all the levels of the
orgUnits for each of the  6 levels implemented. I would like to have a
result in the following form:

orgUnitName (level6), orgUnitName (level5), orgUnitName (level4),
orgUnitName (level3), orgUnitName (level2), orgUnitName (level1)

I have used the following code to output all the information of the level 6:

SELECT organisationunit.organisationunitid, organisationunit.uid,
organisationunit.code, organisationunit.name, organisationunit.shortname
FROM public.organisationunit, public._orgunitstructure WHERE
organisationunit.organisationunitid = _orgunitstructure.idlevel6 AND
organisationunit.code is not null;


How should I update this code in order to pull out the desired output?

Thank you for your support!

Best,

Tantely

-- 
*This message and its attachments are confidential and solely for the 
intended recipients. If received in error, please delete them and notify 
the sender via reply e-mail immediately.*
___
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] SQL View to output all levels of orgUnits

2017-01-10 Thread Ant Snyman
Hi Tantely,

Try the code below. I normally exclude OU1 in the list because that is
generally the country code and just makes the report even more wide.

Regards

Ant Snyman


SELECT ous.level,
ou2.name as ou2_name, ou2.shortname as ou2_shortnamme, ou2.uid as ou2_uid,
ou2.code as ou2_code, ou2.organisationunitid as ou2_organisationunitid,
ou3.name as ou3_name, ou3.shortname as ou3_shortnamme, ou3.uid as ou3_uid,
ou3.code as ou3_code, ou3.organisationunitid as ou3_organisationunitid,
ou4.name as ou4_name, ou4.shortname as ou4_shortnamme, ou4.uid as ou4_uid,
ou4.code as ou4_code, ou4.organisationunitid as ou4_organisationunitid,
ou5.name as ou5_name, ou5.shortname as ou5_shortnamme, ou5.uid as ou5_uid,
ou5.code as ou5_code, ou5.organisationunitid as ou5_organisationunitid,
ou6.name as ou6_name, ou6.shortname as ou6_shortnamme, ou6.uid as ou6_uid,
ou6.code as ou6_code, ou6.organisationunitid as ou6_organisationunitid
FROM organisationunit ou
INNER JOIN _orgunitstructure ous ON ou.organisationunitid =
ous.organisationunitid
LEFT OUTER JOIN organisationunit ou2 on ous.idlevel2 =
ou2.organisationunitid
LEFT OUTER JOIN organisationunit ou3 on ous.idlevel3 =
ou3.organisationunitid
LEFT OUTER JOIN organisationunit ou4 on ous.idlevel4 =
ou4.organisationunitid
LEFT OUTER JOIN organisationunit ou5 on ous.idlevel5 =
ou5.organisationunitid
LEFT OUTER JOIN organisationunit ou6 on ous.idlevel6 =
ou6.organisationunitid
where ous.level > 1
order by ous.level, ou2.name, ou3.name, ou4.name, ou5.name, ou6.name






On 10 January 2017 at 23:56, Raminosoa Rabemanantsoa, Tantely <
tramino...@mikolo.org> wrote:

> Dear Community,
>
> I am trying to output a list of all the orgUnits from the SQLView (DHIS2
> 2.24). I would like to have all the information of all the levels of the
> orgUnits for each of the  6 levels implemented. I would like to have a
> result in the following form:
>
> orgUnitName (level6), orgUnitName (level5), orgUnitName (level4),
> orgUnitName (level3), orgUnitName (level2), orgUnitName (level1)
>
> I have used the following code to output all the information of the level
> 6:
>
> SELECT organisationunit.organisationunitid, organisationunit.uid,
> organisationunit.code, organisationunit.name, organisationunit.shortname
> FROM public.organisationunit, public._orgunitstructure WHERE
> organisationunit.organisationunitid = _orgunitstructure.idlevel6 AND
> organisationunit.code is not null;
>
>
> How should I update this code in order to pull out the desired output?
>
> Thank you for your support!
>
> Best,
>
> Tantely
>
>
> *This message and its attachments are confidential and solely for the
> intended recipients. If received in error, please delete them and notify
> the sender via reply e-mail immediately.*
> ___
> 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
>
>


-- 

*Ant Snyman*

*Cell: 0824910449*

*Landline: 028 2713242*


Health Information Systems Program - SA

-- 


*This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer 
.  Please read the 
disclaimer before opening any attachment or taking any other action in 
terms of this electronic transmission.  If you cannot access the 
disclaimer, kindly send an email to disclai...@hisp.org 
 and a copy will be provided to you. By replying to 
this e-mail or opening any attachment you agree to be bound by the 
provisions of the disclaimer.*
___
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] SQL View to output all levels of orgUnits

2017-01-10 Thread Ant Snyman
I should also add that by changing the where clause you can use this
code for any level, for example if you change it to:

where ous.level = 6 you will only get the structure for your level 6
orgunits

Regards

Ant Snyman


On 11 January 2017 at 07:05, Ant Snyman  wrote:

> Hi Tantely,
>
> Try the code below. I normally exclude OU1 in the list because that is
> generally the country code and just makes the report even more wide.
>
> Regards
>
> Ant Snyman
>
>
> SELECT ous.level,
> ou2.name as ou2_name, ou2.shortname as ou2_shortnamme, ou2.uid as
> ou2_uid, ou2.code as ou2_code, ou2.organisationunitid as
> ou2_organisationunitid,
> ou3.name as ou3_name, ou3.shortname as ou3_shortnamme, ou3.uid as
> ou3_uid, ou3.code as ou3_code, ou3.organisationunitid as
> ou3_organisationunitid,
> ou4.name as ou4_name, ou4.shortname as ou4_shortnamme, ou4.uid as
> ou4_uid, ou4.code as ou4_code, ou4.organisationunitid as
> ou4_organisationunitid,
> ou5.name as ou5_name, ou5.shortname as ou5_shortnamme, ou5.uid as
> ou5_uid, ou5.code as ou5_code, ou5.organisationunitid as
> ou5_organisationunitid,
> ou6.name as ou6_name, ou6.shortname as ou6_shortnamme, ou6.uid as
> ou6_uid, ou6.code as ou6_code, ou6.organisationunitid as
> ou6_organisationunitid
> FROM organisationunit ou
> INNER JOIN _orgunitstructure ous ON ou.organisationunitid =
> ous.organisationunitid
> LEFT OUTER JOIN organisationunit ou2 on ous.idlevel2 =
> ou2.organisationunitid
> LEFT OUTER JOIN organisationunit ou3 on ous.idlevel3 =
> ou3.organisationunitid
> LEFT OUTER JOIN organisationunit ou4 on ous.idlevel4 =
> ou4.organisationunitid
> LEFT OUTER JOIN organisationunit ou5 on ous.idlevel5 =
> ou5.organisationunitid
> LEFT OUTER JOIN organisationunit ou6 on ous.idlevel6 =
> ou6.organisationunitid
> where ous.level > 1
> order by ous.level, ou2.name, ou3.name, ou4.name, ou5.name, ou6.name
>
>
>
>
>
>
> On 10 January 2017 at 23:56, Raminosoa Rabemanantsoa, Tantely <
> tramino...@mikolo.org> wrote:
>
>> Dear Community,
>>
>> I am trying to output a list of all the orgUnits from the SQLView (DHIS2
>> 2.24). I would like to have all the information of all the levels of the
>> orgUnits for each of the  6 levels implemented. I would like to have a
>> result in the following form:
>>
>> orgUnitName (level6), orgUnitName (level5), orgUnitName (level4),
>> orgUnitName (level3), orgUnitName (level2), orgUnitName (level1)
>>
>> I have used the following code to output all the information of the level
>> 6:
>>
>> SELECT organisationunit.organisationunitid, organisationunit.uid,
>> organisationunit.code, organisationunit.name, organisationunit.shortname
>> FROM public.organisationunit, public._orgunitstructure WHERE
>> organisationunit.organisationunitid = _orgunitstructure.idlevel6 AND
>> organisationunit.code is not null;
>>
>>
>> How should I update this code in order to pull out the desired output?
>>
>> Thank you for your support!
>>
>> Best,
>>
>> Tantely
>>
>>
>> *This message and its attachments are confidential and solely for the
>> intended recipients. If received in error, please delete them and notify
>> the sender via reply e-mail immediately.*
>> ___
>> 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
>>
>>
>
>
> --
>
> *Ant Snyman*
>
> *Cell: 0824910449*
>
> *Landline: 028 2713242*
>
>
> Health Information Systems Program - SA
>



-- 

*Ant Snyman*

*Cell: 0824910449*

*Landline: 028 2713242*


Health Information Systems Program - SA

-- 


*This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer 
.  Please read the 
disclaimer before opening any attachment or taking any other action in 
terms of this electronic transmission.  If you cannot access the 
disclaimer, kindly send an email to disclai...@hisp.org 
 and a copy will be provided to you. By replying to 
this e-mail or opening any attachment you agree to be bound by the 
provisions of the disclaimer.*
___
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] SQL View to output all levels of orgUnits

2017-01-10 Thread Jason Pickering
Here is another piece of SQL which will transform the "path" to names.

You can then join this clause with your organisation unit table (or
whatever) on the organisationunitid property. It presents all names in a
single column, as opposed to the multiple columns in Ant's example

SELECT z.organisationunitid,
array_to_string(array_agg(z.name
ORDER BY z.rn),'/') AS path
FROM
(SELECT y.organisationunitid,
ou.name,
y.elem,
y.rn
FROM organisationunit ou
INNER JOIN
(SELECT *,
x.path[x.rn] AS elem
FROM
(SELECT * ,
generate_subscripts(arr.path,1) AS rn
FROM
(SELECT organisationunitid,
string_to_array(substring(path
FROM 2), '/') AS path
FROM organisationunit) arr) x) y ON y.elem = ou.uid) z
GROUP BY organisationunitid;

Regards,
Jason


On Wed, Jan 11, 2017 at 6:14 AM, Ant Snyman  wrote:

> I should also add that by changing the where clause you can use this
> code for any level, for example if you change it to:
>
> where ous.level = 6 you will only get the structure for your level 6
> orgunits
>
> Regards
>
> Ant Snyman
>
>
> On 11 January 2017 at 07:05, Ant Snyman  wrote:
>
>> Hi Tantely,
>>
>> Try the code below. I normally exclude OU1 in the list because that is
>> generally the country code and just makes the report even more wide.
>>
>> Regards
>>
>> Ant Snyman
>>
>>
>> SELECT ous.level,
>> ou2.name as ou2_name, ou2.shortname as ou2_shortnamme, ou2.uid as
>> ou2_uid, ou2.code as ou2_code, ou2.organisationunitid as
>> ou2_organisationunitid,
>> ou3.name as ou3_name, ou3.shortname as ou3_shortnamme, ou3.uid as
>> ou3_uid, ou3.code as ou3_code, ou3.organisationunitid as
>> ou3_organisationunitid,
>> ou4.name as ou4_name, ou4.shortname as ou4_shortnamme, ou4.uid as
>> ou4_uid, ou4.code as ou4_code, ou4.organisationunitid as
>> ou4_organisationunitid,
>> ou5.name as ou5_name, ou5.shortname as ou5_shortnamme, ou5.uid as
>> ou5_uid, ou5.code as ou5_code, ou5.organisationunitid as
>> ou5_organisationunitid,
>> ou6.name as ou6_name, ou6.shortname as ou6_shortnamme, ou6.uid as
>> ou6_uid, ou6.code as ou6_code, ou6.organisationunitid as
>> ou6_organisationunitid
>> FROM organisationunit ou
>> INNER JOIN _orgunitstructure ous ON ou.organisationunitid =
>> ous.organisationunitid
>> LEFT OUTER JOIN organisationunit ou2 on ous.idlevel2 =
>> ou2.organisationunitid
>> LEFT OUTER JOIN organisationunit ou3 on ous.idlevel3 =
>> ou3.organisationunitid
>> LEFT OUTER JOIN organisationunit ou4 on ous.idlevel4 =
>> ou4.organisationunitid
>> LEFT OUTER JOIN organisationunit ou5 on ous.idlevel5 =
>> ou5.organisationunitid
>> LEFT OUTER JOIN organisationunit ou6 on ous.idlevel6 =
>> ou6.organisationunitid
>> where ous.level > 1
>> order by ous.level, ou2.name, ou3.name, ou4.name, ou5.name, ou6.name
>>
>>
>>
>>
>>
>>
>> On 10 January 2017 at 23:56, Raminosoa Rabemanantsoa, Tantely <
>> tramino...@mikolo.org> wrote:
>>
>>> Dear Community,
>>>
>>> I am trying to output a list of all the orgUnits from the SQLView (DHIS2
>>> 2.24). I would like to have all the information of all the levels of the
>>> orgUnits for each of the  6 levels implemented. I would like to have a
>>> result in the following form:
>>>
>>> orgUnitName (level6), orgUnitName (level5), orgUnitName (level4),
>>> orgUnitName (level3), orgUnitName (level2), orgUnitName (level1)
>>>
>>> I have used the following code to output all the information of the
>>> level 6:
>>>
>>> SELECT organisationunit.organisationunitid, organisationunit.uid,
>>> organisationunit.code, organisationunit.name,
>>> organisationunit.shortname FROM public.organisationunit,
>>> public._orgunitstructure WHERE organisationunit.organisationunitid =
>>> _orgunitstructure.idlevel6 AND organisationunit.code is not null;
>>>
>>>
>>> How should I update this code in order to pull out the desired output?
>>>
>>> Thank you for your support!
>>>
>>> Best,
>>>
>>> Tantely
>>>
>>>
>>> *This message and its attachments are confidential and solely for the
>>> intended recipients. If received in error, please delete them and notify
>>> the sender via reply e-mail immediately.*
>>> ___
>>> 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
>>>
>>>
>>
>>
>> --
>>
>> *Ant Snyman*
>>
>> *Cell: 0824910449 <08-249%20104%2049>*
>>
>> *Landline: 028 2713242*
>>
>>
>> Health Information Systems Program - SA
>>
>
>
>
> --
>
> *Ant Snyman*
>
> *Cell: 0824910449 <08-249%20104%2049>*
>
> *Landline: 028 2713242*
>
>
> Health Information Systems Program - SA
>
> *This message and any attachments are subject to a disclaimer published at
> http://www.hisp.org/policies.html#comms_disclaimer
> .  Please read the
> disclaimer before opening any attachment or taking any other action in
> terms of this electronic transmission.  If you cannot access the
> disclaimer, kindly send an email to

[Dhis2-devs] The DHIS 2 Tracker Academy - Goa 2017 is coming up. Register now!

2017-01-10 Thread Neeraj Gupta
*
*

*20 - 24 February*

*2017*

*DHIS 2 Tracker Academy - Goa 2017*



We are pleased to announce the "DHIS 2 Tracker Academy, Level 1 - Goa 2017"
to be held at "The International Centre, Goa" from Feb 20-24. This five day
Tracker Academy will focus on emerging needs for case based reporting,
disease registries, disease surveillance and event reporting.

Register Now! https://www.dhis2.org/india2017-home


We would like to invite you and other staff from your organization engaged
in HIS design, implementation and use to participate in the workshop.
We invite  both new and experienced DHIS 2 implementers to participate,
although it would be preferred that you have had some prior experience with
DHIS 2.

HISP India is one of the pioneers in the design, development and
implementation of DHIS 2 related projects for over a decade, and has worked
with important partners both in India and globally. For more information:
https://hispindia.org




The focus on Tracker is in response to the heightened demand for case based
information systems, especially relating to disease control and
surveillance. The Academy will cover key functionalities of the Tracker,
approaches to their customization and we will provide real life use cases
where the DHIS 2 Tracker has been customized for innovative and scalable
applications.

The conference is being hosted in Goa, the touristic land of extreme
beauty. This will provide the opportunity for participants to participate
in the festivities of the Carnival
following
the workshop.

We look forward to seeing you in the beautiful city of Goa in
February, where we can combine both learning and leisure.

Reach out to us with questions at india2...@dhis2.org

See you in Goa!

The Organizing Committee
___
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] SQL View to output all levels of orgUnits

2017-01-10 Thread Ant Snyman
Thanks Jason,
Nice output and the advantage is you do not have to join to the resource
table _orgunitstructure. It is quite a complex query though, but still a
nice example of using arrays and the path column.
Thanks
Ant


On 11 January 2017 at 07:18, Jason Pickering 
wrote:

> Here is another piece of SQL which will transform the "path" to names.
>
> You can then join this clause with your organisation unit table (or
> whatever) on the organisationunitid property. It presents all names in a
> single column, as opposed to the multiple columns in Ant's example
>
> SELECT z.organisationunitid,
> array_to_string(array_agg(z.name
> ORDER BY z.rn),'/') AS path
> FROM
> (SELECT y.organisationunitid,
> ou.name,
> y.elem,
> y.rn
> FROM organisationunit ou
> INNER JOIN
> (SELECT *,
> x.path[x.rn] AS elem
> FROM
> (SELECT * ,
> generate_subscripts(arr.path,1) AS rn
> FROM
> (SELECT organisationunitid,
> string_to_array(substring(path
> FROM 2), '/') AS path
> FROM organisationunit) arr) x) y ON y.elem = ou.uid) z
> GROUP BY organisationunitid;
>
> Regards,
> Jason
>
>
> On Wed, Jan 11, 2017 at 6:14 AM, Ant Snyman  wrote:
>
>> I should also add that by changing the where clause you can use this
>> code for any level, for example if you change it to:
>>
>> where ous.level = 6 you will only get the structure for your level 6
>> orgunits
>>
>> Regards
>>
>> Ant Snyman
>>
>>
>> On 11 January 2017 at 07:05, Ant Snyman  wrote:
>>
>>> Hi Tantely,
>>>
>>> Try the code below. I normally exclude OU1 in the list because that is
>>> generally the country code and just makes the report even more wide.
>>>
>>> Regards
>>>
>>> Ant Snyman
>>>
>>>
>>> SELECT ous.level,
>>> ou2.name as ou2_name, ou2.shortname as ou2_shortnamme, ou2.uid as
>>> ou2_uid, ou2.code as ou2_code, ou2.organisationunitid as
>>> ou2_organisationunitid,
>>> ou3.name as ou3_name, ou3.shortname as ou3_shortnamme, ou3.uid as
>>> ou3_uid, ou3.code as ou3_code, ou3.organisationunitid as
>>> ou3_organisationunitid,
>>> ou4.name as ou4_name, ou4.shortname as ou4_shortnamme, ou4.uid as
>>> ou4_uid, ou4.code as ou4_code, ou4.organisationunitid as
>>> ou4_organisationunitid,
>>> ou5.name as ou5_name, ou5.shortname as ou5_shortnamme, ou5.uid as
>>> ou5_uid, ou5.code as ou5_code, ou5.organisationunitid as
>>> ou5_organisationunitid,
>>> ou6.name as ou6_name, ou6.shortname as ou6_shortnamme, ou6.uid as
>>> ou6_uid, ou6.code as ou6_code, ou6.organisationunitid as
>>> ou6_organisationunitid
>>> FROM organisationunit ou
>>> INNER JOIN _orgunitstructure ous ON ou.organisationunitid =
>>> ous.organisationunitid
>>> LEFT OUTER JOIN organisationunit ou2 on ous.idlevel2 =
>>> ou2.organisationunitid
>>> LEFT OUTER JOIN organisationunit ou3 on ous.idlevel3 =
>>> ou3.organisationunitid
>>> LEFT OUTER JOIN organisationunit ou4 on ous.idlevel4 =
>>> ou4.organisationunitid
>>> LEFT OUTER JOIN organisationunit ou5 on ous.idlevel5 =
>>> ou5.organisationunitid
>>> LEFT OUTER JOIN organisationunit ou6 on ous.idlevel6 =
>>> ou6.organisationunitid
>>> where ous.level > 1
>>> order by ous.level, ou2.name, ou3.name, ou4.name, ou5.name, ou6.name
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 10 January 2017 at 23:56, Raminosoa Rabemanantsoa, Tantely <
>>> tramino...@mikolo.org> wrote:
>>>
 Dear Community,

 I am trying to output a list of all the orgUnits from the SQLView
 (DHIS2 2.24). I would like to have all the information of all the levels of
 the orgUnits for each of the  6 levels implemented. I would like to have a
 result in the following form:

 orgUnitName (level6), orgUnitName (level5), orgUnitName (level4),
 orgUnitName (level3), orgUnitName (level2), orgUnitName (level1)

 I have used the following code to output all the information of the
 level 6:

 SELECT organisationunit.organisationunitid, organisationunit.uid,
 organisationunit.code, organisationunit.name,
 organisationunit.shortname FROM public.organisationunit,
 public._orgunitstructure WHERE organisationunit.organisationunitid =
 _orgunitstructure.idlevel6 AND organisationunit.code is not null;


 How should I update this code in order to pull out the desired output?

 Thank you for your support!

 Best,

 Tantely


 *This message and its attachments are confidential and solely for the
 intended recipients. If received in error, please delete them and notify
 the sender via reply e-mail immediately.*
 ___
 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


>>>
>>>
>>> --
>>>
>>> *Ant Snyman*
>>>
>>> *Cell: 0824910449 <08-249%20104%2049>*
>>>
>>> *Landline: 028 2713242*
>>>
>>>
>>> Health Information Systems Program - SA
>>>
>>
>>
>>
>> --
>>
>> *Ant Snyman*
>>
>> *Cell: 0824910449 <08-249%20104%2