@SuppressWarnings("unused") public static void history() { IGenericClient client = FhirContext.forDstu2().newRestfulGenericClient(""); { ca.uhn.fhir.model.dstu2.resource.Bundle response; // START SNIPPET: historyDstu2 response = client .history() .onServer() .andReturnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .execute(); // END SNIPPET: historyDstu2 } { ca.uhn.fhir.model.dstu2.resource.Bundle response; // START SNIPPET: historyFeatures response = client .history() .onServer() .andReturnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .since(new InstantDt("2012-01-01T12:22:32.038Z")) .count(100) .execute(); // END SNIPPET: historyFeatures } }
/** * Perform the operation across all versions of all resources of all types on the server * * @param returnType Request that the method return a Bundle resource (such as <code>ca.uhn.fhir.model.dstu2.resource.Bundle</code>). * Use this method if you are accessing a DSTU2+ server. * @param count Request that the server return only up to <code>theCount</code> number of resources, may be NULL * @param cutoff Request that the server return only resource versions that were created at or after the given time (inclusive), may be NULL * @param iCutoff Request that the server return only resource versions that were created at or after the given time (inclusive), may be NULL * @param <T> extends {@link IBaseBundle} * @param extraParameters see {@link ExtraParameters} for a full list of parameters that can be passed, may be NULL * @return the {@link IBaseBundle} */ public <T extends IBaseBundle> T onServer(Class<T> returnType, Integer count, Date cutoff, IPrimitiveType<Date> iCutoff, Map<ExtraParameters, Object> extraParameters) { IHistoryTyped<T> tiHistoryTyped = client.history().onServer().andReturnBundle(returnType); processOptionalParams(count, cutoff, iCutoff, tiHistoryTyped); ExtraParameters.process(extraParameters, tiHistoryTyped); return tiHistoryTyped.execute(); }