Przeglądaj źródła

优化入院时间错误(具体到分)

wangfeng 5 lat temu
rodzic
commit
02b93cc1e2

+ 10 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03002.java

@@ -27,14 +27,16 @@ public class BEH03002 extends QCCatalogue {
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
         if (structureMap != null) {
             String dateStr = structureMap.get(Content.admisDate);
-            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-            try {
-                String replace = dateStr.replace('/', '-');
-                Date d = formatter.parse(replace);
-                status.set("0");
-            } catch (Exception e) {
-                status.set("-1");
-                return;
+            if (dateStr!=null&&!dateStr.isEmpty()) {
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                try {
+                    String replace = dateStr.replace('/', '-');
+                    Date d = formatter.parse(replace);
+                    status.set("0");
+                } catch (Exception e) {
+                    status.set("-1");
+                    return;
+                }
             }
         }
     }