← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Organisation Units repetitive structure

 

Bernard,

I would suggest the following to easily cross-check that your hierarchy is
correctly defined:

1. Go to Data Administration -> Maintenance -> Select "Update Organisation
Unit Paths"

2. In the Data Admin menu, select and run "Generate Resource Tables"

3. Set up and run an SQL VIew (also in Data Admin) like this:
SELECT ou.hierarchylevel, ou.name, ou1.name as Parent from organisationunit
ou
INNER JOIN organisationunit ou1 on ou.parentid = ou1.organisationunitid
order by ou.hierarchylevel, ou.name;

4. Execute that sql view, dump it into CSV or Excel, and scan through to
verify that all organisation units in the database have the correct parent

you can obviously also run the same sql script against the database itself

Best regards
Calle

On 30 January 2018 at 10:21, Knut Staring <knutst@xxxxxxxxx> wrote:

> Hi Bernard,
>
> Sorry, I'm very busy with a series of meetings this week, and also not in
> the best position to resolve this, so hoping for others on the list to step
> up. Thanks for the detailed explanation of your issue, my guess it is
> likely just some small thing with your database. You could perhaps also try
> to take a look directly at your organsationunit table in the db and scan
> for any anomalies such as 10 digit UIDs or null values (can also be done
> through the DHIS2 GUI with an SQL View (under Data Administration).
>
> Knut
>
> On Tue, Jan 30, 2018 at 9:10 AM, Bernard Sadaka (IM Advisor) <
> lib.ima@xxxxxxxxxx> wrote:
>
>> Hello Again Knut,
>>
>> Any news about this issue?
>>
>> Should I open a ticket for it in Jira? The challenge is I don’t know how
>> to replicate this bug.
>>
>>
>>
>> Here is what happening with my org units:
>>
>> *As you can see bellow, all the org units are there duplicated but in a
>> scrambled order and not under their respective parent. Add to that when I
>> click on one of the values that are supposed to show the underlying org
>> units only of the copies will expand and show that.*
>>
>>
>>
>> *Is this front end related? Backend? Database related?*
>>
>>
>>
>> Here is my org unit structure:
>>
>>    1. Lebanon
>>       1. Organisation A
>>
>>                                                                i.      Base
>> 1
>>
>> 1.       PHCC 1
>>
>> 2.       PHCC 2
>>
>> 3.       PHCC 3
>>
>>                                                              ii.      Base
>> 2
>>
>> 1.       PHCC 4
>>
>> 2.       PHCC 5
>>
>> 3.       PHCC 6
>>
>> 4.       PHCC 7
>>
>>    1. Test Org A
>>
>>                                                                i.      Test
>> Base 1
>>
>> 1.       Test PHCC 1
>>
>> 2.       Test PHCC 2
>>
>> 3.       Test PHCC 3
>>
>>                                                              ii.      Test
>> Base 2
>>
>> 1.       Test PHCC 4
>>
>> 2.       Test PHCC 5
>>
>> 3.       Test PHCC 6
>>
>> 4.       Test PHCC 7
>>
>> 5.       Test PHCC 8
>>
>>
>>
>> In some places on my DHIS2 it shows correctly, in other places it shows
>> as per the bellow (in DHIS2 sections such as the “pivot tables” and the
>> “data output and analytics organization units” under new/edit user section)
>> (the pivot tables keep trying to load as mentioned before) :
>>
>> 1.       Base 1
>>
>> 1.       PHCC 1
>>
>> 2.       PHCC 2
>>
>> 3.       PHCC 3
>>
>>    1. PHCC 1
>>    2. PHCC 4
>>    3. PHCC 2
>>    4. PHCC 3
>>    5. PHCC 5
>>    6. PHCC 6
>>    7. Lebanon
>>       1. Organisation A
>>
>>                                                                i.      Base
>> 1
>>
>>                                                              ii.      Base
>> 2
>>
>> 1.       PHCC 4
>>
>> 2.       PHCC 5
>>
>> 3.       PHCC 6
>>
>> 4.       PHCC 7
>>
>>    1. Test Org A
>>
>>                                                                i.      Test
>> Base 1
>>
>> 1.       Test PHCC 1
>>
>> 2.       Test PHCC 2
>>
>> 3.       Test PHCC 3
>>
>>                                                              ii.      Test
>> Base 2
>>
>> 1.       Test PHCC 4
>>
>> 2.       Test PHCC 5
>>
>> 3.       Test PHCC 6
>>
>> 4.       Test PHCC 7
>>
>> 5.       Test PHCC 8
>>
>>    1. Organisation A
>>    2. Base 2
>>    3. PHCC 7
>>    4. Test Base 1
>>    5. Test PHCC 1
>>    6. Test PHCC 4
>>    7. Test PHCC 2
>>    8. Test PHCC 5
>>    9. Test PHCC 6
>>    10. Test PHCC 7
>>    11. Test Org A
>>    12. Test Base 2
>>
>>
>>
>> Your help is appreciated.
>>
>>
>>
>> All the best,
>>
>> Bernard
>>
>>
>>
>> [image: cid:image002.png@01D36F50.572585A0]
>>
>> *Bernard Sadaka*
>>
>> *Information Management Advisor*
>>
>> Première Urgence - Aide Médicale Internationale
>>
>> Nehmeh Building, Sanine Street, Chiyah, 3rd Floor
>>
>> Ain el Remmaneh, Beirut, Lebanon
>>
>> *E-mail:* lib.ima@xxxxxxxxxx
>>
>> *Cell:* +961 71 004 881 <+961%2071%20004%20881> (208)
>>
>> *Skype:* imapuami
>>
>> *Website:* https://www.pu-ami.org
>>
>>
>>
>>
>>
>> *From:* Bernard Sadaka (IM Advisor) [mailto:lib.ima@xxxxxxxxxx]
>> *Sent:* Monday, January 29, 2018 2:29 PM
>> *To:* 'Knut Staring' <knutst@xxxxxxxxx>
>> *Cc:* 'DHIS 2 Users list' <dhis2-users@xxxxxxxxxxxxxxxxxxx>; 'DHIS 2
>> developers' <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
>> *Subject:* RE: [Dhis2-users] Organisation Units repetitive structure
>>
>>
>>
>> Thank you Knut,
>>
>> The console error while at the pivot table and viewing the org units is
>> “Cannot read property ‘internalId’ of undefined ” as per the bellow
>> screenshot:
>>
>>
>>
>> My setup is Tomcat+ postgres+ Ubuntu 16.04.3LTS+ Certbot (for SSL)+nginx
>> (for reverse proxy)
>>
>>
>>
>> As for the catalina.out, what should I be looking exactly for in there?
>> Because when I go to the pivot table section while monitoring catalina.out
>> there’s no exception thrown/shown using “tail –f catalina.out” (even after
>> cleaning the browser cache)
>>
>>
>>
>> Thank you in advance for your invaluable help.
>>
>>
>>
>> Looking forward to hearing from you.
>>
>>
>>
>> All the best,
>>
>> Bernard
>>
>>
>>
>> [image: cid:image002.png@01D36F50.572585A0]
>>
>> *Bernard Sadaka*
>>
>> *Information Management Advisor*
>>
>> Première Urgence - Aide Médicale Internationale
>>
>> Nehmeh Building, Sanine Street, Chiyah, 3rd Floor
>>
>> Ain el Remmaneh, Beirut, Lebanon
>>
>> *E-mail:* lib.ima@xxxxxxxxxx
>>
>> *Cell:* +961 71 004 881 <+961%2071%20004%20881> (208)
>>
>> *Skype:* imapuami
>>
>> *Website:* https://www.pu-ami.org
>>
>>
>>
>>
>>
>> *From:* Knut Staring [mailto:knutst@xxxxxxxxx <knutst@xxxxxxxxx>]
>> *Sent:* Monday, January 29, 2018 1:04 PM
>> *To:* Bernard Sadaka (IM Advisor) <lib.ima@xxxxxxxxxx>
>> *Cc:* DHIS 2 Users list <dhis2-users@xxxxxxxxxxxxxxxxxxx>; DHIS 2
>> developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
>> *Subject:* Re: [Dhis2-users] Organisation Units repetitive structure
>>
>>
>>
>> Hi Bernard,
>>
>>
>>
>> In order to elucidate what is going on, the next places to check are the
>> browser console and the server log.
>>
>>
>>
>> 1) In Chrome, click on Ctrl+Shit+I to open the console window and look
>> for error messages in RED.
>>
>>
>>
>> 2) For the server, look for catalina.out in the logs folder (What is your
>> setup? Tomcat or DHIS Live?. Operating system?)
>>
>>
>>
>> Regards,
>>
>> Knut
>>
>>
>>
>> On Mon, Jan 29, 2018 at 11:47 AM, Bernard Sadaka (IM Advisor) <
>> lib.ima@xxxxxxxxxx> wrote:
>>
>> Hello All,
>>
>> I’m sending this message to seek your help in solving a problem with
>> repetitive organization unit structure in the pivot tables section as well
>> as user management and others:
>>
>> ·         The same org units are showing under their respective org unit
>> and alone multiple times.
>>
>> ·         The org units in pivot tables keep trying to load each of
>> their data without finishing (attached/bellow a screenshot)
>>
>> I tried but failed to find a similar bug in the JIRA.
>>
>> I tried to perform Maintenance, browser cache cleaner, login using
>> incognito browsing… nothing worked.
>>
>> Is there a script or database queries I can run to fix this?
>>
>>
>>
>> All the best,
>>
>> Bernard
>>
>>
>>
>> [image: cid:image002.png@01D36F50.572585A0]
>>
>> *Bernard Sadaka*
>>
>> *Information Management Advisor*
>>
>> Première Urgence - Aide Médicale Internationale
>>
>> Nehmeh Building, Sanine Street, Chiyah, 3rd Floor
>>
>> Ain el Remmaneh, Beirut, Lebanon
>>
>> *E-mail:* lib.ima@xxxxxxxxxx
>>
>> *Cell:* +961 71 004 881 <+961%2071%20004%20881> (208)
>>
>> *Skype:* imapuami
>>
>> *Website:* https://www.pu-ami.org
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> [image: Image removed by sender.]
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon>
>>
>> Virus-free. www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>>
>>
>> --
>>
>> Knut Staring
>>
>> Department of Information, Evidence and Research
>> World Health Organization, Geneva, Switzerland
>> Office: +41 22 791 3683 <+41%2022%20791%2036%2083> Mob1: +33 6 4434 2931
>> <+33%206%2044%2034%2029%2031> Mob2: +47 9188 0522
>> Skype:     knutstar
>>
>
>
>
> --
> Knut Staring
>
> Department of Information, Evidence and Research
> World Health Organization, Geneva, Switzerland
> Office: +41 22 791 3683 <+41%2022%20791%2036%2083> Mob1: +33 6 4434 2931
> <+33%206%2044%2034%2029%2031> Mob2: +47 9188 0522
> Skype:     knutstar
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

PNG image

JPEG image

PNG image

PNG image


References