|
@@ -1,5 +1,6 @@
|
|
|
package com.lantone.qc.kernel.util;
|
|
|
|
|
|
+import com.google.common.collect.ImmutableMap;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.pub.Content;
|
|
@@ -32,7 +33,9 @@ import java.util.regex.Pattern;
|
|
|
@Setter
|
|
|
public class CatalogueUtil {
|
|
|
public static Map<String, QCCatalogue> qcCatalogueMap = new HashMap<>();
|
|
|
-
|
|
|
+ public static Map<Integer, String> intMapString =
|
|
|
+ ImmutableMap.<Integer, String>builder().put(1, "一").put(2, "二").put(3, "三").put(4, "四").put(5, "五")
|
|
|
+ .put(6, "六").put(7, "七").put(8, "八").put(9, "九").build();
|
|
|
|
|
|
public static boolean isEmpty(String content) {
|
|
|
return StringUtil.isBlank(removeSpecialChar(content));
|
|
@@ -114,8 +117,8 @@ public class CatalogueUtil {
|
|
|
}
|
|
|
List<Diag> retDiags = Lists.newArrayList();
|
|
|
diags.forEach(i -> {
|
|
|
- if (i != null && StringUtil.isNotBlank(i.getName())) {
|
|
|
- Map<String, String> diagDetailMap = conceptDiagPropertyMap.get(i.getName());
|
|
|
+ if (i != null && StringUtil.isNotBlank(i.getHospitalDiagName())) {
|
|
|
+ Map<String, String> diagDetailMap = conceptDiagPropertyMap.get(i.getHospitalDiagName());
|
|
|
if (diagDetailMap != null) {
|
|
|
String natureValue_ = diagDetailMap.get(nature);
|
|
|
if (StringUtil.isNotBlank(natureValue_) && natureValue_.equals(natureValue)) {
|
|
@@ -312,4 +315,26 @@ public class CatalogueUtil {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ public static String int2ChineseNum(String content) {
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ char[] contentArr = content.toCharArray();
|
|
|
+ for (int i = 0; i < contentArr.length; i++) {
|
|
|
+ if (isNumeric(contentArr[i])){
|
|
|
+ int num = Integer.parseInt(String.valueOf(contentArr[i]));
|
|
|
+ sb.append(intMapString.get(num));
|
|
|
+ } else {
|
|
|
+ sb.append(contentArr[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static boolean isNumeric(char c) {
|
|
|
+ if (c < 48 || c > 57) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|