|
@@ -1,18 +1,16 @@
|
|
|
package com.lantone.qc.kernel.catalogue.behospitalized;
|
|
|
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
-import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
-import com.lantone.qc.pub.model.entity.Clinical;
|
|
|
import com.lantone.qc.pub.model.entity.PD;
|
|
|
import com.lantone.qc.pub.model.label.ChiefLabel;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -24,33 +22,43 @@ import java.util.regex.Pattern;
|
|
|
@Component
|
|
|
public class BEH02860 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- status.set("0");
|
|
|
if (inputInfo.getBeHospitalizedDoc() == null) {
|
|
|
+ status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
|
|
|
if (chiefLabel == null || StringUtil.isBlank(chiefLabel.getText())) {
|
|
|
+ status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
- String regex = "[零一二三四五六七八九十百千]";
|
|
|
+ List<String> arabicNumList = Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7"
|
|
|
+ , "8", "9");
|
|
|
+ List<String> containList = Arrays.asList("零", "一", "二", "三", "四", "五", "六", "七"
|
|
|
+ , "八", "九", "十", "百", "千");
|
|
|
List<PD> pds = chiefLabel.getPds();
|
|
|
if (ListUtil.isNotEmpty(pds)) {
|
|
|
String name = null, value = null;
|
|
|
for (PD pd : pds) {
|
|
|
name = pd.getName();
|
|
|
value = pd.getValue();
|
|
|
- if(name.contains("半")){
|
|
|
+ if (name.contains("半")) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (value != null && Pattern.matches(regex, value)) {
|
|
|
- status.set("-1");
|
|
|
- return;
|
|
|
+ for (String num : arabicNumList) {
|
|
|
+ if (StringUtil.isNotBlank(name) && name.contains(num)) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
- if (name != null && Pattern.matches(regex, name)) {
|
|
|
- status.set("-1");
|
|
|
- return;
|
|
|
+ for (String word : containList) {
|
|
|
+ if (StringUtil.isNotBlank(value) && value.contains(word)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(name) && name.contains(word)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|