zhoutg před 4 roky
rodič
revize
1b2f5ae21a

+ 3 - 3
src/main/java/com/diagbot/model/ai/BeHospitalizedAI.java

@@ -246,9 +246,9 @@ public class BeHospitalizedAI extends ModelAI {
                 putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), wordCrfDTO);
             }
             // 查体数据
-            // if (wordCrfDTO.getVitalLabel() != null) {
-            //     putInitialVitalCrfData(midData.getJSONObject(Content.phys_exam), wordCrfDTO);
-            // }
+            if (wordCrfDTO.getVitalLabel() != null) {
+                putInitialVitalCrfData(midData.getJSONObject(Content.phys_exam), wordCrfDTO);
+            }
              /*//处理修正诊断
             if (beHospitalizedDoc.getRevisedDiagLabel() != null && beHospitalizedDoc.getRevisedDiagLabel().isCrfLabel()) {
                 putRevisedDiagCrfData(midData.getJSONObject(Content.revised_diag), inputInfo);

+ 38 - 0
src/main/java/com/diagbot/model/ai/process/EntityProcess.java

@@ -373,4 +373,42 @@ public class EntityProcess {
         }
         return res;
     }
+
+    public String[] extract_digit_new(String value) {
+        String[] res = new String[2];
+        try {
+            String reg_time = "([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])";
+            Pattern pattern = Pattern.compile(reg_time);
+            Matcher matcher = pattern.matcher(value);
+            if (matcher.find(0)) {
+                res[0] = matcher.group(1);
+                res[1] = value.substring(value.indexOf(res[0]) + res[0].length());
+            } else {
+                res[0] = value;
+                res[1] = "";
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return res;
+    }
+
+    public static void main(String[] args) {
+        String value = "℃";
+        String[] res = new String[2];
+        try {
+            String reg_time = "([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])";
+            Pattern pattern = Pattern.compile(reg_time);
+            Matcher matcher = pattern.matcher(value);
+            if (matcher.find(0)) {
+                res[0] = matcher.group(1);
+                res[1] = value.substring(value.indexOf(res[0]) + res[0].length());
+            } else {
+                res[0] = value;
+                res[1] = "";
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
 }

+ 1 - 1
src/main/java/com/diagbot/model/ai/process/EntityProcessVital.java

@@ -40,7 +40,7 @@ public class EntityProcessVital extends EntityProcess {
                         PD pd = new PD();
                         String[] val_unit = new String[2];
                         if (StringUtil.isNotBlank(entity)) {
-                            val_unit = extract_digit(entity);
+                            val_unit = extract_digit_new(entity);
                             pd.setValue(val_unit[0]);
                             pd.setUnit(val_unit[1]);
                         }