zhoutg 4 vuotta sitten
vanhempi
commit
ad48b80446

+ 2 - 2
src/main/java/com/diagbot/dto/BillDTO.java

@@ -6,12 +6,12 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * @description: 开单合理性提示信息出参
+ * @description: 提示信息出参
  * @author: zhoutg
  * @time: 2020/7/29 9:57
  */
 @Data
-public class BillDTO {
+public class IndicationDTO {
 
     // 化验开单合理性提示信息
     private List<BillMsg> lisBill = new ArrayList<>();

+ 3 - 3
src/main/java/com/diagbot/facade/BillFacade.java

@@ -2,7 +2,7 @@ package com.diagbot.facade;
 
 import com.diagbot.biz.push.entity.Pacs;
 import com.diagbot.biz.push.entity.Lis;
-import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.process.BillProcess;
@@ -38,7 +38,7 @@ public class BillFacade {
      * @param
      * @return
      */
-    public BillDTO billFac(IndicationPushVO indicationPushVO) {
+    public void billFac(IndicationPushVO indicationPushVO, IndicationDTO res) {
         // 模型处理数据
         WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
 
@@ -56,7 +56,7 @@ public class BillFacade {
         // neoFacade.getDrugCache();
 
         // 规则开发
-       return billProcess.process(billNeoDTOList, wordCrfDTO);
+       billProcess.process(billNeoDTOList, wordCrfDTO, res);
     }
 
 

+ 55 - 0
src/main/java/com/diagbot/facade/IndicationFacade.java

@@ -0,0 +1,55 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.StandConvert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 提示信息facade
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class IndicationFacade {
+
+    @Autowired
+    NeoFacade neoFacade;
+    @Autowired
+    CommonFacade commonFacade;
+    @Autowired
+    BillFacade billFacade;
+
+    /**
+     * 病情提示总入口
+     *
+     * @param
+     * @return
+     */
+    public IndicationDTO indicationFac(IndicationPushVO indicationPushVO) {
+        IndicationDTO res = new IndicationDTO();
+        // 模型处理数据
+        WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
+
+        // 标准词转换
+        StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
+        Map<String, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
+//        wordCrfDTO = commonFacade.dataTypeSet(wordCrfDTO, typeStand);
+
+        List<String> ruleTypeList = Arrays.asList(indicationPushVO.getRuleType().split(","));
+
+        // 开单合理性
+        if (ruleTypeList.contains("2")) {
+            billFacade.billFac(indicationPushVO, res);
+        }
+
+        // TODO 其他类型提示
+        return res;
+    }
+}

+ 3 - 3
src/main/java/com/diagbot/facade/PushFacade.java

@@ -1,7 +1,7 @@
 package com.diagbot.facade;
 
 import com.diagbot.biz.push.entity.Item;
-import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.process.BillProcess;
@@ -35,7 +35,7 @@ public class PushFacade {
      * @param
      * @return
      */
-    public BillDTO billFac(IndicationPushVO indicationPushVO) {
+    public IndicationDTO billFac(IndicationPushVO indicationPushVO) {
         // 模型处理数据 TODO
         WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
         StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
@@ -61,7 +61,7 @@ public class PushFacade {
      * @param
      * @return
      */
-    public BillDTO pushFac(PushVO pushVo) {
+    public IndicationDTO pushFac(PushVO pushVo) {
         // 模型处理数据 TODO
         WordCrfDTO wordCrfDTO = commonFacade.crf_process(pushVo);
         StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);

+ 23 - 26
src/main/java/com/diagbot/process/BillProcess.java

@@ -2,7 +2,7 @@ package com.diagbot.process;
 
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
-import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.DrugBillNeoDTO;
@@ -14,7 +14,6 @@ import com.diagbot.model.label.DiagLabel;
 import com.diagbot.model.label.PresentLabel;
 import com.diagbot.rule.AgeRule;
 import com.diagbot.rule.DiagRule;
-import com.diagbot.rule.LisPacsRule;
 import com.diagbot.rule.SexRule;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
@@ -31,15 +30,13 @@ import java.util.List;
 @Component
 public class BillProcess {
 
-    public BillDTO process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO) {
-        BillDTO billDTO = new BillDTO();
+    public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
         // 化验规则处理
-        processBillWithLis(billNeoDTOList, wordCrfDTO, billDTO);
+        processBillWithLis(billNeoDTOList, wordCrfDTO, res);
         // 辅检规则处理
-        processBillWithPacs(billNeoDTOList, wordCrfDTO, billDTO);
+        processBillWithPacs(billNeoDTOList, wordCrfDTO, res);
         // 药品规则处理
-        processBillWithDrug(billNeoDTOList, wordCrfDTO, billDTO);
-        return billDTO;
+        processBillWithDrug(billNeoDTOList, wordCrfDTO, res);
     }
 
     /**
@@ -47,9 +44,9 @@ public class BillProcess {
      *
      * @param billNeoDTOList
      * @param wordCrfDTO
-     * @param billDTO
+     * @param indicationDTO
      */
-    public void processBillWithLis(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+    public void processBillWithLis(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
 
     }
 
@@ -58,9 +55,9 @@ public class BillProcess {
      *
      * @param billNeoDTOList
      * @param wordCrfDTO
-     * @param billDTO
+     * @param indicationDTO
      */
-    public void processBillWithPacs(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+    public void processBillWithPacs(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
 
     }
 
@@ -69,9 +66,9 @@ public class BillProcess {
      *
      * @param billNeoDTOList
      * @param wordCrfDTO
-     * @param billDTO
+     * @param indicationDTO
      */
-    public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+    public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
         DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
         ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
@@ -101,24 +98,24 @@ public class BillProcess {
             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 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);
 
         }
-        billDTO.setDrugBill(drugBill);
+        indicationDTO.setDrugBill(drugBill);
     }
 
 }

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

@@ -3,6 +3,8 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
+
 /**
  * @Description:病情提示入参
  * @Author:zhaops
@@ -14,5 +16,6 @@ public class IndicationPushVO extends SearchData {
     /**
      * 规则类型(1:危急值提醒,2:开单合理项,3:管理评估,4:不良反应,5:药物推荐,6:异常值)
      */
+    @NotBlank(message = "ruleType不能为空")
     private String ruleType = "";
 }

+ 11 - 12
src/main/java/com/diagbot/web/CoreController.java

@@ -1,11 +1,10 @@
 package com.diagbot.web;
 
-import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.BillFacade;
+import com.diagbot.facade.IndicationFacade;
 import com.diagbot.facade.PushFacade;
 import com.diagbot.vo.IndicationPushVO;
-import com.diagbot.vo.PushVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,20 +25,20 @@ import org.springframework.web.bind.annotation.RestController;
 public class CoreController {
 
     @Autowired
-    private BillFacade billFacade;
+    private IndicationFacade indicationFacade;
     @Autowired
     private PushFacade pushFacade;
 
     @ApiOperation(value = "开单合理性API[zhoutg]", notes = "")
-    @PostMapping("/bill")
-    public RespDTO<BillDTO> bill(@RequestBody IndicationPushVO indicationPushVO) {
-        return RespDTO.onSuc(billFacade.billFac(indicationPushVO));
+    @PostMapping("/indication")
+    public RespDTO<IndicationDTO> indication(@RequestBody IndicationPushVO indicationPushVO) {
+        return RespDTO.onSuc(indicationFacade.indicationFac(indicationPushVO));
     }
 
-    @ApiOperation(value = "推送API[zhoutg]", notes = "类型(多选必填),1:症状,4:查体结果,42:查体指标,5:检验,6:检查,7:诊断")
-    @PostMapping("/push")
-    public RespDTO<BillDTO> push(@RequestBody PushVO pushVo) {
-        return RespDTO.onSuc(pushFacade.pushFac(pushVo));
-    }
+    // @ApiOperation(value = "推送API[zhoutg]", notes = "类型(多选必填),1:症状,4:查体结果,42:查体指标,5:检验,6:检查,7:诊断")
+    // @PostMapping("/push")
+    // public RespDTO<IndicationDTO> push(@RequestBody PushVO pushVo) {
+    //     return RespDTO.onSuc(pushFacade.pushFac(pushVo));
+    // }
 }