Browse Source

Merge remote-tracking branch 'origin/master'

zhoutg 4 years ago
parent
commit
620b62941c

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

@@ -15,11 +15,11 @@ public class WordBillCrfDTO {
     private ChiefLabel chiefLabel;
     private ChiefLabel chiefLabel;
     private DiagLabel diagLabel;
     private DiagLabel diagLabel;
     private FamilyLabel familyLabel;
     private FamilyLabel familyLabel;
-    private LisLabel lisLabel;
+//    private LisLabel lisLabel;
     private MaritalLabel maritalLabel;
     private MaritalLabel maritalLabel;
     private MenstrualLabel menstrualLabel;
     private MenstrualLabel menstrualLabel;
     private PresentLabel presentLabel;
     private PresentLabel presentLabel;
-    private PacsLabel pacsLabel;
+//    private PacsLabel pacsLabel;
     private PastLabel pastLabel;
     private PastLabel pastLabel;
     private PersonalLabel personalLabel;
     private PersonalLabel personalLabel;
     private VitalLabel vitalLabel;
     private VitalLabel vitalLabel;

+ 29 - 24
src/main/java/com/diagbot/model/ai/BeHospitalizedAI.java

@@ -111,7 +111,8 @@ public class BeHospitalizedAI extends ModelAI {
                 wordBillCrfDTO.setFamilyLabel(familyLabel);
                 wordBillCrfDTO.setFamilyLabel(familyLabel);
                 putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
                 putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
             }
             }
-            /* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) */
+
+           /* *//* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) *//*
             if (StringUtils.isNotBlank(inputInfo.getPacsString())) {
             if (StringUtils.isNotBlank(inputInfo.getPacsString())) {
                 String pacsText = inputInfo.getPacsString();
                 String pacsText = inputInfo.getPacsString();
                 PacsLabel pacsLabel = new PacsLabel();
                 PacsLabel pacsLabel = new PacsLabel();
@@ -120,7 +121,7 @@ public class BeHospitalizedAI extends ModelAI {
                 wordBillCrfDTO.setPacsLabel(pacsLabel);
                 wordBillCrfDTO.setPacsLabel(pacsLabel);
                 putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
                 putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
             }
             }
-           /* *//* 专科检查(专科体格检查) *//*
+            //* 专科检查(专科体格检查)
             if (beHospitalizedDoc.getVitalLabelSpecial() != null && beHospitalizedDoc.getVitalLabelSpecial().isCrfLabel()) {
             if (beHospitalizedDoc.getVitalLabelSpecial() != null && beHospitalizedDoc.getVitalLabelSpecial().isCrfLabel()) {
                 String vitalSpecialText = beHospitalizedDoc.getVitalLabelSpecial().getText();
                 String vitalSpecialText = beHospitalizedDoc.getVitalLabelSpecial().getText();
                 putContent(crfContent, medicalTextType.get(3), vitalSpecialText, Content.special_exam);
                 putContent(crfContent, medicalTextType.get(3), vitalSpecialText, Content.special_exam);
@@ -134,14 +135,18 @@ public class BeHospitalizedAI extends ModelAI {
                 wordBillCrfDTO.setVitalLabel(vitalLabel);
                 wordBillCrfDTO.setVitalLabel(vitalLabel);
                 putContent(crfContent, medicalTextType.get(4), vitalText, Content.phys_exam);
                 putContent(crfContent, medicalTextType.get(4), vitalText, Content.phys_exam);
             }
             }
-            /* 初步诊断 *//*
-            if (beHospitalizedDoc.getInitialDiagLabel() != null && beHospitalizedDoc.getInitialDiagLabel().isCrfLabel()) {
-                String initialDiagText = beHospitalizedDoc.getInitialDiagLabel().getText();
+            // 初步诊断
+            if (StringUtils.isNotBlank(inputInfo.getDiagString())) {
+                String initialDiagText = inputInfo.getDiagString();
+                DiagLabel diagLabel = new DiagLabel();
+                diagLabel.setText(initialDiagText);
+                diagLabel.setAiText(initialDiagText);
+                wordBillCrfDTO.setDiagLabel(diagLabel);
                 if (StringUtil.isNotBlank(initialDiagText)) {
                 if (StringUtil.isNotBlank(initialDiagText)) {
-                    *//*initial_diag_text = CatalogueUtil.removeBetweenWordSpace(initial_diag_text);*//*
                     putContent(crfContent, medicalTextType.get(6), initialDiagText, Content.initial_diag);
                     putContent(crfContent, medicalTextType.get(6), initialDiagText, Content.initial_diag);
                 }
                 }
             }
             }
+            /*
             *//* 修正诊断 *//*
             *//* 修正诊断 *//*
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
                 String revisedDiagText = beHospitalizedDoc.getRevisedDiagLabel().getText();
                 String revisedDiagText = beHospitalizedDoc.getRevisedDiagLabel().getText();
@@ -188,22 +193,22 @@ public class BeHospitalizedAI extends ModelAI {
             if (wordBillCrfDTO.getMaritalLabel() != null ) {
             if (wordBillCrfDTO.getMaritalLabel() != null ) {
                 putMaritalCrfData(midData.getJSONObject(Content.marriage), wordBillCrfDTO);
                 putMaritalCrfData(midData.getJSONObject(Content.marriage), wordBillCrfDTO);
             }
             }
-            /* 处理初步诊断 *//*
-            if (beHospitalizedDoc.getInitialDiagLabel() != null && beHospitalizedDoc.getInitialDiagLabel().isCrfLabel()) {
-                putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), inputInfo);
+             //处理初步诊断
+            if (wordBillCrfDTO.getDiagLabel() != null) {
+                putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), wordBillCrfDTO);
             }
             }
-            *//* 处理修正诊断 *//*
+             /*//处理修正诊断
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
                 putRevisedDiagCrfData(midData.getJSONObject(Content.revised_diag), inputInfo);
                 putRevisedDiagCrfData(midData.getJSONObject(Content.revised_diag), inputInfo);
             }
             }
-            *//* 处理补充诊断 *//*
+             //处理补充诊断
             if (beHospitalizedDoc.getSuppleDiagLabel() != null && beHospitalizedDoc.getSuppleDiagLabel().isCrfLabel()) {
             if (beHospitalizedDoc.getSuppleDiagLabel() != null && beHospitalizedDoc.getSuppleDiagLabel().isCrfLabel()) {
                 putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
                 putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
             }*/
             }*/
             /* 处理辅助检查 */
             /* 处理辅助检查 */
-            if (wordBillCrfDTO.getPacsLabel() != null) {
+            /*if (wordBillCrfDTO.getPacsLabel() != null) {
                 putPacsCrfData(midData.getJSONObject(Content.pacs), wordBillCrfDTO);
                 putPacsCrfData(midData.getJSONObject(Content.pacs), wordBillCrfDTO);
-            }
+            }*/
         }
         }
     }
     }
 
 
@@ -342,13 +347,13 @@ public class BeHospitalizedAI extends ModelAI {
         wordBillCrfDTO.setMenstrualLabel(menstrualLabel);
         wordBillCrfDTO.setMenstrualLabel(menstrualLabel);
     }
     }
 
 
-    /**
+    /*
      * 初步诊断信息提取
      * 初步诊断信息提取
      *
      *
      * @param jsonObject
      * @param jsonObject
      * @param inputInfo
      * @param inputInfo
-     *//*
-    public void putInitialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
+     */
+    public void putInitialDiagCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -361,16 +366,16 @@ 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(inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText());
+        initialDiagLabel.setText(wordBillCrfDTO.getDiagLabel().getText());
         initialDiagLabel.setDiags(diags);
         initialDiagLabel.setDiags(diags);
-        inputInfo.getBeHospitalizedDoc().setInitialDiagLabel(initialDiagLabel);
+        wordBillCrfDTO.setDiagLabel(initialDiagLabel);
     }
     }
 
 
-    *//**
+    /**
      * 修正诊断信息提取
      * 修正诊断信息提取
      *
      *
      * @param jsonObject
      * @param jsonObject
-     * @param inputInfo
+     * @param
      *//*
      *//*
     public void putRevisedDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
     public void putRevisedDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         if (jsonObject == null) {
         if (jsonObject == null) {
@@ -397,7 +402,7 @@ public class BeHospitalizedAI extends ModelAI {
         }*//*
         }*//*
     }
     }
 
 
-    *//**
+    /**
      * 补充诊断信息提取
      * 补充诊断信息提取
      *
      *
      * @param jsonObject
      * @param jsonObject
@@ -420,14 +425,14 @@ public class BeHospitalizedAI extends ModelAI {
         suppleDiagLabel.setDiags(diags);
         suppleDiagLabel.setDiags(diags);
         inputInfo.getBeHospitalizedDoc().setSuppleDiagLabel(suppleDiagLabel);
         inputInfo.getBeHospitalizedDoc().setSuppleDiagLabel(suppleDiagLabel);
     }
     }
-*/
+
     /**
     /**
      * 辅助检查信息抽取
      * 辅助检查信息抽取
      *
      *
      * @param jsonObject
      * @param jsonObject
      * @param wordBillCrfDTO
      * @param wordBillCrfDTO
      */
      */
-    public void putPacsCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
+  /*  public void putPacsCrfData(JSONObject jsonObject, WordBillCrfDTO wordBillCrfDTO) {
         if (jsonObject == null) {
         if (jsonObject == null) {
             return;
             return;
         }
         }
@@ -438,7 +443,7 @@ public class BeHospitalizedAI extends ModelAI {
         //放置入inputinfo
         //放置入inputinfo
         PacsLabel pacsLabel = wordBillCrfDTO.getPacsLabel();
         PacsLabel pacsLabel = wordBillCrfDTO.getPacsLabel();
         pacsLabel.setPacses(loadPacses(aiOut));
         pacsLabel.setPacses(loadPacses(aiOut));
-    }
+    }*/
 
 
     /**
     /**
      * 关系抽取疾病信息
      * 关系抽取疾病信息