Ver código fonte

1、修改诊断统一用DiagLabel
2、疾病模型启用

louhr 5 anos atrás
pai
commit
d7ed4cfb85

+ 89 - 29
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java

@@ -50,12 +50,14 @@ public class BeHospitalizedAI {
         BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
         if (beHospitalizedDoc != null) {
             String chief_text = beHospitalizedDoc.getChiefLabel().getText();
-            String Personal_text = beHospitalizedDoc.getPersonalLabel().getText();
+            String personal_text = beHospitalizedDoc.getPersonalLabel().getText();
             String family_text = beHospitalizedDoc.getFamilyLabel().getText();
             String past_text = beHospitalizedDoc.getPastLabel().getText();
             String present_text = beHospitalizedDoc.getPresentLabel().getText();
             String pacs_text = beHospitalizedDoc.getPacsLabel().getText();
-            String initial_diag_text = beHospitalizedDoc.getInitialDiagLabel().getText();
+            String initial_diag_text = beHospitalizedDoc.getInitialDiagLabel().getText();   //初步诊断
+            String revised_diag_text = beHospitalizedDoc.getRevisedDiagLabel().getText();   //修正诊断
+            String supple_diag_text = beHospitalizedDoc.getSuppleDiagLabel().getText();    //补充诊断
             //月经史
             String menstrual_text = beHospitalizedDoc.getMenstrualLabel().getText();
             //婚育史
@@ -77,11 +79,13 @@ public class BeHospitalizedAI {
             //存放一般查体
             putContent(crfContent, medicalTextType.get(4), vital_text, Content.phys_exam);
             //个人史
-            putContent(crfContent, medicalTextType.get(2), Personal_text, Content.personal);
+            putContent(crfContent, medicalTextType.get(2), personal_text, Content.personal);
             //月经史
             String concatMenstrual = "";
-            if (Personal_text.length() > 30) {
-                concatMenstrual = Personal_text.substring(Personal_text.length() - 30);
+            if (personal_text.length() > 30) {
+                concatMenstrual = personal_text.substring(personal_text.length() - 30);
+            } else {
+                concatMenstrual = personal_text;
             }
             putContent(crfContent, medicalTextType.get(2), concatMenstrual, menstrual_text, Content.menses);
             //婚育史
@@ -90,6 +94,14 @@ public class BeHospitalizedAI {
             putContent(crfContent, medicalTextType.get(3), pacs_text, Content.pacs);
             //初步诊断
             putContent(crfContent, medicalTextType.get(6), initial_diag_text, Content.initial_diag);
+            if (StringUtils.isNotEmpty(revised_diag_text)) {
+                //修正诊断
+                putContent(crfContent, medicalTextType.get(6), revised_diag_text, Content.revised_diag);
+            }
+            if (StringUtils.isNotEmpty(supple_diag_text)) {
+                //补充诊断
+                putContent(crfContent, medicalTextType.get(6), supple_diag_text, Content.supple_diag);
+            }
             //存储CRF完整所需结构数据
             CRFVo crfVo = new CRFVo();
             crfVo.setData(crfContent);
@@ -112,10 +124,16 @@ public class BeHospitalizedAI {
             putMaritalCrfData(midData.getJSONObject(Content.marriage), inputInfo);
             //处理初步诊断
             putInitialDiagCrfData(midData.getJSONObject(Content.pridiag), inputInfo);
+            if (StringUtils.isNotEmpty(revised_diag_text)) {
+                //处理修正诊断
+                putInitialDiagCrfData(midData.getJSONObject(Content.revised_diag), inputInfo);
+            }
+            if (StringUtils.isNotEmpty(revised_diag_text)) {
+                //处理补充诊断
+                putInitialDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
+            }
             //处理辅助检查
             putPacsCrfData(midData.getJSONObject(Content.pacs), inputInfo);
-            //处理疾病
-//            putPrimaryDiagCrfData(midData.getJSONObject(Content.primary_diag), inputInfo);
         }
     }
 
@@ -245,31 +263,73 @@ public class BeHospitalizedAI {
      * @param inputInfo
      */
     public void putInitialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        //        if (jsonObject == null) {
-        //            return;
-        //        }
-        //        JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
+        if (jsonObject == null) {
+            return;
+        }
+        JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         //诊断信息
         EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
-        //        List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
-        //
-        //        InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
-        //        initialDiagLabel.setText(inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText());
-        //        initialDiagLabel.setDiags(diags);
-        //        inputInfo.getBeHospitalizedDoc().setInitialDiagLabel(initialDiagLabel);
-
-        //因为关系抽取未标注完成,先用规则
-        String diagString = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText();
-        if (StringUtils.isNotEmpty(diagString)) {
-            String[] diagArray = diagString.split(",");
-            List<Diag> diags = new ArrayList<>();
-            for (String d : diagArray) {
-                Diag diag = DiagEnhancer.create(d);
-                diags.add(diag);
-            }
-            InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
-            initialDiagLabel.setDiags(diags);
+        List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
+
+        DiagLabel initialDiagLabel = new DiagLabel();
+        initialDiagLabel.setText(inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText());
+        initialDiagLabel.setDiags(diags);
+        inputInfo.getBeHospitalizedDoc().setInitialDiagLabel(initialDiagLabel);
+
+//        //因为关系抽取未标注完成,先用规则
+//        String diagString = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText();
+//        if (StringUtils.isNotEmpty(diagString)) {
+//            String[] diagArray = diagString.split(",");
+//            List<Diag> diags = new ArrayList<>();
+//            for (String d : diagArray) {
+//                Diag diag = DiagEnhancer.create(d);
+//                diags.add(diag);
+//            }
+//            InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
+//            initialDiagLabel.setDiags(diags);
+//        }
+    }
+
+    /**
+     * 修正诊断信息提取
+     *
+     * @param jsonObject
+     * @param inputInfo
+     */
+    public void putRevisedDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
+        if (jsonObject == null) {
+            return;
         }
+        JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
+        //诊断信息
+        EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
+        List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
+
+        DiagLabel revisedDiagLabel = new DiagLabel();
+        revisedDiagLabel.setText(inputInfo.getBeHospitalizedDoc().getRevisedDiagLabel().getText());
+        revisedDiagLabel.setDiags(diags);
+        inputInfo.getBeHospitalizedDoc().setRevisedDiagLabel(revisedDiagLabel);
+    }
+
+    /**
+     * 补充诊断信息提取
+     *
+     * @param jsonObject
+     * @param inputInfo
+     */
+    public void putSuppleDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
+        if (jsonObject == null) {
+            return;
+        }
+        JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
+        //诊断信息
+        EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
+        List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
+
+        DiagLabel suppleDiagLabel = new DiagLabel();
+        suppleDiagLabel.setText(inputInfo.getBeHospitalizedDoc().getSuppleDiagLabel().getText());
+        suppleDiagLabel.setDiags(diags);
+        inputInfo.getBeHospitalizedDoc().setSuppleDiagLabel(suppleDiagLabel);
     }
 
     /**

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/Content.java

@@ -105,6 +105,8 @@ public class Content {
     public static final String special_exam = "体格检查(二)";
     public static final String pacs = "辅助检查";
     public static final String initial_diag = "初步诊断";
+    public static final String revised_diag = "修正诊断";
+    public static final String supple_diag = "补充诊断";
 
     public static final String case_feature = "一、病例特点";
     public static final String pridiag = "二、初步诊断";

+ 4 - 16
public/src/main/java/com/lantone/qc/pub/model/doc/BeHospitalizedDoc.java

@@ -1,18 +1,6 @@
 package com.lantone.qc.pub.model.doc;
 
-import com.lantone.qc.pub.model.label.ChiefLabel;
-import com.lantone.qc.pub.model.label.FamilyLabel;
-import com.lantone.qc.pub.model.label.InitialDiagLabel;
-import com.lantone.qc.pub.model.label.MaritalLabel;
-import com.lantone.qc.pub.model.label.MenstrualLabel;
-import com.lantone.qc.pub.model.label.PacsLabel;
-import com.lantone.qc.pub.model.label.PastLabel;
-import com.lantone.qc.pub.model.label.PersonalLabel;
-import com.lantone.qc.pub.model.label.PresentLabel;
-import com.lantone.qc.pub.model.label.RevisedDiagLabel;
-import com.lantone.qc.pub.model.label.SuppleDiagLabel;
-import com.lantone.qc.pub.model.label.VitalLabel;
-import com.lantone.qc.pub.model.label.VitalLabelSpecial;
+import com.lantone.qc.pub.model.label.*;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -46,9 +34,9 @@ public class BeHospitalizedDoc extends ModelDoc {
     //辅助检查
     private PacsLabel pacsLabel;
     //初步诊断
-    private InitialDiagLabel initialDiagLabel;
+    private DiagLabel initialDiagLabel;
     //修正诊断
-    private RevisedDiagLabel revisedDiagLabel;
+    private DiagLabel revisedDiagLabel;
     //补充诊断
-    private SuppleDiagLabel suppleDiagLabel;
+    private DiagLabel suppleDiagLabel;
 }

+ 0 - 10
public/src/main/java/com/lantone/qc/pub/model/label/DifferDiagLabel.java

@@ -1,10 +0,0 @@
-package com.lantone.qc.pub.model.label;
-
-/**
- * @ClassName : DifferDiagLabel
- * @Description : 鉴别诊断
- * @Author : 楼辉荣
- * @Date: 2020-03-03 18:55
- */
-public class DifferDiagLabel {
-}

+ 0 - 20
public/src/main/java/com/lantone/qc/pub/model/label/InitialDiagLabel.java

@@ -1,20 +0,0 @@
-package com.lantone.qc.pub.model.label;
-
-import com.lantone.qc.pub.model.entity.Diag;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @ClassName : InitialDiagLabel
- * @Description : 初步诊断
- * @Author : 楼辉荣
- * @Date: 2020-03-03 18:52
- */
-@Getter
-@Setter
-public class InitialDiagLabel extends GeneralLabel {
-    List<Diag> diags = new ArrayList<>();
-}

+ 0 - 10
public/src/main/java/com/lantone/qc/pub/model/label/RevisedDiagLabel.java

@@ -1,10 +0,0 @@
-package com.lantone.qc.pub.model.label;
-
-/**
- * @ClassName : RevisedDiagLabel
- * @Description : 修正诊断
- * @Author : 楼辉荣
- * @Date: 2020-03-03 18:51
- */
-public class RevisedDiagLabel extends GeneralLabel {
-}

+ 0 - 10
public/src/main/java/com/lantone/qc/pub/model/label/SuppleDiagLabel.java

@@ -1,10 +0,0 @@
-package com.lantone.qc.pub.model.label;
-
-/**
- * @ClassName : FinalDiagLabel
- * @Description : 补充诊断
- * @Author : 楼辉荣
- * @Date: 2020-03-03 18:53
- */
-public class SuppleDiagLabel extends GeneralLabel{
-}

+ 4 - 16
trans/src/main/java/com/lantone/qc/trans/comsis/ModelDocGenerate.java

@@ -1,19 +1,7 @@
 package com.lantone.qc.trans.comsis;
 
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
-import com.lantone.qc.pub.model.label.ChiefLabel;
-import com.lantone.qc.pub.model.label.FamilyLabel;
-import com.lantone.qc.pub.model.label.InitialDiagLabel;
-import com.lantone.qc.pub.model.label.MaritalLabel;
-import com.lantone.qc.pub.model.label.MenstrualLabel;
-import com.lantone.qc.pub.model.label.PacsLabel;
-import com.lantone.qc.pub.model.label.PastLabel;
-import com.lantone.qc.pub.model.label.PersonalLabel;
-import com.lantone.qc.pub.model.label.PresentLabel;
-import com.lantone.qc.pub.model.label.RevisedDiagLabel;
-import com.lantone.qc.pub.model.label.SuppleDiagLabel;
-import com.lantone.qc.pub.model.label.VitalLabel;
-import com.lantone.qc.pub.model.label.VitalLabelSpecial;
+import com.lantone.qc.pub.model.label.*;
 
 import java.util.Map;
 
@@ -85,17 +73,17 @@ public class ModelDocGenerate {
         beHospitalizedDoc.setPacsLabel(pacsLabel);
         structureMap.remove("辅助检查");
 
-        InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
+        DiagLabel initialDiagLabel = new DiagLabel();
         initialDiagLabel.setText(structureMap.get("初步诊断"));
         beHospitalizedDoc.setInitialDiagLabel(initialDiagLabel);
         structureMap.remove("初步诊断");
 
-        RevisedDiagLabel revisedDiagLabel = new RevisedDiagLabel();
+        DiagLabel revisedDiagLabel = new DiagLabel();
         revisedDiagLabel.setText(structureMap.get("修正诊断"));
         beHospitalizedDoc.setRevisedDiagLabel(revisedDiagLabel);
         structureMap.remove("修正诊断");
 
-        SuppleDiagLabel suppleDiagLabel = new SuppleDiagLabel();
+        DiagLabel suppleDiagLabel = new DiagLabel();
         suppleDiagLabel.setText(structureMap.get("补充诊断"));
         beHospitalizedDoc.setSuppleDiagLabel(suppleDiagLabel);
         structureMap.remove("补充诊断");