public OrderTO writeSimpleOrderByPolicy(string providerDUZ, string esig, string locationIEN, string orderIEN, string startDate)
{
OrderTO result = new OrderTO();
if (!mySession.ConnectionSet.IsAuthorized)
{
result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
}
else if (mySession.Patient == null)
{
result.fault = new FaultTO("No patient selected. Need to select patient first.");
}
else if (String.IsNullOrEmpty(providerDUZ) || string.IsNullOrEmpty(esig) ||
String.IsNullOrEmpty(locationIEN) || String.IsNullOrEmpty(startDate))
{
result.fault = new FaultTO("Failed to supply required parameters");
}
if (result.fault != null)
{
return result;
}
try
{
Order order = Order.writeSimpleOrderByPolicy(mySession.ConnectionSet.getConnection(mySession.ConnectionSet.BaseSiteId),
mySession.Patient, providerDUZ, esig, locationIEN, orderIEN,
gov.va.medora.utils.DateUtils.IsoDateStringToDateTime(startDate));
return new OrderTO(order);
}
catch (Exception exc)
{
result.fault = new FaultTO(exc);
}
return result;
}