瀏覽代碼

测试类

zhoutg 5 年之前
父節點
當前提交
5f8b4f51e0

+ 23 - 2
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCTestController.java

@@ -3,7 +3,6 @@ package com.lantone.qc.kernel.web.controller;
 import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.analysis.QCAnalysis;
 import com.lantone.qc.kernel.util.CacheFileManager;
-import com.lantone.qc.kernel.util.ModelDataUtil;
 import com.lantone.qc.kernel.util.KernelConstants;
 import com.lantone.qc.pub.jdbc.MysqlJdbc;
 import com.lantone.qc.pub.model.OutputInfo;
@@ -16,7 +15,9 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -98,6 +99,26 @@ public class QCTestController {
         return response;
     }
 
+
+    @ApiOperation(value = "质控单个病历测试,无需token信息", notes = "")
+    @PostMapping("qc_test_single")
+    public Response<OutputInfo> qc_test_single(String cid, String caseNumber, String hospitalId) {
+        Response response = new Response();
+        if (StringUtils.isEmpty(hospitalId)) {
+            response.setData("未填写医院流水号(hospitalId)......");
+        }
+        if (StringUtils.isEmpty(cid)) {
+            response.setData("未填写医院缩写(cid)......");
+        }
+        //key = 患者就诊号
+        Map<String, QueryVo> queryVoMap = createQueryVo(cid, hospitalId, caseNumber);
+        //key = 患者就诊号
+        OutputInfo outputInfo = qCAnalysis.anlysis(queryVoMap.get(caseNumber));
+        response.setData(outputInfo);
+        return response.success();
+    }
+
+
     public Map<String, QueryVo> createQueryVo(String cid, String hospitalId, String caseNumber) {
         PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
         MysqlJdbc mysqlJdbc = new MysqlJdbc(propertiesUtil.getProperty("mysql.test.user"),

+ 13 - 0
trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtil.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.trans.changx.util;
 
 import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.FileUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
@@ -90,4 +91,16 @@ public class CxXmlUtil {
         return flag;
     }
 
+
+    public static void main(String[] args) {
+        try {
+            String context = FileUtil.fileRead("C:\\Users\\dell\\Desktop\\调试\\test1.txt");
+            Map<String, String> sourceMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent/Region", context);
+            for (String key : sourceMap.keySet()) {
+                System.out.println("\"" + key + "=\",");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }