← Back to team overview

dhis2-users team mailing list archive

Re: Issue importing CSV with categoryoptioncombos

 

Hi Randy

On 18 February 2014 13:06, Wilson,Randy <rwilson@xxxxxxx> wrote:

>  I'm moving data between instances of DHIS-2 (from the HMIS to the Data
> Warehouse with a subset of data elements).
>
>
>
> Since the dataelementids and orgunitides are not always the same in the
> two systems, I'm using the code fields for those.  I've set up a query to
> provide the data I need with one exception: if the categoryoptioncomboids
> are not default, I need to find the id in the *destination* system.
>
>
>
> Would it not be possible to use the categoryoptioncomboname during import,
> since there is no code field for categoryoptioncombos...a file that is
> autogenerated?
>

You have hit precisely the soft underbelly of the categoryoptioncombo
problem here (one of them anyway).  Because it does not have a code it is
not easily matched.  What you need is for the uid to be the same on both
sides. The name is not so reliable, not least because it is a bit
unpredictable how it is constructed (the order) from category names.

Your best bet might be to treat HMIS as your metadata registry for these
datasets (with associated datelements, categories, options and combos).
Then use the "Detailed Metadata Export" option to export the datasets and
finally check the "with dependencies" box when you see it.  If you import
this into data warehouse you should get the same categoryoptioncombos on
both sides.

Slightly further down the line we are hoping to "fix" this problem in dxf2
by exporting the categoryoptions themselves rather than the
categoryoptioncombos, but this is a bit further down the line (and maybe
won't really work with csv).

Try the detailed metadata export and see how that works (it was actually
created with your use case in mind).

Bob


>
> Here is a sample of the CSV: (I've added the categoryoptioncombo field to
> illustrate the issue).
>
>
>
>
> "dataelement";"period";"orgunit";"categoryoptioncomboid";"categoryoptioncombo";"value"
>
> "8942";"201312";"573";"14";"(default)";"24"
>
> "8942";"201312";"94";"14";"(default)";"34"
>
> "8942";"201312";"433";"14";"(default)";"23"
>
> "8942";"201312";"96";"14";"(default)";"30"
>
> "8942";"201312";"266";"14";"(default)";"30"
>
> "8942";"201312";"310";"14";"(default)";"20"
>
> "8222";"201311";"384";"297";"(0-11 months)";"118"
>
> "8222";"201311";"370";"297";"(0-11 months)";"15"
>
> "8222";"201311";"155";"297";"(0-11 months)";"56"
>
> "8222";"201311";"158";"297";"(0-11 months)";"46"
>
>
>
> We move data across to the data warehouse each month, so I'd like to make
> the process as simple as possible.
>
>
>
> Does anyone have a suggestion?
>
>
>
>
>
> *Randy Wilson*
>
> Senior HMIS and Data Use Advisor, Ministry of Health/Rwanda
>
> Integrated Health Systems Strengthening Project
>
> Management Sciences for Health, Inc. (MSH)
>
> BP 371
> Kigali, Rwanda
> +250-788308835
>
> Skype Name (wilsonrandy_us)
>
> www.msh.org<http://www.msh.org/?utm_source=2012-10-15+MSH+internal+announce+email+signature&utm_campaign=iemailsig&utm_medium=email>
>
>
> [image: Description:
> http://ih.constantcontact.com/fs017/1102482301888/img/438.gif]<http://www.msh.org/?utm_source=2012-10-15+MSH+internal+announce+email+signature&utm_campaign=iemailsig&utm_medium=email>
>
> *Stronger health systems. Greater health impact.*
>
> [image: Description: Follow MSH on Facebook]<http://www.facebook.com/ManagementSciencesForHealth>[image:
> Description: Follow MSH on Twitter]<https://twitter.com/#%21/MSHHealthImpact>[image:
> Description: YouTube] <http://www.youtube.com/mshhealthimpact>Follow us
> on Facebook and Twitter
>
>
>
> _______________________________________________
> 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
>
>

GIF image

GIF image

PNG image

PNG image


Follow ups

References