Browse Source

取电子病历的诊断和手术时要捕获异常

lighter 2 years ago
parent
commit
dbe7433e6e

+ 12 - 2
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetMainService.java

@@ -334,7 +334,12 @@ public class CaseFrontSheetMainService {
                 dao.selectSignedSheetDiags(bah, times) : dao.getDisdiags(bah, times);
         if (disdiags.isEmpty()) {
             JSONObject emrPatientData = emrService.getEmrPatientData(bah, times);
-            JSONArray diagList = emrPatientData.getJSONArray("出院诊断");
+            JSONArray diagList;
+            try {
+                diagList = emrPatientData.getJSONArray("出院诊断");
+            } catch (Exception e) {
+                diagList = null;
+            }
             if (null != diagList) {
                 for (int i = 0; i < diagList.size(); i++) {
                     JSONObject diagItem = diagList.getJSONObject(i);
@@ -359,7 +364,12 @@ public class CaseFrontSheetMainService {
             JSONArray oprtList = emrService.getPatientSurgery(bah, times);
             for (int i = 0; i < oprtList.size(); i++) {
                 JSONObject oprtItem = oprtList.getJSONObject(i);
-                JSONObject oprtName = oprtItem.getJSONObject("手术名称");
+                JSONObject oprtName;
+                try {
+                    oprtName = oprtItem.getJSONObject("手术名称");
+                } catch (Exception e) {
+                    continue;
+                }
                 if (null == oprtName) {
                     continue;
                 }