|
@@ -3,7 +3,9 @@ package com.lantone.qc.kernel.catalogue.operationdiscussion;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.ParseException;
|
|
@@ -27,6 +29,8 @@ public class OPE0370 extends QCCatalogue {
|
|
|
// boolean isOperativePatient = CatalogueUtil.isOperativePatients(doctorAdviceDocs);
|
|
|
boolean isOperativePatient = true;//是手术患者(暂时默认是)
|
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
+
|
|
|
+ boolean emergencyOperation = findEmergencyOperation(inputInfo);
|
|
|
if (operationDocs == null || operationDocs.size() < 1) {
|
|
|
return;
|
|
|
}
|
|
@@ -39,6 +43,14 @@ public class OPE0370 extends QCCatalogue {
|
|
|
j++;
|
|
|
}
|
|
|
}
|
|
|
+ /* 如果首次病程录的诊疗计划里有急诊手术,则手术记录的数量减一 */
|
|
|
+ if (emergencyOperation) {
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ if (i < 0) {
|
|
|
+ i = 0;
|
|
|
+ }
|
|
|
+ /* 手术记录数量和术前小结数量不一致则报错 */
|
|
|
if (i != j) {
|
|
|
status.set("-1");
|
|
|
info.set("手术记录不一致");
|
|
@@ -54,4 +66,16 @@ public class OPE0370 extends QCCatalogue {
|
|
|
// return;
|
|
|
// }
|
|
|
}
|
|
|
+
|
|
|
+ private boolean findEmergencyOperation(InputInfo inputInfo) {
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
+ if (firstCourseRecordDoc != null) {
|
|
|
+ String treatPlan = firstCourseRecordDoc.getStructureMap().get("诊疗计划");
|
|
|
+ if (StringUtil.isNotBlank(treatPlan)) {
|
|
|
+ String regex = ".*急诊.*术.*";
|
|
|
+ return treatPlan.matches(regex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|