wangfeng 5 år sedan
förälder
incheckning
ab97aa6d81

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT03009.java

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
+
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description: 转出记录无患方签名
+ * @date 2020-06-30 13:29
+ */
+@Component
+public class DUT03009 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        TransferRecordDoc transferRecordDoc = inputInfo.getTransferRecordDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (transferRecordDoc == null || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        List<TransferOutDoc> transferOutDocs = transferRecordDoc.getTransferOutDocs();
+        if(transferOutDocs!=null&& ListUtil.isNotEmpty(transferOutDocs)){
+            for(TransferOutDoc ts :transferOutDocs){
+                Map<String, String> structureMap = ts.getStructureMap();
+                if(structureMap!=null){
+                    String patients = structureMap.get("患者签字");
+                    if(patients==null||patients.equals("")){
+                        status.set("-1");
+                        return;
+                    }
+                }
+
+            }
+        }
+    }
+
+}

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02993.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -30,9 +31,9 @@ public class FIRP02993 extends QCCatalogue {
                 List<String> nameberList = new ArrayList<String>();
                 for (OperationDoc operationDoc : operationDocs
                 ) {
-                    OperationDiscussionDoc operationDiscussionDoc = operationDoc.getOperationDiscussionDoc();//手术名称
-                    if(operationDiscussionDoc!=null){
-                        String s = ClearBracketUtil.ClearBracket(operationDiscussionDoc.getStructureMap().get(Content.operative_name));
+                    OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();//手术名称
+                    if(operationRecordDoc!=null){
+                        String s = ClearBracketUtil.ClearBracket(operationRecordDoc.getStructureMap().get(Content.operative_name));
                         String[] digitalSplit = s.split("[\\+|,|、|,]");
                         for (int i = 0; i < digitalSplit.length; i++) {
                             if (!digitalSplit[i].equals("")) {

+ 102 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0587.java

@@ -0,0 +1,102 @@
+package com.lantone.qc.kernel.catalogue.operationdiscussion;
+
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description: 术后没有连续记录3天
+ * @date 2020-07-01 10:31
+ */
+@Component
+public class OPE0587 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
+        if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        if (inputInfo.getMedicalRecordInfoDoc() == null || inputInfo.getMedicalRecordInfoDoc().getStructureMap().size() == 0) {
+            return;
+        }
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        //取出所有查房时间
+        List<String> roundsDate = new ArrayList<>();
+        for (ThreeLevelWardDoc t : threeLevelWardDocs) {
+            Date threeLevelDate = StringUtil.parseDateTime(t.getStructureMap().get("查房日期"));
+            roundsDate.add(formatter.format(threeLevelDate));
+        }
+
+        //取出出院时间
+        Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        String leaveHospitalDate = structureMaps.get("出院时间") == null ? null : structureMaps.get("出院时间");
+        Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
+        //没有出院时间, 直接退出
+        if (leaveHospitalDate != null) {
+        //取出病程信息里的手术信息的所有 手术日期
+        List<String> operDateList = new ArrayList<>();
+        for (OperationDoc opera : operationDocs) {
+            OperationRecordDoc operationRecordDoc = opera.getOperationRecordDoc();
+            String operDate = operationRecordDoc.getStructureMap().get("手术日期");
+            if (StringUtil.isNotBlank(operDate)) {
+                operDateList.add(operDate);
+            }
+        }
+        if (operDateList.size() > 0) {
+            for (String operDates : operDateList) {
+                Date oper = StringUtil.parseDateTime(operDates);
+                //手术时间 减去 出院时间
+                long day = (leaveDate.getTime() - oper.getTime()) / (24 * 60 * 60 * 1000);
+                //时间大于三天才能判断有没有连续三天查房
+                if (day > 3) {
+                    List<String> operDatesNew = new ArrayList<>();
+                    //用手术时间加三天
+                    for (int i = 1; i < 4; i++) {
+                        Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(oper, i));
+                        operDatesNew.add(formatter.format(firstTimeOfDay));
+                    }
+                    if (roundsDate.size() > 2) {//查房日期取出没有3天时间, 直接报错
+                        //去重
+                        List<String> listTemp = new ArrayList<String>();
+                        for (int i = 0; i < roundsDate.size(); i++) {
+                            if (!listTemp.contains(roundsDate.get(i))) {
+                                listTemp.add(roundsDate.get(i));
+                            }
+                        }
+                        int i = 0;
+                        //循环两个时间List,
+                        for (String str : operDatesNew) {
+                            for (String s : listTemp) {
+                                if (str.equals(s)) {
+                                    i++;
+                                }
+                            }
+                        }
+                        if (i < 3) {
+                            status.set("-1");
+                        }
+                    } else {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+    }
+}

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

@@ -3,6 +3,7 @@ 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.FirstPageRecordDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -26,9 +27,14 @@ public class THR03010 extends QCCatalogue {
         if (inputInfo.getMedicalRecordInfoDoc() == null || inputInfo.getMedicalRecordInfoDoc().getStructureMap().size() == 0) {
             return;
         }
+        if (inputInfo.getFirstPageRecordDoc() == null || inputInfo.getFirstPageRecordDoc().getStructureMap().size() == 0) {
+            return;
+        }
         Map<String, String> structureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
         String behospitalDate = structureMap.get("behospitalDate") == null ? null : structureMap.get("behospitalDate");
-        String leaveHospitalDate = structureMap.get("leaveHospitalDate") == null ? null : structureMap.get("leaveHospitalDate");
+        //String leaveHospitalDate = structureMap.get("leaveHospitalDate") == null ? null : structureMap.get("leaveHospitalDate");
+        Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        String leaveHospitalDate = structureMaps.get("出院时间")== null ? null : structureMap.get("leaveHospitalDate");
         if (behospitalDate != null && leaveHospitalDate != null) {
             Date beDate = StringUtil.parseDateTime(behospitalDate);
             Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);