|
@@ -0,0 +1,112 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.leavehospital;
|
|
|
+
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
+import com.lantone.qc.pub.model.InputInfo;
|
|
|
+import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.*;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 无出院记录
|
|
|
+ * @author: 胡敬
|
|
|
+ * @time: 2020/3/27 15:15
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class LEA0507 extends QCCatalogue {
|
|
|
+ /**
|
|
|
+ * 获取存在病案首页,或出院信息表,存在出院时间的病人。
|
|
|
+ * 判断是否是死亡病人,存在“死亡”医嘱,排除“死亡蛋白”医嘱;存在抢救记录并抢救文书内包含“死亡”;存在死亡记录;存在24小时内入院死亡记录;存在死亡病例讨论记录。上述情况任意一中存在不报
|
|
|
+ * 非死亡患者存在24小时内入出院记录,不报。
|
|
|
+ * 非死亡患者存在24小时内入出院记录,但入院时间和出院时间超过30小时,报出
|
|
|
+ * 以上情况均无,并无“出院记录/出院小结”报出。
|
|
|
+ *
|
|
|
+ * @param inputInfo
|
|
|
+ * @param outputInfo
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status.set("0");
|
|
|
+ FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
|
+ MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
|
|
|
+ String leaveHospitalDate = null;
|
|
|
+ if (medicalRecordInfoDoc != null) {
|
|
|
+ leaveHospitalDate = medicalRecordInfoDoc.getStructureMap().get("leaveHospitalDate");
|
|
|
+ }
|
|
|
+ if (firstPageRecordDoc == null || StringUtil.isEmpty(leaveHospitalDate)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //排除医嘱死亡
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
+ if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
|
|
|
+ for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
|
|
|
+ Map<String, String> structureMap = doctorAdviceDoc.getStructureMap();
|
|
|
+ String daItemName = structureMap.get("医嘱项目名称");
|
|
|
+ if (StringUtil.isEmpty(daItemName)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (daItemName.contains("死亡") && !daItemName.contains("死亡蛋白")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //排除抢救死亡
|
|
|
+ List<RescueDoc> rescueDocs = inputInfo.getRescueDocs();
|
|
|
+ if (ListUtil.isNotEmpty(rescueDocs)) {
|
|
|
+ for (RescueDoc rescueDoc : rescueDocs) {
|
|
|
+ Map<String, String> structureMap = rescueDoc.getStructureMap();
|
|
|
+ String rescueText = structureMap.get("抢救内容");
|
|
|
+ if (StringUtil.isEmpty(rescueText)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (rescueText.contains("死亡")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
|
|
|
+ if (deathRecordDoc != null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
+ if (beHospitalizedDoc != null) {
|
|
|
+ Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
|
|
|
+ String title = structureMap.get("文书名称");
|
|
|
+ if (title.equals("24小时内入院死亡记录")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DeathCaseDiscussDoc deathCaseDiscussDoc = inputInfo.getDeathCaseDiscussDoc();
|
|
|
+ if (deathCaseDiscussDoc != null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (beHospitalizedDoc != null) {
|
|
|
+ Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
|
|
|
+ String title = structureMap.get("文书名称");
|
|
|
+ if (title.equals("24小时内入出院记录")) {
|
|
|
+ Map<String, String> pageMap = firstPageRecordDoc.getStructureMap();
|
|
|
+ String outDate = pageMap.get("出院时间");
|
|
|
+ String inDate = pageMap.get("入院时间");
|
|
|
+ Date infusionEndDate = StringUtil.parseDateTime(inDate);
|
|
|
+ Date recordDate = StringUtil.parseDateTime(outDate);
|
|
|
+ if (CatalogueUtil.compareTime(infusionEndDate, recordDate, 30 * 60L)) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
|
|
|
+ if(leaveHospitalDate==null){
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|