Browse Source

Merge remote-tracking branch 'origin/master'

MarkHuang 4 years ago
parent
commit
7d8451d3b7

+ 57 - 0
src/main/java/com/diagbot/dto/BillNeoMaxDTO.java

@@ -0,0 +1,57 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 开单合理性图谱数据
+ * @author: Mark
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class BillNeoMaxDTO {
+
+    // 开单项目名称
+    private String name;
+
+    // 禁忌性别
+    private String gender;
+
+    // 年龄
+    private RangeNeoDTO ageNeoDTO;
+
+    // 临床表现
+    private List<RangeNeoDTO> clinicfindings = new ArrayList<>();
+
+    // 服用药品
+    private List<String> prescribe = new ArrayList<>();
+
+    // 禁忌过敏药品
+    private List<String> allergmeds = new ArrayList<>();
+
+    // 禁忌手术
+    private List<String> operations = new ArrayList<>();
+
+    // 禁忌操作
+    private List<String> procedures = new ArrayList<>();
+
+    // 禁忌辅助检查
+    private List<RangeNeoDTO> Pacs = new ArrayList<>();
+
+    // 禁忌疾病
+    private List<String> disease = new ArrayList<>();
+
+    // 禁用人群
+    private List<String> group = new ArrayList<>();
+
+    // 禁忌过敏药品
+    private List<String> allergicmeds = new ArrayList<>();
+
+    // 禁忌实验室检查
+    private List<RangeNeoDTO> lis = new ArrayList<>();
+
+    // 配伍禁忌
+    private List<String> conflictmeds = new ArrayList<>();
+}

+ 102 - 43
src/main/java/com/diagbot/process/BillProcess.java

@@ -2,10 +2,10 @@ package com.diagbot.process;
 
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
-import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
-import com.diagbot.dto.DrugBillNeoDTO;
+import com.diagbot.dto.BillNeoMaxDTO;
+import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.entity.Diag;
@@ -15,6 +15,7 @@ import com.diagbot.model.label.PresentLabel;
 import com.diagbot.rule.AgeRule;
 import com.diagbot.rule.DiagRule;
 import com.diagbot.rule.SexRule;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
 import org.springframework.stereotype.Component;
@@ -31,44 +32,24 @@ import java.util.List;
 public class BillProcess {
 
     public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
-        // 化验规则处理
-        processBillWithLis(billNeoDTOList, wordCrfDTO, res);
-        // 辅检规则处理
-        processBillWithPacs(billNeoDTOList, wordCrfDTO, res);
-        // 药品规则处理
-        processBillWithDrug(billNeoDTOList, wordCrfDTO, res);
-    }
-
-    /**
-     * 化验规则处理
-     *
-     * @param billNeoDTOList
-     * @param wordCrfDTO
-     * @param indicationDTO
-     */
-    public void processBillWithLis(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
-
-    }
-
-    /**
-     * 辅检规则处理
-     *
-     * @param billNeoDTOList
-     * @param wordCrfDTO
-     * @param indicationDTO
-     */
-    public void processBillWithPacs(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
-
+        List<BillNeoMaxDTO> billNeoMaxDTOList = new ArrayList<>();
+        for (BillNeoDTO billNeoDTO : billNeoDTOList) {
+            BillNeoMaxDTO billNeoMaxDTO =  new BillNeoMaxDTO();
+            if (billNeoDTO.getDrugBillNeoDTO() != null) {
+                BeanUtil.copyProperties(billNeoDTO.getDrugBillNeoDTO(), billNeoMaxDTO);
+            } else if (billNeoDTO.getLisBillNeoDTO() != null) {
+                BeanUtil.copyProperties(billNeoDTO.getLisBillNeoDTO(), billNeoMaxDTO);
+            } else if (billNeoDTO.getPacsBillNeoDTO() != null) {
+                BeanUtil.copyProperties(billNeoDTO.getPacsBillNeoDTO(), billNeoMaxDTO);
+            }
+            billNeoMaxDTO.setName(billNeoDTO.getName());
+            billNeoMaxDTOList.add(billNeoMaxDTO);
+        }
+        processRule(billNeoMaxDTOList, wordCrfDTO, res);
     }
 
-    /**
-     * 药品规则处理
-     *
-     * @param billNeoDTOList
-     * @param wordCrfDTO
-     * @param indicationDTO
-     */
-    public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
+    // 规则处理
+    public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
         DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
         ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
@@ -88,14 +69,13 @@ public class BillProcess {
         List<Pacs> pacs = wordCrfDTO.getPacs();
 
         List<BillMsg> drugBill = new ArrayList<>();
-        for (BillNeoDTO bill : billNeoDTOList) {
-            DrugBillNeoDTO drug =  bill.getDrugBillNeoDTO();
+        for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
             // 性别
-            BillMsg sexMsg = SexRule.compareSexWithBill(drug.getGender(), wordCrfDTO, bill.getName());
+            BillMsg sexMsg = SexRule.compareSexWithBill(bill.getGender(), wordCrfDTO, bill.getName());
             CoreUtil.addBeanToList(drugBill, sexMsg);
 
             // 诊断
-            BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(drug.getDisease(), diags, bill.getName());
+            BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(bill.getDisease(), diags, bill.getName());
             CoreUtil.addBeanToList(drugBill, billMsg_disease);
 
             // //化验
@@ -111,11 +91,90 @@ public class BillProcess {
             // CoreUtil.addBeanToList(drugBill, clinicalMsg);
 
             // 年龄
-            BillMsg ageMsg = AgeRule.compareAgeWithBill(drug.getAgeNeoDTO(), wordCrfDTO, bill.getName());
+            BillMsg ageMsg = AgeRule.compareAgeWithBill(bill.getAgeNeoDTO(), wordCrfDTO, bill.getName());
             CoreUtil.addBeanToList(drugBill, ageMsg);
 
         }
         indicationDTO.setDrugBill(drugBill);
     }
+    //
+    // /**
+    //  * 化验规则处理
+    //  *
+    //  * @param billNeoDTOList
+    //  * @param wordCrfDTO
+    //  * @param indicationDTO
+    //  */
+    // public void processBillWithLis(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
+    //
+    // }
+    //
+    // /**
+    //  * 辅检规则处理
+    //  *
+    //  * @param billNeoDTOList
+    //  * @param wordCrfDTO
+    //  * @param indicationDTO
+    //  */
+    // public void processBillWithPacs(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
+    //
+    // }
+    //
+    // /**
+    //  * 药品规则处理
+    //  *
+    //  * @param billNeoDTOList
+    //  * @param wordCrfDTO
+    //  * @param indicationDTO
+    //  */
+    // public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
+    //     DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
+    //     ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
+    //     PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
+    //     List<Diag> diags = new ArrayList<>();
+    //     List<Clinical> clinicals = new ArrayList<>();
+    //     if(diagLabel != null){
+    //         diags = diagLabel.getDiags();
+    //     }
+    //     if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
+    //         clinicals.addAll(chiefLabel.getClinicals());
+    //     }
+    //     // 现病史临床表现数据先不用
+    //     if(presentLabel != null && ListUtil.isNotEmpty(presentLabel.getClinicals())){
+    //         clinicals.addAll(presentLabel.getClinicals());
+    //     }
+    //     List<Lis> lis = wordCrfDTO.getLis();
+    //     List<Pacs> pacs = wordCrfDTO.getPacs();
+    //
+    //     List<BillMsg> drugBill = new ArrayList<>();
+    //     for (BillNeoDTO bill : billNeoDTOList) {
+    //         DrugBillNeoDTO drug =  bill.getDrugBillNeoDTO();
+    //         // 性别
+    //         BillMsg sexMsg = SexRule.compareSexWithBill(drug.getGender(), wordCrfDTO, bill.getName());
+    //         CoreUtil.addBeanToList(drugBill, sexMsg);
+    //
+    //         // 诊断
+    //         BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(drug.getDisease(), diags, bill.getName());
+    //         CoreUtil.addBeanToList(drugBill, billMsg_disease);
+    //
+    //         // //化验
+    //         // BillMsg lisMsg = LisPacsRule.compareLisPacsWithBill(drug.getLis(), lis, bill.getName());
+    //         // CoreUtil.addBeanToList(drugBill, lisMsg);
+    //         //
+    //         // //辅检
+    //         // BillMsg pacsMsg = LisPacsRule.compareLisPacsWithBill(drug.getPacs(), pacs, bill.getName());
+    //         // CoreUtil.addBeanToList(drugBill, pacsMsg);
+    //         //
+    //         // //临床表现
+    //         // BillMsg clinicalMsg = DiagRule.compareDiseaseWithBill(drug.getClinicfindings(), clinicals, bill.getName());
+    //         // CoreUtil.addBeanToList(drugBill, clinicalMsg);
+    //
+    //         // 年龄
+    //         BillMsg ageMsg = AgeRule.compareAgeWithBill(drug.getAgeNeoDTO(), wordCrfDTO, bill.getName());
+    //         CoreUtil.addBeanToList(drugBill, ageMsg);
+    //
+    //     }
+    //     indicationDTO.setDrugBill(drugBill);
+    // }
 
 }

+ 4 - 2
src/main/java/com/diagbot/web/CoreController.java

@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
+
 /**
  * @Description: CDSS核心API控制层
  * @author: zhoutg
@@ -29,9 +31,9 @@ public class CoreController {
     @Autowired
     private PushFacade pushFacade;
 
-    @ApiOperation(value = "开单合理性API[zhoutg]", notes = "")
+    @ApiOperation(value = "开单合理性API[zhoutg]", notes = "ruleType(1:危急值提醒,2:开单合理项,3:管理评估,4:不良反应,5:药物推荐,6:异常值)")
     @PostMapping("/indication")
-    public RespDTO<IndicationDTO> indication(@RequestBody IndicationPushVO indicationPushVO) {
+    public RespDTO<IndicationDTO> indication(@Valid @RequestBody IndicationPushVO indicationPushVO) {
         return RespDTO.onSuc(indicationFacade.indicationFac(indicationPushVO));
     }