|
@@ -8,15 +8,18 @@ import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
|
import com.lantone.qc.pub.model.entity.GeneralDesc;
|
|
|
+import com.lantone.qc.pub.model.entity.Negative;
|
|
|
import com.lantone.qc.pub.model.label.DiagLabel;
|
|
|
import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
import com.lantone.qc.pub.model.label.PresentLabel;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -38,14 +41,41 @@ public class BEH02980 extends QCCatalogue {
|
|
|
|
|
|
List<String> pos_diags = new ArrayList<>();
|
|
|
List<String> neg_diags = new ArrayList<>();
|
|
|
- List<String> present_neg_diags = new ArrayList<>();
|
|
|
- List<String> past_neg_diags = new ArrayList<>();
|
|
|
|
|
|
if (presentLabel != null) {
|
|
|
- present_neg_diags = extract_diags(presentLabel.getDiags(), pos_diags, neg_diags);
|
|
|
+ extract_diags(presentLabel.getDiags(), pos_diags, neg_diags);
|
|
|
}
|
|
|
if (pastLabel != null) {
|
|
|
- past_neg_diags = extract_diags(pastLabel.getDiags(), pos_diags, neg_diags);
|
|
|
+ extract_diags(pastLabel.getDiags(), pos_diags, neg_diags);
|
|
|
+ } else {
|
|
|
+ //例如邵逸夫 台州这种结构化数据,判断高血压 和 糖尿病是否有冲突
|
|
|
+ List<Diag> pastDiags = new ArrayList<>();
|
|
|
+ Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
+ String a1 = structureMap.get("高血压");
|
|
|
+ Diag diag = new Diag();
|
|
|
+ diag.setName("高血压");
|
|
|
+ diag.setHospitalDiagName("高血压");
|
|
|
+ if (StringUtils.isNotEmpty(a1) && "否认".equals(a1)) {
|
|
|
+ Negative negative = new Negative();
|
|
|
+ negative.setName("否认");
|
|
|
+ pastDiags.add(diag);
|
|
|
+ } else if (StringUtils.isNotEmpty(a1) && !"否认".equals(a1)) {
|
|
|
+ pastDiags.add(diag);
|
|
|
+ }
|
|
|
+
|
|
|
+ a1 = structureMap.get("糖尿病");
|
|
|
+ diag = new Diag();
|
|
|
+ diag.setName("糖尿病");
|
|
|
+ diag.setHospitalDiagName("糖尿病");
|
|
|
+ if (StringUtils.isNotEmpty(a1) && "否认".equals(a1)) {
|
|
|
+ Negative negative = new Negative();
|
|
|
+ negative.setName("否认");
|
|
|
+ pastDiags.add(diag);
|
|
|
+ } else if (StringUtils.isNotEmpty(a1) && !"否认".equals(a1)) {
|
|
|
+ pastDiags.add(diag);
|
|
|
+ }
|
|
|
+
|
|
|
+ extract_diags(pastDiags, pos_diags, neg_diags);
|
|
|
}
|
|
|
if (initialDiagLabel != null) {
|
|
|
extract_diags(initialDiagLabel.getDiags(), pos_diags, neg_diags);
|
|
@@ -65,19 +95,18 @@ public class BEH02980 extends QCCatalogue {
|
|
|
double likeRate = jsonArray.getDoubleValue(1);
|
|
|
if (likeRate > 0.85) {
|
|
|
matchSum++;
|
|
|
- if (present_neg_diags.indexOf(negdiag)>=0) {
|
|
|
- infoStr = "现病史:\t" + negdiag;
|
|
|
- }
|
|
|
- else if (past_neg_diags.indexOf(negdiag)>=0) {
|
|
|
- infoStr = "既往史:\t" + negdiag;
|
|
|
+ if (StringUtils.isEmpty(infoStr)) {
|
|
|
+ infoStr = negdiag;
|
|
|
+ } else {
|
|
|
+ infoStr = infoStr + "," + negdiag;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- info.set(infoStr);
|
|
|
if (matchSum > 0) {
|
|
|
status.set("-1");
|
|
|
+ info.set(infoStr);
|
|
|
}
|
|
|
|
|
|
}
|