.onInstance(new IdType("Patient/123")) .andReturnBundle(Bundle.class) .preferResponseType(MyPatient.class)
/** * Perform the operation across all versions of a specific resource (by ID and type) on the server. * Note that <code>theId</code> must be populated with both a resource type and a resource ID at * a minimum. * @param id the {@link IIdType} which must be populated with both a resource type and a resource ID at * @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 * @throws IllegalArgumentException If <code>id</code> does not contain at least a resource type and ID * @return the {@link IBaseBundle} */ public <T extends IBaseBundle> T onInstance(IIdType id, Class<T> returnType, Integer count, Date cutoff, IPrimitiveType<Date> iCutoff, Map<ExtraParameters, Object> extraParameters) { IHistoryTyped<T> tiHistoryTyped = client.history().onInstance(id).andReturnBundle(returnType); processOptionalParams(count, cutoff, iCutoff, tiHistoryTyped); ExtraParameters.process(extraParameters, tiHistoryTyped); return tiHistoryTyped.execute(); }