Browse Source

更新辅检提醒中对年龄和性别条件判断的逻辑

MarkHuang 4 years ago
parent
commit
f09d076a27
1 changed files with 36 additions and 40 deletions
  1. 36 40
      src/main/java/com/diagbot/repository/PacsRemindNode.java

+ 36 - 40
src/main/java/com/diagbot/repository/PacsRemindNode.java

@@ -3,12 +3,8 @@ package com.diagbot.repository;
 
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.dto.OtherTipPacsNeoDTO;
-import com.diagbot.dto.OtherTipTransfusionNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.entity.node.PacsRemind;
-import com.diagbot.entity.node.TransfusionSuggest;
-import com.diagbot.entity.node.YiBaoDiseaseName;
-import com.diagbot.entity.node.YiBaoOperationName;
 import com.diagbot.model.entity.PacsNew;
 import com.diagbot.model.entity.Pacs;
 import com.diagbot.util.ListUtil;
@@ -33,7 +29,8 @@ public class PacsRemindNode {
 		List<String> pacsresultdisease = new ArrayList<>();
 		String pacsgender = "";
 		String disname, gender, psresult, posres, negres, msg;
-		Integer age, agerange;
+		Integer age= null;
+		Integer agerange = null;
 		Integer minage = null;
 		Integer maxage = null;
 
@@ -52,14 +49,17 @@ public class PacsRemindNode {
 			}
 		}
 
-		if (wordCrfDTO.getSex()==1) {
-			pacsgender = "男";
-		}
-		else if (wordCrfDTO.getSex()==2) {
-			pacsgender = "女";
-		}
+		if (null!=wordCrfDTO.getSex()) {
+            if (wordCrfDTO.getSex() == 1) {
+                pacsgender = "男";
+            } else if (wordCrfDTO.getSex() == 2) {
+                pacsgender = "女";
+            }
+        }
 
-		age = wordCrfDTO.getAge();
+		if (null!=wordCrfDTO.getAge()) {
+            age = wordCrfDTO.getAge();
+        }
 
 		for (PacsRemind pr : pacsReminds) {
 
@@ -126,34 +126,30 @@ public class PacsRemindNode {
 					}
 				}
 
-				if (agerange==0 && proceed) {
-					if (null!=minage && null!=maxage && minage<maxage) {
-						if (age>minage && age<maxage) {
-						}
-						else {
-							proceed = false;
-						}
-					}
-				}
-				else if (agerange==1 && proceed) {
-					if (null!=minage) {
-						if (age<minage) {
-
-						}
-						else {
-							proceed =false;
-						}
-					}
-					else if (null!=maxage) {
-						if (age > maxage) {
-
-						}
-						else {
-							proceed = false;
-						}
-					}
-				}
-
+				if (null!=age) {
+                    if (agerange == 0 && proceed) {
+                        if (null != minage && null != maxage && minage < maxage) {
+                            if (age > minage && age < maxage) {
+                            } else {
+                                proceed = false;
+                            }
+                        }
+                    } else if (agerange == 1 && proceed) {
+                        if (null != minage) {
+                            if (age < minage) {
+
+                            } else {
+                                proceed = false;
+                            }
+                        } else if (null != maxage) {
+                            if (age > maxage) {
+
+                            } else {
+                                proceed = false;
+                            }
+                        }
+                    }
+                }
 
 				if (pacsresult.contains(psresult) || pacsresultdisease.contains(psresult)) {