/// <summary> /// Gets a list of reminders for a patient /// </summary> /// <param name="patientDfn">Unique identifier for a patient</param> /// <param name="page">Which page to retrieve for paged results</param> /// <param name="itemsPerPage">The number of items per page for paged results</param> /// <returns></returns> public ReminderListResult GetList(string patientDfn, int page, int itemsPerPage) { // *** Return *** ReminderListResult result = new ReminderListResult(); // *** Create the command *** DsioGetReminderListCommand command = new DsioGetReminderListCommand(this.broker); // *** Add the arguments *** command.AddCommandArguments(patientDfn, page, itemsPerPage); // *** Execute *** RpcResponse response = command.Execute(); // *** Add response to result *** result.Success = response.Status == RpcResponseStatus.Success; result.Message = response.InformationalMessage; // *** Check for success *** if (result.Success) { // *** Set the total result *** result.TotalResults = command.TotalResults; // *** If we have something to work with *** if (result.TotalResults > 0) { if (command.Reminders != null) { if (command.Reminders.Count > 0) { foreach (DsioReminder dsioReminder in command.Reminders) { // *** Create the reminder *** Reminder tempReminder = new Reminder() { Ien = dsioReminder.Ien, ReminderText = dsioReminder.Text }; // *** Set the date *** if (dsioReminder.ReminderDate == "DUE NOW") { tempReminder.ReminderDate = "Due Now"; } else { DateTime tempDate = Util.GetDateTime(dsioReminder.ReminderDate); tempReminder.ReminderDate = tempDate.ToString(VistaDates.UserDateFormat); } // *** Add to result *** result.Reminders.Add(tempReminder); } } } } } return(result); }
public void TestGetReminderListNothingFound() { using (RpcBroker broker = this.GetConnectedBroker()) { this.SignonToBroker(broker, 2); DsioGetReminderListCommand command = new DsioGetReminderListCommand(broker); command.AddCommandArguments("12345", 1, 10); RpcResponse response = command.Execute(); Assert.AreEqual(RpcResponseStatus.Success, response.Status); } }
public void TestGetReminderList() { using (RpcBroker broker = this.GetConnectedBroker()) { this.SignonToBroker(broker, 2); DsioGetReminderListCommand command = new DsioGetReminderListCommand(broker); //command.AddCommandArguments("715", 1, 10); command.AddCommandArguments(TestConfiguration.DefaultPatientDfn, 1, 10); RpcResponse response = command.Execute(); Assert.AreEqual(RpcResponseStatus.Success, response.Status); } }