소스 검색

入院记录发育状况代码返回模式采用crf

chengyao 4 년 전
부모
커밋
8ad0fea9d6

+ 11 - 2
structure-center/src/main/java/com/lantone/structure/ai/BeHospitalizedAI.java

@@ -28,6 +28,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import static com.lantone.structure.model.Content.developmentLabel;
 import static com.lantone.structure.model.Content.familyLabel;
 
 /**
@@ -50,7 +51,7 @@ public class BeHospitalizedAI extends ModelAI {
      * DiagnoseInAssistant[辅助检查]
      */
     public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
-            "GeneralVital_cx", "chief_present", "Diagnoses_cx", "Present_cx", "DiagnoseInAssistant","Taizhou_past_family");
+            "GeneralVital_cx", "chief_present", "Diagnoses_cx", "Present_cx", "DiagnoseInAssistant","Taizhou_past_family","Taizhou_growth");
     public static String entityRelationObject = "entity_relation_object";
     public static String outputs = "outputs";
 
@@ -68,6 +69,10 @@ public class BeHospitalizedAI extends ModelAI {
                 String opName = "家族史:" + structureMap.get("家族史");
                 putContent(crfContent, medicalTextType.get(9), opName, familyLabel);
             }
+            if (StringUtil.isNotEmpty(structureMap.get("生长发育史"))) {
+                String opName = structureMap.get("生长发育史").replace(":","").replace(":","");
+                putContent(crfContent, medicalTextType.get(10), opName, developmentLabel);
+            }
             /* 主诉 */
             if (beHospitalizedDoc.getChiefLabel() != null && beHospitalizedDoc.getChiefLabel().isCrfLabel()) {
                 String chiefText = beHospitalizedDoc.getChiefLabel().getText();
@@ -151,7 +156,7 @@ public class BeHospitalizedAI extends ModelAI {
             }
 
             JSONObject midData = loadAI(crfContent, crfServiceClient);
-            if (midData.get(Content.pastLabel) != null || midData.get(familyLabel) != null){
+            if (midData.get(Content.pastLabel) != null || midData.get(familyLabel) != null || midData.get(developmentLabel) != null){
                 BeHospitalizedDoc beHospitalizedDocs = new BeHospitalizedDoc();
                 /* 恩泽过敏史、输血史、手术史、预防接种史、疾病史(含外伤)*/
                 if (midData.get(Content.pastLabel) != null)
@@ -174,6 +179,10 @@ public class BeHospitalizedAI extends ModelAI {
                     beHospitalizedDocs.getPastLabel().setDiagInfectiouses(flagDia);
                     inputInfo.setBeHospitalizedDoc(beHospitalizedDocs);
                 }
+                /* 恩泽生长发育史 */
+                if (midData.get(developmentLabel) != null) {
+                    EZAllCrfData(midData.getJSONObject(developmentLabel), inputInfo);
+                }
             }
 
             /* 处理主诉 */

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
structure-center/src/main/java/com/lantone/structure/ai/model/EntityEnum.java


+ 29 - 0
structure-center/src/main/java/com/lantone/structure/ai/process/EntityProcessEZaAll.java

@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
 import com.lantone.common.util.ListUtil;
 import com.lantone.structure.ai.model.EntityEnum;
 import com.lantone.structure.ai.model.Lemma;
+import com.lantone.structure.model.Development;
 import com.lantone.structure.model.doc.BeHospitalizedDoc;
 import com.lantone.structure.model.entity.*;
 import com.lantone.structure.model.label.PastLabel;
+import com.lantone.structure.model.label.PersonalLabel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -21,6 +23,7 @@ public class EntityProcessEZaAll extends EntityProcess {
 
     public BeHospitalizedDoc extractEntity(JSONObject aiOut) {
         BeHospitalizedDoc beHospitalizedDoc = new BeHospitalizedDoc();
+        PersonalLabel personalLabel = new PersonalLabel();
         PastLabel pastLabel= new PastLabel();
         List<BloodTransfusion> bloodTransfusions = new ArrayList<>();//输血史
         List<Vaccinate> vaccinates = new ArrayList<>();//预防接种史
@@ -28,8 +31,32 @@ public class EntityProcessEZaAll extends EntityProcess {
         List<Allergy> allergies = new ArrayList<>();//过敏史
         List<Operation> operations = new ArrayList<>();//手术史
         List<DiagInfectious> diagInfectiouses = new ArrayList<>();//传染病史
+        Development development = new Development(); //生长发育史
 
         try {
+            //生长发育史-
+            List<Lemma> uprightType = createEntityTree(aiOut, EntityEnum.UPRIGHTTYPE.toString());
+            if(ListUtil.isNotEmpty(uprightType)){
+                long count = uprightType.stream().filter(obj -> EntityEnum.UPRIGHTTYPE.toString().equals(obj.getProperty())).count();
+                if(count>0){
+                    development.setName(EntityEnum.UPRIGHTTYPE.toString());
+                }
+            }
+            List<Lemma> astheniaType = createEntityTree(aiOut, EntityEnum.ASTHENIATYPE.toString());
+            if(ListUtil.isNotEmpty(astheniaType)){
+                long count = astheniaType.stream().filter(obj -> EntityEnum.ASTHENIATYPE.toString().equals(obj.getProperty())).count();
+                if(count>0){
+                    development.setName(EntityEnum.ASTHENIATYPE.toString());
+                }
+            }
+            List<Lemma> superforceType = createEntityTree(aiOut, EntityEnum.SUPERFORCETYPE.toString());
+            if(ListUtil.isNotEmpty(superforceType)){
+                long count = superforceType.stream().filter(obj -> EntityEnum.SUPERFORCETYPE.toString().equals(obj.getProperty())).count();
+                if(count>0){
+                    development.setName(EntityEnum.SUPERFORCETYPE.toString());
+                }
+            }
+
             //输血史-
             List<Lemma> bloods = createEntityTree(aiOut, EntityEnum.NEGATIVE.toString());
             for (Lemma lemma : bloods) {
@@ -327,6 +354,8 @@ public class EntityProcessEZaAll extends EntityProcess {
             pastLabel.setOperations(operations);
             pastLabel.setAllergies(allergies);
             pastLabel.setDiagInfectiouses(diagInfectiouses);
+            personalLabel.setDevelopment(development);
+            beHospitalizedDoc.setPersonalLabel(personalLabel);
             beHospitalizedDoc.setPastLabel(pastLabel);
         }     catch (Exception e) {
         e.printStackTrace();

+ 29 - 8
structure-center/src/main/java/com/lantone/structure/facade/tran/BeHospitalizedTran.java

@@ -5,9 +5,11 @@ import com.google.common.collect.Maps;
 import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.StringUtil;
 import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
+import com.lantone.structure.model.Development;
 import com.lantone.structure.model.doc.BeHospitalizedDoc;
 import com.lantone.structure.model.entity.*;
 import com.lantone.structure.model.label.PastLabel;
+import com.lantone.structure.model.label.PersonalLabel;
 import com.lantone.structure.util.MapUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -216,18 +218,20 @@ public class BeHospitalizedTran extends TargetTran {
             //发育情况代码
             if(StringUtil.isNotEmpty(retMap.get("个人史"))){
                 List<String> caseStr = Arrays.asList("预防接种史");
-                List<String> standStr = Arrays.asList("正常");
-                List<String> badStr = Arrays.asList("迟缓","缓慢","落后","欠理想");
+             /*   List<String> standStr = Arrays.asList("正常");
+                List<String> badStr = Arrays.asList("迟缓","缓慢","落后","欠理想");*/
                 String casePerson = retMap.get("个人史");
+                String development = "";
                 if(casePerson.contains("生长发育史")){
-                    casePerson = casePerson.substring(casePerson.indexOf("生长发育史")+"生长发育史".length());
+                    development = casePerson.substring(casePerson.indexOf("生长发育史")+"生长发育史".length());
                 }
                 for (String str : caseStr) {
-                    if(casePerson.contains(str)){
-                        casePerson = casePerson.substring(0,casePerson.indexOf(str));
+                    if(development.contains(str)){
+                        development = development.substring(0,development.indexOf(str));
                     }
                 }
-                for (String str : standStr) {
+                retMap.put("生长发育史",development);
+              /*  for (String str : standStr) {
                     if(casePerson.contains(str)) {
                         retMap.put("发育情况代码","1");
                     }
@@ -237,7 +241,7 @@ public class BeHospitalizedTran extends TargetTran {
                     if(casePerson.contains(str)) {
                         retMap.put("发育情况代码","2");
                     }
-                }
+                }*/
 
             }
 
@@ -1161,7 +1165,10 @@ public class BeHospitalizedTran extends TargetTran {
                if(StringUtil.isNotEmpty(rep.get("既往史"))){
                    rep.remove("既往史");
                }
-        if( beHospitalizedDoc !=null && beHospitalizedDoc.getPastLabel() != null){
+               if(StringUtil.isNotEmpty(rep.get("生长发育史"))){
+                rep.remove("生长发育史");
+               }
+        if( beHospitalizedDoc != null && beHospitalizedDoc.getPastLabel() != null){
             PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
             if(pastLabel != null){
                 //输血史
@@ -1190,6 +1197,20 @@ public class BeHospitalizedTran extends TargetTran {
                 commomRecord(vaccinates,rep,"预防接种史");
             }
         }
+
+        if( beHospitalizedDoc != null && beHospitalizedDoc.getPersonalLabel() != null){
+            PersonalLabel personalLabel = beHospitalizedDoc.getPersonalLabel();
+            if(personalLabel != null){
+                //生长发育史
+                Development development = personalLabel.getDevelopment();
+                if(null != development && StringUtils.isNotEmpty(development.getName())){
+                    String name = development.getName().replace("正立型","1")
+                            .replace("无力型","2").replace("超力型","3");
+                    rep.put("生长发育史",name);
+                }
+            }
+
+        }
     }
 
     public static void flagMethod( Map<String,String> rep){

+ 1 - 0
structure-center/src/main/java/com/lantone/structure/model/Content.java

@@ -254,6 +254,7 @@ public class Content {
     public static final String  surgicalSite = "手术目标部位";
     public static final String  pastLabel = "既往史";
     public static final String  familyLabel = "家族史";
+    public static final String  developmentLabel = "生长发育史";
     public static final String  doctorAdviceRecord = "医嘱内容";
     public static final String bloodRecord = "输血记录";
     public static final String stagesSummary = "阶段小结";

+ 16 - 0
structure-center/src/main/java/com/lantone/structure/model/Development.java

@@ -0,0 +1,16 @@
+package com.lantone.structure.model;
+
+import com.lantone.structure.model.entity.General;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @ClassName : Development
+ * @Description : 生长发育史
+ * @Author : 楼辉荣
+ * @Date: 2020-03-10 19:33
+ */
+@Getter
+@Setter
+public class Development extends General {
+}

+ 2 - 0
structure-center/src/main/java/com/lantone/structure/model/label/PersonalLabel.java

@@ -1,5 +1,6 @@
 package com.lantone.structure.model.label;
 
+import com.lantone.structure.model.Development;
 import com.lantone.structure.model.entity.*;
 import lombok.Getter;
 import lombok.Setter;
@@ -19,6 +20,7 @@ public class PersonalLabel extends GeneralLabel {
     private List<Address> addresses = new ArrayList<>();    //地点
     private Occupation occupation;  //职业
     private EpidemicArea epidemicArea; //疫区史
+    private Development development; //生长发育史
     private Contact contact;    //接触史
     private Smoking smoking;    //吸烟史
     private Drinking drinking;  //饮酒史