class DHIS2ReportingServiceImpl extends BaseOpenmrsService implements
			DHIS2ReportingService {

	@Override
	public Location getLocationByOrgUnitCode(String orgUnitCode) {
		List<Location> locationList = new ArrayList<Location>();
		locationList.addAll(Context.getLocationService().getAllLocations());
		for (Location l : locationList) {
			for (LocationAttribute la : l.getActiveAttributes()) {
				if (la.getAttributeType().getName().equals("CODE")) {
					// System.out.println( la.getValue().toString() );
					if ((la.getValue().toString()).equals(orgUnitCode)) {
						return l;
					}
				}

			}
		}
		return null;
	}

}