Browse Source

修复药品 drug_flag 错误的问题

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
2324b1ad58

+ 9 - 7
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -290,12 +290,14 @@ public interface YiZhuLuRuDao {
             "                order_code =a.code, " +
             "                order_name =a.name, " +
             "                drug_specification=a.specification, " +
-            "                order_type =case a.infusion_flag " +
-            "                                when '1' then 'i' " +
-            "                                else " +
-            "                                    (case " +
-            "                                         when a.code >= '30000' and a.code < '50000' then 'z' " +
-            "                                         else 'd' end) end, " +
+            "                    order_type =case a.infusion_flag " +
+            "                    when '1' then 'i' " +
+            "                    else (case categories_flag " +
+            "                              when '0' " +
+            "                                  then 'd' " +
+            "                              else 'z' " +
+            "                        end) " +
+            "                           end, " +
             "                parent_code=null, " +
             "                exclu_group_type=null, " +
             "                discription=case a.infusion_flag " +
@@ -674,7 +676,7 @@ public interface YiZhuLuRuDao {
 
 
     @Select("select " +
-            "    /* 毒麻标志 */     drug_flag, " +
+            "         drug_flag, categories_flag," +
             "                       a.serial, " +
             "    /* 医保自费 */ " +
             "                       cast(isnull(NULLIF(self_flag_yb, " +

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/YaoPinXinXi.java

@@ -100,4 +100,16 @@ public class YaoPinXinXi {
      * 1- 住院限制使用
      */
     private Integer visibleFlagZy;
+
+    /**
+     * 药品大类
+     * 0	口服
+     * 1	大输液
+     * 2	针剂
+     * 3	草药饮片
+     * 4	草药颗粒
+     * 9	其它
+     * 10	雾化溶液
+     */
+    private String categoriesFlag;
 }

+ 18 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -490,6 +490,7 @@ public class YiZhuLuRuServer {
         }
         dao.deleteOrderNo(param.getActOrderNo(), param.getInpatientNo(), param.getAdmissTimes());
         dao.insertEntryOrder(huanZheXinXi, param.getData(), userCode);
+        // 01724
         if (!errorMessageMap.isEmpty()) {
             Map<String, Object> map = new HashMap<>();
             errorMessageMap.put("data", data);
@@ -749,6 +750,8 @@ public class YiZhuLuRuServer {
             if (yp == null) {
                 return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "该医嘱下的药品,可能已经被停用了,请联系药剂科。");
             }
+            yp.setDrugFlag(getDrugFlagByLargeCategories(yp.getCategoriesFlag()));
+
             if (yp.getVisibleFlagZy() == 1) {
                 return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "该药品禁止住院使用。");
             }
@@ -795,6 +798,21 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(map);
     }
 
+
+    private String getDrugFlagByLargeCategories(String val) {
+        if (StringUtil.isBlank(val)) {
+            return "z";
+        }
+        switch (val) {
+            case "0":
+                return "d";
+            case "1":
+                return "i";
+            default:
+                return "z";
+        }
+    }
+
     /**
      * 获取频率
      *