Browse Source

Merge remote-tracking branch 'origin/master'

zhoutg 4 years ago
parent
commit
0ceca31767

+ 5 - 0
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -57,6 +57,10 @@ public class WordCrfDTO {
     private DiagLabel diagLabel = new DiagLabel();
 
     /*******************************************入参数据拷贝开始******************************/
+    /**
+     * 选中诊断
+     */
+    private Item diseaseName;
      // 诊断
     private List<Item> diag = new ArrayList<>();
     // 当前化验开单项
@@ -76,4 +80,5 @@ public class WordCrfDTO {
     // private LisLabel lisLabel;
     // 辅检
     private PacsLabel pacsLabel = new PacsLabel();
+
 }

+ 47 - 34
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -46,6 +46,7 @@ public class CommonFacade {
         wordCrfDTO.setHospitalId(searchData.getHospitalId());
         wordCrfDTO.setAge(searchData.getAge());
         wordCrfDTO.setSex(searchData.getSex());
+        wordCrfDTO.setDiseaseName(searchData.getDiseaseName());
         if (ListUtil.isNotEmpty(searchData.getLis())) {
             wordCrfDTO.setLis(searchData.getLis());
         }
@@ -106,6 +107,10 @@ public class CommonFacade {
         //传的诊断
         diagList.addAll(wordCrfDTO.getDiag().stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
                 .map(x -> x.getName()).collect(Collectors.toList()));
+        //选中的诊断
+        if(wordCrfDTO.getDiseaseName() != null && StringUtils.isBlank(wordCrfDTO.getDiseaseName().getUniqueName())){
+            diagList.add(wordCrfDTO.getDiseaseName().getName());
+        }
         standConvert.setDiaglList(diagList);
 
         //所有化验(结构化数据)
@@ -193,6 +198,7 @@ public class CommonFacade {
         CoreUtil.setPropertyList(diagLabel.getDiags(), map.get(StandConvertEnum.disease.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getDiagOrder(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getDiag(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
+        CoreUtil.setPropertyList(wordCrfDTO.getDiseaseName(),"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()));
@@ -223,51 +229,58 @@ public class CommonFacade {
         ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
         List<Item> diags = wordCrfDTO.getDiag();
+        Item diseaseName = wordCrfDTO.getDiseaseName();
         PastLabel pastLabel = wordCrfDTO.getPastLabel();
         List<Lis> lis = wordCrfDTO.getLis();
 //        List<Pacs> pacs = wordCrfDTO.getPacs();
         List<PacsNew> pacsNewList = wordCrfDTO.getPacsLabel().getPacsNewList();
         pushVO.setAge(wordCrfDTO.getAge());
         pushVO.setSex(wordCrfDTO.getSex());
+        pushVO.setDiaeaseName(diseaseName);
         if (chiefLabel != null) {
-            List<Symptom> cjiefClinicals = chiefLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
-            {
-                Symptom symptom = new Symptom();
-                symptom.setName(z.getStandName());
-                return symptom;
-            }).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(cjiefClinicals)) {
-                ChiefPushVo chiefPushVo = new ChiefPushVo();
-                chiefPushVo.setSymptoms(cjiefClinicals);
-                pushVO.setChiefPushVo(chiefPushVo);
+            if(ListUtil.isNotEmpty(chiefLabel.getClinicals())){
+                List<Symptom> cjiefClinicals = chiefLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
+                {
+                    Symptom symptom = new Symptom();
+                    symptom.setName(z.getStandName());
+                    return symptom;
+                }).collect(Collectors.toList());
+                if (ListUtil.isNotEmpty(cjiefClinicals)) {
+                    ChiefPushVo chiefPushVo = new ChiefPushVo();
+                    chiefPushVo.setSymptoms(cjiefClinicals);
+                    pushVO.setChiefPushVo(chiefPushVo);
+                }
             }
         }
         if(presentLabel != null){
             PresentPushVo presentPushVo = new PresentPushVo();
-            List<Symptom> presentClinicals = presentLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
-            {
-                Symptom symptom = new Symptom();
-                symptom.setName(z.getStandName());
-                return symptom;
-            }).collect(Collectors.toList());
-            presentPushVo.setSymptoms(presentClinicals);
-
-            List<Diag> presentdiags = presentLabel.getDiags().stream().filter(x -> x.getNegative() == null).map(z ->
-            {
-                Diag diag = new Diag();
-                diag.setName(z.getStandName());
-                return diag;
-            }).collect(Collectors.toList());
-            presentPushVo.setDiags(presentdiags);
-
-            List<Drug> presentdrugs = presentLabel.getMedicines().stream().filter(x -> x.getNegative() == null).map(z ->
-            {
-                Drug drug = new Drug();
-                drug.setName(z.getStandName());
-                return drug;
-            }).collect(Collectors.toList());
-            presentPushVo.setDrugs(presentdrugs);
-
+            if(ListUtil.isNotEmpty(presentLabel.getClinicals())){
+                List<Symptom> presentClinicals = presentLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
+                {
+                    Symptom symptom = new Symptom();
+                    symptom.setName(z.getStandName());
+                    return symptom;
+                }).collect(Collectors.toList());
+                presentPushVo.setSymptoms(presentClinicals);
+            }
+            if(ListUtil.isNotEmpty(presentLabel.getDiags())){
+                List<Diag> presentdiags = presentLabel.getDiags().stream().filter(x -> x.getNegative() == null).map(z ->
+                {
+                    Diag diag = new Diag();
+                    diag.setName(z.getStandName());
+                    return diag;
+                }).collect(Collectors.toList());
+                presentPushVo.setDiags(presentdiags);
+            }
+            if(ListUtil.isNotEmpty(presentLabel.getMedicines())){
+                List<Drug> presentdrugs = presentLabel.getMedicines().stream().filter(x -> x.getNegative() == null).map(z ->
+                {
+                    Drug drug = new Drug();
+                    drug.setName(z.getStandName());
+                    return drug;
+                }).collect(Collectors.toList());
+                presentPushVo.setDrugs(presentdrugs);
+            }
             pushVO.setPresentPushVo(presentPushVo);
         }
         if(ListUtil.isNotEmpty(lis)){

+ 7 - 7
src/main/java/com/diagbot/process/PushProcess.java

@@ -186,13 +186,13 @@ public class PushProcess {
                     pushDTO.setDis(dis);
                 }
             }
-            if (ruleTypeList.contains("10") && ListUtil.isNotEmpty(diags)) {
-                List<TreatDTO> collect = diags.stream().map(x -> {
-                    TreatDTO treatDTO = new TreatDTO();
-                    treatDTO.setName(x.getName());
-                    treatDTO.setUniqueName(x.getUniqueName());
-                    return treatDTO;
-                }).collect(Collectors.toList());
+            if (ruleTypeList.contains("10") && pushVO.getDiaeaseName() != null) {
+                List<TreatDTO> collect = new ArrayList<>();
+                Item diaeaseName = pushVO.getDiaeaseName();
+                TreatDTO treatDTO = new TreatDTO();
+                treatDTO.setName(diaeaseName.getName());
+                treatDTO.setUniqueName(diaeaseName.getUniqueName());
+                collect.add(treatDTO);
                 pushDTO.setTreat(collect);
             }
         }

+ 12 - 0
src/main/java/com/diagbot/util/CoreUtil.java

@@ -95,6 +95,18 @@ public class CoreUtil {
         return res;
     }
 
+    public static <T> void  setPropertyList(T list, String propertyName, String standName, Map<String, String> map) {
+        if(list == null){
+            return;
+        }
+        try {
+            setFieldValue(list, propertyName, standName, map);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
     /**
      * 将列表中属性对应的值从map中获取,如果有值,将standName替换
      *

+ 3 - 0
src/main/java/com/diagbot/vo/NeoPushVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.biz.push.entity.Item;
 import com.diagbot.vo.neoPushEntity.*;
 import lombok.Data;
 
@@ -14,6 +15,8 @@ public class NeoPushVO {
     private Integer age;
     // 性别(1:男,2:女)
     private Integer sex;
+    //选中的诊断
+    private Item diaeaseName;
     private DiagVo diagVo;//下的诊断
     private ChiefPushVo chiefPushVo;//主诉
     private PresentPushVo presentPushVo;//现病史