Переглянути джерело

上级医师查房记录crf对接处修改

chengyao 4 роки тому
батько
коміт
e68ed737f7

+ 3 - 2
structure-center/src/main/java/com/lantone/structure/ai/ThreeLevelWardAI.java

@@ -49,8 +49,10 @@ public class ThreeLevelWardAI extends ModelAI {
         //  "============恩泽医嘱crf单独处理================="
         if (ListUtil.isNotEmpty(threeLevelWardDocs) && StringUtil.isNotEmpty(threeLevelWardDocs.get(0).getText())) {
             Map<String, String> maps = threeLevelWardDocs.get(0).getStructureMap();
+            String plan = inputInfo.getThreeLevelWardDocs().get(0).getText();
             if(StringUtil.isNotEmpty(maps.get("诊疗计划")) && StringUtil.isNotEmpty(maps.get("诊疗计划").trim())){
-                String plan = maps.get("诊疗计划");
+                plan = maps.get("诊疗计划");
+            }
                 putContent(crfContent, medicalTextType.get(3), plan, Content.wardRecord);
             JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
             for (int i = 0; i < threeLevelWardDocs.size(); i++) {
@@ -59,7 +61,6 @@ public class ThreeLevelWardAI extends ModelAI {
                 }
                 putRescueCrfData(midData.getJSONObject(Content.wardRecord), inputInfo);
             }
-        }
     }
         //  "============恩泽医嘱crf单独处理完成================="
 

+ 31 - 115
structure-center/src/main/java/com/lantone/structure/ai/process/EntityProcessThreeLevelWard.java

@@ -38,20 +38,15 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
         try {
             //医嘱信息
             StringBuffer sb = new StringBuffer();
-            StringBuffer xb = new StringBuffer();
-            StringBuffer bb = new StringBuffer();
             String drugNames = "",laboratorys,auxoiliarys;
             //药品
             List<Lemma> drugName = createEntityTree(aiOut, EntityEnum.DRUG_NAME.toString());
+            sb.append("药品:");
             for (Lemma lemma : drugName) {
                 String text = lemma.getText();
                 if (lemma.isHaveChildren()) {
                     for (Lemma relationLemmaRec : lemma.getRelationLemmas()) {
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.STOPNOW.toString())) {
-                            drugNames = relationLemmaRec.getText()+text;
-                            sb.append(drugNames+"、");
-                        }
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.CONTINUE.toString())) {
+                        if (relationLemmaRec.getProperty().equals(EntityEnum.STOPNOW.toString()) || relationLemmaRec.getProperty().equals(EntityEnum.CONTINUE.toString())) {
                             drugNames = relationLemmaRec.getText()+text;
                             sb.append(drugNames+"、");
                         }
@@ -60,147 +55,62 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
                     sb.append(text+" ");
                 }
             }
-            Boolean sbxflag = false;
+
             String str = sb.toString();
-            StringBuffer sbx = new StringBuffer();
-            StringBuffer sbxx = new StringBuffer();
-            if(str.contains("、")){
-                String[] split = str.split("、");
-                if(split.length>1){
-                    for (int i = 0; i < split.length; i++) {
-                        if(!(split[i].contains(EntityEnum.STOPNOW.toString()) || split[i].contains(EntityEnum.CONTINUE.toString()))){
-                            sbx.append(split[i]+"、");
-                        }else{
-                            sbxx.append(split[i]+"、");
-                        }
-                    }
-                }
-            }else{
-                sbxflag = true;
-            }
-            sb = new StringBuffer();
-            if(ListUtil.isNotEmpty(drugName)){
-                sb.append("药品:");
+            if(str.endsWith("药品:")){
+                sb = new StringBuffer();
             }
-            if(!sbxflag){
-                if(sbx.toString().endsWith("、")){
-                    sbx.deleteCharAt(sbx.toString().length()-1);
-                    sbx.append(";");
-                }
-                sb.append(sbx.toString());
-                sb.append(sbxx.toString());
-            }else{
-                sb.append(str);
-            }
-
             str = sb.toString();
             if(str.endsWith("、")){
                 sb.deleteCharAt(str.length()-1);
             }
+
             //实验室检查
             List<Lemma> laboratory = createEntityTree(aiOut, EntityEnum.LABORATORY.toString());
+            sb.append("  实验室检查:");
             for (Lemma lemma : laboratory) {
                 String text = lemma.getText();
                 if (lemma.isHaveChildren()) {
                     for (Lemma relationLemmaRec : lemma.getRelationLemmas()) {
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.REPATE.toString())) {
-                            laboratorys = relationLemmaRec.getText()+text;
-                            xb.append(laboratorys+"、");
-                        }
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.OTHERREPATE.toString())) {
+                        if (relationLemmaRec.getProperty().equals(EntityEnum.REPATE.toString()) || relationLemmaRec.getProperty().equals(EntityEnum.OTHERREPATE.toString())) {
                             laboratorys = relationLemmaRec.getText()+text;
-                            xb.append(laboratorys+"、");
+                            sb.append(laboratorys+"、");
                         }
                     }
                 }else{
-                    xb.append(text+" ");
-                }
-            }
-            String xtr = xb.toString();
-            StringBuffer xbx = new StringBuffer();
-            StringBuffer xbxx = new StringBuffer();
-            Boolean xbxflag = false;
-            if(xtr.contains("、")){
-                String[] split = xtr.split("、");
-                if(split.length>1){
-                    for (int i = 0; i < split.length; i++) {
-                        if(!(split[i].contains(EntityEnum.STOPNOW.toString()) || split[i].contains(EntityEnum.CONTINUE.toString()))){
-                            xbx.append(split[i]+"、");
-                        }else{
-                            xbxx.append(split[i]+"、");
-                        }
-                    }
-                }
-            }else{
-                xbxflag = true;
-            }
-            if(ListUtil.isNotEmpty(laboratory)){
-                sb.append("  实验室检查:");
-            }
-            if(!xbxflag){
-                if(xbx.toString().endsWith("、")){
-                    xbx.deleteCharAt(xbx.toString().length()-1);
-                    xbx.append(";");
+                    sb.append(text+" ");
                 }
-                sb.append(xbx.toString());
-                sb.append(xbxx.toString());
-            }else{
-                sb.append(xtr);
             }
 
+            str = sb.toString();
+            if(str.endsWith("  实验室检查:")){
+                sb.delete(str.length()-"  实验室检查:".length(),str.length());
+            }
             str = sb.toString();
             if(str.endsWith("、")){
                 sb.deleteCharAt(str.length()-1);
             }
+
             //辅助检查
             List<Lemma> auxoiliary = createEntityTree(aiOut, EntityEnum.AUXILIARY_EXAMINATION.toString());
+            sb.append("  辅助检查:");
             for (Lemma lemma : auxoiliary) {
                 String text = lemma.getText();
                 if (lemma.isHaveChildren()) {
                     for (Lemma relationLemmaRec : lemma.getRelationLemmas()) {
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.REPATE.toString())) {
+                        if (relationLemmaRec.getProperty().equals(EntityEnum.REPATE.toString()) || relationLemmaRec.getProperty().equals(EntityEnum.OTHERREPATE.toString())) {
                             auxoiliarys = relationLemmaRec.getText()+text;
-                            bb.append(auxoiliarys+"、");
-                        }
-                        if (relationLemmaRec.getProperty().equals(EntityEnum.OTHERREPATE.toString())) {
-                            auxoiliarys = relationLemmaRec.getText()+text;
-                            bb.append(auxoiliarys+"、");
+                            sb.append(auxoiliarys+"、");
                         }
                     }
                 }else{
-                    bb.append(text+" ");
-                }
-            }
-            Boolean bbxflag = false;
-            String btr = bb.toString();
-            StringBuffer bbx = new StringBuffer();
-            StringBuffer bbxx = new StringBuffer();
-            if(btr.contains("、")){
-                String[] split = xtr.split("、");
-                if(split.length>1){
-                    for (int i = 0; i < split.length; i++) {
-                        if(!(split[i].contains(EntityEnum.STOPNOW.toString()) || split[i].contains(EntityEnum.CONTINUE.toString()))){
-                            bbx.append(split[i]+"、");
-                        }else{
-                            bbxx.append(split[i]+"、");
-                        }
-                    }
+                    sb.append(text+" ");
                 }
-            }else{
-                bbxflag = true;
-            }
-            if(ListUtil.isNotEmpty(auxoiliary)){
-                sb.append("  辅助检查:");
             }
-            if(!bbxflag){
-                if(bbx.toString().endsWith("、")){
-                    bbx.deleteCharAt(bbx.toString().length()-1);
-                    bbx.append(";");
-                }
-                sb.append(bbx.toString());
-                sb.append(bbxx.toString());
-            }else{
-                sb.append(btr);
+
+            str = sb.toString();
+            if(str.endsWith("  辅助检查:")){
+                sb.delete(str.length()-"  辅助检查:".length(),str.length());
             }
             str = sb.toString();
             if(str.endsWith("、")){
@@ -209,13 +119,19 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
 
             //手术名称
             List<Lemma> operation = createEntityTree(aiOut, EntityEnum.OPERATION.toString());
-            if(ListUtil.isNotEmpty(operation)){
                 sb.append("  手术名称:");
-            }
             for (Lemma lemma : operation) {
                 String text = lemma.getText();
                 sb.append(text+" ");
             }
+            str = sb.toString();
+            if(str.endsWith("  手术名称:")){
+                sb.delete(str.length()-"  手术名称:".length(),str.length());
+            }
+            str = sb.toString();
+            if(str.endsWith("、")){
+                sb.deleteCharAt(str.length()-1);
+            }
             threeLevelWardLabel.setDoctorAdviceRecord(sb.toString());
         } catch (Exception e) {
             e.printStackTrace();