public TrackingHistoryResult GetPatientEntries(string dfn, int page, int itemsPerPage) { // *** Gets one page of tracking history entries for a patient *** TrackingHistoryResult result = new TrackingHistoryResult(); DsioGetTrackingCommand command = new DsioGetTrackingCommand(this.broker); // *** If we don't have a valid page, get all *** if (page > 0) { command.AddPatientLogsParameter(dfn, page, itemsPerPage); } else { command.AddPatientLogsParameter(dfn); } // *** Execute the command *** RpcResponse response = command.Execute(); // *** Store success and message *** result.Success = (response.Status == RpcResponseStatus.Success); result.Message = response.InformationalMessage; if (result.Success) { // *** Add results to return value *** result.TrackingEntries = GetTrackingEntries(command.TrackingItems); result.TotalEntries = command.TotalResults; } return(result); }
public TrackingHistoryResult GetHistoryEntries(int page, int itemsPerPage) { TrackingHistoryResult returnResult = new TrackingHistoryResult(); if (this.broker == null) { returnResult.Message = "No broker"; } else { DsioGetTrackingCommand command = new DsioGetTrackingCommand(this.broker); //command.AddGetAllParameters(); command.AddGetAllParameters(page, itemsPerPage); RpcResponse response = command.Execute(); returnResult.Success = (response.Status == RpcResponseStatus.Success); returnResult.Message = response.InformationalMessage; if (returnResult.Success) { returnResult.TrackingEntries = GetTrackingEntries(command.TrackingItems); returnResult.TotalEntries = command.TotalResults; } } return(returnResult); }