@Override protected void onPostExecute(EncounterAddFailedEvent event) { // If an error occurred, post the error event. if (event != null) { mBus.post(event); return; } // If the UUID was not set, a programming error occurred. Log and post an error event. if (mUuid == null) { LOG.e( "Although an encounter add ostensibly succeeded, no UUID was set for the newly-" + "added encounter. This indicates a programming error."); mBus.post( new EncounterAddFailedEvent(EncounterAddFailedEvent.Reason.UNKNOWN, null /*exception*/)); return; } // Otherwise, start a fetch task to fetch the encounter from the database. mBus.register(new CreationEventSubscriber()); FetchSingleAsyncTask<AppEncounter> task = mTaskFactory.newFetchSingleAsyncTask( Contracts.Observations.CONTENT_URI, ENCOUNTER_PROJECTION, new EncounterUuidFilter(), mUuid, new AppEncounterConverter(mPatient.uuid), mBus); task.execute(); }
/** Asynchronously adds filters to the action bar based on location data. */ public void setupActionBarAsync() { mCrudEventBus.register(new AppLocationTreeFetchedSubscriber()); mAppModel.fetchLocationTree(mCrudEventBus, mLocale); }