=== modified file 'dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java' --- dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java 2014-01-27 10:01:17 +0000 +++ dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java 2014-01-27 10:46:25 +0000 @@ -304,28 +304,33 @@ continue; } - if ( organisationUnitGroup.getCode() == null ) - { - continue; - } - - CodedType codedType = new CodedType(); - codedType.setCode( organisationUnitGroup.getCode() ); - - codedType.setCodingSchema( "Unknown" ); - - for ( AttributeValue attributeValue : organisationUnitGroup.getAttributeValues() ) - { - if ( attributeValue.getAttribute().getName().equals( "code_system" ) ) - { - codedType.setCodingSchema( attributeValue.getValue() ); - break; - } - } - - codedType.setValue( organisationUnitGroup.getDisplayName() ); - - facility.getCodedTypes().add( codedType ); + + if ( organisationUnitGroup.getGroupSet() != null && + FACILITY_TYPE_GROUPSET.equals( organisationUnitGroup.getGroupSet().getName() ) ) + { + if ( organisationUnitGroup.getCode() == null ) + { + continue; + } + + CodedType codedType = new CodedType(); + codedType.setCode( organisationUnitGroup.getCode() ); + + codedType.setCodingSchema( "Unknown" ); + + for ( AttributeValue attributeValue : organisationUnitGroup.getAttributeValues() ) + { + if ( attributeValue.getAttribute().getName().equals( "code_system" ) ) + { + codedType.setCodingSchema( attributeValue.getValue() ); + break; + } + } + + codedType.setValue( organisationUnitGroup.getDisplayName() ); + + facility.getCodedTypes().add( codedType ); + } } Organization organization = new Organization( "No oid, please provide organisation_oid attribute value." );