Browse Source

对接接口和沙雅现场配置信息上传

“wangdsYun 3 months ago
parent
commit
eea57ba6c9

+ 0 - 1
src/main/java/com/diagbot/facade/QcClientFacade.java

@@ -34,7 +34,6 @@ public class QcClientFacade {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "配置表内找不到评分接口地址数据!");
         }
 //        url = "http://127.0.0.1:6660";
-        url = "http://173.18.12.195:6660";
         try {
             uri = new URI(url);
         } catch (Exception e) {

+ 56 - 47
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.diagbot.dto.AnalyzeApiDTO;
 import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.AHomePageDTO;
@@ -180,16 +181,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
 
                 // 拆分新生儿年龄
                 if (StringUtil.isNotBlank(s.getNewbornAgeUnit())) {
-                    List<String> newbornAgeUnitList = SplitUtil.splitAge(s.getNewbornAgeUnit());
-                    for (String newbornAgeUnit : newbornAgeUnitList) {
-                        String[] newbornAgeUnitArr = newbornAgeUnit.split(",");
-                        if (newbornAgeUnitArr.length != 2) continue;
-                        if (newbornAgeUnitArr[1].equals("月")) {
-                            homePage.setNewbornMonth(newbornAgeUnitArr[0]);
-                        } else if (newbornAgeUnitArr[1].equals("天")) {
-                            homePage.setNewbornDay(newbornAgeUnitArr[0]);
-                        }
-                    }
+                    homePage.setNewbornMonth(s.getNewbornAgeUnit().replace("月", ""));
                 }
 
                 // 拆分新生儿出生体重
@@ -412,7 +404,6 @@ public class AHomePageFacade extends HomePageServiceImpl{
                     }
                 }
 
-//                sendDataDealFacade.sendInfo(s.getBehospitalCode());
 
                 homePageList.add(homePage);
 
@@ -420,29 +411,29 @@ public class AHomePageFacade extends HomePageServiceImpl{
                 aHomeDiagnoseInfoFacade.executeHomeDiagnose(s.getLeaveDiags());//首页诊断
                 aHomeOperationInfoFacade.executeHomeOperation(s.getOperations());//首页手术
 
-                try {
-                    //从病案首页同步入院登记表中的住院医生behospitalDoctor,主治医生attendingDoctor和主任医生directorDoctor和ID
-                    String behospitalDoctor = StringUtils.isEmpty(homePage.getBehospitalDoctor()) ? "" : homePage.getBehospitalDoctor();//获取住院医师姓名
-                    String attendingDoctor = StringUtils.isEmpty(homePage.getAttendingDoctor()) ? "" : homePage.getAttendingDoctor();//获取主治医师姓名
-                    String directorDoctor = StringUtils.isEmpty(homePage.getDirectorDoctor()) ? "" : homePage.getDirectorDoctor();//获取主任医师姓名
-                    String behospitalDoctorID = this.getDoctorId(behospitalDoctor);//获取住院医师id
-                    String attendingDoctorID = this.getDoctorId(attendingDoctor);//获取主治医师id
-                    String directorDoctorID = this.getDoctorId(directorDoctor);//获取主任医师id
-
-                    UpdateWrapper<BehospitalInfo> updateWrapper = new UpdateWrapper<>();
-                    updateWrapper.eq("behospital_code", homePage.getBehospitalCode())
-                            .eq("hospital_id", homePage.getHospitalId())
-                            .eq("is_deleted", IsDeleteEnum.N)
-                            .set("beh_doctor_name", behospitalDoctor)
-                            .set("doctor_name", attendingDoctor)
-                            .set("director_doctor_name", directorDoctor)
-                            .set("beh_doctor_id", behospitalDoctorID)
-                            .set("doctor_id", attendingDoctorID)
-                            .set("director_doctor_id", directorDoctorID);
-                    behospitalInfoFacade.update(updateWrapper);
-                }catch (Exception e){
-                    aMedAbnormalInfoFacade.saveAbnormalInfo("反查主治id异常","", JSON.toJSONString(homePage),"",e.getMessage());
-                }
+                //从病案首页同步入院登记表中的住院医生behospitalDoctor,主治医生attendingDoctor和主任医生directorDoctor和ID (按需开放)
+//                try {
+//                    String behospitalDoctor = StringUtils.isEmpty(homePage.getBehospitalDoctor()) ? "" : homePage.getBehospitalDoctor();//获取住院医师姓名
+//                    String attendingDoctor = StringUtils.isEmpty(homePage.getAttendingDoctor()) ? "" : homePage.getAttendingDoctor();//获取主治医师姓名
+//                    String directorDoctor = StringUtils.isEmpty(homePage.getDirectorDoctor()) ? "" : homePage.getDirectorDoctor();//获取主任医师姓名
+//                    String behospitalDoctorID = this.getDoctorId(behospitalDoctor);//获取住院医师id
+//                    String attendingDoctorID = this.getDoctorId(attendingDoctor);//获取主治医师id
+//                    String directorDoctorID = this.getDoctorId(directorDoctor);//获取主任医师id
+//
+//                    UpdateWrapper<BehospitalInfo> updateWrapper = new UpdateWrapper<>();
+//                    updateWrapper.eq("behospital_code", homePage.getBehospitalCode())
+//                            .eq("hospital_id", homePage.getHospitalId())
+//                            .eq("is_deleted", IsDeleteEnum.N)
+//                            .set("beh_doctor_name", behospitalDoctor)
+//                            .set("doctor_name", attendingDoctor)
+//                            .set("director_doctor_name", directorDoctor)
+//                            .set("beh_doctor_id", behospitalDoctorID)
+//                            .set("doctor_id", attendingDoctorID)
+//                            .set("director_doctor_id", directorDoctorID);
+//                    behospitalInfoFacade.update(updateWrapper);
+//                }catch (Exception e){
+//                    aMedAbnormalInfoFacade.saveAbnormalInfo("反查主治id异常","", JSON.toJSONString(homePage),"",e.getMessage());
+//                }
             });
             execute(homePageList);
         }catch (Exception e){
@@ -482,7 +473,10 @@ public class AHomePageFacade extends HomePageServiceImpl{
             return RespDTO.onSuc(map);
         }else if(aHomePageIngVO.getDockModeType().equals("1")){
             //页面模式
-            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId;
+            String url=readProperties.getProcessQcUrl()+"?bcode="+behospitalCode+"&hid="+hospitalId+"&type=0";
+            if(aHomePageIngVO.getIsPlacefile().equals("1")){
+                url=readProperties.getProcessQcUrl()+"?bcode="+behospitalCode+"&hid="+hospitalId+"&type=1";
+            }
             Map<String,Object> map=new HashMap<String,Object>();
             map.put("url",url);
             aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页页面推送模式验证1","", JSON.toJSONString(aHomePageIngVO),url,"");
@@ -491,25 +485,40 @@ public class AHomePageFacade extends HomePageServiceImpl{
             AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
             analyzeRunVO.setBehospitalCode(behospitalCode);
             analyzeRunVO.setHospitalId(hospitalId);
-            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
             Map<String,Object> map=new HashMap<String,Object>();
-//            if(analyzeRunDTO.getMsgDTOList().size()>0){
-//                map.put("analyze",analyzeRunDTO.getMsgDTOList());
-//            }
+            if(aHomePageIngVO.getIsPlacefile().equals("1")){
+                AnalyzeApiDTO analyzeApiDTO=behospitalInfoFacade.analyzeApi(analyzeRunVO);
+                if(analyzeApiDTO != null){
+                    map.put("analyzeApi",analyzeApiDTO);
+                }
+            } else {
+                AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+                if(analyzeRunDTO != null){
+                    map.put("analyzeRun",analyzeRunDTO);
+                }
+            }
             return RespDTO.onSuc(map);
         }else{
+//            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId;
             //页面模式+接口引擎模式
-            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId;
-
+            String url = "";
             AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
             analyzeRunVO.setBehospitalCode(behospitalCode);
             analyzeRunVO.setHospitalId(hospitalId);
-            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
             Map<String,Object> map=new HashMap<String,Object>();
-//            if(analyzeRunDTO.getMsgDTOList().size()>0){
-//                map.put("url",url);
-//                map.put("analyze",analyzeRunDTO.getMsgDTOList());
-//            }
+            if(aHomePageIngVO.getIsPlacefile().equals("1")){
+                url=readProperties.getProcessQcUrl()+"?bcode="+behospitalCode+"&hid="+hospitalId+"&type=1";
+                AnalyzeApiDTO analyzeApiDTO=behospitalInfoFacade.analyzeApi(analyzeRunVO);
+                if(analyzeApiDTO != null){
+                    map.put("analyzeApi",analyzeApiDTO);
+                }
+            } else {
+                url=readProperties.getProcessQcUrl()+"?bcode="+behospitalCode+"&hid="+hospitalId+"&type=0";
+                AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+                if(analyzeRunDTO != null){
+                    map.put("analyzeRun",analyzeRunDTO);
+                }
+            }
             aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页页面模式+接口引擎模式","", JSON.toJSONString(aHomePageIngVO),url,"");
             return RespDTO.onSuc(map);
         }
@@ -565,7 +574,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
                 homePageList.stream().forEach(s -> {
 
                     HomePage homePage = this.getOne(new QueryWrapper<HomePage>()
-                            /*.eq("home_page_id", s.getHomePageId())*/
+                            .eq("home_page_id", s.getHomePageId())
                             .eq("hospital_id", s.getHospitalId())
                             .eq("behospital_code", s.getBehospitalCode()), false);
                     if (homePage != null) {

+ 3 - 67
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -85,7 +85,6 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
      * 终末质控-同步前一天的病历记录
      */
     public void executeMrRecord() {
-        //String sql="select * from mr_medicalrecords  where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
         String sql = "select * from mr_medicalrecords  where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
         List<MedicalRecord> medicalRecordList = tzDBConn.getMedicalRecord(sql);
         execute(medicalRecordList);
@@ -265,84 +264,21 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
             executeMrRecord(aMrContentVO.getRecords());
 
             aMrContentVO.getRecords().stream().forEach(s -> {
-                String tableName =s.getRecId().substring(0,2);
-                String recId=s.getRecId().substring(3);
-                String sql ="select * from v_jkcdss_bl_binglijlnr where RECID= '"+recId+" ' and tableName = '"+tableName+"'";
-                List<MedicalRecordContent> medicalRecordContent =tzDBConn.getMedicalRecordContent(sql);
-                    //更新文书详情
-                    aMedicalRecordContentFacade.execute(medicalRecordContent);
-
+                //更新文书详情
+                aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
             });
 
             //数据解析,评分规则等还未完整时不解析
             if(xmlAnalyseFlag){
                 splicingParam(aMrContentVO);
             }
-            //评分后返回结构体
-            return mrIng(aMrContentVO);
+            return RespDTO.onSuc("操作成功!");
 
         } else {
             return RespDTO.onError("未接收到数据!");
         }
     }
 
-    /**
-     * 评分后返回结构体
-     *
-     * @param aMrContentVO
-     * @return
-     */
-    private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO) {
-        String behospitalCode = aMrContentVO.getRecords().get(0).getBehospitalCode();
-        Long hospitalId = aMrContentVO.getRecords().get(0).getHospitalId();
-        MedicalRecord medicalRecord = new MedicalRecord();
-        BeanUtil.copyProperties(aMrContentVO.getRecords().get(0), medicalRecord);
-        Long modeId = initModeId(medicalRecord);
-        if (aMrContentVO.getDockModeType().equals("0")) {
-            Map<String, Object> map = new HashMap<String, Object>();
-            List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
-            map.put("records", medicalRecordDTOList);
-            return RespDTO.onSuc("操作成功!");
-        } else if (aMrContentVO.getDockModeType().equals("1")) {
-            if (modeId == 0 || modeId == null) {
-                return RespDTO.onError("无对应的文书类型");
-            }
-            //页面模式
-            String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
-            Map<String, Object> map = new HashMap<String, Object>();
-            map.put("url", url);
-            return RespDTO.onSuc(map);
-        } else if (aMrContentVO.getDockModeType().equals("2")) {
-            AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
-            analyzeRunVO.setBehospitalCode(behospitalCode);
-            analyzeRunVO.setHospitalId(hospitalId);
-            AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
-            Map<String, Object> map = new HashMap<String, Object>();
-//            if (analyzeRunDTO.getMsgDTOList().size() > 0) {
-//                map.put("analyze", analyzeRunDTO.getMsgDTOList());
-//            }
-            //接口引擎模式
-            return RespDTO.onSuc(map);
-        } else {
-            if (modeId == 0 || modeId == null) {
-                return RespDTO.onError("无对应的文书类型");
-            }
-            //页面模式
-            String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
-
-            AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
-            analyzeRunVO.setBehospitalCode(behospitalCode);
-            analyzeRunVO.setHospitalId(hospitalId);
-            AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
-            Map<String, Object> map = new HashMap<String, Object>();
-//            if (analyzeRunDTO.getMsgDTOList().size() > 0) {
-//                map.put("url", url);
-//                map.put("analyze", analyzeRunDTO.getMsgDTOList());
-//            }
-            return RespDTO.onSuc(map);
-        }
-    }
-
     public void execute(List<MedicalRecord> medicalRecordList) {
         try {
             List<MedicalRecord> addE = Lists.newLinkedList();

+ 0 - 34
src/main/java/com/diagbot/util/ReadProperties.java

@@ -7,38 +7,16 @@ import org.springframework.stereotype.Component;
 @Component
 @PropertySource(value={"classpath:jdbc.properties"})
 public class ReadProperties {
-
-	@Value(value="${remote.address.ver}")
-	public String remoteAddressVer;
-	
-	@Value(value="${remote.address.hor}")
-	public String remoteAddressHor;
 	
 	@Value(value="${jdbc.driverClassName}")
 	public String jdbcDriverClassName;
 	
 	@Value(value="${jdbc.url}")
 	public String jdbcUrl;
-	
-	@Value(value="${jdbc.username}")
-	public String jdbcUsername;
-	
-	@Value(value="${jdbc.password}")
-	public String jdbcPassword;
 
 	@Value(value="${process.qc.url}")
 	public String processQcUrl;
 
-	@Value(value="${rule.warn.qc.url}")
-	public String ruleWarnQcUrl;
-
-	public String getRemoteAddressVer() {
-		return remoteAddressVer;
-	}
-
-	public String getRemoteAddressHor() {
-		return remoteAddressHor;
-	}
 
 	@Value(value="${his.patient.url}")
 	public String hisPatientUrl;
@@ -50,24 +28,12 @@ public class ReadProperties {
 		return hisPatientUrl;
 	}
 
-	public String getJdbcDriverClassName() {
-		return jdbcDriverClassName;
-	}
 
 	public String getJdbcUrl() {
 		return jdbcUrl;
 	}
-
-	public String getJdbcUsername() {
-		return jdbcUsername;
-	}
-
-	public String getJdbcPassword() {
-		return jdbcPassword;
-	}
 	
 	public String getProcessQcUrl(){return processQcUrl;}
 
-	public String getRuleWarnQcUrl(){return ruleWarnQcUrl;}
 	
 }

+ 3 - 0
src/main/java/com/diagbot/vo/data/AHomePageIngVO.java

@@ -13,5 +13,8 @@ public class AHomePageIngVO {
     @NotBlank(message = "对接模式类型编码不能为空")
     private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
 
+    // 归档字段
+    private String isPlacefile = "0";
+
     private List<AHomePageVO> homePages;
 }

+ 1 - 1
src/main/java/com/diagbot/vo/data/AMedicalRecordContentVO.java

@@ -29,7 +29,7 @@ public class AMedicalRecordContentVO {
     /**
      * html文本信息
      */
-    //private String htmlText;
+    private String htmlText;
 
     /**
      * xml文本信息

+ 0 - 2
src/main/java/com/diagbot/vo/data/AMrContentVO.java

@@ -10,8 +10,6 @@ import java.util.Map;
 @Getter
 @Setter
 public class AMrContentVO {
-    @NotBlank(message = "对接模式类型编码不能为空")
-    private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
 
     private String title;
 

+ 5 - 5
src/main/resources/application-local.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5656
+  port: 5757
   max-http-header-size: 10MB
 
 hystrix:
@@ -59,9 +59,9 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.16.1.104:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.65.92:3306/ihqc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
-      password: lt@great
+      password: cxzg8!@#
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -111,9 +111,9 @@ spring:
     database:
       cache: 3 # cache索引
       token: 3 # Token索引
-    host: 192.16.1.104  #Redis服务器地址
+    host: 192.168.65.92  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: lantone # Redis服务器连接密码(默认为空)
+    password: # Redis服务器连接密码(默认为空)
     lettuce:
       pool:
         max-active: 8 # 连接池最大连接数(使用负值表示没有限制)

+ 1 - 1
src/main/resources/application-pre.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5656
+  port: 5757
   max-http-header-size: 10MB
 
 hystrix:

+ 1 - 1
src/main/resources/application-pro.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5656
+  port: 5757
   max-http-header-size: 10MB
 
 hystrix:

+ 1 - 1
src/main/resources/application-test.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5656
+  port: 5757
   max-http-header-size: 10MB
 
 hystrix:

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: ihqc-sys
   profiles:
-    active: dev
+    active: local
   main:
     allow-bean-definition-overriding: true
 

+ 2 - 13
src/main/resources/jdbc.properties

@@ -1,26 +1,15 @@
-#\u6570\u636e\u5e93\u914d\u7f6e
-#jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc:mysql://127.0.0.1:3306/diagbot-app?useUnicode=true&characterEncoding=UTF-8
-#jdbc.username=root
-#jdbc.password=root
 
 jdbc.driverClassName=oracle.jdbc.OracleDriver
 jdbc.url=jdbc:oracle:thin:@192.16.1.176:1521/ORCL
 jdbc.username=jkcdss
 jdbc.password=jkcdss
 
-#jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
-#jdbc.url=jdbc:sqlserver://192.168.100.39\\tzmhemr;DatabaseName=bigemr
-#jdbc.username=zjlt
-#jdbc.password=zjlt@2020
 
 #\u6570\u636e\u670d\u52a1\u6a21\u5f0f
 remote.address.ver=http://192.16.1.104:2030/index.html
 remote.address.hor=http://192.16.1.104:2030/indexHorizontal.html
 
-process.qc.url=http://192.16.1.104:1489/index.html
-
-rule.warn.qc.url=http://192.16.1.104:1489/indexRuleWarn.html
-
+process.qc.url=http://192.168.65.92:1033/#/fcr
+#http://173.18.12.191:1033/#/fcr?bcode=4178289_34&hid=2&type=1
 #his\u65b9\u60a3\u8005\u63a5\u53e3\u5730\u5740
 his.patient.url=