|
@@ -3,6 +3,7 @@ package com.lantone.qc.kernel.catalogue.yiwu.behospitalized;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
|
import com.lantone.qc.pub.model.entity.Cause;
|
|
|
import com.lantone.qc.pub.model.entity.Clinical;
|
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -29,7 +31,8 @@ public class BEH0014 extends QCCatalogue {
|
|
|
, "药物", "误服", "查", "撞", "伤", "月经", "暴力", "超", "术");
|
|
|
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- if (inputInfo.getBeHospitalizedDoc() == null) {
|
|
|
+ BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
+ if (beHospitalizedDoc == null) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
@@ -45,10 +48,19 @@ public class BEH0014 extends QCCatalogue {
|
|
|
}
|
|
|
}*/
|
|
|
PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
|
|
|
+ Map<String, String> structureMap_bh = beHospitalizedDoc.getStructureMap();
|
|
|
+ String generalCondition = structureMap_bh.get("一般情况");
|
|
|
+ if (StringUtil.isNotBlank(generalCondition) && presentLabel == null) {
|
|
|
+ //能取到一般情况,前30个字有"体检"或"发现"或"检查"(containList)字样
|
|
|
+ if (isInducement(generalCondition)) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
//既往史
|
|
|
PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
|
|
|
if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
|
|
|
- && (StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
|
|
|
+ && (pastLabel == null || StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
@@ -64,15 +76,9 @@ public class BEH0014 extends QCCatalogue {
|
|
|
//硬规则匹配 前30个字有"体检"或"发现"或"检查"(containList)字样
|
|
|
String present = presentLabel.getText();
|
|
|
if (StringUtils.isNotEmpty(present)) {
|
|
|
- if (present.length() > 30) {
|
|
|
- present = present.substring(0, 30);
|
|
|
- }
|
|
|
- present = present.replaceAll("[\"“”]", "");
|
|
|
- for (String word : containList) {
|
|
|
- if (present.contains(word)) {
|
|
|
- status.set("0");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (isInducement(present)) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
}
|
|
|
//模型在现病史前30个字里能提出来疾病,那也可以算有诱因
|
|
|
List<Diag> presentDiags = presentLabel.getDiags();
|
|
@@ -95,4 +101,18 @@ public class BEH0014 extends QCCatalogue {
|
|
|
status.set("0");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //判断一般情况和现病史中是否含有containList字样
|
|
|
+ private boolean isInducement(String text) {
|
|
|
+ if (text.length() > 30) {
|
|
|
+ text = text.substring(0, 30);
|
|
|
+ }
|
|
|
+ text = text.replaceAll("[\"“”]", "");
|
|
|
+ for (String word : containList) {
|
|
|
+ if (text.contains(word)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|