@Test public void shouldDeleteVoidedObservationsWhenDownloadingObservations() throws ObservationController.DeleteObservationException, ObservationController.DownloadObservationException, ReplaceObservationException, ConceptController.ConceptFetchException { List<String> patientUuids = Collections.singletonList("patientUuid"); final Patient patient = new Patient() {{ setUuid("patientUuid"); }}; List<Observation> observations = new ArrayList<>(); Observation anObservation = mock(Observation.class); when(anObservation.isVoided()).thenReturn(false); when(anObservation.getPerson()).thenReturn(patient); observations.add(anObservation); Observation voidedObservation = mock(Observation.class); when(voidedObservation.isVoided()).thenReturn(true); when(voidedObservation.getPerson()).thenReturn(patient); observations.add(voidedObservation); List<Concept> conceptList = new ArrayList<Concept>() {{ add(new Concept() {{ setUuid("concept1"); }}); }}; when(conceptController.getConcepts()).thenReturn(conceptList); when(observationController.downloadObservationsByPatientUuidsAndConceptUuids (eq(patientUuids), eq(Collections.singletonList("concept1")))).thenReturn(observations); muzimaSyncService.downloadObservationsForPatientsByPatientUUIDs(patientUuids,true); verify(observationController).deleteObservations(Collections.singletonList(voidedObservation)); verify(observationController).replaceObservations(Collections.singletonList(anObservation)); }
public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids); List<List<String>> slicedConceptUuids = split(conceptUuidsFromConcepts); Set<String> patientUuidsForDownloadedObs = new HashSet<>(); long totalTimeDownloading = 0, totalTimeReplacing = 0, totalTimeSaving = 0; int i = 0; for (List<String> slicedPatientUuid : slicedPatientUuids) { for (List<String> slicedConceptUuid : slicedConceptUuids) { long startDownloadObservations = System.currentTimeMillis(); List<Observation> allObservations = new ArrayList<>(observationController.downloadObservationsByPatientUuidsAndConceptUuids( slicedPatientUuid, slicedConceptUuid)); for (Observation observation : allObservations) { patientUuidsForDownloadedObs.add(observation.getPerson().getUuid()); } updateProgressDialog(muzimaApplication.getString(R.string.info_observations_download_progress, patientUuidsForDownloadedObs.size(), patientUuids.size())); Log.i(getClass().getSimpleName(), "Downloading observations for " + slicedPatientUuid.size() + " patients and " + slicedConceptUuid.size() + " concepts"); long endDownloadObservations = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Observations download successful with " + allObservations.size() + " observations"); Log.d(getClass().getSimpleName(), "In Downloading observations : " + (endDownloadObservations - startDownloadObservations) / 1000 + " sec"); totalTimeDownloading += endDownloadObservations - startDownloadObservations; List<Observation> voidedObservations = getVoidedObservations(allObservations); observationController.deleteObservations(voidedObservations); allObservations.removeAll(voidedObservations); Log.i(getClass().getSimpleName(), "Voided observations delete successful with " + voidedObservations.size() + " observations"); if (replaceExistingObservations) { observationController.replaceObservations(allObservations); long replacedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In Replacing observations for patients: " + (replacedObservations - endDownloadObservations) / 1000 + " sec"); totalTimeReplacing += replacedObservations - endDownloadObservations; } else { observationController.saveObservations(allObservations); long savedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In saving observations : " + (savedObservations - endDownloadObservations) / 1000 + " sec\n"); totalTimeSaving += savedObservations - endDownloadObservations; } result[1] += allObservations.size(); result[2] += voidedObservations.size(); } } result[3] = patientUuidsForDownloadedObs.size(); result[0] = SUCCESS; Log.d(getClass().getSimpleName(), "Total Downloading observations : " + totalTimeDownloading / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Replacing observations : " + totalTimeReplacing / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Saving observations : " + totalTimeSaving / 1000 + " sec\n"); } catch (ObservationController.DownloadObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading observations.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (ObservationController.ReplaceObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing observations.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } catch (ConceptController.ConceptFetchException e) { Log.e(getClass().getSimpleName(), "Exception thrown while loading concepts.", e); result[0] = SyncStatusConstants.LOAD_ERROR; } catch (ObservationController.DeleteObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while deleting observations.", e); result[0] = SyncStatusConstants.DELETE_ERROR; } catch (ObservationController.SaveObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while saving observations.", e); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; }
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids); List<List<String>> slicedConceptUuids = split(conceptUuidsFromConcepts); Set<String> patientUuidsForDownloadedObs = new HashSet<>(); long totalTimeDownloading = 0, totalTimeReplacing = 0, totalTimeSaving = 0; int i = 0; for (List<String> slicedPatientUuid : slicedPatientUuids) { for (List<String> slicedConceptUuid : slicedConceptUuids) { long startDownloadObservations = System.currentTimeMillis(); List<Observation> allObservations = new ArrayList<>(observationController.downloadObservationsByPatientUuidsAndConceptUuids( slicedPatientUuid, slicedConceptUuid)); for (Observation observation : allObservations) { patientUuidsForDownloadedObs.add(observation.getPerson().getUuid()); } updateProgressDialog(muzimaApplication.getString(R.string.info_observations_download_progress, patientUuidsForDownloadedObs.size(), patientUuids.size())); Log.i(getClass().getSimpleName(), "Downloading observations for " + slicedPatientUuid.size() + " patients and " + slicedConceptUuid.size() + " concepts"); long endDownloadObservations = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Observations download successful with " + allObservations.size() + " observations"); Log.d(getClass().getSimpleName(), "In Downloading observations : " + (endDownloadObservations - startDownloadObservations) / 1000 + " sec"); totalTimeDownloading += endDownloadObservations - startDownloadObservations; List<Observation> voidedObservations = getVoidedObservations(allObservations); observationController.deleteObservations(voidedObservations); allObservations.removeAll(voidedObservations); Log.i(getClass().getSimpleName(), "Voided observations delete successful with " + voidedObservations.size() + " observations"); if (replaceExistingObservations) { observationController.replaceObservations(allObservations); long replacedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In Replacing observations for patients: " + (replacedObservations - endDownloadObservations) / 1000 + " sec"); totalTimeReplacing += replacedObservations - endDownloadObservations; } else { observationController.saveObservations(allObservations); long savedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In saving observations : " + (savedObservations - endDownloadObservations) / 1000 + " sec\n"); totalTimeSaving += savedObservations - endDownloadObservations; } result[1] += allObservations.size(); result[2] += voidedObservations.size(); } } result[3] = patientUuidsForDownloadedObs.size(); result[0] = SUCCESS; Log.d(getClass().getSimpleName(), "Total Downloading observations : " + totalTimeDownloading / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Replacing observations : " + totalTimeReplacing / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Saving observations : " + totalTimeSaving / 1000 + " sec\n"); } catch (ObservationController.DownloadObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading observations.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (ObservationController.ReplaceObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing observations.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } catch (ConceptController.ConceptFetchException e) { Log.e(getClass().getSimpleName(), "Exception thrown while loading concepts.", e); result[0] = SyncStatusConstants.LOAD_ERROR; } catch (ObservationController.DeleteObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while deleting observations.", e); result[0] = SyncStatusConstants.DELETE_ERROR; } catch (ObservationController.SaveObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while saving observations.", e); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; } }
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids); List<List<String>> slicedConceptUuids = split(conceptUuidsFromConcepts); Set<String> patientUuidsForDownloadedObs = new HashSet<>(); long totalTimeDownloading = 0, totalTimeReplacing = 0, totalTimeSaving = 0; int i = 0; for (List<String> slicedPatientUuid : slicedPatientUuids) { for (List<String> slicedConceptUuid : slicedConceptUuids) { long startDownloadObservations = System.currentTimeMillis(); List<Observation> allObservations = new ArrayList<>(observationController.downloadObservationsByPatientUuidsAndConceptUuids( slicedPatientUuid, slicedConceptUuid)); for (Observation observation : allObservations) { patientUuidsForDownloadedObs.add(observation.getPerson().getUuid()); } updateProgressDialog(muzimaApplication.getString(R.string.info_observations_download_progress, patientUuidsForDownloadedObs.size(), patientUuids.size())); Log.i(getClass().getSimpleName(), "Downloading observations for " + slicedPatientUuid.size() + " patients and " + slicedConceptUuid.size() + " concepts"); long endDownloadObservations = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Observations download successful with " + allObservations.size() + " observations"); Log.d(getClass().getSimpleName(), "In Downloading observations : " + (endDownloadObservations - startDownloadObservations) / 1000 + " sec"); totalTimeDownloading += endDownloadObservations - startDownloadObservations; List<Observation> voidedObservations = getVoidedObservations(allObservations); observationController.deleteObservations(voidedObservations); allObservations.removeAll(voidedObservations); Log.i(getClass().getSimpleName(), "Voided observations delete successful with " + voidedObservations.size() + " observations"); if (replaceExistingObservations) { observationController.replaceObservations(allObservations); long replacedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In Replacing observations for patients: " + (replacedObservations - endDownloadObservations) / 1000 + " sec"); totalTimeReplacing += replacedObservations - endDownloadObservations; } else { observationController.saveObservations(allObservations); long savedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In saving observations : " + (savedObservations - endDownloadObservations) / 1000 + " sec\n"); totalTimeSaving += savedObservations - endDownloadObservations; } result[1] += allObservations.size(); result[2] += voidedObservations.size(); } } result[3] = patientUuidsForDownloadedObs.size(); result[0] = SUCCESS; Log.d(getClass().getSimpleName(), "Total Downloading observations : " + totalTimeDownloading / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Replacing observations : " + totalTimeReplacing / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Saving observations : " + totalTimeSaving / 1000 + " sec\n"); } catch (ObservationController.DownloadObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading observations.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (ObservationController.ReplaceObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing observations.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } catch (ConceptController.ConceptFetchException e) { Log.e(getClass().getSimpleName(), "Exception thrown while loading concepts.", e); result[0] = SyncStatusConstants.LOAD_ERROR; } catch (ObservationController.DeleteObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while deleting observations.", e); result[0] = SyncStatusConstants.DELETE_ERROR; } catch (ObservationController.SaveObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while saving observations.", e); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids); List<List<String>> slicedConceptUuids = split(conceptUuidsFromConcepts); Set<String> patientUuidsForDownloadedObs = new HashSet<>(); long totalTimeDownloading = 0, totalTimeReplacing = 0, totalTimeSaving = 0; int i = 0; for (List<String> slicedPatientUuid : slicedPatientUuids) { for (List<String> slicedConceptUuid : slicedConceptUuids) { long startDownloadObservations = System.currentTimeMillis(); List<Observation> allObservations = new ArrayList<>(observationController.downloadObservationsByPatientUuidsAndConceptUuids( slicedPatientUuid, slicedConceptUuid)); for (Observation observation : allObservations) { patientUuidsForDownloadedObs.add(observation.getPerson().getUuid()); } updateProgressDialog(muzimaApplication.getString(R.string.info_observations_download_progress, patientUuidsForDownloadedObs.size(), patientUuids.size())); Log.i(getClass().getSimpleName(), "Downloading observations for " + slicedPatientUuid.size() + " patients and " + slicedConceptUuid.size() + " concepts"); long endDownloadObservations = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Observations download successful with " + allObservations.size() + " observations"); Log.d(getClass().getSimpleName(), "In Downloading observations : " + (endDownloadObservations - startDownloadObservations) / 1000 + " sec"); totalTimeDownloading += endDownloadObservations - startDownloadObservations; List<Observation> voidedObservations = getVoidedObservations(allObservations); observationController.deleteObservations(voidedObservations); allObservations.removeAll(voidedObservations); Log.i(getClass().getSimpleName(), "Voided observations delete successful with " + voidedObservations.size() + " observations"); if (replaceExistingObservations) { observationController.replaceObservations(allObservations); long replacedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In Replacing observations for patients: " + (replacedObservations - endDownloadObservations) / 1000 + " sec"); totalTimeReplacing += replacedObservations - endDownloadObservations; } else { observationController.saveObservations(allObservations); long savedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In saving observations : " + (savedObservations - endDownloadObservations) / 1000 + " sec\n"); totalTimeSaving += savedObservations - endDownloadObservations; } result[1] += allObservations.size(); result[2] += voidedObservations.size(); } } result[3] = patientUuidsForDownloadedObs.size(); result[0] = SUCCESS; Log.d(getClass().getSimpleName(), "Total Downloading observations : " + totalTimeDownloading / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Replacing observations : " + totalTimeReplacing / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Saving observations : " + totalTimeSaving / 1000 + " sec\n"); } catch (ObservationController.DownloadObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading observations.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (ObservationController.ReplaceObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing observations.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } catch (ConceptController.ConceptFetchException e) { Log.e(getClass().getSimpleName(), "Exception thrown while loading concepts.", e); result[0] = SyncStatusConstants.LOAD_ERROR; } catch (ObservationController.DeleteObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while deleting observations.", e); result[0] = SyncStatusConstants.DELETE_ERROR; } catch (ObservationController.SaveObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while saving observations.", e); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTemplatesAndRelatedMetadata(String[] formIds, boolean replaceExistingTemplates); int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates); int[] downloadLocations(String[] locationIds); int[] downloadProviders(String[] providerIds); int[] downloadConcepts(String[] conceptIds); int[] downloadCohorts(); int[] downloadCohorts(String[] cohortUuids); int[] downloadPatientsForCohortsWithUpdatesAvailable(); int[] downloadRemovedCohortMembershipData(String[] cohortUuids); int[] downloadPatientsForCohorts(String[] cohortUuids); int[] downloadPatients(String[] patientUUIDs); int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation); int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations); int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters); int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters); int[] uploadAllCompletedForms(); void consolidatePatients(); List<FormData> getArchivedFormData(); int[] checkAndDeleteTemporaryDataForProcessedFormData(List<FormData> archivedFormData); List<String> getUuidsForAllPatientsFromLocalStorage(); List<Patient> updatePatientsNotPartOfCohorts(); int[] downloadNotifications(String receiverUuid); int[] downloadPatientReportHeaders(String patientUuid); int[] downloadAllPatientReportHeadersAndReports(); int[] downloadPatientReportsByUuid(String[] reportUuids); void downloadSetupConfigurations(); int[] downloadSetupConfigurationTemplate(String uuid); int[] downloadAndSaveUpdatedSetupConfigurationTemplate(String uuid); int[] updateSetupConfigurationTemplates(); int[] downloadSetting(String property); int[] downloadNewSettings(); void updateSettingsPreferences(List<MuzimaSetting> muzimaSettings); int[] downloadRelationshipsTypes(); int[] downloadRelationshipsForPatientsByPatientUUIDs(List<String> patientUuids); int[] downloadRelationshipsForPatientsByCohortUUIDs(String[] cohortUuids); String getDefaultLocation(); }
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids); List<List<String>> slicedConceptUuids = split(conceptUuidsFromConcepts); Set<String> patientUuidsForDownloadedObs = new HashSet<>(); long totalTimeDownloading = 0, totalTimeReplacing = 0, totalTimeSaving = 0; int i = 0; for (List<String> slicedPatientUuid : slicedPatientUuids) { for (List<String> slicedConceptUuid : slicedConceptUuids) { long startDownloadObservations = System.currentTimeMillis(); List<Observation> allObservations = new ArrayList<>(observationController.downloadObservationsByPatientUuidsAndConceptUuids( slicedPatientUuid, slicedConceptUuid)); for (Observation observation : allObservations) { patientUuidsForDownloadedObs.add(observation.getPerson().getUuid()); } updateProgressDialog(muzimaApplication.getString(R.string.info_observations_download_progress, patientUuidsForDownloadedObs.size(), patientUuids.size())); Log.i(getClass().getSimpleName(), "Downloading observations for " + slicedPatientUuid.size() + " patients and " + slicedConceptUuid.size() + " concepts"); long endDownloadObservations = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Observations download successful with " + allObservations.size() + " observations"); Log.d(getClass().getSimpleName(), "In Downloading observations : " + (endDownloadObservations - startDownloadObservations) / 1000 + " sec"); totalTimeDownloading += endDownloadObservations - startDownloadObservations; List<Observation> voidedObservations = getVoidedObservations(allObservations); observationController.deleteObservations(voidedObservations); allObservations.removeAll(voidedObservations); Log.i(getClass().getSimpleName(), "Voided observations delete successful with " + voidedObservations.size() + " observations"); if (replaceExistingObservations) { observationController.replaceObservations(allObservations); long replacedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In Replacing observations for patients: " + (replacedObservations - endDownloadObservations) / 1000 + " sec"); totalTimeReplacing += replacedObservations - endDownloadObservations; } else { observationController.saveObservations(allObservations); long savedObservations = System.currentTimeMillis(); Log.d(getClass().getSimpleName(), "In saving observations : " + (savedObservations - endDownloadObservations) / 1000 + " sec\n"); totalTimeSaving += savedObservations - endDownloadObservations; } result[1] += allObservations.size(); result[2] += voidedObservations.size(); } } result[3] = patientUuidsForDownloadedObs.size(); result[0] = SUCCESS; Log.d(getClass().getSimpleName(), "Total Downloading observations : " + totalTimeDownloading / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Replacing observations : " + totalTimeReplacing / 1000 + " sec\n"); Log.d(getClass().getSimpleName(), "Total Saving observations : " + totalTimeSaving / 1000 + " sec\n"); } catch (ObservationController.DownloadObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading observations.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (ObservationController.ReplaceObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing observations.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } catch (ConceptController.ConceptFetchException e) { Log.e(getClass().getSimpleName(), "Exception thrown while loading concepts.", e); result[0] = SyncStatusConstants.LOAD_ERROR; } catch (ObservationController.DeleteObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while deleting observations.", e); result[0] = SyncStatusConstants.DELETE_ERROR; } catch (ObservationController.SaveObservationException e) { Log.e(getClass().getSimpleName(), "Exception thrown while saving observations.", e); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTemplatesAndRelatedMetadata(String[] formIds, boolean replaceExistingTemplates); int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates); int[] downloadLocations(String[] locationIds); int[] downloadProviders(String[] providerIds); int[] downloadConcepts(String[] conceptIds); int[] downloadCohorts(); int[] downloadCohorts(String[] cohortUuids); int[] downloadPatientsForCohortsWithUpdatesAvailable(); int[] downloadRemovedCohortMembershipData(String[] cohortUuids); int[] downloadPatientsForCohorts(String[] cohortUuids); int[] downloadPatients(String[] patientUUIDs); int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation); int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations); int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters); int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters); int[] uploadAllCompletedForms(); void consolidatePatients(); List<FormData> getArchivedFormData(); int[] checkAndDeleteTemporaryDataForProcessedFormData(List<FormData> archivedFormData); List<String> getUuidsForAllPatientsFromLocalStorage(); List<Patient> updatePatientsNotPartOfCohorts(); int[] downloadNotifications(String receiverUuid); int[] downloadPatientReportHeaders(String patientUuid); int[] downloadAllPatientReportHeadersAndReports(); int[] downloadPatientReportsByUuid(String[] reportUuids); void downloadSetupConfigurations(); int[] downloadSetupConfigurationTemplate(String uuid); int[] downloadAndSaveUpdatedSetupConfigurationTemplate(String uuid); int[] updateSetupConfigurationTemplates(); int[] downloadSetting(String property); int[] downloadNewSettings(); void updateSettingsPreferences(List<MuzimaSetting> muzimaSettings); int[] downloadRelationshipsTypes(); int[] downloadRelationshipsForPatientsByPatientUUIDs(List<String> patientUuids); int[] downloadRelationshipsForPatientsByCohortUUIDs(String[] cohortUuids); String getDefaultLocation();  }