Ver código fonte

打开医嘱

rengb 5 anos atrás
pai
commit
ae644b4875

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

@@ -61,10 +61,10 @@ public class ChangxDocTrans extends DocTrans {
             //                ChangxDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new ChangxDifficultCaseDiscussDocTrans();
             //                inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
             //            }
-            //            if (i.getTitle().equals("医嘱信息")) {
-            //                ChangxDoctorAdviceDocTrans doctorAdviceDocTrans = new ChangxDoctorAdviceDocTrans();
-            //                inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
-            //            }
+            if (i.getTitle().equals("医嘱信息")) {
+                ChangxDoctorAdviceDocTrans doctorAdviceDocTrans = new ChangxDoctorAdviceDocTrans();
+                inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
+            }
             //            if (i.getTitle().equals("值班交接制度")) {
             //                ChangxDutyShiftSystemDocTrans dutyShiftSystemDocTrans = new ChangxDutyShiftSystemDocTrans();
             //                inputInfo.setDutyShiftSystemDocs(dutyShiftSystemDocTrans.extract(i));
@@ -141,9 +141,9 @@ public class ChangxDocTrans extends DocTrans {
         //        if (ListUtil.isNotEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
         //            inputInfo.getPageData().put("疑难病例讨论记录", inputInfo.getDifficultCaseDiscussDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         //        }
-        //        if (ListUtil.isNotEmpty(inputInfo.getDoctorAdviceDocs())) {
-        //            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
-        //        }
+        if (ListUtil.isNotEmpty(inputInfo.getDoctorAdviceDocs())) {
+            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
         //        if (ListUtil.isNotEmpty(inputInfo.getDutyShiftSystemDocs())) {
         //            inputInfo.getPageData().put("值班交接制度", inputInfo.getDutyShiftSystemDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         //        }

+ 5 - 46
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDoctorAdviceDocTrans.java

@@ -4,8 +4,6 @@ import com.google.common.collect.Lists;
 import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.trans.ModelDocTrans;
-import com.lantone.qc.trans.comsis.ModelDocGenerate;
-import com.lantone.qc.trans.comsis.Preproc;
 
 import java.util.List;
 import java.util.Map;
@@ -20,57 +18,18 @@ public class ChangxDoctorAdviceDocTrans extends ModelDocTrans {
     @Override
     public List<DoctorAdviceDoc> extract(MedrecVo medrecVo) {
         List<DoctorAdviceDoc> retList = Lists.newArrayList();
-        List<String> contents = (List) medrecVo.getContent().get("content");
+        List<Map<String, String>> contents = (List) medrecVo.getContent();
         contents.forEach(content -> {
             retList.add(getDoctorAdviceDoc(content));
         });
         return retList;
     }
 
-    private DoctorAdviceDoc getDoctorAdviceDoc(String content) {
-        Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
-        pageData.put("病程记录内容",
-                pageData.get("病程记录内容")
-                        .replace(pageData.get("病程记录时间"), "")
-                        .replace(pageData.get("病程记录名称"), "")
-        );
-
-        List<String> targetTitles = Lists.newArrayList();
-        sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
-
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
-        sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
-
-        DoctorAdviceDoc doctorAdviceDoc = ModelDocGenerate.doctorAdviceDocGen(sourceMap);
-        doctorAdviceDoc.setText(content);
-        doctorAdviceDoc.setPageData((Map) pageData);
-
+    private DoctorAdviceDoc getDoctorAdviceDoc(Map<String, String> content) {
+        DoctorAdviceDoc doctorAdviceDoc = new DoctorAdviceDoc();
+        doctorAdviceDoc.setStructureMap(content);
+        doctorAdviceDoc.setPageData((Map) content);
         return doctorAdviceDoc;
     }
 
-    private List<String> pageDataTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
-            "记录医师"
-    );
-
-    private List<String> sourceTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
-            "记录时间",
-            "记录医师"
-    );
-
 }