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); }
private List <FlaggedPatient> ProcessDsioFlaggedPatients(Dictionary <string, DsioFlaggedPatient> dsioFlaggedPatients) { // *** Get list of flagged patients from dictionary of dsio flagged patients *** List <FlaggedPatient> returnList = new List <FlaggedPatient>(); // *** Loop *** foreach (DsioFlaggedPatient dsioPatient in dsioFlaggedPatients.Values) { // *** Get tracking history for this patient *** DsioGetTrackingCommand command = new DsioGetTrackingCommand(broker); command.AddPatientLogsParameter(dsioPatient.Dfn); RpcResponse response = command.Execute(); if (response.Status == RpcResponseStatus.Success) { foreach (DsioTrackingItem item in command.TrackingItems) { dsioPatient.TrackingItems.Add(item.Id, item); } } // *** Create new flagged patient and add to list *** FlaggedPatient patient = this.GetFlaggedPatient(dsioPatient); returnList.Add(patient); } return(returnList); }
public void TestGetTracking_AllEntriesByPatient() { using (RpcBroker broker = GetConnectedBroker()) { this.SignonToBroker(broker, 2); DsioGetTrackingCommand command = new DsioGetTrackingCommand(broker); command.AddPatientLogsParameter(TestConfiguration.DefaultPatientDfn, 1, 3); RpcResponse response = command.Execute(); Assert.AreEqual(RpcResponseStatus.Success, response.Status); Assert.IsNotNull(command.TrackingItems); broker.Disconnect(); } }