|
@@ -0,0 +1,116 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.hospital.ningbozhenhai.threelevelward;
|
|
|
+
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
+import com.lantone.qc.pub.Content;
|
|
|
+import com.lantone.qc.pub.model.InputInfo;
|
|
|
+import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+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;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : THR02900
|
|
|
+ * @Description : 术后24小时内无主刀或一助查房记录
|
|
|
+ * @Author : 胡敬
|
|
|
+ * @Date: 2020-05-27 14:23
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class THR02900 extends QCCatalogue {
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status.set("0");
|
|
|
+ if (inputInfo.getOperationDocs().size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = new ArrayList<>();
|
|
|
+ if (inputInfo.getThreeLevelWardDocs() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
|
|
|
+ allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
|
|
|
+ }
|
|
|
+ //标题
|
|
|
+ String allTitle = "";
|
|
|
+ //病情记录
|
|
|
+ String allPathography = "";
|
|
|
+ String[] split = null;
|
|
|
+ //一助或助手
|
|
|
+ String firstAssistant = "";
|
|
|
+ //手术结束时间
|
|
|
+ String opeEndTime = "";
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if (operationRecordDoc == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, String> structureMap = operationRecordDoc.getStructureMap();
|
|
|
+ opeEndTime = structureMap.get("手术结束时间");
|
|
|
+ firstAssistant = structureMap.get("一助");
|
|
|
+ String chiefSurgeon = structureMap.get("主刀医师");
|
|
|
+ Date opeEndDate = CatalogueUtil.parseStringDate(opeEndTime);
|
|
|
+ if (opeEndDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!CatalogueUtil.compareTime(
|
|
|
+ StringUtil.parseDateTime(opeEndTime),
|
|
|
+ StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
+ Long.valueOf(24 * 60))) {//如果接收未超过6小时,规则不判断
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ if ((StringUtil.isNotEmpty(chiefSurgeon) || StringUtil.isNotEmpty(firstAssistant)) && ListUtil.isEmpty(allDoctorWradDocs)) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(allDoctorWradDocs)) {
|
|
|
+ for (ThreeLevelWardDoc wardDoc : allDoctorWradDocs) {
|
|
|
+ Map<String, String> wardStructureMap = wardDoc.getStructureMap();
|
|
|
+ String recordDateStr = wardStructureMap.get("查房日期");
|
|
|
+ String recordTitle = wardStructureMap.get("查房标题");
|
|
|
+ String writTitle = wardStructureMap.get("文书标题");
|
|
|
+ String pathography = wardStructureMap.get("病情记录");
|
|
|
+ Date recordDate = CatalogueUtil.parseStringDate(recordDateStr);
|
|
|
+ if (StringUtil.isBlank(recordTitle) || StringUtil.isBlank(pathography) || recordDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (opeEndDate.before(recordDate) && !CatalogueUtil.compareTime(opeEndDate, recordDate, 24 * 60L)) {
|
|
|
+ allTitle += recordTitle;
|
|
|
+ allPathography += pathography;
|
|
|
+ if (StringUtil.isNotBlank(writTitle)) {
|
|
|
+ allTitle += writTitle;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //查房标题中有主刀
|
|
|
+ if (allTitle.contains("主刀") || allTitle.contains("术后第一天") || allTitle.contains("术后第1天")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //病情记录对比
|
|
|
+ if ((StringUtil.isNotBlank(chiefSurgeon) && allPathography.contains(chiefSurgeon)) || allPathography.contains("术后第一天") || allPathography.contains("术后第1天") ||
|
|
|
+ (StringUtil.isNotBlank(firstAssistant) && allPathography.contains(firstAssistant))) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //查房标题对比
|
|
|
+ if (StringUtil.isNotBlank(chiefSurgeon) && !allTitle.contains(chiefSurgeon) &&
|
|
|
+ StringUtil.isNotBlank(firstAssistant) && !allTitle.contains(firstAssistant)) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ } else if (StringUtil.isBlank(chiefSurgeon) && StringUtil.isBlank(firstAssistant) && split.length > 1) {
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ if (allTitle.contains(split[i])) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|