diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs index 2e06608e..3364cde7 100644 --- a/BMA.EHR.Command.Service/Controllers/OrderController.cs +++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs @@ -178,16 +178,43 @@ namespace BMA.EHR.Command.Service.Controllers var cover = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_COVER); var attatchment = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_ATTACHMENT); - if (command.CommandNo != "" && - command.CommandYear != null && - command.CommandExcecuteDate != null && - cover != null && - attatchment != null) + switch (command.CommandType.CommandCode.ToUpper()) { - return Success(new { result = "Y" }); + case "C-PM-10": + case "C-PM-11": + case "C-PM-12": + case "C-PM-16": + case "C-PM-18": + case "C-PM-19": + case "C-PM-20": + case "C-PM-21": + { + if (command.CommandNo != "" && + command.CommandYear != null && + command.CommandExcecuteDate != null && + cover != null) + { + return Success(new { result = "Y" }); + } + else + return Success(new { result = "N" }); + } + default: + { + if (command.CommandNo != "" && + command.CommandYear != null && + command.CommandExcecuteDate != null && + cover != null && + attatchment != null) + { + return Success(new { result = "Y" }); + } + else + return Success(new { result = "N" }); + } } - else - return Success(new { result = "N" }); + + } catch {