Преглед на файлове

服用药品处理、现病史辅检加到pacs

kongwz преди 4 години
родител
ревизия
ca0edfe907

+ 30 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -133,6 +133,8 @@ public class CommonFacade {
                     .map(x -> x.getName()).collect(Collectors.toList());
             allPacs.addAll(pacss_unique);
         }
+        allPacs.addAll(wordCrfDTO.getPacs().stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
+                .map(x -> x.getName()).collect(Collectors.toList()));
         //开单检查
         allPacs.addAll(wordCrfDTO.getPacsOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x -> x.getName()).collect(Collectors.toList()));
         standConvert.setPacsList(allPacs);
@@ -140,6 +142,7 @@ public class CommonFacade {
         List<String> drugList = new ArrayList<>();
         //1、现病史中的药品
         drugList.addAll(CoreUtil.getPropertyList(presentLabel.getMedicines()));
+        drugList.addAll(CoreUtil.getPropertyList(presentLabel.getTakeMedicine()));
         //2、既往史(药物过敏)
         drugList.addAll(CoreUtil.getPropertyList(pastLabel.getAllergyMedicines()));
         //3、开单药品
@@ -191,6 +194,7 @@ public class CommonFacade {
         CoreUtil.setPropertyList(wordCrfDTO.getDiag(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
         //药品回填
         CoreUtil.setPropertyList(presentLabel.getMedicines(), map.get(StandConvertEnum.drug.getName()));
+        CoreUtil.setPropertyList(presentLabel.getTakeMedicine(), map.get(StandConvertEnum.drug.getName()));
         CoreUtil.setPropertyList(pastLabel.getAllergyMedicines(), map.get(StandConvertEnum.drug.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getDrugOrder(),"name", "uniqueName", map.get(StandConvertEnum.drug.getName()));
         //化验回填
@@ -198,6 +202,7 @@ public class CommonFacade {
         CoreUtil.setPropertyList(wordCrfDTO.getLisOrder(), "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
         //辅助检查回填
         CoreUtil.setPropertyList(pacsNews, "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
+        CoreUtil.setPropertyList(wordCrfDTO.getPacs(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
         //体征回填
         CoreUtil.setPropertyList(vitalLabel.getVitals(), map.get(StandConvertEnum.vital.getName()));
@@ -337,6 +342,7 @@ public class CommonFacade {
             }
         }
         //处理辅检
+        List<com.diagbot.biz.push.entity.Pacs> pacs = new ArrayList<>();
         List<PacsNew> packagePacs = new ArrayList<>();
         List<PacsNew> pacsNewList = wordCrfDTO.getPresentLabel().getPacsNewList();
         if(ListUtil.isNotEmpty(pacsNewList)){
@@ -358,12 +364,36 @@ public class CommonFacade {
                             return pan;
                         }).collect(Collectors.toList());
                         packagePacs.addAll(collect);
+                        collect.forEach(x ->{
+                            com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
+                            p.setName(x.getName());
+                            p.setUniqueName(x.getUniqueName());
+                            pacs.add(p);
+                        });
+                    }else {
+                        PacsNew pan = new PacsNew();
+                        pan.setName(name);
+                        pan.setPacsResults(pacsResults);
+                        pan.setDisease(disease);
+                        packagePacs.add(pan);
+                        com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
+                        p.setName(name);
+                        pacs.add(p);
                     }
                 });
             }else {
                 packagePacs.addAll(pacsNewList);
+                pacsNewList.forEach(x ->{
+                    com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
+                    p.setName(x.getName());
+                    pacs.add(p);
+                });
             }
         }
+        if(ListUtil.isNotEmpty(pacs)){
+            wordCrfDTO.getPacs().addAll(pacs);
+        }
+
         wordCrfDTO.getLis().addAll(lisList);
 
         PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();

+ 28 - 2
src/main/java/com/diagbot/model/ai/BeHospitalizedAI.java

@@ -307,8 +307,9 @@ public class BeHospitalizedAI extends ModelAI {
         presentLabel.setText(wordCrfDTO.getPresentLabel().getText());
         List<Lis> lis = loadLises(aiOut);
         presentLabel.setLises(lis);
-//        EntityProcessPacsNew entityProcessPacsNew = new EntityProcessPacsNew();
-//        entityProcessPacsNew.extractEntity(aiOut, wordCrfDTO.getPacsLabel());
+        //服用药品
+        List<Medicine> medicines = takeMedicine(presentLabel);
+        presentLabel.setTakeMedicine(medicines);
         wordCrfDTO.setPresentLabel(presentLabel);
     }
 
@@ -677,4 +678,29 @@ public class BeHospitalizedAI extends ModelAI {
             }
         }
     }
+
+    /**
+     * 一般情况以后的药品
+     * @param presentLabel
+     */
+    public List<Medicine> takeMedicine(PresentLabel presentLabel){
+        List<Medicine> takems = new ArrayList<>();
+        List<GeneralDesc> generals = presentLabel.getGenerals();
+        List<Medicine> medicines = presentLabel.getMedicines();
+        if (generals.size() > 0) {
+            String presentText = presentLabel.getText();
+            if (StringUtils.isNotBlank(presentText) && medicines != null && medicines.size() > 0) {
+                String lastGeneral = generals.get(generals.size() - 1).getName();
+                int lastGeneralIndex = presentText.lastIndexOf(lastGeneral);
+                for (Medicine medicine : medicines) {
+                    /* 现病史中一般情况之后的药品名称,并且不包含不详 */
+                    int medicine_index = presentText.indexOf(medicine.getName());
+                    if (medicine_index > lastGeneralIndex && !medicine.getName().contains("不详")) {
+                        takems.add(medicine);
+                    }
+                }
+            }
+        }
+        return takems;
+    }
 }

+ 2 - 0
src/main/java/com/diagbot/model/label/PresentLabel.java

@@ -41,6 +41,8 @@ public class PresentLabel extends GeneralLabel {
     private BeHospitalizedWay beHospitalizedWay;
     //现病史中所有时间实体存入
     private List<PD> pds = new ArrayList<>();
+    //现病史一般情况之后的服用药品
+    List<Medicine> takeMedicine = new ArrayList<>();
 
     public <T> void add(List<T> list, T obj) {
         list.add(obj);

+ 5 - 40
src/main/java/com/diagbot/process/BillProcess.java

@@ -1,26 +1,15 @@
 package com.diagbot.process;
 
 import com.diagbot.biz.push.entity.Item;
-import com.diagbot.dto.BillMsg;
-import com.diagbot.dto.BillNeoDTO;
-import com.diagbot.dto.BillNeoMaxDTO;
-import com.diagbot.dto.IndicationDTO;
-import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.dto.*;
 import com.diagbot.enums.NeoEnum;
 import com.diagbot.facade.NeoFacade;
-import com.diagbot.model.entity.*;
+import com.diagbot.model.entity.Clinical;
+import com.diagbot.model.entity.Operation;
 import com.diagbot.model.label.*;
-import com.diagbot.rule.AgeRule;
-import com.diagbot.rule.CommonRule;
-import com.diagbot.rule.DrugRule;
-import com.diagbot.rule.GroupRule;
-import com.diagbot.rule.LisRule;
-import com.diagbot.rule.PacsRule;
-import com.diagbot.rule.SexRule;
-import com.diagbot.rule.VitalRule;
+import com.diagbot.rule.*;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ListUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -191,7 +180,7 @@ public class BillProcess {
             DrugRule.compareDrugWithBill(bill.getAllergicmeds(), pastLabel.getAllergyMedicines(), bill, billMsgList, drugMap, NeoEnum.allergicmeds.getName());
 
             // 服用药品(现病史一般情况后的药品)
-            DrugRule.compareDrugWithBill(bill.getOralmeds(), takeMedicine(presentLabel), bill, billMsgList, drugMap, NeoEnum.oralmeds.getName());
+            DrugRule.compareDrugWithBill(bill.getOralmeds(), presentLabel.getTakeMedicine(), bill, billMsgList, drugMap, NeoEnum.oralmeds.getName());
 
             // 禁用人群
             GroupRule.compareGroupWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
@@ -205,28 +194,4 @@ public class BillProcess {
         indicationDTO.setBillMsgList(billMsgList);
     }
 
-    /**
-     * 一般情况以后的药品
-     * @param presentLabel
-     */
-    public List<Medicine> takeMedicine(PresentLabel presentLabel){
-        List<Medicine> takems = new ArrayList<>();
-        List<GeneralDesc> generals = presentLabel.getGenerals();
-        List<Medicine> medicines = presentLabel.getMedicines();
-        if (generals.size() > 0) {
-            String presentText = presentLabel.getText();
-            if (StringUtils.isNotBlank(presentText) && medicines != null && medicines.size() > 0) {
-                String lastGeneral = generals.get(generals.size() - 1).getName();
-                int lastGeneralIndex = presentText.lastIndexOf(lastGeneral);
-                for (Medicine medicine : medicines) {
-                    /* 现病史中一般情况之后的药品名称,并且不包含不详 */
-                    int medicine_index = presentText.indexOf(medicine.getName());
-                    if (medicine_index > lastGeneralIndex && !medicine.getName().contains("不详")) {
-                        takems.add(medicine);
-                    }
-                }
-            }
-        }
-        return takems;
-    }
 }