|
@@ -4,8 +4,10 @@ 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.MedicalRecordInfoDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+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;
|
|
@@ -24,6 +26,16 @@ public class OPE0369 extends QCCatalogue {
|
|
|
@Override
|
|
|
protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
|
|
|
status.set("0");
|
|
|
+ MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
|
|
|
+ String admisTime = "";
|
|
|
+ if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
|
|
|
+ //入院日期
|
|
|
+ admisTime = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
|
|
|
+ if (CatalogueUtil.isEmpty(admisTime)) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
//先判断是否有手术记录
|
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
if (operationDocs == null || operationDocs.size() == 0) {
|
|
@@ -39,7 +51,6 @@ public class OPE0369 extends QCCatalogue {
|
|
|
status.set("-1");
|
|
|
return;
|
|
|
}
|
|
|
-// Map<Date, String> operationDateNameMap = Maps.newLinkedHashMap();
|
|
|
String operationStartDate = "";
|
|
|
List<Date> operDateList = new ArrayList<>();
|
|
|
for (OperationDoc operationDoc : operationDocs) {
|
|
@@ -47,20 +58,16 @@ public class OPE0369 extends QCCatalogue {
|
|
|
Map<String, String> operationDocStructureMap = operationDoc.getOperationRecordDoc().getStructureMap();
|
|
|
operationStartDate = operationDocStructureMap.get("手术开始时间");
|
|
|
if (StringUtil.isNotBlank(operationStartDate)) {
|
|
|
- operDateList.add(StringUtil.parseDateTime(operationStartDate));
|
|
|
+ if (!CatalogueUtil.compareTime(
|
|
|
+ StringUtil.parseDateTime(admisTime),
|
|
|
+ StringUtil.parseDateTime(operationStartDate),
|
|
|
+ Long.valueOf(30))) {
|
|
|
+ operDateList.add(StringUtil.parseDateTime(operationStartDate));
|
|
|
+ }
|
|
|
}
|
|
|
-// String operatorName = operationDocStructureMap.get("主刀医师");
|
|
|
-// if (StringUtil.isBlank(operatorName) && StringUtil.isNotBlank(operationDocStructureMap.get("手术者及助手名称"))) {
|
|
|
-// operatorName = operationDocStructureMap.get("手术者及助手名称").split("、")[0];
|
|
|
-// if (operatorName.contains("主刀:") && operatorName.split(":").length > 1) {
|
|
|
-// operatorName = operatorName.split(":")[1];
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (StringUtil.isNotBlank(operationStartDate) && StringUtil.isNotBlank(operatorName)) {
|
|
|
-// operationDateNameMap.put(StringUtil.parseDateTime(operationStartDate), operatorName);
|
|
|
-// }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (operDateList.size() > 1) {
|
|
|
for (int i = 0; i < operDateList.size(); i++) {
|
|
|
if (CatalogueUtil.compareTime(operDateList.get(i), operDateList.get(i + 1),
|
|
@@ -75,15 +82,19 @@ public class OPE0369 extends QCCatalogue {
|
|
|
for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
|
|
|
Map<String, String> structureMap = threeLevelWard.getStructureMap();
|
|
|
String makeTitle = structureMap.get("查房标题");
|
|
|
- if (makeTitle.contains("术前") && makeTitle.contains("主刀")) {
|
|
|
- operateCount++;
|
|
|
- }
|
|
|
- if (operateCount == 0 && makeTitle.contains("主刀")) {
|
|
|
- String recordDateStr = structureMap.get("查房日期");
|
|
|
- if (StringUtil.isNotBlank(recordDateStr) && StringUtil.isNotBlank(operationStartDate) &&
|
|
|
- StringUtil.parseDateTime(recordDateStr).before(StringUtil.parseDateTime(operationStartDate))) {
|
|
|
- operateCount++;
|
|
|
+ String recordDateStr = structureMap.get("查房日期");
|
|
|
+ if (operDateList.size() > 0) {
|
|
|
+ for (Date date : operDateList) {
|
|
|
+ if (StringUtil.isNotBlank(recordDateStr) && date != null
|
|
|
+ && StringUtil.parseDateTime(recordDateStr).before(date)) {
|
|
|
+ if (CatalogueUtil.compareTime(StringUtil.parseDateTime(recordDateStr), date, Long.valueOf(24 * 60))
|
|
|
+ && makeTitle.contains("主刀")) {
|
|
|
+ operateCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {//手术开始时间跟入院时间 小于30分钟,规则不判断
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|