Sfoglia il codice sorgente

长兴新需求开发

hujing 5 anni fa
parent
commit
c99411ed6f

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

@@ -2,12 +2,16 @@ package com.lantone.qc.kernel.catalogue.threelevelward;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.kernel.util.KernelConstants;
+import com.lantone.qc.kernel.util.RedisUtil;
 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.util.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -23,6 +27,9 @@ import java.util.Map;
  */
 @Component
 public class THR0128 extends QCCatalogue {
+    @Autowired
+    private RedisUtil redisUtil;
+
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getLeaveHospitalDoc() != null
@@ -71,6 +78,19 @@ public class THR0128 extends QCCatalogue {
                 status.set("0");
                 return;
             }
+            boolean firstRecordAttendExist = findfirstRecordAttend(inputInfo);
+            for (int j = 0; j < roundRecordEveryWeek.size(); j++) {
+                int indicationsNum = CatalogueUtil.appearNumber(roundRecordEveryWeek.get(j).split(","), Content.attend);
+                if (j == 0 && firstRecordAttendExist) { //如果首程中医师签名为主治医师,第一周查房记录也要加上
+                    indicationsNum += 1;
+                }
+                if (indicationsNum < 3) {
+                    //每周无3次主治医师查房记录
+                    status.set("-1");
+                    info.set(lastWardDateRange);
+                    return;
+                }
+            }
             for (String roundRecord : roundRecordEveryWeek) {
                 int indicationsNum = CatalogueUtil.appearNumber(roundRecord.split(","), Content.attend);
                 if (indicationsNum < 3) {
@@ -129,4 +149,23 @@ public class THR0128 extends QCCatalogue {
         }
         return "";
     }
+
+    private boolean findfirstRecordAttend(InputInfo inputInfo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            return false;
+        }
+        Map<String, Map<String, Object>> hospitalDoctorMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        String doctorSign = firstCourseRecordDoc.getStructureMap().get("医师签名");
+        if (hospitalDoctorMap == null || StringUtil.isBlank(doctorSign)) {
+            return false;
+        }
+        if (hospitalDoctorMap.containsKey(doctorSign)) {
+            Object professor = hospitalDoctorMap.get(doctorSign).get("professor");
+            if (professor != null) {
+                return professor.toString().contains("主治");
+            }
+        }
+        return false;
+    }
 }

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0698.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : THR0698
+ * @Description : 查房记录无记录时间
+ * @Author : 胡敬
+ * @Date: 2020-04-20 15:23
+ */
+@Component
+public class THR0698 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (threeLevelWardDocs.size() == 0) {
+            status.set("0");
+            return;
+        }
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
+        List<ThreeLevelWardDoc> recordDoctorList = allDoctorWradDocs
+                .stream()
+                .filter(doc -> StringUtil.isBlank(doc.getStructureMap().get("记录时间")))
+                .collect(Collectors.toList());
+        if (recordDoctorList.size() == 0) {
+            status.set("0");
+        }
+
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0700.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR0700
+ * @Description : 最后一次查房记录缺“上级医师”
+ * @Author : 胡敬
+ * @Date: 2020-03-19 17:20
+ */
+@Component
+public class THR0700 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getThreeLevelWardDocs().size() > 0) {
+            List<ThreeLevelWardDoc> allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
+            if (allDoctorWradDocs.size() > 0) {
+                ThreeLevelWardDoc lastWardDoc = allDoctorWradDocs.get(allDoctorWradDocs.size() - 1);
+                Map<String, String> structureMap = lastWardDoc.getStructureMap();
+                String conditionRecord = structureMap.get("病情记录");
+                if (StringUtil.isBlank(conditionRecord)){
+                    return;
+                }
+                if (conditionRecord.contains("上级医师")){
+                    status.set("0");
+                }
+            }
+        }
+    }
+}

+ 77 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0701.java

@@ -0,0 +1,77 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : THR0701
+ * @Description : 首次主治医师查房中鉴别诊断跟首程一致
+ * @Author : 胡敬
+ * @Date: 2020-04-20 16:38
+ */
+@Component
+public class THR0701 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getThreeLevelWardDocs().size() == 0 || inputInfo.getFirstCourseRecordDoc() == null) {
+            status.set("0");
+        }
+        List<AttendingDoctorWardDoc> attendDocs = inputInfo.getThreeLevelWardDocs().get(0).getAttendingDoctorWardDocs();
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        String firstCourseDiffDiag = getDiffDiag(firstCourseRecordDoc);
+        if (StringUtil.isBlank(firstCourseDiffDiag)) {
+            return;
+        }
+        if (attendDocs.size() > 0) {
+            AttendingDoctorWardDoc firstAttendDoc = attendDocs.get(0);
+            ThreeLevelWardLabel firstAttendLabel = firstAttendDoc.getThreeLevelWardLabel();
+            if (firstAttendLabel == null) {
+                return;
+            }
+            if (firstAttendLabel.getDiffDiag().size() != 0) {
+                for (Diag diffDiag : firstAttendLabel.getDiffDiag()) {
+                    String diffDiagName = diffDiag.getHospitalDiagName();
+                    if (StringUtil.isBlank(diffDiagName)) {
+                        continue;
+                    }
+                    if (firstCourseDiffDiag.equals(diffDiagName)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+
+            }
+            if (StringUtil.isNotBlank(firstAttendLabel.getDiffDiagText())) {
+                if (firstAttendLabel.getDiffDiagText().equals(firstCourseDiffDiag)) {
+                    status.set("0");
+                }
+            }
+        }
+    }
+
+    /**
+     * 获取首程鉴别诊断
+     *
+     * @param firstCourseRecordDoc
+     * @return
+     */
+    private String getDiffDiag(FirstCourseRecordDoc firstCourseRecordDoc) {
+        String diffDiag = "";
+        DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();
+        if (StringUtil.isNotBlank(firstCourseRecordDoc.getStructureMap().get("鉴别诊断"))) {
+            diffDiag = firstCourseRecordDoc.getStructureMap().get("鉴别诊断");
+        } else if (differentialDiagLabel != null && StringUtil.isNotBlank(differentialDiagLabel.getText())) {
+            diffDiag = differentialDiagLabel.getText();
+        }
+        return diffDiag;
+    }
+}

+ 78 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0702.java

@@ -0,0 +1,78 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.model.doc.ward.DirectorDoctorWardDoc;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : THR0701
+ * @Description : 首次主任医师查房中鉴别诊断跟首程一致
+ * @Author : 胡敬
+ * @Date: 2020-04-20 16:38
+ */
+@Component
+public class THR0702 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getThreeLevelWardDocs().size() == 0 || inputInfo.getFirstCourseRecordDoc() == null) {
+            status.set("0");
+        }
+        List<DirectorDoctorWardDoc> directorDocs = inputInfo.getThreeLevelWardDocs().get(0).getDirectorDoctorWardDocs();
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        String firstCourseDiffDiag = getDiffDiag(firstCourseRecordDoc);
+        if (StringUtil.isBlank(firstCourseDiffDiag)) {
+            return;
+        }
+        if (directorDocs.size() > 0) {
+            DirectorDoctorWardDoc firstDirectorDoc = directorDocs.get(0);
+            ThreeLevelWardLabel firstAttendLabel = firstDirectorDoc.getThreeLevelWardLabel();
+            if (firstAttendLabel == null) {
+                return;
+            }
+            if (firstAttendLabel.getDiffDiag().size() != 0) {
+                for (Diag diffDiag : firstAttendLabel.getDiffDiag()) {
+                    String diffDiagName = diffDiag.getHospitalDiagName();
+                    if (StringUtil.isBlank(diffDiagName)) {
+                        continue;
+                    }
+                    if (firstCourseDiffDiag.equals(diffDiagName)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+
+            }
+            if (StringUtil.isNotBlank(firstAttendLabel.getDiffDiagText())) {
+                if (firstAttendLabel.getDiffDiagText().equals(firstCourseDiffDiag)) {
+                    status.set("0");
+                }
+            }
+        }
+    }
+
+    /**
+     * 获取首程鉴别诊断
+     *
+     * @param firstCourseRecordDoc
+     * @return
+     */
+    private String getDiffDiag(FirstCourseRecordDoc firstCourseRecordDoc) {
+        String diffDiag = "";
+        DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();
+        if (StringUtil.isNotBlank(firstCourseRecordDoc.getStructureMap().get("鉴别诊断"))) {
+            diffDiag = firstCourseRecordDoc.getStructureMap().get("鉴别诊断");
+        } else if (differentialDiagLabel != null && StringUtil.isNotBlank(differentialDiagLabel.getText())) {
+            diffDiag = differentialDiagLabel.getText();
+        }
+        return diffDiag;
+    }
+}