Browse Source

Merge remote-tracking branch 'origin/master'

MarkHuang 4 years ago
parent
commit
eac5d9393d

+ 9 - 1
src/main/java/com/diagbot/dto/WordBillCrfDTO.java

@@ -11,7 +11,15 @@ import lombok.Data;
  * @since 1.0.0
  * @since 1.0.0
  */
  */
 @Data
 @Data
-public class WordBillCrfDTO {
+public class WordCrfDTO {
+    /**
+     * 年龄
+     */
+    private Integer age;
+    /**
+     * 性别(1:男,2:女,3:通用)
+     */
+    private Integer sex;
     // 主诉
     // 主诉
     private ChiefLabel chiefLabel;
     private ChiefLabel chiefLabel;
     // 现病史
     // 现病史

+ 12 - 13
src/main/java/com/diagbot/facade/BillFacade.java

@@ -1,18 +1,17 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
+import com.diagbot.biz.push.entity.Item;
 import com.diagbot.dto.BillDTO;
 import com.diagbot.dto.BillDTO;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.BillNeoDTO;
-import com.diagbot.dto.WordBillCrfDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.facade.rule.BillRuleFacade;
 import com.diagbot.vo.BillNeoVO;
 import com.diagbot.vo.BillNeoVO;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.StandConvert;
 import com.diagbot.vo.StandConvert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
-import com.diagbot.biz.push.entity.Item;
-
 import java.util.List;
 import java.util.List;
-
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -26,7 +25,7 @@ public class BillFacade {
     @Autowired
     @Autowired
     NeoFacade neoFacade;
     NeoFacade neoFacade;
     @Autowired
     @Autowired
-    RuleFacade ruleFacade;
+    BillRuleFacade billRuleFacade;
     @Autowired
     @Autowired
     CommonFacade commonFacade;
     CommonFacade commonFacade;
 
 
@@ -36,22 +35,22 @@ public class BillFacade {
      * @return
      * @return
      */
      */
     public BillDTO billFac(IndicationPushVO indicationPushVO) {
     public BillDTO billFac(IndicationPushVO indicationPushVO) {
-        // 模型处理数据 TODO
-        WordBillCrfDTO wordBillCrfDTO = commonFacade.crf_process(indicationPushVO);
-        StandConvert standConvert = commonFacade.dataTypeGet(wordBillCrfDTO);
+        // 模型处理数据
+        WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
+        StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
 
 
         // 标准词转换 TODO
         // 标准词转换 TODO
         Map<String, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
         Map<String, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
-        wordBillCrfDTO = commonFacade.dataTypeSet(wordBillCrfDTO, typeStand);
+        wordCrfDTO = commonFacade.dataTypeSet(wordCrfDTO, typeStand);
 
 
-        // 图谱接口调用
+        // 开单合理性图谱接口调用
         BillNeoVO billNeoVO = fillBillNeo(indicationPushVO);
         BillNeoVO billNeoVO = fillBillNeo(indicationPushVO);
-
         BillNeoDTO billNeoDTO = neoFacade.getBillNeo(billNeoVO);
         BillNeoDTO billNeoDTO = neoFacade.getBillNeo(billNeoVO);
 
 
+        // neoFacade.getDrugCache();
+
         // 规则开发 TODO
         // 规则开发 TODO
-        neoFacade.getDrugCache();
-        return null;
+        return billRuleFacade.process(billNeoDTO, wordCrfDTO);
     }
     }
 
 
 
 

+ 18 - 16
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -1,20 +1,18 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
 import com.diagbot.client.CRFServiceClient;
 import com.diagbot.client.CRFServiceClient;
-import com.diagbot.dto.WordBillCrfDTO;
+import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.model.ai.AIAnalyze;
 import com.diagbot.model.ai.AIAnalyze;
-import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.label.ChiefLabel;
 import com.diagbot.model.label.ChiefLabel;
 import com.diagbot.model.label.DiagLabel;
 import com.diagbot.model.label.DiagLabel;
 import com.diagbot.model.label.PastLabel;
 import com.diagbot.model.label.PastLabel;
 import com.diagbot.model.label.PresentLabel;
 import com.diagbot.model.label.PresentLabel;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.CoreUtil;
-import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.SearchData;
 import com.diagbot.vo.StandConvert;
 import com.diagbot.vo.StandConvert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
-import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -30,26 +28,30 @@ public class CommonFacade {
     CRFServiceClient crfServiceClient;
     CRFServiceClient crfServiceClient;
 
 
     //组装好的label
     //组装好的label
-    public WordBillCrfDTO crf_process(IndicationPushVO indicationPushVO){
+    public WordCrfDTO crf_process(SearchData searchData){
+
         AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
         AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
-        WordBillCrfDTO wordBillCrfDTO = new WordBillCrfDTO();
-        aiAnalyze.aiProcess(indicationPushVO,wordBillCrfDTO);
-        return wordBillCrfDTO;
+        WordCrfDTO wordCrfDTO = new WordCrfDTO();
+        wordCrfDTO.setAge(searchData.getAge());
+        wordCrfDTO.setSex(searchData.getSex());
+        aiAnalyze.aiProcess(searchData, wordCrfDTO);
+        return wordCrfDTO;
     }
     }
+
     //返回给图谱的词,这些词需要转换成标准词
     //返回给图谱的词,这些词需要转换成标准词
-    public StandConvert dataTypeGet(WordBillCrfDTO wordBillCrfDTO){
+    public StandConvert dataTypeGet(WordCrfDTO wordCrfDTO){
         StandConvert standConvert = new StandConvert();
         StandConvert standConvert = new StandConvert();
 
 
         //所有的症状(主诉、现病史)
         //所有的症状(主诉、现病史)
         List<String> clinicalList = new ArrayList<>();
         List<String> clinicalList = new ArrayList<>();
-        ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
+        ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
         clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
-        PresentLabel presentLabel = wordBillCrfDTO.getPresentLabel();
+        PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
         clinicalList.addAll(CoreUtil.getPropertyList(presentLabel.getClinicals()));
         clinicalList.addAll(CoreUtil.getPropertyList(presentLabel.getClinicals()));
 
 
         //所有的疾病(主诉、现病史,诊断列表,过去史)
         //所有的疾病(主诉、现病史,诊断列表,过去史)
-        DiagLabel diagLabel = wordBillCrfDTO.getDiagLabel();
-        PastLabel pastLabel = wordBillCrfDTO.getPastLabel();
+        DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
+        PastLabel pastLabel = wordCrfDTO.getPastLabel();
         List<String> diagList = new ArrayList<>();
         List<String> diagList = new ArrayList<>();
         diagList.addAll(CoreUtil.getPropertyList(chiefLabel.getDiags()));
         diagList.addAll(CoreUtil.getPropertyList(chiefLabel.getDiags()));
         diagList.addAll(CoreUtil.getPropertyList(presentLabel.getDiags()));
         diagList.addAll(CoreUtil.getPropertyList(presentLabel.getDiags()));
@@ -61,10 +63,10 @@ public class CommonFacade {
         return standConvert;
         return standConvert;
     }
     }
     //把图谱返回的标准词set到label中
     //把图谱返回的标准词set到label中
-    public WordBillCrfDTO dataTypeSet(WordBillCrfDTO wordBillCrfDTO, Map<String, Map<String, String>> map){
-        ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
+    public WordCrfDTO dataTypeSet(WordCrfDTO wordCrfDTO, Map<String, Map<String, String>> map){
+        ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get("clinicalList"));
         CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get("clinicalList"));
-        return wordBillCrfDTO;
+        return wordCrfDTO;
     }
     }
 
 
 }
 }

+ 88 - 0
src/main/java/com/diagbot/facade/PushFacade.java

@@ -0,0 +1,88 @@
+package com.diagbot.facade;
+
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.BillNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.facade.rule.BillRuleFacade;
+import com.diagbot.vo.BillNeoVO;
+import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.PushVO;
+import com.diagbot.vo.StandConvert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 推送facade
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class PushFacade {
+
+    @Autowired
+    NeoFacade neoFacade;
+    @Autowired
+    BillRuleFacade billRuleFacade;
+    @Autowired
+    CommonFacade commonFacade;
+
+    /**
+     * 开单合理性业务
+     * @param
+     * @return
+     */
+    public BillDTO billFac(IndicationPushVO indicationPushVO) {
+        // 模型处理数据 TODO
+        WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
+        StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
+
+        // 标准词转换 TODO
+        Map<String, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
+        wordCrfDTO = commonFacade.dataTypeSet(wordCrfDTO, typeStand);
+
+        // 图谱接口调用
+        BillNeoVO billNeoVO = fillBillNeo(indicationPushVO);
+
+        BillNeoDTO billNeoDTO = neoFacade.getBillNeo(billNeoVO);
+
+        // 规则开发 TODO
+        neoFacade.getDrugCache();
+
+        // TODO
+        return null;
+    }
+
+    /**
+     * 推送业务
+     * @param
+     * @return
+     */
+    public BillDTO pushFac(PushVO pushVo) {
+        // 模型处理数据 TODO
+        WordCrfDTO wordCrfDTO = commonFacade.crf_process(pushVo);
+        StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
+
+        // 标准词转换 TODO
+        Map<String, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
+        wordCrfDTO = commonFacade.dataTypeSet(wordCrfDTO, typeStand);
+
+        // TODO
+        return null;
+    }
+
+
+    public BillNeoVO fillBillNeo(IndicationPushVO indicationPushVO) {
+        BillNeoVO billNeoVO = new BillNeoVO();
+
+        List<Item> items = indicationPushVO.getDrug();
+        for (Item item : items) {
+            billNeoVO.getDrugList().add(item.getName());
+        }
+
+        return billNeoVO;
+    }
+}

+ 0 - 13
src/main/java/com/diagbot/facade/RuleFacade.java

@@ -1,13 +0,0 @@
-package com.diagbot.facade;
-
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 规则facade
- * @author: zhoutg
- * @time: 2018/8/6 9:11
- */
-@Component
-public class RuleFacade {
-
-}

+ 44 - 0
src/main/java/com/diagbot/facade/rule/BillRuleFacade.java

@@ -0,0 +1,44 @@
+package com.diagbot.facade.rule;
+
+import com.diagbot.dto.BillDTO;
+import com.diagbot.dto.BillNeoDTO;
+import com.diagbot.dto.DrugBillNeoDTO;
+import com.diagbot.dto.LisBillNeoDTO;
+import com.diagbot.dto.PacsBillNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 规则facade
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class BillRuleFacade {
+
+    public BillDTO process(BillNeoDTO billNeoDTO, WordCrfDTO wordCrfDTO) {
+        BillDTO billDTO = new BillDTO();
+        // 化验规则处理
+        processBillWithLis(billNeoDTO.getLisBillNeoDTOList(), wordCrfDTO, billDTO);
+        // 辅检规则处理
+        processBillWithPacs(billNeoDTO.getPacsBillNeoDTOList(), wordCrfDTO, billDTO);
+        // 药品规则处理
+        processBillWithDrug(billNeoDTO.getDrugBillNeoDTOList(), wordCrfDTO, billDTO);
+        return billDTO;
+    }
+
+    public void processBillWithLis(List<LisBillNeoDTO> lisBillNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+
+    }
+
+    public void processBillWithPacs(List<PacsBillNeoDTO> pacsBillNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+
+    }
+
+    public void processBillWithDrug(List<DrugBillNeoDTO> drugBillNeoDTOList, WordCrfDTO wordCrfDTO, BillDTO billDTO) {
+
+    }
+
+}

+ 10 - 0
src/main/java/com/diagbot/facade/rule/RuleUtil.java

@@ -0,0 +1,10 @@
+package com.diagbot.facade.rule;
+
+/**
+ * @description:
+ * @author: zhoutg
+ * @time: 2020/8/3 11:22
+ */
+public class RuleUtil {
+
+}

+ 4 - 4
src/main/java/com/diagbot/model/ai/AIAnalyze.java

@@ -2,8 +2,8 @@ package com.diagbot.model.ai;
 
 
 
 
 import com.diagbot.client.CRFServiceClient;
 import com.diagbot.client.CRFServiceClient;
-import com.diagbot.dto.WordBillCrfDTO;
-import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.vo.SearchData;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
 @Slf4j
 @Slf4j
@@ -16,7 +16,7 @@ public class AIAnalyze {
         this.crfServiceClient = crfService;
         this.crfServiceClient = crfService;
     }
     }
 
 
-    public void aiProcess(IndicationPushVO inputInfo, WordBillCrfDTO wordBillCrfDTO) {
-        beHospitalizedAI.medrec(inputInfo,wordBillCrfDTO,crfServiceClient);
+    public void aiProcess(SearchData searchData, WordCrfDTO wordCrfDTO) {
+        beHospitalizedAI.medrec(searchData, wordCrfDTO, crfServiceClient);
     }
     }
 }
 }

+ 83 - 63
src/main/java/com/diagbot/model/ai/BeHospitalizedAI.java

@@ -3,13 +3,33 @@ package com.diagbot.model.ai;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.diagbot.client.CRFServiceClient;
 import com.diagbot.client.CRFServiceClient;
-import com.diagbot.dto.WordBillCrfDTO;
-import com.diagbot.model.ai.process.*;
-import com.diagbot.model.entity.*;
-import com.diagbot.model.label.*;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.model.ai.process.EntityProcessClinic;
+import com.diagbot.model.ai.process.EntityProcessDiag;
+import com.diagbot.model.ai.process.EntityProcessFamily;
+import com.diagbot.model.ai.process.EntityProcessLis;
+import com.diagbot.model.ai.process.EntityProcessMarital;
+import com.diagbot.model.ai.process.EntityProcessMenses;
+import com.diagbot.model.ai.process.EntityProcessPacs;
+import com.diagbot.model.ai.process.EntityProcessPast;
+import com.diagbot.model.ai.process.EntityProcessPersonal;
+import com.diagbot.model.ai.process.EntityProcessVital;
+import com.diagbot.model.entity.Diag;
+import com.diagbot.model.entity.Lis;
+import com.diagbot.model.entity.Pacs;
+import com.diagbot.model.entity.Vital;
+import com.diagbot.model.label.ChiefLabel;
+import com.diagbot.model.label.DiagLabel;
+import com.diagbot.model.label.FamilyLabel;
+import com.diagbot.model.label.MaritalLabel;
+import com.diagbot.model.label.MenstrualLabel;
+import com.diagbot.model.label.PastLabel;
+import com.diagbot.model.label.PersonalLabel;
+import com.diagbot.model.label.PresentLabel;
+import com.diagbot.model.label.VitalLabel;
 import com.diagbot.util.Content;
 import com.diagbot.util.Content;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
-import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.SearchData;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
@@ -58,10 +78,10 @@ public class BeHospitalizedAI extends ModelAI {
      *
      *
      *
      *
      * @param inputInfo
      * @param inputInfo
-     * @param wordBillCrfDTO
+     * @param wordCrfDTO
      * @param crfServiceClient
      * @param crfServiceClient
      */
      */
-    public void medrec(IndicationPushVO inputInfo, WordBillCrfDTO wordBillCrfDTO, CRFServiceClient crfServiceClient) {
+    public void medrec(SearchData inputInfo, WordCrfDTO wordCrfDTO, CRFServiceClient crfServiceClient) {
         JSONArray crfContent = new JSONArray();
         JSONArray crfContent = new JSONArray();
         if (inputInfo != null) {
         if (inputInfo != null) {
             /* 主诉 */
             /* 主诉 */
@@ -72,7 +92,7 @@ public class BeHospitalizedAI extends ModelAI {
                     ChiefLabel chiefLabel = new ChiefLabel();
                     ChiefLabel chiefLabel = new ChiefLabel();
                     chiefLabel.setText(chiefText);
                     chiefLabel.setText(chiefText);
                     chiefLabel.setAiText(chiefText);
                     chiefLabel.setAiText(chiefText);
-                    wordBillCrfDTO.setChiefLabel(chiefLabel);
+                    wordCrfDTO.setChiefLabel(chiefLabel);
                     putContent(crfContent, medicalTextType.get(7), chiefText, Content.chief);/* 2020-06-08修改主诉模型为现病史模型 */
                     putContent(crfContent, medicalTextType.get(7), chiefText, Content.chief);/* 2020-06-08修改主诉模型为现病史模型 */
                 }
                 }
             }
             }
@@ -82,7 +102,7 @@ public class BeHospitalizedAI extends ModelAI {
                 PresentLabel presentLabel = new PresentLabel();
                 PresentLabel presentLabel = new PresentLabel();
                 presentLabel.setText(presentText);
                 presentLabel.setText(presentText);
                 presentLabel.setAiText(presentText);
                 presentLabel.setAiText(presentText);
-                wordBillCrfDTO.setPresentLabel(presentLabel);
+                wordCrfDTO.setPresentLabel(presentLabel);
                 putContent(crfContent, medicalTextType.get(7), presentText, Content.present);
                 putContent(crfContent, medicalTextType.get(7), presentText, Content.present);
             }
             }
             /* 既往史 */
             /* 既往史 */
@@ -91,7 +111,7 @@ public class BeHospitalizedAI extends ModelAI {
                 PastLabel pastLabel = new PastLabel();
                 PastLabel pastLabel = new PastLabel();
                 pastLabel.setText(pastText);
                 pastLabel.setText(pastText);
                 pastLabel.setAiText(pastText);
                 pastLabel.setAiText(pastText);
-                wordBillCrfDTO.setPastLabel(pastLabel);
+                wordCrfDTO.setPastLabel(pastLabel);
                 putContent(crfContent, medicalTextType.get(1), pastText, Content.past);
                 putContent(crfContent, medicalTextType.get(1), pastText, Content.past);
             }
             }
             /* 月经史文本需从个人史截取一部分文本拼接 */
             /* 月经史文本需从个人史截取一部分文本拼接 */
@@ -102,7 +122,7 @@ public class BeHospitalizedAI extends ModelAI {
                 PersonalLabel personalLabel = new PersonalLabel();
                 PersonalLabel personalLabel = new PersonalLabel();
                 personalLabel.setText(personalText);
                 personalLabel.setText(personalText);
                 personalLabel.setAiText(personalText);
                 personalLabel.setAiText(personalText);
-                wordBillCrfDTO.setPersonalLabel(personalLabel);
+                wordCrfDTO.setPersonalLabel(personalLabel);
                 putContent(crfContent, medicalTextType.get(2), personalText, Content.personal);
                 putContent(crfContent, medicalTextType.get(2), personalText, Content.personal);
                 concatMenstrual = getConcatMenstrual(concatMenstrual, personalText);
                 concatMenstrual = getConcatMenstrual(concatMenstrual, personalText);
             }
             }
@@ -112,7 +132,7 @@ public class BeHospitalizedAI extends ModelAI {
                 MaritalLabel maritalLabel = new MaritalLabel();
                 MaritalLabel maritalLabel = new MaritalLabel();
                 maritalLabel.setText(maritalText);
                 maritalLabel.setText(maritalText);
                 maritalLabel.setAiText(maritalText);
                 maritalLabel.setAiText(maritalText);
-                wordBillCrfDTO.setMaritalLabel(maritalLabel);
+                wordCrfDTO.setMaritalLabel(maritalLabel);
                 putContent(crfContent, medicalTextType.get(2), maritalText, Content.marriage);
                 putContent(crfContent, medicalTextType.get(2), maritalText, Content.marriage);
             }
             }
             /* 月经史 */
             /* 月经史 */
@@ -121,7 +141,7 @@ public class BeHospitalizedAI extends ModelAI {
                 MenstrualLabel menstrualLabel = new MenstrualLabel();
                 MenstrualLabel menstrualLabel = new MenstrualLabel();
                 menstrualLabel.setText(menstrualText);
                 menstrualLabel.setText(menstrualText);
                 menstrualLabel.setAiText(menstrualText);
                 menstrualLabel.setAiText(menstrualText);
-                wordBillCrfDTO.setMenstrualLabel(menstrualLabel);
+                wordCrfDTO.setMenstrualLabel(menstrualLabel);
                 putContent(crfContent, medicalTextType.get(2), concatMenstrual, menstrualText, Content.menses);
                 putContent(crfContent, medicalTextType.get(2), concatMenstrual, menstrualText, Content.menses);
             }
             }
             /* 家族史 */
             /* 家族史 */
@@ -130,7 +150,7 @@ public class BeHospitalizedAI extends ModelAI {
                 FamilyLabel familyLabel = new FamilyLabel();
                 FamilyLabel familyLabel = new FamilyLabel();
                 familyLabel.setText(familyText);
                 familyLabel.setText(familyText);
                 familyLabel.setAiText(familyText);
                 familyLabel.setAiText(familyText);
-                wordBillCrfDTO.setFamilyLabel(familyLabel);
+                wordCrfDTO.setFamilyLabel(familyLabel);
                 putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
                 putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
             }
             }
 
 
@@ -140,7 +160,7 @@ public class BeHospitalizedAI extends ModelAI {
                 PacsLabel pacsLabel = new PacsLabel();
                 PacsLabel pacsLabel = new PacsLabel();
                 pacsLabel.setText(pacsText);
                 pacsLabel.setText(pacsText);
                 pacsLabel.setAiText(pacsText);
                 pacsLabel.setAiText(pacsText);
-                wordBillCrfDTO.setPacsLabel(pacsLabel);
+                wordCrfDTO.setPacsLabel(pacsLabel);
                 putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
                 putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
             }
             }
             //* 专科检查(专科体格检查)
             //* 专科检查(专科体格检查)
@@ -154,7 +174,7 @@ public class BeHospitalizedAI extends ModelAI {
                 VitalLabel vitalLabel = new VitalLabel();
                 VitalLabel vitalLabel = new VitalLabel();
                 vitalLabel.setAiText(vitalText);
                 vitalLabel.setAiText(vitalText);
                 vitalLabel.setText(vitalText);
                 vitalLabel.setText(vitalText);
-                wordBillCrfDTO.setVitalLabel(vitalLabel);
+                wordCrfDTO.setVitalLabel(vitalLabel);
                 putContent(crfContent, medicalTextType.get(4), vitalText, Content.phys_exam);
                 putContent(crfContent, medicalTextType.get(4), vitalText, Content.phys_exam);
             }
             }
             // 初步诊断
             // 初步诊断
@@ -163,7 +183,7 @@ public class BeHospitalizedAI extends ModelAI {
                 DiagLabel diagLabel = new DiagLabel();
                 DiagLabel diagLabel = new DiagLabel();
                 diagLabel.setText(initialDiagText);
                 diagLabel.setText(initialDiagText);
                 diagLabel.setAiText(initialDiagText);
                 diagLabel.setAiText(initialDiagText);
-                wordBillCrfDTO.setDiagLabel(diagLabel);
+                wordCrfDTO.setDiagLabel(diagLabel);
                 if (StringUtil.isNotBlank(initialDiagText)) {
                 if (StringUtil.isNotBlank(initialDiagText)) {
                     putContent(crfContent, medicalTextType.get(6), initialDiagText, Content.initial_diag);
                     putContent(crfContent, medicalTextType.get(6), initialDiagText, Content.initial_diag);
                 }
                 }
@@ -188,36 +208,36 @@ public class BeHospitalizedAI extends ModelAI {
 
 
             JSONObject midData = loadAI(crfContent, crfServiceClient);
             JSONObject midData = loadAI(crfContent, crfServiceClient);
             /* 处理主诉 */
             /* 处理主诉 */
-            if (wordBillCrfDTO.getChiefLabel() != null ) {
-                putChiefCrfData(midData.getJSONObject(Content.chief), wordBillCrfDTO);
+            if (wordCrfDTO.getChiefLabel() != null ) {
+                putChiefCrfData(midData.getJSONObject(Content.chief), wordCrfDTO);
             }
             }
             /* 处理现病史 */
             /* 处理现病史 */
-            if (wordBillCrfDTO.getPresentLabel() != null ) {
-                putPresentCrfData(midData.getJSONObject(Content.present), wordBillCrfDTO);
+            if (wordCrfDTO.getPresentLabel() != null ) {
+                putPresentCrfData(midData.getJSONObject(Content.present), wordCrfDTO);
             }
             }
             /* 处理既往史 */
             /* 处理既往史 */
-            if (wordBillCrfDTO.getPastLabel() != null) {
-                putPastCrfData(midData.getJSONObject(Content.past), wordBillCrfDTO);
+            if (wordCrfDTO.getPastLabel() != null) {
+                putPastCrfData(midData.getJSONObject(Content.past), wordCrfDTO);
             }
             }
             /* 处理个人史 */
             /* 处理个人史 */
-            if (wordBillCrfDTO.getPersonalLabel() != null) {
-                putPersonalCrfData(midData.getJSONObject(Content.personal), wordBillCrfDTO);
+            if (wordCrfDTO.getPersonalLabel() != null) {
+                putPersonalCrfData(midData.getJSONObject(Content.personal), wordCrfDTO);
             }
             }
             /* 处理月经史 */
             /* 处理月经史 */
-            if (wordBillCrfDTO.getMenstrualLabel() != null) {
-                putMensesCrfData(midData.getJSONObject(Content.menses), wordBillCrfDTO);
+            if (wordCrfDTO.getMenstrualLabel() != null) {
+                putMensesCrfData(midData.getJSONObject(Content.menses), wordCrfDTO);
             }
             }
             /* 处理家族史 */
             /* 处理家族史 */
-            if (wordBillCrfDTO.getFamilyLabel() != null) {
-                putFamilyCrfData(midData.getJSONObject(Content.family), wordBillCrfDTO);
+            if (wordCrfDTO.getFamilyLabel() != null) {
+                putFamilyCrfData(midData.getJSONObject(Content.family), wordCrfDTO);
             }
             }
             /* 处理婚育史 */
             /* 处理婚育史 */
-            if (wordBillCrfDTO.getMaritalLabel() != null ) {
-                putMaritalCrfData(midData.getJSONObject(Content.marriage), wordBillCrfDTO);
+            if (wordCrfDTO.getMaritalLabel() != null ) {
+                putMaritalCrfData(midData.getJSONObject(Content.marriage), wordCrfDTO);
             }
             }
              //处理初步诊断
              //处理初步诊断
-            if (wordBillCrfDTO.getDiagLabel() != null) {
-                putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), wordBillCrfDTO);
+            if (wordCrfDTO.getDiagLabel() != null) {
+                putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), wordCrfDTO);
             }
             }
              /*//处理修正诊断
              /*//处理修正诊断
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
@@ -228,13 +248,13 @@ public class BeHospitalizedAI extends ModelAI {
                 putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
                 putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
             }*/
             }*/
             /* 处理辅助检查 */
             /* 处理辅助检查 */
-            /*if (wordBillCrfDTO.getPacsLabel() != null) {
-                putPacsCrfData(midData.getJSONObject(Content.pacs), wordBillCrfDTO);
+            /*if (wordCrfDTO.getPacsLabel() != null) {
+                putPacsCrfData(midData.getJSONObject(Content.pacs), wordCrfDTO);
             }*/
             }*/
         }
         }
     }
     }
 
 
-    public void putChiefCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putChiefCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -246,13 +266,13 @@ public class BeHospitalizedAI extends ModelAI {
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
 
 
-        ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
+        ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         chiefLabel.setClinicals(presentLabel.getClinicals());
         chiefLabel.setClinicals(presentLabel.getClinicals());
         chiefLabel.setDiags(presentLabel.getDiags());
         chiefLabel.setDiags(presentLabel.getDiags());
         chiefLabel.setPds(presentLabel.getPds());
         chiefLabel.setPds(presentLabel.getPds());
     }
     }
 
 
-    public void putPresentCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putPresentCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -263,19 +283,19 @@ public class BeHospitalizedAI extends ModelAI {
         //放置入inputinfo
         //放置入inputinfo
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
-        presentLabel.setText(wordBillCrfDTO.getPresentLabel().getText());
+        presentLabel.setText(wordCrfDTO.getPresentLabel().getText());
         List<Lis> lis = loadLises(aiOut);
         List<Lis> lis = loadLises(aiOut);
         presentLabel.setLises(lis);
         presentLabel.setLises(lis);
-        wordBillCrfDTO.setPresentLabel(presentLabel);
+        wordCrfDTO.setPresentLabel(presentLabel);
     }
     }
 
 
     /**
     /**
      * 家族史
      * 家族史
      *
      *
      * @param jsonObject
      * @param jsonObject
-     * @param wordBillCrfDTO
+     * @param wordCrfDTO
      */
      */
-    public void putFamilyCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putFamilyCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -286,17 +306,17 @@ public class BeHospitalizedAI extends ModelAI {
         //家族史信息处理
         //家族史信息处理
         EntityProcessFamily entityProcess = new EntityProcessFamily();
         EntityProcessFamily entityProcess = new EntityProcessFamily();
         FamilyLabel familyLabel = entityProcess.extractEntity(aiOut);
         FamilyLabel familyLabel = entityProcess.extractEntity(aiOut);
-        familyLabel.setText(wordBillCrfDTO.getFamilyLabel().getText());
-        wordBillCrfDTO.setFamilyLabel(familyLabel);
+        familyLabel.setText(wordCrfDTO.getFamilyLabel().getText());
+        wordCrfDTO.setFamilyLabel(familyLabel);
     }
     }
 
 
     /**
     /**
      * 婚育史
      * 婚育史
      *
      *
      * @param jsonObject
      * @param jsonObject
-     * @param wordBillCrfDTO
+     * @param wordCrfDTO
      */
      */
-    public void putMaritalCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putMaritalCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -307,11 +327,11 @@ public class BeHospitalizedAI extends ModelAI {
         //家族史信息处理
         //家族史信息处理
         EntityProcessMarital entityProcess = new EntityProcessMarital();
         EntityProcessMarital entityProcess = new EntityProcessMarital();
         MaritalLabel maritalLabel = entityProcess.extractEntity(aiOut);
         MaritalLabel maritalLabel = entityProcess.extractEntity(aiOut);
-        maritalLabel.setText(wordBillCrfDTO.getMaritalLabel().getText());
-        wordBillCrfDTO.setMaritalLabel(maritalLabel);
+        maritalLabel.setText(wordCrfDTO.getMaritalLabel().getText());
+        wordCrfDTO.setMaritalLabel(maritalLabel);
     }
     }
 
 
-    public void putPastCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putPastCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -322,8 +342,8 @@ public class BeHospitalizedAI extends ModelAI {
         //放置入inputinfo
         //放置入inputinfo
         EntityProcessPast entityProcessPast = new EntityProcessPast();
         EntityProcessPast entityProcessPast = new EntityProcessPast();
         PastLabel pastLabel = entityProcessPast.extractEntity(aiOut);
         PastLabel pastLabel = entityProcessPast.extractEntity(aiOut);
-        pastLabel.setText(wordBillCrfDTO.getPastLabel().getText());
-        wordBillCrfDTO.setPastLabel(pastLabel);
+        pastLabel.setText(wordCrfDTO.getPastLabel().getText());
+        wordCrfDTO.setPastLabel(pastLabel);
 
 
     }
     }
 
 
@@ -331,9 +351,9 @@ public class BeHospitalizedAI extends ModelAI {
      * 个人史信息提取
      * 个人史信息提取
      *
      *
      * @param jsonObject
      * @param jsonObject
-     * @param wordBillCrfDTO
+     * @param wordCrfDTO
      */
      */
-    public void putPersonalCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putPersonalCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -344,17 +364,17 @@ public class BeHospitalizedAI extends ModelAI {
         //个人史信息提取
         //个人史信息提取
         EntityProcessPersonal entityProcessPersonal = new EntityProcessPersonal();
         EntityProcessPersonal entityProcessPersonal = new EntityProcessPersonal();
         PersonalLabel personalLabel = entityProcessPersonal.extractEntity(aiOut);
         PersonalLabel personalLabel = entityProcessPersonal.extractEntity(aiOut);
-        personalLabel.setText(wordBillCrfDTO.getPersonalLabel().getText());
-        wordBillCrfDTO.setPersonalLabel(personalLabel);
+        personalLabel.setText(wordCrfDTO.getPersonalLabel().getText());
+        wordCrfDTO.setPersonalLabel(personalLabel);
     }
     }
 
 
     /**
     /**
      * 月经史信息提取
      * 月经史信息提取
      *
      *
      * @param jsonObject
      * @param jsonObject
-     * @param wordBillCrfDTO
+     * @param wordCrfDTO
      */
      */
-    public void putMensesCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putMensesCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -365,8 +385,8 @@ public class BeHospitalizedAI extends ModelAI {
         //月经史信息处理
         //月经史信息处理
         EntityProcessMenses entityProcess = new EntityProcessMenses();
         EntityProcessMenses entityProcess = new EntityProcessMenses();
         MenstrualLabel menstrualLabel = entityProcess.extractEntity(aiOut);
         MenstrualLabel menstrualLabel = entityProcess.extractEntity(aiOut);
-        menstrualLabel.setText(wordBillCrfDTO.getMenstrualLabel().getText());
-        wordBillCrfDTO.setMenstrualLabel(menstrualLabel);
+        menstrualLabel.setText(wordCrfDTO.getMenstrualLabel().getText());
+        wordCrfDTO.setMenstrualLabel(menstrualLabel);
     }
     }
 
 
     /*
     /*
@@ -375,7 +395,7 @@ public class BeHospitalizedAI extends ModelAI {
      * @param jsonObject
      * @param jsonObject
      * @param inputInfo
      * @param inputInfo
      */
      */
-    public void putInitialDiagCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+    public void putInitialDiagCrfData(JSONObject jsonObject, WordCrfDTO wordCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -388,9 +408,9 @@ public class BeHospitalizedAI extends ModelAI {
         List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
         List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
 
 
         DiagLabel initialDiagLabel = new DiagLabel();
         DiagLabel initialDiagLabel = new DiagLabel();
-        initialDiagLabel.setText(wordBillCrfDTO.getDiagLabel().getText());
+        initialDiagLabel.setText(wordCrfDTO.getDiagLabel().getText());
         initialDiagLabel.setDiags(diags);
         initialDiagLabel.setDiags(diags);
-        wordBillCrfDTO.setDiagLabel(initialDiagLabel);
+        wordCrfDTO.setDiagLabel(initialDiagLabel);
     }
     }
 
 
     /**
     /**
@@ -454,7 +474,7 @@ public class BeHospitalizedAI extends ModelAI {
      * @param jsonObject
      * @param jsonObject
      * @param wordBillCrfDTO
      * @param wordBillCrfDTO
      */
      */
-  /*  public void putPacsCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+  /*  public void putPacsCrfData(JSONObject jsonObject, WordCrfDTO wordBillCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }

+ 10 - 0
src/main/java/com/diagbot/web/CoreController.java

@@ -3,7 +3,9 @@ package com.diagbot.web;
 import com.diagbot.dto.BillDTO;
 import com.diagbot.dto.BillDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.BillFacade;
 import com.diagbot.facade.BillFacade;
+import com.diagbot.facade.PushFacade;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.PushVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,11 +27,19 @@ public class CoreController {
 
 
     @Autowired
     @Autowired
     private BillFacade billFacade;
     private BillFacade billFacade;
+    @Autowired
+    private PushFacade pushFacade;
 
 
     @ApiOperation(value = "开单合理性API[zhoutg]", notes = "")
     @ApiOperation(value = "开单合理性API[zhoutg]", notes = "")
     @PostMapping("/bill")
     @PostMapping("/bill")
     public RespDTO<BillDTO> bill(@RequestBody IndicationPushVO indicationPushVO) {
     public RespDTO<BillDTO> bill(@RequestBody IndicationPushVO indicationPushVO) {
         return RespDTO.onSuc(billFacade.billFac(indicationPushVO));
         return RespDTO.onSuc(billFacade.billFac(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));
+    }
 }
 }