|
@@ -11,10 +11,9 @@ import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : LEA02987
|
|
@@ -56,9 +55,24 @@ public class LEA02987 extends QCCatalogue {
|
|
|
}
|
|
|
|
|
|
String infoStr = "";
|
|
|
+ List<String> notContainsDrugs = new ArrayList<>();
|
|
|
for (String drug:drugs) {
|
|
|
if (!dischargeOrder.contains(drug)){
|
|
|
- infoStr = CatalogueUtil.concatInfo(infoStr,drug);
|
|
|
+ notContainsDrugs.add(drug);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //没有包含的药品再次查看商品名或化学名在出院医嘱书写
|
|
|
+ for (String drug : notContainsDrugs) {
|
|
|
+ Set<String> splitDrugs = getRegexWords(drug, "[((][^()()]+[))]");
|
|
|
+ boolean isFind = false;
|
|
|
+ for (String sd : splitDrugs) {
|
|
|
+ if (dischargeOrder.contains(sd)){
|
|
|
+ isFind = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isFind) {
|
|
|
+ infoStr = CatalogueUtil.concatInfo(infoStr, drug);
|
|
|
}
|
|
|
}
|
|
|
if (StringUtil.isNotBlank(infoStr)){
|
|
@@ -66,4 +80,27 @@ public class LEA02987 extends QCCatalogue {
|
|
|
info.set(infoStr);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private Set<String> getRegexWords(String word, String regex) {
|
|
|
+ Set<String> ret = new HashSet<>();
|
|
|
+ if (StringUtil.isNotBlank(word) && StringUtil.isNotBlank(regex)) {
|
|
|
+ Pattern pattern = Pattern.compile(regex);
|
|
|
+ Matcher matcher = pattern.matcher(word);
|
|
|
+ if (matcher.find()) {
|
|
|
+ ret.add(matcher.group().replaceAll("[(())]", ""));
|
|
|
+ int startIndex = matcher.start();
|
|
|
+ int endIndex = matcher.end();
|
|
|
+ if (startIndex > 0) {
|
|
|
+ ret.add(word.substring(0, startIndex));
|
|
|
+ }
|
|
|
+ if (endIndex <= word.length()) {
|
|
|
+ ret.addAll(getRegexWords(word.substring(endIndex), regex));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ret.add(word);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
}
|