|
@@ -6,11 +6,16 @@ import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
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.OperationDoc;
|
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 手术患者无术前讨论记录
|
|
* @Description: 手术患者无术前讨论记录
|
|
@@ -35,11 +40,8 @@ public class PRE0328 extends QCCatalogue {
|
|
boolean emergencyOperation = findEmergencyOperation(inputInfo);
|
|
boolean emergencyOperation = findEmergencyOperation(inputInfo);
|
|
boolean emergencyOperationFromWardRecord = findEmergencyOperationFromWardRecord(inputInfo);
|
|
boolean emergencyOperationFromWardRecord = findEmergencyOperationFromWardRecord(inputInfo);
|
|
|
|
|
|
- int i = 0, j = 0;
|
|
|
|
|
|
+ int i = getOperationSum(operationDocs), j = 0;
|
|
for (OperationDoc operationDoc : operationDocs) {
|
|
for (OperationDoc operationDoc : operationDocs) {
|
|
- if (operationDoc.getOperationRecordDoc() != null) {
|
|
|
|
- i++;
|
|
|
|
- }
|
|
|
|
if (operationDoc.getPreoperativeDiscussionDoc() != null) {
|
|
if (operationDoc.getPreoperativeDiscussionDoc() != null) {
|
|
j++;
|
|
j++;
|
|
}
|
|
}
|
|
@@ -86,4 +88,58 @@ public class PRE0328 extends QCCatalogue {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取手术记录次数
|
|
|
|
+ * @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("手术开始时间");
|
|
|
|
+ String operationEndDateStr = structureMap.get("手术结束时间");
|
|
|
|
+ if (StringUtil.isNotBlank(operationStartDateStr) && StringUtil.isNotBlank(operationEndDateStr)) {
|
|
|
|
+ Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
|
|
|
|
+ Date operationEndDate = StringUtil.parseDateTime(operationEndDateStr);
|
|
|
|
+ if (operationStartDate != null && operationEndDate != null) {
|
|
|
|
+ /* 放第一个手术记录的时间到operationDateList */
|
|
|
|
+ if (operationDateList.size() == 0) {
|
|
|
|
+ operationDate = new HashMap<>();
|
|
|
|
+ operationDate.put("手术开始时间", operationStartDate);
|
|
|
|
+ operationDate.put("手术结束时间", operationEndDate);
|
|
|
|
+ operationDateList.add(operationDate);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ /* 如果其中一个手术记录的开始时间到结束时间之间还包含另一个手术,就不往operationDateList里加 */
|
|
|
|
+ boolean findInnerOperation = false;
|
|
|
|
+ for (Map<String, Date> date : operationDateList) {
|
|
|
|
+ Date listStartDate = date.get("手术开始时间");
|
|
|
|
+ Date listEndDate = date.get("手术结束时间");
|
|
|
|
+ if (operationStartDate.before(listStartDate) && listEndDate.before(operationEndDate)){
|
|
|
|
+ date.put("手术开始时间", operationStartDate);
|
|
|
|
+ date.put("手术结束时间", operationEndDate);
|
|
|
|
+ }
|
|
|
|
+ if (listStartDate.before(operationStartDate) && operationEndDate.before(listEndDate)) {
|
|
|
|
+ findInnerOperation = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!findInnerOperation) {
|
|
|
|
+ operationDate = new HashMap<>();
|
|
|
|
+ operationDate.put("手术开始时间", operationStartDate);
|
|
|
|
+ operationDate.put("手术结束时间", operationEndDate);
|
|
|
|
+ operationDateList.add(operationDate);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return operationDateList.size();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|