|
@@ -5,10 +5,13 @@ import com.diagbot.dto.BillMsg;
|
|
|
import com.diagbot.dto.BillNeoMaxDTO;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.util.MsgUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
@@ -38,30 +41,8 @@ public class GroupRule {
|
|
|
|
|
|
switch (node.getName()) {
|
|
|
case "妊娠":
|
|
|
- // 主诉、现病史、诊断包含“孕妇”,“妊娠”
|
|
|
- boolean flag = false;
|
|
|
- if (symptom.contains("孕妇") || chief.contains("孕妇")
|
|
|
- || symptom.contains("妊娠") || chief.contains("妊娠")) {
|
|
|
- flag = true;
|
|
|
- } else {
|
|
|
- // 主诉、现病史出现孕几周
|
|
|
- String regex = ".*孕.{1,4}周.*"; // 孕xx周
|
|
|
- if (symptom.matches(regex) || chief.matches(regex)) {
|
|
|
- flag = true;
|
|
|
- } else {
|
|
|
- List<Item> diag = wordCrfDTO.getDiag();
|
|
|
- for (Item item : diag) {
|
|
|
- // 诊断出现“孕几周”,孕字必须是第一个
|
|
|
- String regex1 = "孕.{1,4}周.*"; // 孕xx周
|
|
|
- if (item.getUniqueName().matches(regex1) || item.getUniqueName().contains("孕妇")
|
|
|
- || item.getUniqueName().contains("妊娠")) {
|
|
|
- flag = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (flag) {
|
|
|
+ Map map = gravidityRule(wordCrfDTO);
|
|
|
+ if (CoreUtil.getMapFlag(map) == true) {
|
|
|
BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
|
|
|
billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
|
|
|
"妊娠", type, billNeoMaxDTO.getType());
|
|
@@ -105,4 +86,45 @@ public class GroupRule {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断妊娠规则
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map gravidityRule(WordCrfDTO wordCrfDTO) {
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ // 妊娠目前从诊断里判断,包含“妊娠”
|
|
|
+ String symptom = wordCrfDTO.getSymptom(); // 现病史内容
|
|
|
+ String chief = wordCrfDTO.getChief(); // 主诉
|
|
|
+ // 主诉、现病史、诊断包含“孕妇”,“妊娠”
|
|
|
+ boolean flag = false;
|
|
|
+ if (symptom.contains("孕妇") || chief.contains("孕妇")
|
|
|
+ || symptom.contains("妊娠") || chief.contains("妊娠")) {
|
|
|
+ flag = true;
|
|
|
+ } else {
|
|
|
+ // 主诉、现病史出现孕几周
|
|
|
+ String regex = ".*孕.{1,4}周.*"; // 孕xx周
|
|
|
+ if (symptom.matches(regex) || chief.matches(regex)) {
|
|
|
+ flag = true;
|
|
|
+ } else {
|
|
|
+ List<Item> diag = wordCrfDTO.getDiag();
|
|
|
+ for (Item item : diag) {
|
|
|
+ // 诊断出现“孕几周”,孕字必须是第一个
|
|
|
+ String regex1 = "孕.{1,4}周.*"; // 孕xx周
|
|
|
+ if (item.getUniqueName().matches(regex1) || item.getUniqueName().contains("孕妇")
|
|
|
+ || item.getUniqueName().contains("妊娠")) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ map.put("flag", flag);
|
|
|
+ map.put("msg", "妊娠");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|