Forráskód Böngészése

北仑增加手麻质控规则

easi 4 éve
szülő
commit
9802249d72
27 módosított fájl, 1173 hozzáadás és 23 törlés
  1. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java
  2. 95 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP03104.java
  3. 92 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP03105.java
  4. 90 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03096.java
  5. 85 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03097.java
  6. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03098.java
  7. 91 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03099.java
  8. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03100.java
  9. 73 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03101.java
  10. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03102.java
  11. 129 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03103.java
  12. 80 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03106.java
  13. 6 0
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/AIAnalyze.java
  14. 12 11
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/model/Lemma.java
  15. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java
  16. 3 0
      public/src/main/java/com/lantone/qc/pub/model/InputInfo.java
  17. 1 0
      public/src/main/java/com/lantone/qc/pub/model/doc/ADLGradeDoc.java
  18. 33 0
      public/src/main/java/com/lantone/qc/pub/model/doc/AnesthesiaRecordDoc.java
  19. 4 4
      public/src/main/java/com/lantone/qc/pub/model/entity/Diag.java
  20. 2 2
      public/src/main/java/com/lantone/qc/pub/model/entity/PD.java
  21. 2 2
      public/src/main/java/com/lantone/qc/pub/model/label/ChiefLabel.java
  22. 1 1
      public/src/main/java/com/lantone/qc/pub/model/label/PastLabel.java
  23. 82 0
      public/src/main/java/com/lantone/qc/pub/util/DateUtil.java
  24. 1 0
      trans/src/main/java/com/lantone/qc/trans/TransDispatch.java
  25. 46 0
      trans/src/main/java/com/lantone/qc/trans/beilun/AnesthesiaRecordDocTrans.java
  26. 5 0
      trans/src/main/java/com/lantone/qc/trans/beilun/BeilunDocTrans.java
  27. 0 1
      trans/src/main/java/com/lantone/qc/trans/beilun/util/BeiLunADLGradeHtmlAnalysis.java

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java

@@ -50,7 +50,7 @@ public class QCAnalysis {
         inputInfo.setUseCrfCache(queryVo.isUseCrfCache());
         inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
         AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
-        //5.质控录入数据过ai模型
+        //5.质控录入数据过CRF ai模型(完善InputInfo用户相关信息)
         try {
             aiAnalyze.aiProcess(inputInfo);
         } catch (Exception e) {
@@ -101,4 +101,5 @@ public class QCAnalysis {
         return outputInfo;
     }
 
+
 }

+ 95 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP03104.java

@@ -0,0 +1,95 @@
+package com.lantone.qc.kernel.catalogue.beilun.firstpagerecord;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.JsonObject;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Pattern;
+
+
+/**
+ * @ClassName: FIRP03104
+ * @Description: 麻醉医师与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class FIRP03104 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录麻醉医师 判断麻醉医师是否相同
+         */
+        status.set("0");
+        //1.获取患者的病案首页相关文档,手麻记录
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if(firstPageRecordDoc==null||firstPageRecordDoc.getStructureExtMap().isEmpty()
+            ||firstPageRecordDoc.getStructureExtMap().get("手术信息")==null
+        ||(JSONArray.parseArray(""+firstPageRecordDoc.getStructureExtMap().get("手术信息"))).isEmpty())//无病案首页相关记录或者病案首页无手术记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.获取手术信息
+       try{
+           JSONArray  operationArr = JSONArray.parseArray(""+firstPageRecordDoc.getStructureExtMap().get("手术信息"));
+           for(Object operationOBJ:operationArr)
+           {
+               JSONObject operationJson = JSONObject.parseObject(operationOBJ+"");
+                  if(operationJson!=null)
+                  {
+                      //2.1获取手术麻醉医师
+                      String anesthesiaDoctor = operationJson.getString("麻醉医师");
+                      //通过手术时间判断是否是同一个手术
+                      Date operationStartTime = DateUtil.newParseDateTime(operationJson.getString("手术日期"));
+                      if(StringUtil.isBlank(anesthesiaDoctor)) {
+                          status.set("-1");
+                          return;
+                      }
+                      if(operationStartTime ==null) {continue;}
+                      anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                          //2.2遍历手麻记录,对比手术名称(如果手麻开始时间和病案首页记录时间在3个小时以内则判定为同一台手术)
+                          if (CatalogueUtil.compareTime(operationStartTime,
+                                  anesthesiaRecordDoc.getAnesStartTime(),
+                                  Long.valueOf(2 * 60)))
+                          {
+                              if(StringUtil.isNotBlank(anesthesiaRecordDoc.getAnesthesiaDoctor()))
+                              {
+                                  if(!StringUtil.equals(anesthesiaDoctor,anesthesiaRecordDoc.getAnesthesiaDoctor()))
+                                  {
+                                      status.set("-1");
+                                      return;
+                                  }
+                              }
+                          }
+
+                      });
+                  }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 92 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP03105.java

@@ -0,0 +1,92 @@
+package com.lantone.qc.kernel.catalogue.beilun.firstpagerecord;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: FIRP03105
+ * @Description: 麻醉方式与麻醉记录不一致(病案首页)
+ * @Author songxl
+ * @Date 2021/3/22
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class FIRP03105 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录麻醉方式 判断麻醉方式是否相同
+         */
+        status.set("0");
+        //1.获取患者的病案首页相关文档,手麻记录
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if(firstPageRecordDoc==null||firstPageRecordDoc.getStructureExtMap().isEmpty()
+                ||firstPageRecordDoc.getStructureExtMap().get("手术信息")==null
+                ||(JSONArray.parseArray(""+firstPageRecordDoc.getStructureExtMap().get("手术信息"))).isEmpty())//无病案首页相关记录或者病案首页无手术记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.获取手术信息
+        try{
+            JSONArray  operationArr = JSONArray.parseArray(""+firstPageRecordDoc.getStructureExtMap().get("手术信息"));
+            for(Object operationOBJ:operationArr)
+            {
+                JSONObject operationJson = JSONObject.parseObject(operationOBJ+"");
+                if(operationJson!=null)
+                {
+                    //2.1获取手术麻醉方式
+                    String anesthesiaMethod = operationJson.getString("麻醉方式");
+                    //通过手术时间判断是否是同一个手术
+                    Date operationStartTime = DateUtil.newParseDateTime(operationJson.getString("手术日期"));
+                    if(StringUtil.isBlank(anesthesiaMethod)) {
+                        status.set("-1");
+                        return;
+                    }
+                    if(operationStartTime ==null) {continue;}
+                    anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                        //2.2遍历手麻记录,对比手术名称(如果手麻开始时间和病案首页记录时间在3个小时以内则判定为同一台手术)
+                        if (CatalogueUtil.compareTime(operationStartTime,
+                                anesthesiaRecordDoc.getAnesStartTime(),
+                                Long.valueOf(2 * 60)))
+                        {
+                            if(StringUtil.isNotBlank(anesthesiaRecordDoc.getAnesthesiaMethod()))
+                            {
+                                if(!StringUtil.equals(anesthesiaMethod,anesthesiaRecordDoc.getAnesthesiaMethod()))
+                                {
+                                    status.set("-1");
+                                    return;
+                                }
+                            }
+                        }
+
+                    });
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            log.error(e.getMessage(),e);
+        }
+
+    }
+}

+ 90 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03096.java

@@ -0,0 +1,90 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.alibaba.fastjson.JSONArray;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.SimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03096
+ * @Description: 术后诊断与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03096 extends QCCatalogue {
+    @Autowired
+    SimilarityServiceClient similarityServiceClient;
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录的术后诊断和麻醉记录的术后诊断进行相似度对比
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术记录术后诊断、手术时间
+                   String diagAfterOperation = operationDoc.getOperationRecordDoc().getStructureMap().get("术中后诊断");
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                                    .getStructureMap().get("手术开始时间"));
+                   if(operationStartTime==null || StringUtil.isBlank(diagAfterOperation)) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       //2.2遍历手麻记录,找到该手术时间的手麻记录
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null)
+                       {
+                           if(DateUtils.isSameInstant(operationStartTime,anesthesiaRecordDoc.getAnesStartTime()))
+                           {
+                               String anesDiagAfterOperation = anesthesiaRecordDoc.getDiagAfterOperation();
+                               //相似度对比
+                               /* 文本相似度模型 */
+                               ModelAI modelAI = new ModelAI();
+                               JSONArray similarContent = new JSONArray();
+                               modelAI.putContent(similarContent,diagAfterOperation,anesDiagAfterOperation);
+                               double likeRate = modelAI.loadSimilarAI(similarContent, similarityServiceClient);
+                               if (likeRate < 0.9) {
+                                   status.set("-1");
+                                   return;
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 85 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03097.java

@@ -0,0 +1,85 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.alibaba.fastjson.JSONArray;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03097
+ * @Description: 手术开始时间与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03097 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录手术开始时间 判断时间是否相同
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术时间
+                   Date operationEndTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术结束时间"));
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(operationStartTime==null||operationEndTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesEndTime()!=null) {
+                           if (DateUtils.isSameInstant(operationEndTime, anesthesiaRecordDoc.getAnesEndTime())) {
+                               //2.2遍历手麻记录,对比手术时间开始时间
+                               if(anesthesiaRecordDoc.getAnesStartTime()!=null)
+                               {
+                                   if(!DateUtils.isSameInstant(operationStartTime,anesthesiaRecordDoc.getAnesStartTime()))
+                                   {
+                                       status.set("-1");
+                                       return;
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03098.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03098
+ * @Description: 手术名称与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03098 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录手术名称 判断手术名称是否相同
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术名称
+                   String operationName = operationDoc.getOperationRecordDoc().getStructureMap().get("手术名称");
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(StringUtil.isBlank(operationName)||operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null) {
+                           if (DateUtils.isSameInstant(operationStartTime, anesthesiaRecordDoc.getAnesStartTime())) {
+                               //2.2遍历手麻记录,对比手术名称
+                               if(StringUtil.isNotBlank(anesthesiaRecordDoc.getOperationName()))
+                               {
+                                   if(!StringUtil.equals(operationName,anesthesiaRecordDoc.getOperationName()))
+                                   {
+                                       status.set("-1");
+                                       return;
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 91 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03099.java

@@ -0,0 +1,91 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.alibaba.fastjson.JSONArray;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.SimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03099
+ * @Description: 术前诊断与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03099 extends QCCatalogue {
+    @Autowired
+    SimilarityServiceClient similarityServiceClient;
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录的术后诊断和麻醉记录的术前诊断进行相似度对比
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术记录术前诊断、手术时间
+                   String diagBeforeOperation = operationDoc.getOperationRecordDoc().getStructureMap().get("术前诊断");
+                   Date operationStartTime = DateUtil.parseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"),"yyyy年MM月dd日HH时mm分");
+                   if(operationStartTime==null || StringUtil.isBlank(diagBeforeOperation)) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       //2.2遍历手麻记录,找到该手术时间的手麻记录
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null)
+                       {
+                           if(DateUtils.isSameInstant(operationStartTime,anesthesiaRecordDoc.getAnesStartTime()))
+                           {
+                               String anesDiagBeforeOperation = anesthesiaRecordDoc.getDiagBeforeOperation();
+                               //相似度对比
+                               /* 文本相似度模型 */
+                               ModelAI modelAI = new ModelAI();
+                               JSONArray similarContent = new JSONArray();
+                               modelAI.putContent(similarContent,diagBeforeOperation,anesDiagBeforeOperation);
+                               double likeRate = modelAI.loadSimilarAI(similarContent, similarityServiceClient);
+                               if (likeRate < 0.9) {
+                                   status.set("-1");
+                                   return;
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03100.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03100
+ * @Description: 麻醉医师与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03100 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录的麻醉医师和麻醉记录判断麻醉医师是否相同
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术名称
+                   String anesthesiaDoctor = operationDoc.getOperationRecordDoc().getStructureMap().get("麻醉医师");
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(StringUtil.isBlank(anesthesiaDoctor)||operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null) {
+                           if (DateUtils.isSameInstant(operationStartTime, anesthesiaRecordDoc.getAnesStartTime())) {
+                               //2.2遍历手麻记录,对比麻醉医师
+                               if(StringUtil.isNotBlank(anesthesiaRecordDoc.getAnesthesiaDoctor()))
+                               {
+                                   if(!StringUtil.equals(anesthesiaDoctor,anesthesiaRecordDoc.getAnesthesiaDoctor()))
+                                   {
+                                       status.set("-1");
+                                       return;
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 73 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03101.java

@@ -0,0 +1,73 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03101
+ * @Description: 出血量与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03101 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录的出血量和麻醉记录出血量比较
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术时间
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       //2.2遍历手麻记录,对比手术时间开始时间
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null)
+                       {
+                           if(!DateUtils.isSameInstant(operationStartTime,anesthesiaRecordDoc.getAnesStartTime()))
+                           {
+                               status.set("-1");
+                               return;
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03102.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03102
+ * @Description: 麻醉方式与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/22
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03102 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录麻醉方式 判断麻醉方式是否相同
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术麻醉方式
+                   String anesthesiaDoctor = operationDoc.getOperationRecordDoc().getStructureMap().get("麻醉方式");
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(StringUtil.isBlank(anesthesiaDoctor)||operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null) {
+                           if (DateUtils.isSameInstant(operationStartTime, anesthesiaRecordDoc.getAnesStartTime())) {
+                               //2.2遍历手麻记录,对比麻醉方式
+                               if(StringUtil.isNotBlank(anesthesiaRecordDoc.getAnesthesiaMethod()))
+                               {
+                                   if(!StringUtil.equals(anesthesiaDoctor,anesthesiaRecordDoc.getAnesthesiaMethod()))
+                                   {
+                                       status.set("-1");
+                                       return;
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 129 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03103.java

@@ -0,0 +1,129 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03103
+ * @Description: 主刀医师与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/22
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03103 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 1.先去判断手术记录和麻醉记录的主刀医师,如果不一致就直接抛出错误
+         * 2.手术记录和麻醉记录的主刀医师一致,再去和病案首页主刀医师进行比对不一致抛出错误
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术主刀医师
+                   String doctorName = operationDoc.getOperationRecordDoc().getStructureMap().get("主刀医师");
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(StringUtil.isBlank(doctorName)||operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null) {
+                           if (DateUtils.isSameInstant(operationStartTime, anesthesiaRecordDoc.getAnesStartTime())) {
+                               //2.2遍历手麻记录,对比主刀医师
+                               if (StringUtil.isNotBlank(anesthesiaRecordDoc.getDoctorName())) {
+                                   if (!StringUtil.equals(doctorName, anesthesiaRecordDoc.getDoctorName())) {
+                                       status.set("-1");
+                                       return;
+                                   }
+                                   //2.3 手术记录和麻醉记录如果一致判断是否和病案首页是否一致
+                                   //2.3.1.获取患者的病案首页相关文档,手麻记录
+                                   FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+                                   if(firstPageRecordDoc==null||firstPageRecordDoc.getStructureExtMap().isEmpty()
+                                           ||firstPageRecordDoc.getStructureExtMap().get("手术信息")==null
+                                           ||(JSONArray.parseArray(""+firstPageRecordDoc.getStructureExtMap().get("手术信息"))).isEmpty())//无病案首页相关记录或者病案首页无手术记录
+                                   {
+                                       return;
+                                   }
+                                   else {
+                                       //2.3.2.获取手术信息
+                                       try {
+                                           JSONArray operationArr = JSONArray.parseArray("" + firstPageRecordDoc.getStructureExtMap().get("手术信息"));
+                                           for (Object operationOBJ : operationArr) {
+                                               JSONObject operationJson = JSONObject.parseObject(operationOBJ + "");
+                                               if (operationJson != null) {
+                                                   //2.1获取手术麻醉方式
+                                                   Long doctorID = operationJson.getLong("手术医生ID");
+                                                   //通过手术时间判断是否是同一个手术
+                                                   Date firOperationStartTime = DateUtil.newParseDateTime(operationJson.getString("手术日期"));
+                                                   if (doctorID == null) {
+                                                       status.set("-1");
+                                                       return;
+                                                   }
+                                                   if (operationStartTime == null) {
+                                                       continue;
+                                                   }
+
+                                                   //2.2遍历手麻记录,对比手术名称(如果手麻开始时间和病案首页记录时间在3个小时以内则判定为同一台手术)
+                                                   if (CatalogueUtil.compareTime(firOperationStartTime,
+                                                           anesthesiaRecordDoc.getAnesStartTime(),
+                                                           Long.valueOf(2 * 60)))
+                                                   {
+                                                       if(!doctorID.equals(anesthesiaRecordDoc.getDid()))
+                                                       {
+                                                           status.set("-1");
+                                                           return;
+                                                       }
+                                                   }
+                                               }
+                                           }
+                                       }
+                                       catch (Exception e)
+                                       {
+                                           log.error(e.getMessage(),e);
+                                       }
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 80 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE03106.java

@@ -0,0 +1,80 @@
+package com.lantone.qc.kernel.catalogue.beilun.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @ClassName: OPE03103
+ * @Description: 手术结束时间与麻醉记录不一致
+ * @Author songxl
+ * @Date 2021/3/22
+ * @Version 1.0
+ */
+@Component
+@Slf4j
+public class OPE03106 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 获取手术记录和麻醉记录手术结束时间 判断手术结束时间是否相同
+         */
+        status.set("0");
+        //1.获取患者的手术相关文档,手麻记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs==null||operationDocs.isEmpty())//无手术相关记录
+        {
+            return;
+        }
+        List<AnesthesiaRecordDoc> anesthesiaDocs  = inputInfo.getAnesthesiaRecordDocs();
+        if(anesthesiaDocs==null|| anesthesiaDocs.isEmpty())//无手麻相关记录
+        {
+            return;
+        }
+        //2.遍历获取手术记录
+       try{
+           for(OperationDoc operationDoc:operationDocs)
+           {
+               if(operationDoc.getOperationRecordDoc()!=null)
+               {
+                   //2.1获取手术主刀医师
+                   Date operationEndTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术结束时间"));
+                   Date operationStartTime = DateUtil.newParseDateTime(operationDoc.getOperationRecordDoc()
+                           .getStructureMap().get("手术开始时间"));
+                   if(operationEndTime==null||operationStartTime==null) {continue;}
+                   anesthesiaDocs.forEach(anesthesiaRecordDoc -> {
+                       if(anesthesiaRecordDoc.getAnesStartTime()!=null) {
+                           if (DateUtils.isSameInstant(operationStartTime, anesthesiaRecordDoc.getAnesStartTime())) {
+                               //2.2遍历手麻记录,对比手术结束时间
+                               if(anesthesiaRecordDoc.getAnesStartTime()!=null)
+                               {
+                                   if(!DateUtils.isSameInstant(operationEndTime,anesthesiaRecordDoc.getAnesEndTime()))
+                                   {
+                                       status.set("-1");
+                                       return;
+                                   }
+                               }
+                           }
+                       }
+                   });
+               }
+           }
+       }
+       catch (Exception e)
+       {
+           log.error(e.getMessage(),e);
+       }
+
+    }
+}

+ 6 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/AIAnalyze.java

@@ -23,11 +23,17 @@ public class AIAnalyze {
     }
 
     public void aiProcess(InputInfo inputInfo) {
+        //入院记录
         beHospitalizedAI.medrec(inputInfo, crfServiceClient);
+        //首次病程录
         firstCourseRecordAI.medrec(inputInfo, crfServiceClient, similarityServiceClient);
+        //出院小结
         leaveHospitalAI.medrec(inputInfo, crfServiceClient);
+        //查房记录
         threeLevelWardAI.medrec(inputInfo, crfServiceClient);
+        //手术记录,术后首次病程及谈话记录
         operationAI.medrec(inputInfo, crfServiceClient);
+        //会诊记录
         consultationAI.medrec(inputInfo, crfServiceClient);
     }
 

+ 12 - 11
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/model/Lemma.java

@@ -16,17 +16,18 @@ import java.util.List;
 @Getter
 @Setter
 public class Lemma {
-    private int id;
-    private String text;
-    private String position;
-    private int from;
-    private int to;
-    private int len;
-    private String property;
-    private String relationName;
-    private Lemma parent;
-    private boolean haveChildren = false;
-    private List<Lemma> relationLemmas = new ArrayList<>();
+    private int id;		                                    //实体id
+    private String text;		                            //实体内容文本
+    private String position;	                            //实体位置
+    private int from;		                                //实体起始位置
+    private int to;		                                    //实体终止位置
+    private int len;		                                //实体文本长度
+    private String property;	                            //实体类别,如疾病名称、身体部位
+    private String relationName;                            //关系名称
+    private Lemma parent;		                            //父类实体信息,如头痛三天,头痛为临床表现实体,是三天(时间)实体的父实体
+    private boolean haveChildren = false;                   //是否包含子实体信息,与上述逻辑一致
+    private List<Lemma> relationLemmas = new ArrayList<>(); //与该实体有关系的所有实体列表
+
 
     public void addRelationLemmas(Lemma lemma) {
         this.relationLemmas.add(lemma);

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -284,7 +284,7 @@ public class EntityProcess {
             if (lemma.getProperty().equals(EntityEnum.TIME.toString())) {
                 PD pd = new PD();
                 value = lemma.getText();
-                String[] valUnit = new String[2];;
+                String[] valUnit = new String[2];
                 if (value.trim().length() > 0) {
                     valUnit = CatalogueUtil.extractDigit(value);
                 }

+ 3 - 0
public/src/main/java/com/lantone/qc/pub/model/InputInfo.java

@@ -101,6 +101,9 @@ public class InputInfo {
     private VTEGradeDoc vteGradeDoc;
     //ADL评分
     private ADLGradeDoc adlGradeDoc;
+
+    //手麻信息
+    private List<AnesthesiaRecordDoc> anesthesiaRecordDocs = new ArrayList<>();
     private boolean useCrfCache;
 
     //新增记录

+ 1 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/ADLGradeDoc.java

@@ -13,4 +13,5 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ADLGradeDoc extends ModelDoc {
+
 }

+ 33 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/AnesthesiaRecordDoc.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.pub.model.doc;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @ClassName: AnesthesiaRecordDoc
+ * @Description: 手麻记录文档
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Getter
+@Setter
+public class AnesthesiaRecordDoc extends ModelDoc{
+    private Long id;
+    private Long hospitalId;                        //医院ID
+    private String behospitalCode;                  //病历号
+    private Date anesStartTime;                     //开始时间
+    private String diagBeforeOperation;             //术前诊断
+    private String diagAfterOperation;              //术后诊断
+    private String operationName;                   //手术名称
+    private String anesthesiaDoctor;                //麻醉医师
+    private String bleedingAmount;                  //出血量
+    private Long did;                        //主刀医师ID
+    private String doctorName;                      //主刀医师
+    private String anesthesiaMethod;                //麻醉方式
+    private Date anesEndTime;                       //手术结束时间
+    private Date inAnesStartTime;                   //入手术时间(进入手术室时间,早于手术时间,用于术前准备)
+    private String is_deleted;                      //是否删除
+}

+ 4 - 4
public/src/main/java/com/lantone/qc/pub/model/entity/Diag.java

@@ -14,8 +14,8 @@ import lombok.Setter;
 @Setter
 public class Diag extends General {
     private String hospitalDiagName;    //医院疾病名称
-    private Possible possible;
-    private Negative negative;
-    private PD pd;
-    private String ICD;
+    private Possible possible;          //可能性
+    private Negative negative;          //阴性
+    private PD pd;                      //疾病进展
+    private String ICD;                 //疾病编码
 }

+ 2 - 2
public/src/main/java/com/lantone/qc/pub/model/entity/PD.java

@@ -6,6 +6,6 @@ import lombok.Setter;
 @Setter
 @Getter
 public class PD extends General {
-    private String value;
-    private String unit;
+    private String value; //值
+    private String unit;  //单位
 }

+ 2 - 2
public/src/main/java/com/lantone/qc/pub/model/label/ChiefLabel.java

@@ -18,8 +18,8 @@ import java.util.List;
 @Setter
 @Getter
 public class ChiefLabel extends GeneralLabel {
-    private List<Clinical> clinicals;
-    private List<Diag> diags;
+    private List<Clinical> clinicals; //临床表现
+    private List<Diag> diags;         //诊断
     //现病史中所有时间实体存入
     private List<PD> pds = new ArrayList<>();
 }

+ 1 - 1
public/src/main/java/com/lantone/qc/pub/model/label/PastLabel.java

@@ -22,7 +22,7 @@ public class PastLabel extends GeneralLabel{
     private List<Allergy> allergies = new ArrayList<>();//过敏史
     private List<AllergyFood> allergyFoods = new ArrayList<>();//食物过敏史
     private List<AllergyMedicine> allergyMedicines = new ArrayList<>();//药物过敏史
-    private List<AllergyDesc> allergyDescs = new ArrayList<>();
+    private List<AllergyDesc> allergyDescs = new ArrayList<>();//过敏表现
     private List<BloodTransfusion> bloodTransfusions = new ArrayList<>();//输血史
     private List<Operation> operations = new ArrayList<>();//手术史
     private List<Vaccinate> vaccinates = new ArrayList<>();//预防接种史

+ 82 - 0
public/src/main/java/com/lantone/qc/pub/util/DateUtil.java

@@ -4,6 +4,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.regex.Pattern;
 
 /**
  * @Description: 日期工具类
@@ -38,6 +39,10 @@ public class DateUtil {
      * 日期格式:yyyy-MM-dd HH:mm:ss
      */
     public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+    /**
+     * 日期格式:yyyy/MM/dd HH:mm:ss
+     */
+    public static final String DATE_TIME_SG_FORMAT = "yyyy/MM/dd HH:mm:ss";
     /**
      * 日期格式:yyyy-MM-dd HH:mm:ss.SSS
      */
@@ -254,7 +259,28 @@ public class DateUtil {
     public static Date parseDateTime(String dateString) {
         return parseDate(dateString, DATE_TIME_FORMAT);
     }
+    /**
+     * 将字符(yyyy-MM-dd HH:mm:ss)转换为日期
+     *
+     * @param dateString
+     * @return 将字符(yyyy-MM-dd HH:mm:ss)转换为日期
+     */
+    public static Date parseDateTime(String dateString,String format) {
+        return parseDate(dateString, format);
+    }
 
+    /**
+     * 将字符(yyyy-MM-dd HH:mm:ss)转换为日期
+     *
+     * @param time
+     * @return 将字符时间转换为日期
+     */
+    public static Date newParseDateTime(String time) {
+        if(StringUtil.isBlank(time)){return null;}
+        String format = getTimeFormat(time);
+        if(StringUtil.isBlank(format)){return null;}
+        return parseDate(time, format);
+    }
     /**
      * milliseconds 转化为日期
      *
@@ -752,6 +778,62 @@ public class DateUtil {
     }
 
 
+
+    /**
+     * 获取字符串时间的format
+     * @param time
+     * @return
+     */
+    public static String getTimeFormat(String time)
+    {
+        if(StringUtil.isBlank(time))
+        {
+            return null;
+        }
+        String regex = "\\d+";
+        time = time.replaceAll(regex,"");
+        switch (time)
+        {
+            //===========yyyy年MM月dd日HH时mm分ss秒============
+            case "年月日 时分秒":
+                return "yyyy年MM月dd日 HH时mm分ss秒";
+            case "年月日时分秒":
+                return "yyyy年MM月dd日HH时mm分ss秒";
+            case "年月日 时分":
+                return "yyyy年MM月dd日HH时mm分";
+            case "年月日时分":
+                return "yyyy年MM月dd日HH时mm分";
+            case "年月日 时":
+                return "yyyy年MM月dd日 HH时";
+            case "年月日时":
+                return "yyyy年MM月dd日HH时";
+            case "年月日":
+                return "yyyy年MM月dd日";
+            //===========yyyy-MM-dd HH:mm:ss============
+            case "-- ::":
+                return "yyyy-MM-dd HH:mm:ss";
+            case "-- :":
+                return "yyyy-MM-dd HH:mm";
+            case "-- ":
+                return "yyyy-MM-dd HH";
+            case "--":
+                return "yyyy-MM-dd";
+            //===========yyyy/MM/dd HH:mm:ss============
+            case "// ::":
+                return "yyyy/MM/dd HH:mm:ss";
+            case "// :":
+                return "yyyy/MM/dd HH:mm";
+            case "// ":
+                return "yyyy/MM/dd HH";
+            case "//":
+                return "yyyy/MM/dd";
+            default:
+                break;
+        }
+        return null;
+    }
+
+
     //计算时间差,以天数为单位。如:2018-08-08 和 2018-08-05 相差3天
     public static int getDistanceTime(Date startTime, Date endTime) {
         int days = 0;

+ 1 - 0
trans/src/main/java/com/lantone/qc/trans/TransDispatch.java

@@ -27,6 +27,7 @@ public class TransDispatch {
                     + queryVo.getCid().substring(1)
                     + "DocTrans";
             DocTrans docTrans = (DocTrans) Class.forName(classPath).newInstance();
+            //将大标题里面的内容取出封装成小标题:MedrecVo装进MedrecVo
             queryDeal(queryVo, "会诊", "会诊申请单", "会诊结果单", "会诊记录");
             queryDeal(queryVo, "手术", "术前讨论、术前小结", "手术记录", "术后首次病程及谈话记录");
             queryDeal(queryVo, "转科", "转入记录", "转出记录", "转科记录");

+ 46 - 0
trans/src/main/java/com/lantone/qc/trans/beilun/AnesthesiaRecordDocTrans.java

@@ -0,0 +1,46 @@
+package com.lantone.qc.trans.beilun;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.ADLGradeDoc;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.beilun.util.BeiLunADLGradeHtmlAnalysis;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: AnesthesiaRecordDocTrans
+ * @Description: 手麻记录解析
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Slf4j
+public class AnesthesiaRecordDocTrans extends ModelDocTrans {
+    @Override
+    public List<AnesthesiaRecordDoc> extract(MedrecVo medrecVo) {
+        List<AnesthesiaRecordDoc> anesList = Lists.newArrayList();
+        try {
+            //1.获取mrqc medrecVo content数据
+            List<String> anesthesiaList = (List<String>)medrecVo.getContent().get("content");
+            //2.装载到AnesthesiaRecordDoc
+            anesthesiaList.forEach(anesthesiaStr->{
+                AnesthesiaRecordDoc anesthesiaTemp =JSONObject.parseObject
+                        (anesthesiaStr,AnesthesiaRecordDoc.class);
+                anesList.add(anesthesiaTemp);
+            });
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return anesList;
+    }
+}

+ 5 - 0
trans/src/main/java/com/lantone/qc/trans/beilun/BeilunDocTrans.java

@@ -130,6 +130,11 @@ public class BeilunDocTrans extends DocTrans {
                     BeiLunADLGradeDocTrans adlGradeDocTrans = new BeiLunADLGradeDocTrans();
                     inputInfo.setAdlGradeDoc(adlGradeDocTrans.extract(i));
                 }
+                /*******************************手麻记录 trans解析*****************************************/
+                if (i.getTitle().equals("手麻记录")) {
+                    AnesthesiaRecordDocTrans anesthesiaRecordDocTrans= new AnesthesiaRecordDocTrans();
+                    inputInfo.setAnesthesiaRecordDocs(anesthesiaRecordDocTrans.extract(i));
+                }
             }
         }
         pageDataHandle(inputInfo);

+ 0 - 1
trans/src/main/java/com/lantone/qc/trans/beilun/util/BeiLunADLGradeHtmlAnalysis.java

@@ -31,7 +31,6 @@ public class BeiLunADLGradeHtmlAnalysis implements BeiLunHtmlAnalysis{
             Document doc = Jsoup.parse(html);
             //评估日期
             Elements spanES = doc.getElementById("table2").nextElementSiblings().get(1).getElementsByTag("span");
-            System.out.println(spanES.text());
             String time = spanES.text().split(Content.adl_grade_time)[1]
                     .replaceAll(":","").trim();
             map.put(Content.adl_grade_time,time);