|
@@ -0,0 +1,67 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.operationdiscussion;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+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.operation.OperationDoc;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 手术记录次数与手术次数不一致
|
|
|
+ * @author: cy
|
|
|
+ * @time: 2021/04/15 10:01
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class OPE03107 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();
|
|
|
+ //先从病案首页判断手术次数
|
|
|
+ Map<String, Object> structureExtMap = new HashMap<>();
|
|
|
+ if(inputInfo.getFirstPageRecordDoc()!=null){
|
|
|
+ structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ }
|
|
|
+ if(MapUtils.isNotEmpty(structureExtMap) && structureExtMap.get("手术信息") != null && StringUtils.isNotEmpty(structureExtMap.get("手术信息").toString())){
|
|
|
+ String objs = structureExtMap.get("手术信息").toString();
|
|
|
+ List<Map<String,String>> operation = (List<Map<String,String>>) JSONArray.parse(objs);
|
|
|
+ if (operation.size()!=cou) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //无病案首页则从医嘱里判断手术次数
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
+ if (doctorAdviceDocs.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ long count = 0L;
|
|
|
+ List<String> adviceDocs = new ArrayList<>();
|
|
|
+ for (DoctorAdviceDoc dad : doctorAdviceDocs) {
|
|
|
+ String daPrescriptionType = dad.getStructureMap().get("医嘱处方类型");
|
|
|
+ String adviceType = dad.getStructureMap().get("医嘱类型判别");
|
|
|
+ String da_status = dad.getStructureMap().get("医嘱状态判别");
|
|
|
+ String fileCode = dad.getStructureMap().get("医嘱同组序号");
|
|
|
+ if(StringUtils.isNotEmpty(adviceType) && adviceType.equals(Content.statOrder) && StringUtils.isNotEmpty(daPrescriptionType) && daPrescriptionType.equals(Content.operationOrder) && (StringUtils.isEmpty(da_status) || (StringUtils.isNotEmpty(da_status) && ! da_status.equals(Content.cancellationOrder)))){
|
|
|
+ if(StringUtils.isNotEmpty(fileCode)){
|
|
|
+ adviceDocs.add(fileCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ count = adviceDocs.stream().distinct().count();
|
|
|
+ if (count!=cou) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|