Beispiel #1
0
 public static string ValidateOrder(Order order)
 {
     if (!string.IsNullOrEmpty(order.ClinicalInfo))
     {
         return string.Empty;
     }
     else
     {
         return "c";
     }
 }
Beispiel #2
0
        public void ValidateOrder_StringReturned()
        {
            var order = new Order()
            {
                ClinicalInfo = string.Empty,
                Number = "string"
            };

            string result = OrderMethods.ValidateOrder(order);
            Assert.AreEqual(result, "c");
        }
Beispiel #3
0
 public string InsertOrder(Order order)
 {
     var message = ValidateOrder(order);
     if (string.IsNullOrEmpty(message))
     {
         bool isProcessDone = InsertEntity<Order>(order);
         if (isProcessDone)
         {
             log.Info(string.Format("Order {0} saved", order.Number));
             return "o";
         }
         else
         {
             return "e";
         }
     }
     else
     {
         return message;
     }
 }
Beispiel #4
0
 public string EditOrder(DtoOrder dtoOrder)
 {
     var visit = VisitMethods.Instance.GetVisitByBillingNumber(dtoOrder.Visit.BillingNumber);
     var uniqueOrder = OrderMethods.Instance.GetOrderByNumber(dtoOrder.Number);
     if (PatientMethods.Instance.GetPatientById(visit.Patient.Id).Dod == null)
     {
         if (uniqueOrder == null)
         {
             var order = new Order()
             {
                 Number = dtoOrder.Number,
                 Visit = new Visit()
                 {
                     Id = visit.Id
                 },
                 ClinicalInfo = dtoOrder.ClinicalInfo
             };
             return OrderMethods.Instance.InsertOrder(order);
         }
         else
         {
             Order order = new Order()
             {
                 Number = dtoOrder.Number,
                 Id = uniqueOrder.Id,
                 ClinicalInfo = dtoOrder.ClinicalInfo,
                 Visit = new Visit()
                 {
                     Id = visit.Id
                 }
             };
             return OrderMethods.Instance.UpdateOrder(order);
         }
     }
     else
     {
         return "d";
     }
 }
Beispiel #5
0
 public string UpdateOrder(Order order)
 {
     var message = ValidateOrder(order);
     if (string.IsNullOrEmpty(message))
     {
         if (InterpretationMethods.Instance.GetInterpretationByOrder(order.Number).SignOutDt == null)
         {
             bool isProcessDone = UpdateEntity<Order>(order);
             if (isProcessDone)
             {
                 log.Info(string.Format("Order {0} changed", order.Number));
                 return "o";
             }
             else
             {
                 return "e";
             }
         }
         else
         {
             return "s";
         }
     }
     else
     {
         return message;
     }
 }