|
@@ -1,7 +1,6 @@
|
|
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;
|
|
@@ -39,6 +38,20 @@ public class DUT0296 extends QCCatalogue {
|
|
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
|
|
|
|
+ /* 住院天数小于30天不报错*/
|
|
|
|
+ int lengthOfStayNum = 0;
|
|
|
|
+ if (StringUtil.isNotBlank(beDate) || StringUtil.isNotBlank(leaveDate)) {
|
|
|
|
+ lengthOfStayNum = dateDifference(beDate, leaveDate);
|
|
|
|
+ if (lengthOfStayNum < 30) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ lengthOfStayNum = getLengthOfStay(structureMap_leave);
|
|
|
|
+ if (lengthOfStayNum < 30) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
if (transferRecordDoc != null) {
|
|
if (transferRecordDoc != null) {
|
|
List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
|
|
List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
|
|
String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
|
|
String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
|
|
@@ -75,30 +88,35 @@ public class DUT0296 extends QCCatalogue {
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
}
|
|
}
|
|
- if (!checkDays(stagesSummaryDocs, dateDifference)) {
|
|
|
|
|
|
+ if (checkDays(stagesSummaryDocs, dateDifference)) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- String lengthOfStay = structureMap_leave.get("住院天数");
|
|
|
|
- if (StringUtil.isNotBlank(lengthOfStay)) {
|
|
|
|
- int lengthOfStayNum = onlyNum(lengthOfStay);
|
|
|
|
- if (!checkDays(stagesSummaryDocs, lengthOfStayNum)) {
|
|
|
|
- status.set("-1");
|
|
|
|
- }
|
|
|
|
|
|
+ int lengthOfStay = getLengthOfStay(structureMap_leave);
|
|
|
|
+ if (checkDays(stagesSummaryDocs, lengthOfStay)) {
|
|
|
|
+ status.set("-1");
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private int getLengthOfStay(Map<String, String> structureMap_leave) {
|
|
|
|
+ int lengthOfStayNum = 0;
|
|
|
|
+ String lengthOfStay = structureMap_leave.get("住院天数");
|
|
|
|
+ if (StringUtil.isNotBlank(lengthOfStay)) {
|
|
|
|
+ lengthOfStayNum = onlyNum(lengthOfStay);
|
|
|
|
+ }
|
|
|
|
+ return lengthOfStayNum;
|
|
|
|
+ }
|
|
|
|
+
|
|
private boolean checkDays(List<StagesSummaryDoc> stagesSummaryDocs, int dateDifference) {
|
|
private boolean checkDays(List<StagesSummaryDoc> stagesSummaryDocs, int dateDifference) {
|
|
if (stagesSummaryDocs != null && stagesSummaryDocs.size() > 0) {
|
|
if (stagesSummaryDocs != null && stagesSummaryDocs.size() > 0) {
|
|
double sum = Math.floor(dateDifference / 30);
|
|
double sum = Math.floor(dateDifference / 30);
|
|
- return sum == stagesSummaryDocs.size();
|
|
|
|
|
|
+ return sum != stagesSummaryDocs.size();
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -183,7 +201,7 @@ public class DUT0296 extends QCCatalogue {
|
|
return day;
|
|
return day;
|
|
}
|
|
}
|
|
|
|
|
|
- private int onlyNum (String str){
|
|
|
|
- return Integer.parseInt(str.replaceAll("[^0-9]",""));
|
|
|
|
|
|
+ private int onlyNum(String str) {
|
|
|
|
+ return Integer.parseInt(str.replaceAll("[^0-9]", ""));
|
|
}
|
|
}
|
|
}
|
|
}
|