浏览代码

首次病程录文档生成修改

rengb 5 年之前
父节点
当前提交
291f697644

+ 86 - 0
public/src/main/java/com/lantone/qc/pub/util/FileUtil.java

@@ -0,0 +1,86 @@
+package com.lantone.qc.pub.util;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/1/14 16:01
+ */
+public class FileUtil {
+
+    /**
+     * 读取文件,返回字符串
+     *
+     * @param path
+     * @return
+     */
+    public static String fileRead(String path) {
+        String ret = null;
+        FileReader fr = null;
+        BufferedReader br = null;
+        try {
+            fr = new FileReader(path);
+            br = new BufferedReader(fr);
+            String line = null;
+            StringBuffer sbf = new StringBuffer();
+            while ((line = br.readLine()) != null) {
+                sbf.append(line);
+            }
+            ret = sbf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (br != null) {
+                    br.close();
+                }
+                if (fr != null) {
+                    fr.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * 写文件
+     *
+     * @param path
+     * @param fileName
+     * @param content
+     * @return
+     */
+    public static boolean fileWrite(String path, String fileName, String content) {
+        boolean flag = false;
+        FileWriter fw = null;
+        try {
+            File dicPath = new File(path);
+            if (!dicPath.exists()) {
+                dicPath.mkdirs();
+            }
+            fw = new FileWriter(path + "\\" + fileName);
+            fw.write(content);
+            fw.close();
+            flag = true;
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (fw != null) {
+                    fw.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return flag;
+    }
+
+}

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

@@ -22,8 +22,10 @@ import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 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;
+import com.lantone.qc.pub.model.label.CaseCharacteristicLabel;
 import com.lantone.qc.pub.model.label.ChiefLabel;
 import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.model.label.DiagnosisLabel;
 import com.lantone.qc.pub.model.label.FamilyLabel;
 import com.lantone.qc.pub.model.label.MaritalLabel;
 import com.lantone.qc.pub.model.label.MenstrualLabel;
@@ -31,6 +33,7 @@ import com.lantone.qc.pub.model.label.PacsLabel;
 import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.model.label.PersonalLabel;
 import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.model.label.TreatPlanLabel;
 import com.lantone.qc.pub.model.label.VitalLabel;
 import com.lantone.qc.pub.model.label.VitalLabelSpecial;
 
@@ -300,6 +303,32 @@ public class ModelDocGenerate {
      */
     public static FirstCourseRecordDoc firstCourseRecordDocGen(Map<String, String> structureMap) {
         FirstCourseRecordDoc firstCourseRecordDoc = new FirstCourseRecordDoc();
+
+        DiagLabel initialDiagLabel = new DiagLabel();
+        initialDiagLabel.setText(structureMap.get("初步诊断"));
+        firstCourseRecordDoc.setInitialDiagLabel(initialDiagLabel);
+        structureMap.remove("初步诊断");
+
+        CaseCharacteristicLabel caseCharacteristicLabel = new CaseCharacteristicLabel();
+        caseCharacteristicLabel.setText(structureMap.get("病例特点"));
+        firstCourseRecordDoc.setCaseCharacteristicLabel(caseCharacteristicLabel);
+        structureMap.remove("病例特点");
+
+        DiagnosisLabel diagnosisLabel = new DiagnosisLabel();
+        diagnosisLabel.setText(structureMap.get("诊断依据"));
+        firstCourseRecordDoc.setDiagnosisLabel(diagnosisLabel);
+        structureMap.remove("诊断依据");
+
+        DiagLabel differentialDiagLabel = new DiagLabel();
+        differentialDiagLabel.setText(structureMap.get("鉴别诊断"));
+        firstCourseRecordDoc.setDifferentialDiagLabel(differentialDiagLabel);
+        structureMap.remove("鉴别诊断");
+
+        TreatPlanLabel treatPlanLabel = new TreatPlanLabel();
+        treatPlanLabel.setText(structureMap.get("诊疗计划"));
+        firstCourseRecordDoc.setTreatPlanLabel(treatPlanLabel);
+        structureMap.remove("诊疗计划");
+
         firstCourseRecordDoc.setStructureMap(structureMap);
         return firstCourseRecordDoc;
     }