Parcourir la source

不使用算法

wangsy il y a 2 ans
Parent
commit
40b972b334

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java

@@ -205,6 +205,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -223,6 +226,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -246,6 +252,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -267,6 +276,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -282,6 +294,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -304,6 +319,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -325,6 +343,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null || jsonObject.getJSONObject(entityRelationObject) == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -346,6 +367,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -383,6 +407,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -414,6 +441,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;
@@ -438,6 +468,9 @@ public class BeHospitalizedAI extends ModelAI {
         if (jsonObject == null) {
             return;
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return;
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
         if (aiOut == null) {
             return;

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

@@ -65,7 +65,7 @@ public class ConsultationAI extends ModelAI {
      */
     public List<Drug> putDrugCrfData(JSONObject jsonObject) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return new ArrayList<>();
         }
         EntityProcessDrug entityProcessDrug = new EntityProcessDrug();

+ 5 - 5
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java

@@ -178,7 +178,7 @@ public class FirstCourseRecordAI extends ModelAI {
      */
     public void putInitialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         //诊断信息
@@ -195,7 +195,7 @@ public class FirstCourseRecordAI extends ModelAI {
      */
     public void putDiagnosisCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         //使用现病史结构来处理诊断依据
@@ -213,7 +213,7 @@ public class FirstCourseRecordAI extends ModelAI {
      */
     public void putDifferentialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         //诊断信息
@@ -230,7 +230,7 @@ public class FirstCourseRecordAI extends ModelAI {
      */
     public void putTreatPlanCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         //诊疗计划
@@ -248,7 +248,7 @@ public class FirstCourseRecordAI extends ModelAI {
      */
     public void putDrugCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         EntityProcessDrug entityProcessDrug = new EntityProcessDrug();

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/LeaveHospitalAI.java

@@ -92,7 +92,7 @@ public class LeaveHospitalAI extends ModelAI {
      */
     public void putDischargeCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         EntityProcessLeaveHospital entityProcessLeaveHospital = new EntityProcessLeaveHospital();
@@ -108,7 +108,7 @@ public class LeaveHospitalAI extends ModelAI {
      */
     public void putDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
@@ -126,7 +126,7 @@ public class LeaveHospitalAI extends ModelAI {
      */
     public void putDrugCrfData(JSONObject jsonObject, InputInfo inputInfo) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         EntityProcessDrug entityProcessDrug = new EntityProcessDrug();

+ 13 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java

@@ -44,7 +44,7 @@ public class ModelAI {
         if (useCrfCache) {
             data = (JSONArray) redisUtil.hget(prex + behospitalCode, classname);
         }
-        if (data == null) {
+        if (false) {
             //存储CRF完整所需结构数据
             CRFVo crfVo = new CRFVo();
             crfVo.setData(crfContent);
@@ -65,6 +65,9 @@ public class ModelAI {
         if (jsonObject == null) {
             return new JSONObject();
         }
+        if (jsonObject.getJSONObject(entityRelationObject) == null) {
+            return new JSONObject();
+        }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(outputs);
         aiOut.put(content, jsonObject.getJSONObject(entityRelationObject).getString(content));
         return aiOut;
@@ -115,6 +118,9 @@ public class ModelAI {
      */
     public JSONObject getOutputs(JSONArray data) {
         JSONObject midData = new JSONObject();
+        if(data == null){
+            return midData;
+        }
         for (int i = 0; i < data.size(); i++) {
             JSONObject detailContent = data.getJSONObject(i);
             String detail_title = detailContent.getString("detail_title");
@@ -182,6 +188,9 @@ public class ModelAI {
      */
     public double getSimilarOutputs(JSONArray data) {
         double likeRate = 0d;
+        if( data==null ){
+            return likeRate;
+        }
         if (data.size() > 0) {
             JSONObject dataContent = data.getJSONObject(0);
             likeRate = dataContent.getDoubleValue("like_rate");
@@ -251,6 +260,9 @@ public class ModelAI {
      */
     public JSONArray getChiefPresentSimilarOutputs(JSONArray predY) {
         JSONArray dataArr = new JSONArray();
+        if(predY == null){
+            return dataArr;
+        }
         if (predY != null && predY.size() > 0) {
             dataArr = predY.getJSONArray(0);
         }

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/OperationAI.java

@@ -95,7 +95,7 @@ public class OperationAI extends ModelAI {
      */
     public OperationDiscussionLabel putOperationDiscussionCrfData(JSONObject jsonObject) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return null;
         }
         String originalText = jsonObject.getString("originalText");
@@ -110,7 +110,7 @@ public class OperationAI extends ModelAI {
      */
     public List<Drug> putDrugCrfData(JSONObject jsonObject) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return new ArrayList<>();
         }
         EntityProcessDrug entityProcessDrug = new EntityProcessDrug();

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ThreeLevelWardAI.java

@@ -160,7 +160,7 @@ public class ThreeLevelWardAI extends ModelAI {
      */
     public void putWardRoundCrfData(JSONObject jsonObject, InputInfo inputInfo, int serious) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return;
         }
         String wardDate = jsonObject.getString("wardDate");
@@ -201,7 +201,7 @@ public class ThreeLevelWardAI extends ModelAI {
      */
     public ThreeLevelWardLabel putWardRoundCrfData(JSONObject jsonObject) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
-        if (aiOut == null) {
+        if (aiOut == null || aiOut.size()==0) {
             return new ThreeLevelWardLabel();
         }
         String detailTitle = jsonObject.getString("detail_title");

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/util/SimilarityUtil.java

@@ -62,6 +62,9 @@ public class SimilarityUtil {
      * @return 返回具体数据集合
      */
     public JSONArray similarityRequest(String word_type, String word, int number) {
+        if(1==1){
+            return null;
+        }
         if (StringUtil.isBlank(word_type) || StringUtil.isBlank(word) || number == 0) {
             return null;
         }