From 0c1a8f29cc63d18f5c446877b8145ee5e594561e Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Tue, 5 Sep 2023 11:04:12 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84=E0=B8=84=E0=B8=A7?= =?UTF-8?q?=E0=B8=B2=E0=B8=A1=E0=B8=9E=E0=B8=A3=E0=B9=89=E0=B8=AD=E0=B8=A1?= =?UTF-8?q?=E0=B9=83=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/OrderController.cs | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) 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 {