Browse Source

Merge branch 'dev-shaoyf' of http://192.168.2.236:10080/louhr/qc into dev-shaoyf

louhr 5 năm trước cách đây
mục cha
commit
6a0e446a52

+ 52 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR03034.java

@@ -0,0 +1,52 @@
+package com.lantone.qc.kernel.catalogue.deathrecord;
+
+import com.lantone.qc.dbanaly.util.KernelConstants;
+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.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : DEAR0338
+ * @Description : 死亡记录无副主任医师审核签名
+ * @Author : 胡敬
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class DEAR03034 extends QCCatalogue {
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getDeathRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> deathRecordStructure = inputInfo.getDeathRecordDoc().getStructureMap();
+        String recordDoctor = deathRecordStructure.get("审核人");
+        if (StringUtil.isNotBlank(recordDoctor)) {
+            if (findDirectorDoctor(recordDoctor)) {
+                status.set("0");
+            }
+        }
+    }
+
+    private boolean findDirectorDoctor(String recordDoctor) {
+        Map<String, Map<String, Object>> hospitalDoctorMap = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        if (hospitalDoctorMap == null) {
+            return false;
+        }
+        if (hospitalDoctorMap.containsKey(recordDoctor)) {
+            Object professor = hospitalDoctorMap.get(recordDoctor).get("professor");
+            if (professor != null) {
+                return professor.toString().contains("主任");
+            }
+        }
+        return false;
+    }
+}

+ 83 - 57
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0256.java

@@ -5,16 +5,10 @@ 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.model.entity.BetterFinding;
-import com.lantone.qc.pub.model.entity.OutcomeCure;
-import com.lantone.qc.pub.model.entity.OutcomeToBetter;
-import com.lantone.qc.pub.model.entity.PositiveFinding;
-import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
-import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -27,69 +21,101 @@ import java.util.Map;
 @Component
 public class FIRP0256 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        /**
+         * 1、转归情况“死亡”与死亡记录不匹配
+         * 2、病案首页【转归情况】与病案首页诊断信息第一个诊断的“入院情况”进行比对,如果不相同,报错
+         */
         status.set("0");
-        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
-                && inputInfo.getThreeLevelWardDocs().size() > 0
-                && inputInfo.getLeaveHospitalDoc() != null && inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel() != null
-                && inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel() != null) {
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String outcome = firstpageStructureMap.get(Content.outcome);    //病案首页转归情况
             if (CatalogueUtil.isEmpty(outcome)) {
                 return;
             }
-
-            List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
-            //最后一次主任查房记录、出院小结转归情况
-            List<BetterFinding> betterFindings = new ArrayList<>();//好转表现
-            List<OutcomeToBetter> outcomeToBetters = new ArrayList<>();//转归情况-好转
-            List<OutcomeCure> outcomeCures = new ArrayList<>();//转归情况-治愈
-            List<PositiveFinding> positiveFindings = new ArrayList<>();//阳性表现
-            for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel() == null) {
-                    List<ThreeLevelWardLabel> threeLevelWardLabels = threeLevelWardDoc.getThreeLevelWardLabel();
-                    for (ThreeLevelWardLabel threeLevelWardLabel : threeLevelWardLabels) {
-                        if (!threeLevelWardLabel.getTitle().contains("最后一次")) {
-                            continue;
-                        }
-                        betterFindings = threeLevelWardLabel.getBetterFindings();
-                        outcomeToBetters = threeLevelWardLabel.getOutcomeToBetters();
-                        outcomeCures = threeLevelWardLabel.getOutcomeCures();
-                        positiveFindings = threeLevelWardLabel.getPositiveFindings();
-                    }
-                }
-            }
-
-            //出院小结转归情况
-            LeaveHospitalLabel leaveHospitalLabel = inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel();
-            betterFindings.addAll(leaveHospitalLabel.getBetterFindings());
-            outcomeToBetters.addAll(leaveHospitalLabel.getOutcomeToBetters());
-            outcomeCures.addAll(leaveHospitalLabel.getOutcomeCures());
-            positiveFindings.addAll(leaveHospitalLabel.getPositiveFindings());
-
             //若出现死亡记录或死亡医嘱,则 转归情况 必须为 死亡。若未出现死亡记录或死亡医嘱,则 转归情况 必不为 死亡。
             if (inputInfo.getDeathRecordDoc() != null && !"死亡".equals(outcome)
                     || inputInfo.getDeathRecordDoc() == null && "死亡".equals(outcome)) {
                 status.set("-1");
                 return;
             }
-            //若出院小结或末次病程中明确记录转归情况 实体(转归情况-好转,转归情况-治愈,转归情况-未愈),则首页必须与其保持一致。
-            if (outcomeToBetters.size() > 0 && !"好转".equals(outcome)
-                    || outcomeCures.size() > 0 && !"治愈".equals(outcome)) {
-                status.set("-1");
-                return;
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return ;
+            }
+            // 取第一个诊断的出院情况
+            String firstDisInfo = dischargeDiag.get(0).get("出院情况");
+            if (StringUtil.isEmpty(firstDisInfo)) {
+                return ;
             }
-            //若出院小结或末次病程中没有明确记录转归情况
-            if (outcomeToBetters.size() == 0 && outcomeCures.size() == 0) {
-                //若末次病程中发现任一 阳性表现 实体,则转归情况必不为 治愈。
-                if (positiveFindings.size() > 0 && "治愈".equals(outcome)) {
-                    status.set("-1");
-                    return;
-                }
-                //若末次病程中没有发现 阳性表现 实体,且发现任一 好转表现,则转归情况必不为 未愈。
-                if (positiveFindings.size() == 0 && betterFindings.size() > 0 && "未愈".equals(outcome)) {
-                    status.set("-1");
-                }
+            if (!outcome.equals(firstDisInfo)) {
+                status.set("-1");
+                return ;
             }
         }
+
+        // if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
+        //         && inputInfo.getThreeLevelWardDocs().size() > 0
+        //         && inputInfo.getLeaveHospitalDoc() != null && inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel() != null
+        //         && inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel() != null) {
+        //     Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        //     String outcome = firstpageStructureMap.get(Content.outcome);    //病案首页转归情况
+        //     if (CatalogueUtil.isEmpty(outcome)) {
+        //         return;
+        //     }
+        //
+        //     List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        //     //最后一次主任查房记录、出院小结转归情况
+        //     List<BetterFinding> betterFindings = new ArrayList<>();//好转表现
+        //     List<OutcomeToBetter> outcomeToBetters = new ArrayList<>();//转归情况-好转
+        //     List<OutcomeCure> outcomeCures = new ArrayList<>();//转归情况-治愈
+        //     List<PositiveFinding> positiveFindings = new ArrayList<>();//阳性表现
+        //     for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+        //         if (threeLevelWardDoc.getThreeLevelWardLabel() == null) {
+        //             List<ThreeLevelWardLabel> threeLevelWardLabels = threeLevelWardDoc.getThreeLevelWardLabel();
+        //             for (ThreeLevelWardLabel threeLevelWardLabel : threeLevelWardLabels) {
+        //                 if (!threeLevelWardLabel.getTitle().contains("最后一次")) {
+        //                     continue;
+        //                 }
+        //                 betterFindings = threeLevelWardLabel.getBetterFindings();
+        //                 outcomeToBetters = threeLevelWardLabel.getOutcomeToBetters();
+        //                 outcomeCures = threeLevelWardLabel.getOutcomeCures();
+        //                 positiveFindings = threeLevelWardLabel.getPositiveFindings();
+        //             }
+        //         }
+        //     }
+        //
+        //     //出院小结转归情况
+        //     LeaveHospitalLabel leaveHospitalLabel = inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel();
+        //     betterFindings.addAll(leaveHospitalLabel.getBetterFindings());
+        //     outcomeToBetters.addAll(leaveHospitalLabel.getOutcomeToBetters());
+        //     outcomeCures.addAll(leaveHospitalLabel.getOutcomeCures());
+        //     positiveFindings.addAll(leaveHospitalLabel.getPositiveFindings());
+        //
+        //     //若出现死亡记录或死亡医嘱,则 转归情况 必须为 死亡。若未出现死亡记录或死亡医嘱,则 转归情况 必不为 死亡。
+        //     if (inputInfo.getDeathRecordDoc() != null && !"死亡".equals(outcome)
+        //             || inputInfo.getDeathRecordDoc() == null && "死亡".equals(outcome)) {
+        //         status.set("-1");
+        //         return;
+        //     }
+        //     //若出院小结或末次病程中明确记录转归情况 实体(转归情况-好转,转归情况-治愈,转归情况-未愈),则首页必须与其保持一致。
+        //     if (outcomeToBetters.size() > 0 && !"好转".equals(outcome)
+        //             || outcomeCures.size() > 0 && !"治愈".equals(outcome)) {
+        //         status.set("-1");
+        //         return;
+        //     }
+        //     //若出院小结或末次病程中没有明确记录转归情况
+        //     if (outcomeToBetters.size() == 0 && outcomeCures.size() == 0) {
+        //         //若末次病程中发现任一 阳性表现 实体,则转归情况必不为 治愈。
+        //         if (positiveFindings.size() > 0 && "治愈".equals(outcome)) {
+        //             status.set("-1");
+        //             return;
+        //         }
+        //         //若末次病程中没有发现 阳性表现 实体,且发现任一 好转表现,则转归情况必不为 未愈。
+        //         if (positiveFindings.size() == 0 && betterFindings.size() > 0 && "未愈".equals(outcome)) {
+        //             status.set("-1");
+        //         }
+        //     }
+        // }
     }
 }

+ 2 - 0
trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfDeathRecordDocTrans.java

@@ -6,6 +6,7 @@ import com.lantone.qc.pub.model.doc.DeathRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.shaoyf.util.ShaoyfOrdinaryAssistant;
 
 import java.util.List;
 import java.util.Map;
@@ -26,6 +27,7 @@ public class ShaoyfDeathRecordDocTrans extends ModelDocTrans {
         sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
         Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
 
+        ShaoyfOrdinaryAssistant.techTitleDocRemove(structureMap, "审核人");
         DeathRecordDoc deathRecordDoc = new DeathRecordDoc();
         deathRecordDoc.setStructureMap(structureMap);
         deathRecordDoc.setPageData((Map) structureMap);