فهرست منبع

修改逻辑及bug

hujing 5 سال پیش
والد
کامیت
0adf655aa2

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02885.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -21,8 +22,8 @@ public class FIRP02885 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
-            String zipcode = firstpageStructureMap.get(Content.household_address);
-            if (!CatalogueUtil.isEmpty(zipcode)) {
+            String zipcode = firstpageStructureMap.get(Content.household_address_zipcode);
+            if (StringUtil.isNotBlank(zipcode) && CatalogueUtil.numbersOnly(zipcode)) {
                 String regex = "^\\d{6}$";
                 if (!zipcode.matches(regex)) {
                     status.set("-1");

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02886.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -22,7 +23,7 @@ public class FIRP02886 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String zipcode = firstpageStructureMap.get(Content.work_unit_zipcode);
-            if (!CatalogueUtil.isEmpty(zipcode)) {
+            if (StringUtil.isNotBlank(zipcode) && CatalogueUtil.numbersOnly(zipcode)) {
                 String regex = "^\\d{6}$";
                 if (!zipcode.matches(regex)) {
                     status.set("-1");

+ 3 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/preoperativediscussion/PRE0328.java

@@ -46,7 +46,9 @@ public class PRE0328 extends QCCatalogue {
         }
         /* 如果首次病程录的诊疗计划里有急诊手术,则术前小结的数量加一 */
         if (emergencyOperation || emergencyOperationFromWardRecord) {
-            j++;
+            if (j == 0) {
+                j++;
+            }
         }
         if (i > 0 && i != j) {
             status.set("-1");

+ 37 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0126.java

@@ -1,15 +1,20 @@
 package com.lantone.qc.kernel.catalogue.threelevelward;
 
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.RedisUtil;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.util.SpringContextUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -40,12 +45,25 @@ public class THR0126 extends QCCatalogue {
                 status.set("0");
                 return;
             }
+            /* 首次病程录如果是主治或者主任写的,也算主治查房 */
+            FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+            if (firstCourseRecordDoc != null) {
+                String firstCourseProfessor = getFirstCourseProfessor(firstCourseRecordDoc);
+                if (firstCourseProfessor.contains("主治") || firstCourseProfessor.contains("主任")) {
+                    String recordDateStr = firstCourseRecordDoc.getStructureMap().get("记录时间");
+                    if (StringUtil.isNotBlank(recordDateStr)) {
+                        if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(recordDateStr), 48 * 60L)) {
+                            status.set("0");
+                        }
+                    }
+                }
+            }
             ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
             List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
             if (attendingDoctorWardDocs.size() > 0) {
                 AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
                 String wardDateStr = firstAttending.getStructureMap().get("查房日期");
-                if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), (long) (48 * 60))) {
+                if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
                     status.set("0");
                 }
             }
@@ -54,4 +72,22 @@ public class THR0126 extends QCCatalogue {
             status.set("0");
         }
     }
+
+    private String getFirstCourseProfessor(FirstCourseRecordDoc firstCourseRecordDoc) {
+        String professor = "";
+        String doctorSign = firstCourseRecordDoc.getStructureMap().get("记录医师");
+        if (StringUtil.isBlank(doctorSign)){
+            return professor;
+        }
+        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        if (surgeon != null) {
+            Map<String, String> doctor = (Map) surgeon.get(doctorSign);
+            if (doctor != null) {
+                professor = doctor.get("professor");
+            }
+
+        }
+        return professor;
+    }
 }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0128.java

@@ -171,7 +171,7 @@ public class THR0128 extends QCCatalogue {
         if (hospitalDoctorMap.containsKey(doctorSign)) {
             Object professor = hospitalDoctorMap.get(doctorSign).get("professor");
             if (professor != null) {
-                return professor.toString().contains("主治");
+                return professor.toString().contains("主治") || professor.toString().contains("主任");
             }
         }
         return false;