← Back to team overview

dhis2-users team mailing list archive

Re: Orgunit

 

Ola, thanks for the really useful info.  I think the first one is in the technical approach manual as well, but I don't trust arrowheads anymore, you never know whether you're referring to data objects via UML convention or tables via data model convention (or just seeing what's available in Powerpoint).  The second reference is superduper, even if it's not up-to-date it's a great starting point.  

 

I am not yet fluent enough in MySQL to remember the syntax for viewing constraints, I only use show fields. .I will go look at my Hibernate stuff, but I think somebody told it Active was not null while nobody told the DB itself.

 

BTW, I was able to create a new org unit group set manually, then use it as a model to populate the "type" set via SQL.  So maybe I'm not as dumb as I seem.

 

I added a note to a pre-existing bug report about IE7.  There may also be a bug around the display of trees, elements sort of jump around depending on what's been clicked lately, and I don't think org unit assignments are showing up as one would like with selected elements in a contrast color.  I have installed Firefox and hopefully this will clear up, no more time today.

 

Thanks for all your help

 

From: Ola Hodne Titlestad [mailto:olatitle@xxxxxxxxx] 
Sent: Thursday, March 04, 2010 5:57 PM
To: Friedman, Roger (CDC/CCID/NCHHSTP) (CTR)
Cc: Lars Helge Øverland; Ignac Mare; DHIS 2.0 Users; Bob Jolliffe
Subject: Re: [Dhis2-users] Orgunit

 

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

	It's a lot clearer, but it still doesn't tell me about the table structure.  At this point, DHIS2 is not starting in Tomcat.  It failed with this error:

This drawing might help to better understand the group set model (as well as the rest of the multidimensional model):
https://docs.google.com/Doc?docid=0AfhDQuGFI-A_ZGNjNW1waHhfMThkOWtiamdndA&hl=en

I know there is an old db schema on the wiki somewhere (Knut, do you remember where?). However, this page, although quite old as well, is still mostly valid and it should give you a better overview of the DHIS2 from a database table perspective:
http://208.76.222.114/confluence/display/DOC/Database+API

I would also recommend having a look at the chapter in the manual called DHIS Technical Architecture Guide if you want to dive into the more technical details of the code and architecture.

As you found out you need to be careful with the NOT NULL columns in the database when manually populating the database as hibernate will not like it and startup routines for DHIS will most likely fail.

Ola
----------

 

	 

	Mar 4, 2010 4:30:19 PM org.apache.catalina.core.ApplicationContext log

	INFO: Initializing Spring root WebApplicationContext Mar 4, 2010 4:30:36 PM org.apache.catalina.core.StandardContext listenerStart

	SEVERE: Exception sending context initialized event to listener instance of class org.hisp.dhis.system.startup.StartupListener

	java.lang.RuntimeException: Failed to run startup routines

	      at org.hisp.dhis.system.startup.StartupListener.contextInitialized(StartupListener.java:61)

	      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)

	<<snip>>

	Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.hisp.dhis.organisationunit.OrganisationUnit.active

	      at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:85)

	 

	so I went in and set organisationunit.active to 1 in all records.  But before and after getting this message, DHIS2 just hung Tomcat, I have to reboot.  So either Hibernate is enforcing some relational integrity that I have broken, or I am running out of memory or something.  Guess I will go back and set the memory size parameters.  Any other suggestions?

	 

	From: Ola Hodne Titlestad [mailto:olatitle@xxxxxxxxx] 
	Sent: Thursday, March 04, 2010 12:03 PM
	To: Friedman, Roger (CDC/CCID/NCHHSTP) (CTR)
	Cc: Lars Helge Øverland; Ignac Mare; DHIS 2.0 Users; Bob Jolliffe

	
	Subject: Re: [Dhis2-users] 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 <mailto:dhis2-users-bounces%2Brdf4> =cdc.gov@xxxxxxxxxxxxxxxxxxx] 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

	 

 


References