← Back to team overview

dhis2-users team mailing list archive

Re: Orgunit

 

Hi Roger,

To read up on the usage of groups and group sets I recommend the 2nd chapter
of the user manual (was updated on March 2) which explains how you can add
dimensions to orgunits using these groups and group sets, e.g. create
alternative hierarchies like the one you mention:
fresh download available here:
http://dhis.uio.no/ci/job/Dhis2%20documentation/lastSuccessfulBuild/artifact/target/docbkx/pdf/dhis2_user_manual_en.pdf
(about 6mb)

Note that the orgunit group sets are only mandatory in the sense that they
are enforced in the UI when creating new orgunits. You don't have to worry
about these when doing inserts directly in the database. Having the groups
of course adds a lot of value to your data analysis, but is not
necessary/mandatory to get you started with DHIS.

I would suggest you insert all the orgunits in the database first, then go
to the UI to populate the necessary groups to the group sets you want to use
(Type is very useful and highly recommended, but also ownership
public/private and rural/urban are useful when doing analysis).  Normally
the three "mandatory" orgunit group sets have just a few orgunit groups
each, so its quick to set up this using the UI. E.g. you would create a new
orgunit group for every facility type in Ghana plus the names of the
administrative levels so that you can give each orgunit a type by assigning
it to the orgunit group. E.g. in Sierra Leone the groups belonging to the
group set OrgUnitType are something like:
MoH, District, Chiefdom, CHC, CHP, MCHP, Hospital. And for Ownership there
is private, public, NGO.
For RuraUrban there is typically Rural, Urban,. PeriUrban. You get the
feeling....

The reason why these groups have not been autopopulated and assigned to the
group sets is because they vary slightly from country to country. I think we
should remove the UI consrataint on the three group sets being mandatory and
just leave them there as option until the system admins themselves have
populated their groups and set them to mandatory. Makes little sense to
enforce empty group sets, although for standardisation I see the point of
populating these on startup. So I guess we should keep them, but leave it up
to the user to say which are mandatory and not.

Then when you have set up the group sets and groups in the UI I would, given
that you are dealing with hundreds of facilities, insert the
orgunitgroupmembership rows directly in the database, where you need groupid
and orgunitid.

Regarding the foreign key constraint on sourceid from orgunit, you could
maybe just drop that constraint while populating orgunits and then when your
done with all the orgunits, populate the full source table, and after that
put the constraint back in again?

Setting up a full orgunit tree can be a hassle, and we are working on some
importers that generate these hierarchies off shape files or structured
excel files, but they are not there yet, I am afraid.

Hope this was to some help at least. Keep bothering us at this list, we
really appreciate it.

Ola
------

On 4 March 2010 15:45, Friedman, Roger (CDC/CCID/NCHHSTP) (CTR) <
rdf4@xxxxxxx> wrote:

>  All of this is extremely unclear, it would be nice if there were a data
> model on the site somewhere.
>
> But more importantly, what are group sets and compulsory group sets, what
> is their purpose?  The most I can find is the user manual sec. 4.2.2.11-14.
>
>
>
>
> I have created my OrgUnit table with a series of SQL statements like the
> following:
>
> INSERT INTO Source (SourceID) VALUES (3);
>
> INSERT INTO OrganisationUnit
> (OrganisationUnitID,UUID,Name,ParentID,ShortName,Type,GeoCode,LastUpdated)
>
>   VALUES(3,uuid(),"Ghana",NULL,"Ghana","Country","GHA",'2010-03-03
> 18:23:49');
>
> INSERT INTO Source (SourceID) VALUES (14);
>
> INSERT INTO OrganisationUnit
> (OrganisationUnitID,UUID,Name,ParentID,ShortName,Type,GeoCode,LastUpdated)
>
>   VALUES(14,uuid(),"Ashanti",3,"Ashanti","Region","GHA001",'2010-03-03
> 18:23:49');
>
> INSERT INTO Source (SourceID) VALUES (90);
>
> INSERT INTO OrganisationUnit
> (OrganisationUnitID,UUID,Name,ParentID,ShortName,Type,GeoCode,LastUpdated)
>
>   VALUES(90,uuid(),"Kumasi",14,"Kumasi","District","GHA001014",'2010-03-03
> 18:23:49');
>
> INSERT INTO Source (SourceID) VALUES (226);
>
> INSERT INTO OrganisationUnit
> (OrganisationUnitID,UUID,Name,ParentID,ShortName,Type,GeoCode,LastUpdated)
>
>
> VALUES(226,uuid(),"Adum",90,"Adum","Sub-District","GHA001014010",'2010-03-03
> 18:23:49');
>
> INSERT INTO Source (SourceID) VALUES (327);
>
> INSERT INTO OrganisationUnit
> (OrganisationUnitID,UUID,Name,ParentID,ShortName,Type,GeoCode,LastUpdated)
>
>   VALUES(327,uuid(),"Rabito Clinic",226,"Rabito
> Clinic","Clinic","GHA001014010",'2010-03-03 18:23:49');
>
>
>
> So I could easily have Type as a compulsory group, as suggested in the
> documentation.  But what table do I have to modify to reflect this?  And
> does this mean that if I add other (compulsory) groups, the structure of the
> OrgUnit table will change?
>
>
>
> Into what table and how do I insert hierarchy names (region, district)?
> What do I do about incomplete or unbalanced hierarchies -- district
> hospitals may be considered as belonging to the district rather than the
> sub-district in which they are located, there is an intermediate structure
> called a metropolitan government which exists only in large urban areas.
>
>
>
> Are there other tasks that need to be done to get OrgUnits completely in?
> Any tricks or gotchas (like Source and ShortName)?
>
>
>
> Thanks, Roger
>
>
>
> *From:* dhis2-users-bounces+rdf4=cdc.gov@xxxxxxxxxxxxxxxxxxx [mailto:
> dhis2-users-bounces+rdf4 <dhis2-users-bounces%2Brdf4>=cdc.gov@
> lists.launchpad.net] *On Behalf Of *Lars Helge Øverland
> *Sent:* Thursday, March 04, 2010 8:17 AM
> *To:* Ignac Mare
> *Cc:* DHIS 2.0 Users
> *Subject:* Re: [Dhis2-users] Orgunit
>
>
>
>
>
> On Sat, Feb 27, 2010 at 3:55 PM, Ignac Mare <ignac.mare@xxxxxxxxx> wrote:
>
> On adding orgunits there is a block that says type what exactly can any one
> help
>
>
>
> Hi,
>
>
>
> the system requires one to add newly created organisation units to groups
> for all compulsory group sets. The system comes with three group sets
> pre-configured. You will need to create a few groups for each group set, and
> then choose one of these when creating a new organisation unit.
>
>
>
> regards, Lars
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> I Mare
> Information Management
> Limpopo Emergency Medical Services
> Cell: 083 635 0605
> Fax: 086 614 2028
> Skype ignac.mare
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users<https://launchpad.net/%7Edhis2-users>
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users<https://launchpad.net/%7Edhis2-users>
> More help   : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users<https://launchpad.net/%7Edhis2-users>
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users<https://launchpad.net/%7Edhis2-users>
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References