Преглед изворни кода

使用创智的诊断什么什么接口

lighter пре 3 година
родитељ
комит
28edd40e5c

+ 1 - 10
pom.xml

@@ -10,17 +10,13 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>10.8.6</version>
+    <version>10.8.7</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>
         <java.version>1.8</java.version>
     </properties>
     <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
@@ -96,11 +92,6 @@
             <artifactId>postgresql</artifactId>
             <version>42.2.20</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.amqp</groupId>
-            <artifactId>spring-rabbit-test</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>net.sourceforge.jtds</groupId>
             <artifactId>jtds</artifactId>

+ 6 - 0
src/main/java/thyyxxk/webserver/controller/casefrontsheet/CaseFrontSheetController.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.controller.casefrontsheet;
 
+import com.alibaba.fastjson.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
@@ -122,5 +123,10 @@ public class CaseFrontSheetController {
     public ResultVo<PureCodeName> fetchSsfz(@RequestParam("code") String code) {
         return service.fetchSsfz(code);
     }
+
+    @PostMapping("/qualityControl")
+    public ResultVo<JSONObject> qualityControl(@RequestBody CaseFrontsheetMain sheet) {
+        return service.qualityControl(sheet);
+    }
     
 }

+ 54 - 1
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetService.java

@@ -1,5 +1,7 @@
 package thyyxxk.webserver.service.casefrontsheet;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
@@ -12,6 +14,7 @@ import thyyxxk.webserver.dao.his.casefrontsheet.SheetCreatedDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
+import thyyxxk.webserver.service.externalhttp.PowersiSrvc;
 import thyyxxk.webserver.utils.*;
 
 import java.lang.reflect.Field;
@@ -30,12 +33,14 @@ public class CaseFrontSheetService {
     private final SheetCreatedDao createdDao;
     private final BasSelectOverviewDao basDao;
     private final LoginDao userDao;
+    private final PowersiSrvc srvc;
 
-    public CaseFrontSheetService(SheetCreatedDao createdDao, CaseFrontSheetDao dao, BasSelectOverviewDao basDao, LoginDao userDao) {
+    public CaseFrontSheetService(SheetCreatedDao createdDao, CaseFrontSheetDao dao, BasSelectOverviewDao basDao, LoginDao userDao, PowersiSrvc srvc) {
         this.dao = dao;
         this.createdDao = createdDao;
         this.basDao = basDao;
         this.userDao = userDao;
+        this.srvc = srvc;
         if (allDictionary == null) {
             allDictionary = new ConcurrentHashMap<>();
         }
@@ -524,6 +529,54 @@ public class CaseFrontSheetService {
         return ResultVoUtil.success(new ArrayList<>());
     }
 
+    public ResultVo<JSONObject> qualityControl(CaseFrontsheetMain sheet) {
+        JSONObject obj = new JSONObject();
+        obj.put("functionId", "100138");
+        JSONObject baseinfo = new JSONObject();
+        baseinfo.put("name", sheet.getName());
+        baseinfo.put("age", sheet.getAge());
+        baseinfo.put("sex_id", sheet.getSex());
+        String agedays = sheet.getAgeDays();
+        if (null != agedays && agedays.equals("-")) {
+            agedays = "";
+        }
+        baseinfo.put("nwb_age", agedays);
+        baseinfo.put("out_hosp_id", FilterUtil.filterDismissWay(sheet.getZyDismissWay()));
+        baseinfo.put("is_autopsy_id", sheet.getAutopsy());
+        JSONObject inputParam = new JSONObject();
+        inputParam.put("baseInfo", baseinfo);
+        JSONArray hsptzdDagnsInfo = new JSONArray();
+        for (CaseFrontsheetDisdiag diag : sheet.getDisdiagList()) {
+            if (null == diag.getNo()) {
+                break;
+            }
+            JSONObject itm = new JSONObject();
+            itm.put("icd_code", diag.getCode());
+            itm.put("dagns_type", diag.getNo() == 1 ? 1 : 2);
+            itm.put("disease_name", diag.getName());
+            itm.put("order", diag.getNo());
+            hsptzdDagnsInfo.add(itm);
+        }
+        inputParam.put("hsptzdDagnsInfo", hsptzdDagnsInfo);
+        JSONArray hsptzdOprtInfo = new JSONArray();
+        for (CaseFrontsheetSurgery surgery : sheet.getSurgeryList()) {
+            if (null == surgery.getNo()) {
+                break;
+            }
+            JSONObject itm = new JSONObject();
+            itm.put("oprt_code", surgery.getCode());
+            itm.put("oprt_name", surgery.getName());
+            itm.put("oprt_type", surgery.getNo() == 1 ? 1 : 2);
+            itm.put("order", surgery.getNo());
+            hsptzdOprtInfo.add(itm);
+        }
+        inputParam.put("hsptzdOprtInfo", hsptzdOprtInfo);
+        obj.put("inputParam", inputParam);
+        JSONObject result = srvc.setlQualityControl(obj);
+        log.info("病案质控接口:\n参数:{}\n结果:{}", obj, result);
+        return ResultVoUtil.success(result);
+    }
+
     public ResultVo<PureCodeName> fetchSsfz(String code) {
         PureCodeName ret = new PureCodeName();
         Connection conn = null;

+ 4 - 3
src/main/java/thyyxxk/webserver/service/externalhttp/PowersiSrvc.java

@@ -1,13 +1,14 @@
 package thyyxxk.webserver.service.externalhttp;
 
 import com.alibaba.fastjson.JSONObject;
-import com.dtflys.forest.annotation.BaseRequest;
 import com.dtflys.forest.annotation.JSONBody;
 import com.dtflys.forest.annotation.Post;
 
-@BaseRequest(baseURL = "http://172.16.32.183:8916/mmg-gateway")
 public interface PowersiSrvc {
 
-    @Post("/empiDataProvide/queryEmpiPatientListByIdentIndex")
+    @Post("http://172.16.32.183:8916/mmg-gateway/empiDataProvide/queryEmpiPatientListByIdentIndex")
     JSONObject queryEmpiPatientList(@JSONBody JSONObject obj);
+
+    @Post("http://172.16.32.183:8917/mmg-transceiver/interfaceFactory/call")
+    JSONObject setlQualityControl(@JSONBody JSONObject obj);
 }

+ 21 - 0
src/main/java/thyyxxk/webserver/utils/FilterUtil.java

@@ -26,6 +26,27 @@ public class FilterUtil {
         }
     }
 
+    public static String filterDismissWay(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
+        switch (code) {
+            case "0":
+                return "1";
+            case "1":
+                return "2";
+            case "2":
+                return "3";
+            case "3":
+                return "4";
+            case "4":
+                return "5";
+            case "5":
+                return "9";
+        }
+        return "";
+    }
+
     public static String filterHnsybBizType(String bizType) {
         switch (bizType) {
             case "10":