Pārlūkot izejas kodu

首次病程非执业医师书写 修改

rengb 5 gadi atpakaļ
vecāks
revīzija
69dcd3307d

+ 35 - 13
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0082.java

@@ -5,6 +5,7 @@ import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.SpringContextUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,22 +29,43 @@ public class FIRC0082 extends QCCatalogue {
             status.set("0");
             return;
         }
+
         String doctorName = inputInfo.getFirstCourseRecordDoc().getStructureMap().get("医师签名");
-        if (StringUtil.isNotBlank(doctorName)) {
-            Map<String, Map<String, String>> hospitalDoctorMap = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
-            if (hospitalDoctorMap != null) {
-                Map<String, String> doctor = (Map) hospitalDoctorMap.get(doctorName);
-                if (doctor != null) {
-                    String occup = doctor.get("occup");
-                    if (StringUtils.isNotEmpty(occup) && "1".equals(occup)) {
-                        status.set("0");
-                        return;
-                    }
-                }
-            }
-        } else {
+        if (StringUtil.isBlank(doctorName)) {
+            status.set("0");
+            return;
+        }
+
+        String occup = getOccup(doctorName);
+        if (StringUtils.isNotEmpty(occup) && "1".equals(occup)) {
             status.set("0");
+            return;
+        }
+
+        if (doctorName.length() > 1) {
+            doctorName = doctorName.substring(0, doctorName.length() - 1);
+            occup = getOccup(doctorName);
+            if (StringUtils.isNotEmpty(occup) && "1".equals(occup)) {
+                status.set("0");
+                return;
+            }
+        }
+    }
+
+    private String getOccup(String doctorName) {
+        String occup = "";
+        if (StringUtil.isBlank(doctorName)) {
+            return occup;
+        }
+        SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
+        Map<String, Map<String, String>> surgeon = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        if (surgeon != null) {
+            Map<String, String> doctor = (Map) surgeon.get(doctorName);
+            if (doctor != null) {
+                occup = doctor.get("occup");
+            }
         }
+        return occup;
     }
 
 }