|
@@ -4,12 +4,15 @@ 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.DoctorAdviceDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* @Description: 手术患者无手术记录
|
|
@@ -22,20 +25,34 @@ public class OPE0322 extends QCCatalogue {
|
|
|
@Override
|
|
|
protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
|
|
|
status.set("0");
|
|
|
+ long cou = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationRecordDoc).filter(Objects::nonNull).count();
|
|
|
//先判断医嘱里有无手术
|
|
|
List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
if (doctorAdviceDocs.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
- long cou = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationRecordDoc).filter(Objects::nonNull).count();
|
|
|
+ // 判断查房记录中是否有患者拒绝手术的内容
|
|
|
+ List<ThreeLevelWardDoc> wardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
+ boolean isRefused = wardDocs.stream()
|
|
|
+ .map(doc -> doc.getStructureMap().get("病情记录"))
|
|
|
+ .filter(Objects::nonNull) // 过滤掉空的记录内容
|
|
|
+ .anyMatch(content -> {
|
|
|
+ Pattern pattern = Pattern.compile("建议患者手术.*拒绝|拒绝.*建议患者手术");
|
|
|
+ Matcher matcher = pattern.matcher(content);
|
|
|
+ return matcher.find();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (DoctorAdviceDoc dad : doctorAdviceDocs) {
|
|
|
String name = dad.getStructureMap().get("医嘱项目名称");
|
|
|
if (name.contains("非手术") || name.contains("手术室") || (name.contains("手术") && name.contains("取消")) || (name.contains("暂停") && name.contains("手术")) || name.contains("静脉穿刺置管术") || name.startsWith("停") || name.contains("前一次")
|
|
|
|| name.contains("特殊病人手术使用一次性卫生材料")) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (name.contains("手术") && cou == 0) {
|
|
|
+ if (!isRefused && name.contains("手术") && cou == 0) {
|
|
|
status.set("-1");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
/*long cou = inputInfo.getOperationDocs().stream().map(i -> i.getOperationRecordDoc()).filter(i -> i != null).count();
|