Ver código fonte

异步调用评分接口

shiyue 3 anos atrás
pai
commit
c36c8bbcff

+ 23 - 8
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -27,6 +27,8 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @Component
 public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
@@ -317,16 +319,25 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                 respDto.put("ret","0");respDto.put("mag","true");
             }
 
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息入參",
-                    behospitalCode,
-                    JSON.toJSONString(aMrContentVO),
-                    JSON.toJSONString(respDto),
-                    "");
-
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息入參", behospitalCode, JSON.toJSONString(aMrContentVO), JSON.toJSONString(respDto), "");
+            //异步调用评分接口
+            ExecutorService executorService = Executors.newCachedThreadPool();
+            executorService.execute(() -> {
+                try {
+                    //保存完数据后评分
+                    AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
+                    analyzeRunVO.setHospitalId(Long.valueOf("35"));
+                    analyzeRunVO.setBehospitalCode(behospitalCode);
+                    behospitalInfoFacade.analyzeApi(analyzeRunVO);
+                } catch (Exception e) {
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("保存文书后评分失败", behospitalCode, "", JSON.toJSONString(aMrContentVO), e.getMessage());
+                }
+            });
 
 
             return respDto;
 
+
 //            //数据解析,评分规则等还未完整时不解析
 //            if(xmlAnalyseFlag){
 //                splicingParam(aMrContentVO);
@@ -436,8 +447,12 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                         if (behospitalInfo != null){
                             //如果病人住院信息存在,更新对应的qc_type_id
                             Long qcTypeId=Long.valueOf("0");
-                            if (s.getRecTitle().contains("日间")||s.getRecTitle().contains("24小时")){
-                                qcTypeId=Long.valueOf("211");
+                            if (s.getRecTitle().contains("日间")){
+                                qcTypeId=Long.valueOf("222");
+                            }else if (s.getRecTitle().contains("24小时") && s.getRecTitle().contains("死亡")){
+                                qcTypeId=Long.valueOf("225");
+                            }else if (s.getRecTitle().contains("24小时")){
+                                qcTypeId=Long.valueOf("220");
                             }else {
                                 qcTypeId = initQcTypeId(behospitalInfo);
                             }