Browse Source

服用药品接口更改

zhoutg 4 years ago
parent
commit
09aa7531d7

+ 12 - 7
src/main/java/com/diagbot/facade/TestFacade.java

@@ -93,13 +93,13 @@ public class TestFacade {
 
             if (StringUtil.isNotEmpty(bean.getNeoType())) {
                 switch (bean.getNeoType()) {
-                    case "1" : // 性别
-                        if ("男性".equals(bean.getNeoName())) {
-                            indicationPushVO.setSex(1);
-                        } else if ("女性".equals(bean.getNeoName())) {
-                            indicationPushVO.setSex(2);
-                        }
-                        break;
+                    // case "1" : // 性别
+                    //     if ("男性".equals(bean.getNeoName())) {
+                    //         indicationPushVO.setSex(1);
+                    //     } else if ("女性".equals(bean.getNeoName())) {
+                    //         indicationPushVO.setSex(2);
+                    //     }
+                    //     break;
                     // case "2" : // 化验, 示例:血小板计数,<,50,*10~9L
                     //     String lisStr = bean.getNeoName();
                     //     String[] lisArr = lisStr.split(",");
@@ -124,6 +124,11 @@ public class TestFacade {
                     //     diag.add(diagItem);
                     //     indicationPushVO.setDiag(diag);
                     //     break;
+                    case "6" : // 服用药品
+                        StringBuffer symptom = new StringBuffer("发病来,神志清,精神可,胃纳一般,睡眠可,二便无殊。一直服用");
+                        symptom.append(bean.getNeoName()).append("。");
+                        indicationPushVO.setSymptom(symptom.toString());
+                        break;
                     // case "12" : // 体征
                     //     String[] vitalArr = bean.getNeoName().split(",");
                     //     StringBuffer sbVital = new StringBuffer();

+ 41 - 1
src/main/java/com/diagbot/rule/DrugRule.java

@@ -22,7 +22,7 @@ import java.util.stream.Collectors;
 public class DrugRule {
 
     /**
-     * 比较药品是否存在(图谱返回的是药品大类,需要从缓存中获取大类对应的药品名称)
+     * 比较药品是否存在(图谱返回的是药品通用名,直接比较)
      *
      * @param drugLises
      * @param inputLises
@@ -31,6 +31,46 @@ public class DrugRule {
     public static <T> void compareDrugWithBill(List<NodeNeoDTO> drugLises, List<T> inputLises, BillNeoMaxDTO billNeoMaxDTO,
                                                List<BillMsg> billMsgList, Map<String, List<String>> drugMap, String type) {
         Map<String, String> old_stand = new HashMap<>();
+        if (ListUtil.isNotEmpty(drugLises) && ListUtil.isNotEmpty(inputLises)) {
+            List<String> allDrug = drugLises.stream().map(x -> x.getName()).collect(Collectors.toList());
+            for (T d : inputLises) {
+                Negative val = (Negative) CoreUtil.getFieldValue(d, "negative");
+                if (val == null) {
+                    String c = (String) CoreUtil.getFieldValue(d, "standName");
+                    String c_name = (String) CoreUtil.getFieldValue(d, "name");
+                    if (StringUtils.isNotBlank(c) && allDrug.contains(c)) {
+                        old_stand.put(c_name, c);
+                    }
+                }
+            }
+            if (old_stand.size() > 0) {
+                for (Map.Entry<String, String> d : old_stand.entrySet()) {
+                    String message = "";
+                    if ("禁忌过敏药品".equals(type)) {
+                        message = d.getKey() + "过敏";
+                    } else {
+                        message = "已开" + d.getKey();
+                    }
+                    BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
+                            billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                            message, type);
+                    billMsgList.add(commonBillMsg);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 比较药品是否存在(图谱返回的是药品大类,需要从缓存中获取大类对应的药品名称)
+     *
+     * @param drugLises
+     * @param inputLises
+     * @return
+     */
+    public static <T> void compareDrugWithBillWithType(List<NodeNeoDTO> drugLises, List<T> inputLises, BillNeoMaxDTO billNeoMaxDTO,
+                                               List<BillMsg> billMsgList, Map<String, List<String>> drugMap, String type) {
+        Map<String, String> old_stand = new HashMap<>();
         if (ListUtil.isNotEmpty(drugLises) && ListUtil.isNotEmpty(inputLises)) {
             List<String> drugType = drugLises.stream().map(x -> x.getName()).collect(Collectors.toList());
             List<String> allDrug = new ArrayList<>(); // 所有的药品名称

+ 2 - 4
src/main/java/com/diagbot/vo/TestIndicationVO.java

@@ -170,15 +170,13 @@ public class TestIndicationVO implements Serializable {
 
 
     /************************************************扩展字段开始***********************/
-    @Excel(name="1.实验室检查," +
-            "2辅助检查," +
-            "3手术和操作")
+    @Excel(name="开单项类型")
     private String orderType;
     @Excel(name="标准名称")
     private String standName;
     @Excel(name="内容标准名称")
     private String neoName;
-    @Excel(name="1性别,2实验室检查,3临床表现,4辅助检查描述,5疾病,6服用药品,7药物过敏原,8食物过敏原,9手术,10人群,11过敏原,12体征,13医疗器械及物品")
+    @Excel(name="禁忌类型")
     private String neoType;
     @Excel(name="序号")
     private String idNum;