public String execute() throws Exception { // --------------------------------------------------------------------- // Get File Excel // --------------------------------------------------------------------- String path = selectionManager.getUploadFilePath(); if (path != null && path != "") { fileExcel = new File(path); } // --------------------------------------------------------------------- // Validate selected OrganisationUnit // --------------------------------------------------------------------- organisationUnit = organisationUnitSelectionManager.getSelectedOrganisationUnit(); if (organisationUnit == null) { return SUCCESS; } // --------------------------------------------------------------------- // Load and sort ImportReports // --------------------------------------------------------------------- importReports = new ArrayList<ImportReport>(importReportService.getImportReports(organisationUnit)); return SUCCESS; }
public String execute() throws Exception { String[] importItemIds = selectionManager.getListObject(); if (importItemIds == null) { message = i18n.getString("choose_import_item"); return ERROR; } OrganisationUnit organisationUnit = organisationUnitSelectionManager.getSelectedOrganisationUnit(); if (organisationUnit != null) { Period period = periodGenericManager.getSelectedPeriod(); Set<DataValue> oldDataValues = new HashSet<DataValue>(); Set<DataValue> newDataValues = new HashSet<DataValue>(); executeToImport(organisationUnit, period, importItemIds, oldDataValues, newDataValues); selectionManager.setOldDataValueList(oldDataValues); selectionManager.setNewDataValueList(newDataValues); } message = i18n.getString("import_successfully"); return SUCCESS; }
public String execute() { relationshipTypes = new ArrayList<RelationshipType>(relationshipTypeService.getAllRelationshipTypes()); identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes(); attributes = patientAttributeService.getAllPatientAttributes(); OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit(); healthWorkers = organisationUnit.getUsers(); return SUCCESS; }
public String execute() throws Exception { patientAttributes = patientAttributeService.getAllPatientAttributes(); programs = programService.getProgramsByCurrentUser(); organisationUnit = selectionManager.getSelectedOrganisationUnit(); if (organisationUnit == null) { status = 1; } return SUCCESS; }
public String execute() throws Exception { organisationUnit = organisationUnitSelectionManager.getSelectedOrganisationUnit(); feature = featureService.get(organisationUnit); if (organisationUnit != null) { mapFile = selectionManager.getSelectedMapFile(); } if (mapFile == null) { mapFile = new MapFile(); mapFile.setMapFile("example.svg"); } // TODO Auto-generated method stub return SUCCESS; }
public String execute() { unit = selectionManager.getSelectedOrganisationUnit(); return SUCCESS; }
public String execute() throws Exception { type = StringUtils.trimToNull(type); // --------------------------------------------------------------------- // Get group sets // --------------------------------------------------------------------- groupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets()); Collections.sort(groupSets, IdentifiableObjectNameComparator.INSTANCE); // --------------------------------------------------------------------- // Assemble groups and get search result // --------------------------------------------------------------------- if (!skipSearch) { name = StringUtils.trimToNull(name); selectedOrganisationUnit = selectionManager.getSelectedOrganisationUnit(); log.debug("Name: " + name + ", Orgunit: " + selectedOrganisationUnit + ", type: " + type); // ----------------------------------------------------------------- // Set orgunit to null if root to avoid subquery and improve perf // ----------------------------------------------------------------- selectedOrganisationUnit = selectedOrganisationUnit != null && selectedOrganisationUnit.getParent() == null ? null : selectedOrganisationUnit; Collection<OrganisationUnitGroup> groups = new HashSet<OrganisationUnitGroup>(); for (Integer id : groupId) { if (id != ANY) { OrganisationUnitGroup group = organisationUnitGroupService.getOrganisationUnitGroup(id); groups.add(group); } } boolean limit = type == null; // Only limit for HTML view since browser is memory constrained organisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitsByNameAndGroups( name, groups, selectedOrganisationUnit, limit)); limited = organisationUnits != null && organisationUnits.size() == OrganisationUnitService.MAX_LIMIT; Collections.sort(organisationUnits, IdentifiableObjectNameComparator.INSTANCE); if (type != null && !type.equalsIgnoreCase(DEFAULT_TYPE)) { grid = generateGrid(); } } return type != null ? type : SUCCESS; }