← Back to team overview

dhis2-users team mailing list archive

Re: using a CSV file for visualization

 

Hi Alison,

In Rwanda we're doing quite a bit by importing external data into a DHIS-2 instance that we call the "Data warehouse".

Often this comes in as CSV files that we import into a temporary table we've created in the DHIS and then we create a SQL script to import it into the datavalues table.  This table has a lot of data integrity constraints that make it difficult to import data.

Below are a couple of tips for the 4 required fields that in combination must be unique:


1.       In order to fill the sourceid field, be sure to use the code field in the organisationunit table to store the facility code for the reporting units from your local EMR (perhaps in this case all data are from one facility).  Then you can link to the organisationunit table to pull the appropriate organisationunitid.

2.       Make sure to create the dataelements in the DHIS-2 that correspond to your indicators and that you store the dataelement id in your OpenMRS system or store the OpenMRS concept code in the dataelement code field so that you can map to the dataelementid on import.

3.       Periodid: this may be a challenge for you if the data you are importing are not of any specific periodicity.  I believe the smallest reporting period in DHIS-2 is currently daily.  If your data show hourly updates of lab test values you may not be able to import them into DHIS-2.

4.       Categoryoptioncomboid:  if your data does not have dimensions (i.e. M/F, age group), look up the value for "default" - often 13 or 14 and use that to fill this column.

Also the value stored in the DHIS-2 is actually a text field, so be sure to convert the values to strings before importing.

As always, after importing or adding new data be sure to run the analytics table process or you won't see your new data.

Randy


From: Dhis2-users [mailto:dhis2-users-bounces+rwilson=msh.org@xxxxxxxxxxxxxxxxxxx] On Behalf Of Alison Perez
Sent: Wednesday, October 09, 2013 6:10 PM
To: dhis2-users@xxxxxxxxxxxxxxxxxxx
Subject: [Dhis2-users] using a CSV file for visualization

Greetings to the DHIS2 community. I wish to consult the group on strategy and general procedures on how to use a CSV file as a data source for DHIS2 graphs. We have a local electronic medical record in our provincial hospital that generates a CSV file with each data set representing numerical values for an indicator. While XML might be a better file format, we are generating CSV due to the need to have the data be shared to another system.  I was hoping to utilize DHIS2's graphing capability by feeding the CSV to the DHIS2 engine. Is this possible and how?
thank you very much.



--
Alison O. Perez
Software Developer
Wireless Access for Health (WAH)
Province of Tarlac, Philippines

Linkedin Profile: ph.linkedin.com/pub/alison-perez/56/44/a65/<http://ph.linkedin.com/pub/alison-perez/56/44/a65/>
Personal Blog: http://darthblitzkrieg.blogspot.com
ICT4D/H Blog: http://alisonperez.tk
Skype / IM: darth_ali

"Daring ideas are like chessmen moved forward; they may be beaten, but they
may start a winning game." -- Johann Wolfgang Goethe*

Follow ups

References