|
@@ -0,0 +1,129 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.hospital.yiwu.doctorsadvice;
|
|
|
+
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+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.DoctorAdviceDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.LisDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : ADVI03254
|
|
|
+ * @Description : 子宫内膜息肉 医嘱无病理相关医嘱
|
|
|
+ * @Author : liuxb
|
|
|
+ */
|
|
|
+@Component
|
|
|
+@Slf4j
|
|
|
+public class ADVI03254 extends QCCatalogue {
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status.set("0");
|
|
|
+
|
|
|
+ Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ List<Map<String, String>> outpatientEmergencyDiagList = (List) firstpageStructureMap.get(Content.outpatientEmergencyDiag);
|
|
|
+ if (ListUtil.isEmpty(outpatientEmergencyDiagList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<String> firstpageDischargeDiag = getFirstpageDischargeDiag(outpatientEmergencyDiagList);
|
|
|
+ boolean matched = false;
|
|
|
+ for (String temp : firstpageDischargeDiag) {
|
|
|
+ if (temp.matches(".*(子宫内膜息肉|子宫息肉|宫腔息肉|子宫内膜赘生物).*")) {
|
|
|
+ matched = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!matched) {
|
|
|
+ log.info("非子宫内膜息肉疾病");
|
|
|
+ status.set("1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //病案首页确诊
|
|
|
+ matched = false;
|
|
|
+ List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
+ if (operationDocs == null || operationDocs.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (OperationDoc temp : operationDocs) {
|
|
|
+ if (temp == null || StringUtil.isEmpty(temp.getOperationName())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (temp.getOperationName().matches(".*(子宫内膜息肉|子宫息肉|宫腔息肉|子宫内膜赘生物|宫腔镜电切术|刮宫术|子宫切除术|宫腔镜手术).*")) {
|
|
|
+ matched = true;
|
|
|
+ log.info("进行手术:"+temp.getOperationName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!matched) {//手术未查到病案首页再次查找手术信息
|
|
|
+ Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ Object operation = structureExtMap.get(Content.operative_information);//手术信息
|
|
|
+ List<Map<String, String>> mapStrs = (List<Map<String, String>>) operation;
|
|
|
+ if (mapStrs == null || mapStrs.isEmpty()) {//未进行手术
|
|
|
+ log.info("未进行手术");
|
|
|
+ status.set("1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (mapStrs.size() > 0) {
|
|
|
+ for (Map<String, String> mapStr : mapStrs) {
|
|
|
+ String name = mapStr.get(Content.operative_name);//手术名称
|
|
|
+ if (!StringUtil.isEmpty(name) && name.matches(".*(子宫内膜息肉|子宫息肉|宫腔息肉|子宫内膜赘生物|宫腔镜电切术|刮宫术|子宫切除术|宫腔镜手术).*")) {
|
|
|
+ matched = true;
|
|
|
+ log.info("进行手术:"+name);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!matched) {//未进行手术
|
|
|
+ log.info("未进行手术");
|
|
|
+ status.set("1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //确诊且进行了相关手术
|
|
|
+ if (matched) {
|
|
|
+ matched = false;
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
+ if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
|
|
|
+ for (DoctorAdviceDoc doc : doctorAdviceDocs) {
|
|
|
+ Map<String, String> structureMap = doc.getStructureMap();
|
|
|
+ String doctorAdviceName = structureMap.get("医嘱项目名称");
|
|
|
+ if (doctorAdviceName.matches(".*(病理|活检|活组织检查|组织病检|组织学检查).*")) {
|
|
|
+ matched = true;
|
|
|
+ log.info("有相关病理检查:"+doctorAdviceName);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (matched) { //确诊且进行了相关手术且相关病理检查
|
|
|
+ status.set("1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private List<String> getFirstpageDischargeDiag(List<Map<String, String>> outpatientEmergencyDiagList) {
|
|
|
+ List<String> firstpageDischargeDiag = new ArrayList<>();
|
|
|
+ for (Map<String, String> outpatientEmergencyDiag : outpatientEmergencyDiagList) {
|
|
|
+ String diag = outpatientEmergencyDiag.get(Content.diagnoseName);
|
|
|
+ if (StringUtil.isNotBlank(diag)) {
|
|
|
+ firstpageDischargeDiag.add(diag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return firstpageDischargeDiag;
|
|
|
+ }
|
|
|
+}
|