|
@@ -1,6 +1,7 @@
|
|
package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
|
|
package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
|
|
|
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
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.InputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
@@ -31,19 +32,17 @@ public class DUT0296 extends QCCatalogue {
|
|
if (leaveHospitalDoc == null) {
|
|
if (leaveHospitalDoc == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ List<StagesSummaryDoc> stagesSummaryDocs = inputInfo.getStagesSummaryDocs();
|
|
|
|
+ TransferRecordDoc transferRecordDoc = inputInfo.getTransferRecordDocs();//转科记录
|
|
|
|
+
|
|
Map<String, String> structureMap_leave = leaveHospitalDoc.getStructureMap();
|
|
Map<String, String> structureMap_leave = leaveHospitalDoc.getStructureMap();
|
|
String beDate = structureMap_leave.get("入院时间"); //2019-12-07 08:48
|
|
String beDate = structureMap_leave.get("入院时间"); //2019-12-07 08:48
|
|
String leaveDate = structureMap_leave.get("出院时间");//2019-12-10 10:49
|
|
String leaveDate = structureMap_leave.get("出院时间");//2019-12-10 10:49
|
|
- if (StringUtil.isBlank(beDate) || StringUtil.isBlank(leaveDate)) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- List<StagesSummaryDoc> stagesSummaryDocs = inputInfo.getStagesSummaryDocs();
|
|
|
|
-
|
|
|
|
- TransferRecordDoc transferRecordDoc = inputInfo.getTransferRecordDocs();//转科记录
|
|
|
|
if (transferRecordDoc != null) {
|
|
if (transferRecordDoc != null) {
|
|
List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
|
|
List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
|
|
String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
|
|
String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
|
|
- if (StringUtil.isNotBlank(firstOutRecordDate)) {
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(firstOutRecordDate) && StringUtil.isNotBlank(beDate)) {
|
|
//入院时间到第一次转出时间,大于30天则报错
|
|
//入院时间到第一次转出时间,大于30天则报错
|
|
int dateDifference = dateDifference(beDate, firstOutRecordDate);
|
|
int dateDifference = dateDifference(beDate, firstOutRecordDate);
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
@@ -52,7 +51,7 @@ public class DUT0296 extends QCCatalogue {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String lastInrecordDate = getLastInrecordDate(allTransferDocs);
|
|
String lastInrecordDate = getLastInrecordDate(allTransferDocs);
|
|
- if (StringUtil.isNotBlank(lastInrecordDate)) {
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(lastInrecordDate) && StringUtil.isNotBlank(leaveDate)) {
|
|
//最后一次转入时间到出院时间,大于30天则报错
|
|
//最后一次转入时间到出院时间,大于30天则报错
|
|
int dateDifference = dateDifference(lastInrecordDate, leaveDate);
|
|
int dateDifference = dateDifference(lastInrecordDate, leaveDate);
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
@@ -71,11 +70,35 @@ public class DUT0296 extends QCCatalogue {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//没有转科记录,直接入院时间和出院时间比
|
|
//没有转科记录,直接入院时间和出院时间比
|
|
- int dateDifference = dateDifference(beDate, leaveDate);
|
|
|
|
- if (dateDifference >= 31 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
|
|
- status.set("-1");
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(beDate) && StringUtil.isNotBlank(leaveDate)) {
|
|
|
|
+ int dateDifference = dateDifference(beDate, leaveDate);
|
|
|
|
+ if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ }
|
|
|
|
+ if (!checkDays(stagesSummaryDocs, dateDifference)) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ String lengthOfStay = structureMap_leave.get("住院天数");
|
|
|
|
+ if (StringUtil.isNotBlank(lengthOfStay)) {
|
|
|
|
+ int lengthOfStayNum = onlyNum(lengthOfStay);
|
|
|
|
+ if (!checkDays(stagesSummaryDocs, lengthOfStayNum)) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean checkDays(List<StagesSummaryDoc> stagesSummaryDocs, int dateDifference) {
|
|
|
|
+ if (stagesSummaryDocs != null && stagesSummaryDocs.size() > 0) {
|
|
|
|
+ double sum = Math.floor(dateDifference / 30);
|
|
|
|
+ return sum == stagesSummaryDocs.size();
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -159,4 +182,8 @@ public class DUT0296 extends QCCatalogue {
|
|
}
|
|
}
|
|
return day;
|
|
return day;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private int onlyNum (String str){
|
|
|
|
+ return Integer.parseInt(str.replaceAll("[^0-9]",""));
|
|
|
|
+ }
|
|
}
|
|
}
|