dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #10140
Issues with import..what is going on?
Sorry. Script kiddies like me should probably not dabble in all this
code, but sometimes you gotta get things to work.
So, at this point (rev 1938) something happened.
getOrganisationUnitByShortName method was switched to
getOrganisationUnitByCode in the OrganisationUnitImporter. I keep
getting weird problems that I used to not have trying to import either
from DHIS 1.4 XML or DHIS1.4 files with earlier versions of DHIS2. By
NULLING the "code" field entirely in the orgunit table of the 1.4
database, I can import from DHIS 1.4 database which has duplicates in
the code field prior to NULLING all the fields.
Was there are reason that this method was switched ? According to this
code, isn't the matching during an import occurring first by name and
then by code? Since there is not a unique restriction on the code,
what if multiple orgunits are returned?
I suspect this is related to the same problem I had reported a few
days ago about not being able to import stuff via DXF.
Can someone that knows what they are doing take a look at it?
Regards,
Jason
C:\dhis2\dhis-2\dhis-services\dhis-service-importexport\src\main\java\org\hisp\d
his\importexport\importer>bzr diff OrganisationUnitImporter.java -r 1937
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/
org/hisp/dhis/importexport/importer/OrganisationUnitImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/i
mportexport/importer/OrganisationUnitImporter.java 2010-07-30 14:20:36 +000
0
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/i
mportexport/importer/OrganisationUnitImporter.java 2011-01-28 12:21:19 +000
0
@@ -104,7 +104,7 @@
if ( match == null )
{
- match = organisationUnitService.getOrganisationUnitByShortName( obj
ect.getShortName() );
+ match = organisationUnitService.getOrganisationUnitByCode( object.g
etCode() );
}
return match;
--
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+260974901293
Follow ups