Browse Source

长兴手术安全核查表对接修改

rengb 5 years ago
parent
commit
9726e21fd2

+ 1 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationDoc.java

@@ -17,5 +17,6 @@ public class OperationDoc {
     private OperationRecordDoc operationRecordDoc;
     private PreoperativeDiscussionDoc preoperativeDiscussionDoc;
     private OperationInformedConsentDoc operationInformedConsentDoc;
+    private OperationSafetyChecklistDoc operationSafetyChecklistDoc;
 
 }

+ 16 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationSafetyChecklistDoc.java

@@ -0,0 +1,16 @@
+package com.lantone.qc.pub.model.doc.operation;
+
+import com.lantone.qc.pub.model.doc.ModelDoc;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 手术安全核查表文档
+ * @author: rengb
+ * @time: 2020/4/4 14:26
+ */
+@Getter
+@Setter
+public class OperationSafetyChecklistDoc extends ModelDoc {
+    private String operationName;
+}

+ 9 - 0
public/src/main/java/com/lantone/qc/pub/model/keys/TextTypeStandardKeys.java

@@ -109,6 +109,15 @@ public class TextTypeStandardKeys {
             "签名",
             "签名时间"
     );
+    //手术-手术安全核查表的标准key
+    public static final List<String> operationSafetyChecklist = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "签名"
+    );
 
 
     //转科记录-转入的标准key

+ 8 - 0
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java

@@ -219,6 +219,14 @@ public class ChangxDocTrans extends DocTrans {
                             .map(operationDoc -> operationDoc.getOperationInformedConsentDoc().getPageData())
                             .collect(Collectors.toList())
             );
+            inputInfo.getPageData().put(
+                    "手术安全核查表",
+                    inputInfo.getOperationDocs()
+                            .stream()
+                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationSafetyChecklistDoc() != null)
+                            .map(operationDoc -> operationDoc.getOperationSafetyChecklistDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
         }
     }
 

+ 62 - 0
trans/src/main/java/com/lantone/qc/trans/changx/ChangxOperationDocTrans.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationInformedConsentDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationSafetyChecklistDoc;
 import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.ListUtil;
@@ -41,12 +42,14 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
         Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap(contentMap.get("手术记录"));
         Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap(contentMap.get("术前讨论、术前小结"));
         Map<String, OperationInformedConsentDoc> operationInformedConsentDocMap = getOperationInformedConsentDocMap(contentMap.get("手术知情同意书"));
+        Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap(contentMap.get("手术安全核查表"));
 
         Set<String> operationNameSet = Sets.newHashSet();
         operationNameSet.addAll(operationDiscussionDocMap.keySet());
         operationNameSet.addAll(operationRecordDocMap.keySet());
         operationNameSet.addAll(preoperativeDiscussionDocMap.keySet());
         operationNameSet.addAll(operationInformedConsentDocMap.keySet());
+        operationNameSet.addAll(operationSafetyChecklistDocMap.keySet());
 
         operationNameSet.forEach(operationName -> {
             OperationDoc operationDoc = new OperationDoc();
@@ -55,6 +58,7 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
             operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
             operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
+            operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
             retList.add(operationDoc);
         });
 
@@ -393,4 +397,62 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             "签名时间=签名时间"
     );
 
+
+    /**********************************************手术安全核查表****************************************************/
+    private Map<String, OperationSafetyChecklistDoc> getOperationSafetyChecklistDocMap(List<String> contents) {
+        Map<String, OperationSafetyChecklistDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contents)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (String content : contents) {
+            if (StringUtil.isBlank(content)) {
+                continue;
+            }
+            operationName = index + "";
+            OperationSafetyChecklistDoc operationSafetyChecklistDoc = getOperationSafetyChecklistDoc(content);
+            operationSafetyChecklistDoc.setOperationName(operationName);
+            retMap.put(operationName, operationSafetyChecklistDoc);
+            index++;
+        }
+        return retMap;
+    }
+
+    private OperationSafetyChecklistDoc getOperationSafetyChecklistDoc(String content) {
+        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent", content);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationSafetyChecklist_keyContrasts);
+
+        String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Content_Text");
+        if (StringUtil.isBlank(text)) {
+            text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent");
+        }
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationSafetyChecklist_sourceTitles, text);
+        cutWordMap.putAll(structureMap);
+
+        OperationSafetyChecklistDoc operationSafetyChecklistDoc = ModelDocGenerate.operationSafetyChecklistDocGen(cutWordMap);
+        operationSafetyChecklistDoc.setText(text);
+        operationSafetyChecklistDoc.setPageData((Map) xmlNodeValueMap);
+
+        return operationSafetyChecklistDoc;
+    }
+
+    private List<String> operationSafetyChecklist_sourceTitles = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "签名"
+    );
+
+    private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
+            "姓名++++患者姓名=姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号++++住院号=病案号",
+            "签名++++=签名"
+    );
+
 }

+ 13 - 0
trans/src/main/java/com/lantone/qc/trans/comsis/ModelDocGenerate.java

@@ -22,6 +22,7 @@ import com.lantone.qc.pub.model.doc.consultation.ConsultationResultsDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationInformedConsentDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationSafetyChecklistDoc;
 import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
@@ -135,6 +136,18 @@ public class ModelDocGenerate {
         return operationInformedConsentDoc;
     }
 
+    /**
+     * 手术-手术安全核查表文档
+     *
+     * @param structureMap
+     * @return
+     */
+    public static OperationSafetyChecklistDoc operationSafetyChecklistDocGen(Map<String, String> structureMap) {
+        OperationSafetyChecklistDoc operationSafetyChecklistDoc = new OperationSafetyChecklistDoc();
+        operationSafetyChecklistDoc.setStructureMap(structureMap);
+        return operationSafetyChecklistDoc;
+    }
+
     /**
      * 转科记录-转入
      *