|
@@ -181,16 +181,31 @@ public class BEH02980 extends QCCatalogue {
|
|
|
//过敏史
|
|
|
private List<String> extract_Allergy(List<Allergy> allergys, List<String> pos_diags, List<String> neg_diags, String text) {
|
|
|
List<String> dgs = new ArrayList<>();
|
|
|
+ int allergyNum = 0;
|
|
|
for (Allergy dg : allergys) {
|
|
|
String dgname = dg.getName();
|
|
|
if (dg.getNegative() == null) {
|
|
|
if (!pos_diags.contains(dgname)) {
|
|
|
pos_diags.add(dgname);
|
|
|
}
|
|
|
+ if (dg.getAllergyFood() != null) {
|
|
|
+ allergyNum = 1;
|
|
|
+ }
|
|
|
+ if (dg.getAllergyMedicine() != null) {
|
|
|
+ allergyNum = 2;
|
|
|
+ }
|
|
|
} else {
|
|
|
int index = text.indexOf(dgname);
|
|
|
text = text.substring(Math.max(0, index - 10), index);
|
|
|
- if (!neg_diags.contains(dgname) && !text.contains("其他")) {
|
|
|
+ if (allergyNum == 0 && !neg_diags.contains(dgname) && !text.contains("其他")) {
|
|
|
+ neg_diags.add(dgname);
|
|
|
+ dgs.add(dgname);
|
|
|
+ }
|
|
|
+ if (allergyNum == 1 && text.contains("食物") && !neg_diags.contains(dgname) && !text.contains("其他")) {
|
|
|
+ neg_diags.add(dgname);
|
|
|
+ dgs.add(dgname);
|
|
|
+ }
|
|
|
+ if (allergyNum == 2 && text.contains("药物") && !neg_diags.contains(dgname) && !text.contains("其他")) {
|
|
|
neg_diags.add(dgname);
|
|
|
dgs.add(dgname);
|
|
|
}
|