|
@@ -7,6 +7,8 @@ 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.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;
|
|
@@ -40,7 +42,8 @@ public class OPE0369 extends QCCatalogue {
|
|
|
return;
|
|
|
}
|
|
|
List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
- long operationCount = operationDocs.stream().filter(operationDoc -> operationDoc.getOperationRecordDoc() != null).count();
|
|
|
+ int operationCount = getOperationSum(operationDocs); // 获取手术记录次数
|
|
|
+// long operationCount = operationDocs.stream().filter(operationDoc -> operationDoc.getOperationRecordDoc() != null).count();
|
|
|
//主刀查房次数
|
|
|
long operateCount = 0;
|
|
|
if (operationCount > 0) {
|
|
@@ -107,9 +110,57 @@ public class OPE0369 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (operationCount > operateCount) {
|
|
|
+ if (operationCount > 0 && operationCount > operateCount) {
|
|
|
status.set("-1");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取手术记录次数
|
|
|
+ *
|
|
|
+ * @param operationDocs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private int getOperationSum(List<OperationDoc> operationDocs) {
|
|
|
+ List<Map<String, Date>> operationDateList = new ArrayList<>();
|
|
|
+ Map<String, Date> operationDate = null;
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if (operationRecordDoc == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, String> structureMap = operationRecordDoc.getStructureMap();
|
|
|
+ String operationStartDateStr = structureMap.get("手术开始时间");
|
|
|
+ if (StringUtil.isNotBlank(operationStartDateStr) && !operationStartDateStr.contains("年月日")) {
|
|
|
+ Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
|
|
|
+ operationStartDate = DateUtil.dateZeroClear(operationStartDate);
|
|
|
+ if (operationStartDate != null) {
|
|
|
+ /* 放第一个手术记录的日期到operationDateList */
|
|
|
+ if (operationDateList.size() == 0) {
|
|
|
+ operationDate = new HashMap<>();
|
|
|
+ operationDate.put("手术开始时间", operationStartDate);
|
|
|
+ operationDateList.add(operationDate);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ /* 如果其中一个手术记录的开始时间到结束时间之间还包含另一个手术,就不往operationDateList里加 */
|
|
|
+ boolean findInnerOperation = false;
|
|
|
+ for (Map<String, Date> date : operationDateList) {
|
|
|
+ Date listStartDate = DateUtil.dateZeroClear(date.get("手术开始时间"));
|
|
|
+ if (listStartDate.equals(operationStartDate)) {
|
|
|
+ findInnerOperation = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!findInnerOperation) {
|
|
|
+ operationDate = new HashMap<>();
|
|
|
+ operationDate.put("手术开始时间", operationStartDate);
|
|
|
+ operationDateList.add(operationDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return operationDateList.size();
|
|
|
+ }
|
|
|
}
|