Compare commits

...

14 Commits

Author SHA1 Message Date
zhangye 832a6b54f2 柳铁同步相关 1 day ago
zhangye 144999f7cd Merge branch 'master' into ltszxyy 3 days ago
zhangye 1170b88ff1 修改同步时其他信息的添加 3 days ago
zhangye c0ee0f5597 暂存 4 days ago
zhangye a759cc61ab 暂存 4 days ago
lzp bb158a771c 量表套餐界面,套餐添加权限按钮 4 days ago
lzp 64769d26b9 柳铁默认筛查版本 4 days ago
zhangye 6b346542f1 修改同步用户 5 days ago
zhangye 93120bd663 修改柳铁bug 7 days ago
zhangye c57d2a6af4 修改柳铁数据源 7 days ago
zhangye 997f81f6ae 修改同步用户信息 1 week ago
zhangye 5569d19ad2 修改配置信息 1 week ago
zhangye 09496981a0 部署柳铁 1 week ago
zhangye a5bb791511 柳铁调用his接口同步部门和用户,未内网测试 1 week ago
  1. 2
      ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/enums/DataSourceType.java
  2. 8
      ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/config/DruidConfig.java
  3. 4
      ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml
  4. 2
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java
  5. 17
      ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml
  6. 2
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/DockController.java
  7. 43
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java
  8. 74
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java
  9. 12
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalViwe.java
  10. 18
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/HisConnectionDao.java
  11. 13
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/ILtHisConnectionService.java
  12. 4
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IPmsPatientService.java
  13. 562
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/LtHisConnectionServiceImpl.java
  14. 57
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/PmsPatientServiceImpl.java
  15. 7
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  16. 38
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  17. 6
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/HisConnectionDao.xml
  18. 185
      web_admin/adminapi/index.html
  19. BIN
      web_admin/adminapi/index.html.gz
  20. 2
      web_client/src/views/evaluation/index.vue
  21. 2
      web_client/vue.config.js

2
ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/enums/DataSourceType.java

@ -19,5 +19,5 @@ public enum DataSourceType {
/** /**
* 柳铁 * 柳铁
*/ */
ORACLE LTSZXYYORACLE
} }

8
ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/config/DruidConfig.java

@ -54,9 +54,9 @@ public class DruidConfig {
} }
@Bean @Bean
@ConfigurationProperties("spring.datasource.druid.oracle") @ConfigurationProperties("spring.datasource.druid.ltszxyyoracle")
@ConditionalOnProperty(prefix = "spring.datasource.druid.oracle", name = "enabled", havingValue = "true") @ConditionalOnProperty(prefix = "spring.datasource.druid.ltszxyyoracle", name = "enabled", havingValue = "true")
public DataSource oracleDataSource(DruidProperties druidProperties) { public DataSource ltszxyyDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource); return druidProperties.dataSource(dataSource);
} }
@ -67,7 +67,7 @@ public class DruidConfig {
Map<Object, Object> targetDataSources = new HashMap<>(); Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource"); setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
setDataSource(targetDataSources, DataSourceType.ORACLE.name(), "oracleDataSource"); // 添加这一行 setDataSource(targetDataSources, DataSourceType.LTSZXYYORACLE.name(), "ltszxyyDataSource"); // 添加这一行
return new DynamicDataSource(masterDataSource, targetDataSources); return new DynamicDataSource(masterDataSource, targetDataSources);
} }

4
ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -11,8 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="postId" column="post_id" /> <result property="postId" column="post_id" />
<result property="titleId" column="title_id" /> <result property="titleId" column="title_id" />
<result property="userName" column="user_name" /> <result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="emplCode" column="empl_code" /> <result property="emplCode" column="empl_code" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" /> <result property="email" column="email" />
<result property="phonenumber" column="phonenumber" /> <result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" /> <result property="sex" column="sex" />
@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.post_id, u.title_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.post_id, u.title_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_name, d.leader, d1.dept_name as parent_name, d1.dept_id as parent_id, d.dept_name, d.leader, d1.dept_name as parent_name, d1.dept_id as parent_id,
p.post_name, p.post_code, u.empl_code, u.valid_date, p.post_name, p.post_code,u.empl_code, u.valid_date,
t.title_name, u.skip_check_device, t.title_code t.title_name, u.skip_check_device, t.title_code
from ums_user u from ums_user u
left join ums_dept d on u.dept_id = d.dept_id left join ums_dept d on u.dept_id = d.dept_id

2
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java

@ -40,7 +40,7 @@ public class ReportPdfController {
@ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "") @ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "")
@PostMapping(value="/reportPDF") @PostMapping(value="/reportPDF")
public JsonResponse<PageInfo<RmsVo.ReportPDF>> reportPDF(@RequestBody @Validated BaseDto<RmsDto.ReportPDF> dto){ public JsonResponse<PageInfo<RmsVo.ReportPDF>> reportPDF(@RequestBody @Validated BaseDto<RmsDto.ReportPDF> dto){
log.info("通过就诊号查询患者的评估报告单:{}", dto); log.info("院内对接his通过就诊号查询患者的评估报告单:{}", dto);
startPage(dto); startPage(dto);
List<RmsVo.ReportPDF> list = rmsService.viewReportPDF(dto.getParam()); List<RmsVo.ReportPDF> list = rmsService.viewReportPDF(dto.getParam());
return JsonResponse.ok(new PageInfo<>(list)); return JsonResponse.ok(new PageInfo<>(list));

17
ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml

@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.0.128:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://200.1.8.141:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Sxinf18aA password: xian#2024!!!
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
@ -62,13 +62,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: localhost host: 172.17.0.1
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 1 database: 1
# 密码 # 密码
password: 123456 password: "redis111^#"
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -99,12 +99,12 @@ ht:
patientUrl: https://api.tall.wiki/ruisi/client/# patientUrl: https://api.tall.wiki/ruisi/client/#
name: 认知功能评测云平台系统 name: 认知功能评测云平台系统
file: file:
path: /data/cgav2/profile/ path: /data/cgav2/server/profile/
#domain: https://api.ccsens.com/test/ #domain: https://api.ccsens.com/test/
domain: http://116.204.40.58/ruisiClient domain: http://116.204.40.58/ruisiClient
imgDomain: http://116.204.40.58/ruisiClient/profile imgDomain: https://test.tall.wiki/htageClient/profile
reportDomain: /data/cgav2/server/profile
reportPath: /data/cgav2/server/profile reportPath: /data/cgav2/server/profile
reportDomain: /data/cgav2/server/profile
ldTemplate: /data/cgav2/server/profile/upload/dTemplate.xlsx ldTemplate: /data/cgav2/server/profile/upload/dTemplate.xlsx
ldTjbgDir: /data/cgav2/server/profile/tjbg/ ldTjbgDir: /data/cgav2/server/profile/tjbg/
ldExportDir: /data/cgav2/server/profile/ldExport ldExportDir: /data/cgav2/server/profile/ldExport
@ -112,9 +112,10 @@ file:
ldZQTYTemplate: /data/cgav2/server/profile/upload/2024年河津流调知情同意书模板-V1.docx ldZQTYTemplate: /data/cgav2/server/profile/upload/2024年河津流调知情同意书模板-V1.docx
grPath: /data/cgav2/server/profile/grReportTemplate.docx grPath: /data/cgav2/server/profile/grReportTemplate.docx
ysPath: /data/cgav2/server/profile/ysReportTemplate.docx ysPath: /data/cgav2/server/profile/ysReportTemplate.docx
allPath: /data/cgav2/server/profile/allReportTemplate.docx
informed: informed:
studySign: /data/cgav2/server/profile/studySign.png studySign: /data/cgav2/server/profile/studySign.png
template: /data/cgav2/server/profile/知情同意模板.docx template: /data/cgav2/server/profile/知情同意模板.docx
wordUrl: /data/cgav2/server/profile/informed/ wordUrl: /data/cgav2/server/profile/informed/
prefixWord: /data/cgav2/server/profile/ prefixWord: /data/cgav2/server/profile/

2
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/DockController.java

@ -50,10 +50,12 @@ public class DockController {
@ApiOperation("对接院内登录重定向至本系统") @ApiOperation("对接院内登录重定向至本系统")
@GetMapping("/redirect") @GetMapping("/redirect")
public void loginRedirect(String visitNo, String emplCode, HttpServletResponse response) throws IOException { public void loginRedirect(String visitNo, String emplCode, HttpServletResponse response) throws IOException {
log.info("院内登录重定向至本系统{}--{}", visitNo, emplCode);
//根据emplCode获取token //根据emplCode获取token
String token = loginService.getLoginByEmplCode(emplCode); String token = loginService.getLoginByEmplCode(emplCode);
// 3. 构建前端URL // 3. 构建前端URL
String frontendUrl = redirectPath + "?idCard=" + visitNo + "&token=Bearer " + token; String frontendUrl = redirectPath + "?idCard=" + visitNo + "&token=Bearer " + token;
log.info("重定向至本系统路径:{}", frontendUrl);
// 4. 重定向 // 4. 重定向
response.sendRedirect(frontendUrl); response.sendRedirect(frontendUrl);
} }

43
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java

@ -15,9 +15,11 @@ import com.ccsens.common.core.controller.BaseController;
import com.ccsens.common.core.domain.BaseDto; import com.ccsens.common.core.domain.BaseDto;
import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.JsonResponse;
import com.ccsens.common.core.domain.model.LoginUser; import com.ccsens.common.core.domain.model.LoginUser;
import com.ccsens.common.enums.DataSourceType;
import com.ccsens.common.exception.base.BaseException; import com.ccsens.common.exception.base.BaseException;
import com.ccsens.common.utils.SecurityUtils; import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.common.utils.sign.Md5Utils; import com.ccsens.common.utils.sign.Md5Utils;
import com.ccsens.framework.datasource.DynamicDataSourceContextHolder;
import com.ccsens.system.domain.dto.LdPatientDto; import com.ccsens.system.domain.dto.LdPatientDto;
import com.ccsens.system.domain.dto.PmsPatientDto; import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.po.HmsHospitalConfig; import com.ccsens.system.domain.po.HmsHospitalConfig;
@ -54,22 +56,25 @@ public class PmsController extends BaseController {
private IPmsPatientService patientService; private IPmsPatientService patientService;
@Resource @Resource
private IHmsService hmsService; private IHmsService hmsService;
// @Resource @Resource
// private ILtHisConnectionService ltHisConnectionService; private ILtHisConnectionService ltHisConnectionService;
private final String hospitalConfKey = "patient_encryption"; private final String hospitalConfKey = "patient_encryption";
@ApiOperation("获取患者信息列表") @ApiOperation("获取患者信息列表")
@PostMapping("/queryList") @PostMapping("/queryList")
public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) { public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) {
// List<PmsPatientVo.PatientList> list = new ArrayList<>(); List<PmsPatientVo.PatientList> list = new ArrayList<>();
// PmsPatientDto.QueryPatient param = dto.getParam(); PmsPatientDto.QueryPatient param = dto.getParam();
// if (StrUtil.isNotEmpty(param.getSearchValue()) && param.getSearchValue().length() == 10) { // if (StrUtil.isNotEmpty(param.getSearchValue()) && param.getSearchValue().length() == 10) {
// //关键字不为空,且长度等于10,先查询院内his信息 if(StrUtil.isNotEmpty(param.getSearchValue())) {
// List<PmsPatientVo.PatientList> hisList = ltHisConnectionService.queryHisPatient(param.getSearchValue()); //先查询院内his信息
// if (CollUtil.isNotEmpty(hisList)) { List<PmsPatientVo.PatientList> hisList = ltHisConnectionService.queryHisPatient(param.getSearchValue());
// list.addAll(hisList); if (CollUtil.isNotEmpty(hisList)) {
// } list.addAll(hisList);
}
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
}
// } // }
//获取用户的权限 //获取用户的权限
@ -86,18 +91,18 @@ public class PmsController extends BaseController {
startPageOvertop(dto); startPageOvertop(dto);
List<PmsPatientVo.PatientList> serverList = patientService.queryPatientList(dto.getParam(), dataScope, loginUser.getUserId(), loginUser.getUsername()); List<PmsPatientVo.PatientList> serverList = patientService.queryPatientList(dto.getParam(), dataScope, loginUser.getUserId(), loginUser.getUsername());
// if (CollUtil.isNotEmpty(serverList)) { if (CollUtil.isNotEmpty(serverList)) {
// list.addAll(serverList); list.addAll(serverList);
// } }
// // 创建一个 TreeSet,通过 Comparator 根据 patientId 去重 // 创建一个 TreeSet,通过 Comparator 根据 patientId 去重
// Set<PmsPatientVo.PatientList> uniqueSet = new TreeSet<>( Set<PmsPatientVo.PatientList> uniqueSet = new TreeSet<>(
// Comparator.comparing(PmsPatientVo.PatientList::getPatientId) Comparator.comparing(PmsPatientVo.PatientList::getPatientId)
// ); );
// uniqueSet.addAll(list); uniqueSet.addAll(list);
// List<PmsPatientVo.PatientList> uniqueList = new ArrayList<>(uniqueSet); List<PmsPatientVo.PatientList> uniqueList = new ArrayList<>(uniqueSet);
return JsonResponse.ok(new PageInfo<>(serverList)); return JsonResponse.ok(new PageInfo<>(uniqueList));
} }
@ApiOperation("通过身份证号查询患者信息,方便页面展示返回和列表一样的格式") @ApiOperation("通过身份证号查询患者信息,方便页面展示返回和列表一样的格式")

74
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java

@ -1,5 +1,6 @@
package com.ccsens.client.controller.scheduled; package com.ccsens.client.controller.scheduled;
import com.ccsens.client.service.ILtHisConnectionService;
import com.ccsens.common.annotation.DataSource; import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.core.domain.entity.SysDept; import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser; import com.ccsens.common.core.domain.entity.SysUser;
@ -22,44 +23,81 @@ public class SyncHospitalData {
@Resource @Resource
private DockService dockService; private DockService dockService;
@Resource
private ILtHisConnectionService ltHisConnectionService;
@DataSource(value = DataSourceType.SLAVE) // @DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?") // @Scheduled(cron = "0 */1 * * * ?")
public void syncHospitalData() { // public void syncHospitalData() {
dockService.syncHospitalData(); // dockService.syncHospitalData();
} // }
@DataSource(value = DataSourceType.SLAVE) // @DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?")
// public void syncDeptData() {
// try {
// List<SysDept> sysDepts = dockService.syncUmsDeptSlave();
// syncDeptMaster(sysDepts);
// }catch (Exception e){
// log.error("部门信息同步失败",e);
// }
//
// }
// @DataSource(value = DataSourceType.MASTER)
// public void syncDeptMaster(List<SysDept> sysDepts) {
// dockService.syncUmsDeptMaster(sysDepts);
// }
// @DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?") // @Scheduled(cron = "0 */1 * * * ?")
public void syncDeptData() { // public void syncUserData() {
// try {
// List<SysUser> sysUsers = dockService.syncUmsUserSlave();
// syncUserMaster(sysUsers);
// }catch (Exception e){
// log.error("用户信息同步失败",e);
// }
// }
// @DataSource(value = DataSourceType.MASTER)
// public void syncUserMaster(List<SysUser> sysUser) {
// dockService.syncUmsUserMaster(sysUser);
// }
/**
* 柳铁自动更新部门和用户信息
*/
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "0 */30 * * * ?")
public void syncDeptDataSlave() {
try { try {
List<SysDept> sysDepts = dockService.syncUmsDeptSlave(); List<SysDept> sysDepts = ltHisConnectionService.syncDeptDataSlave();
syncDeptMaster(sysDepts); syncDeptMaster(sysDepts);
}catch (Exception e){ } catch (Exception e) {
log.error("部门信息同步失败",e); log.error("部门信息同步失败", e);
} }
} }
@DataSource(value = DataSourceType.MASTER) @DataSource(value = DataSourceType.MASTER)
public void syncDeptMaster(List<SysDept> sysDepts) { public void syncDeptMaster(List<SysDept> sysDepts) {
dockService.syncUmsDeptMaster(sysDepts); ltHisConnectionService.syncDeptDataMaster(sysDepts);
} }
@DataSource(value = DataSourceType.SLAVE) @DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?") @Scheduled(cron = "0 */10 * * * ?")
public void syncUserData() { public void syncUserDataSlave() {
try { try {
List<SysUser> sysUsers = dockService.syncUmsUserSlave(); List<SysUser> sysUsers = ltHisConnectionService.syncUserDataSlave();
syncUserMaster(sysUsers); syncUserMaster(sysUsers);
}catch (Exception e){ } catch (Exception e) {
log.error("用户信息同步失败",e); log.error("用户信息同步失败", e);
} }
} }
@DataSource(value = DataSourceType.MASTER) @DataSource(value = DataSourceType.MASTER)
public void syncUserMaster(List<SysUser> sysUser) { public void syncUserMaster(List<SysUser> sysUser) {
dockService.syncUmsUserMaster(sysUser); ltHisConnectionService.syncUserDataMaster(sysUser);
} }
} }

12
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalViwe.java

@ -24,42 +24,42 @@ public class SyncHospitalViwe {
@Resource @Resource
private DockService dockService; private DockService dockService;
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getDeptView() { public void getDeptView() {
List<DockVo.DeptInfo> sysDepts = dockService.getDeptView(); List<DockVo.DeptInfo> sysDepts = dockService.getDeptView();
syncDeptView(sysDepts); syncDeptView(sysDepts);
} }
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getEmplView() { public void getEmplView() {
List<DockVo.EmplInfo> sysEmpls = dockService.getEmplView(); List<DockVo.EmplInfo> sysEmpls = dockService.getEmplView();
syncEmplView(sysEmpls); syncEmplView(sysEmpls);
} }
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getPatientBasicView() { public void getPatientBasicView() {
List<DockVo.PatientBasicInfo> sysPatients = dockService.getPatientBasicView(); List<DockVo.PatientBasicInfo> sysPatients = dockService.getPatientBasicView();
syncPatientBasicView(sysPatients); syncPatientBasicView(sysPatients);
} }
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getPatientVisitView() { public void getPatientVisitView() {
List<DockVo.PatientVisitInfo> sysVisits = dockService.getPatientVisitView(); List<DockVo.PatientVisitInfo> sysVisits = dockService.getPatientVisitView();
syncPatientVisitView(sysVisits); syncPatientVisitView(sysVisits);
} }
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getDiagnosisView() { public void getDiagnosisView() {
List<DockVo.DiagnosisInfo> sysDiagnosis = dockService.getDiagnosisView(); List<DockVo.DiagnosisInfo> sysDiagnosis = dockService.getDiagnosisView();
syncDiagnosisView(sysDiagnosis); syncDiagnosisView(sysDiagnosis);
} }
@DataSource(value = DataSourceType.ORACLE) // @DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
public void getMedicationView() { public void getMedicationView() {
List<DockVo.MedicationInfo> sysMedications = dockService.getMedicationView(); List<DockVo.MedicationInfo> sysMedications = dockService.getMedicationView();

18
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/HisConnectionDao.java

@ -12,12 +12,18 @@ import java.util.Map;
*/ */
public interface HisConnectionDao { public interface HisConnectionDao {
@DataSource(DataSourceType.SLAVE) // @DataSource(DataSourceType.LTSZXYYORACLE)
List<Map<String, Object>> getGmxx(String cardNo); // List<Map<String, Object>> getGmxx(String cardNo);
//
// @DataSource(DataSourceType.LTSZXYYORACLE)
// List<Map<String, Object>> getBlxx(String cardNo);
@DataSource(DataSourceType.SLAVE) @DataSource(DataSourceType.LTSZXYYORACLE)
List<Map<String, Object>> getBlxx(String cardNo);
@DataSource(DataSourceType.SLAVE)
List<Object> getBlxxAll(); List<Object> getBlxxAll();
@DataSource(DataSourceType.LTSZXYYORACLE)
List<Map<String, Object>> getBlxxByVisitNo(String visitNo);
@DataSource(DataSourceType.LTSZXYYORACLE)
List<Map<String, Object>> getGmxxByVisitNo(String visitNo);
} }

13
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/ILtHisConnectionService.java

@ -1,5 +1,7 @@
package com.ccsens.client.service; package com.ccsens.client.service;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
@ -14,7 +16,16 @@ public interface ILtHisConnectionService {
PmsPatientVo.PatientList getPatientByCardNo(String cardNo); PmsPatientVo.PatientList getPatientByCardNo(String cardNo);
Map<String, List<Map<String, Object>>> getPatientOtherMsgByCardNo(String cardNo, Long patientId); Map<String, List<Map<String, Object>>> getPatientOtherMsgByCardNo(String visitNo, String cardNo, Long patientId);
List<PmsPatientVo.PatientList> queryHisPatient(String cardNo); List<PmsPatientVo.PatientList> queryHisPatient(String cardNo);
List<SysDept> syncDeptDataSlave();
void syncDeptDataMaster(List<SysDept> sysDepts);
List<SysUser> syncUserDataSlave();
void syncUserDataMaster(List<SysUser> sysUsers);
} }

4
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IPmsPatientService.java

@ -2,7 +2,7 @@ package com.ccsens.client.service;
import com.ccsens.system.domain.dto.LdPatientDto; import com.ccsens.system.domain.dto.LdPatientDto;
import com.ccsens.system.domain.dto.PmsPatientDto; import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.po.PmsPatient; import com.ccsens.system.domain.po.*;
import com.ccsens.system.domain.vo.LdPatientVo; import com.ccsens.system.domain.vo.LdPatientVo;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
@ -36,7 +36,7 @@ public interface IPmsPatientService {
PmsPatientVo.PatientInfo editPatient(PmsPatient pmsPatient); PmsPatientVo.PatientInfo editPatient(PmsPatient pmsPatient);
Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param); Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param);
Long editPatientOtherMsgByHis(PmsPatientDto.EditOtherMsg param); void editPatientOtherMsgByHis(PmsPatientBody pmsPatientBody, PmsPatientPersonal pmsPatientPersonal, PmsPatientDiagnosis PmsPatientDiagnosis, PmsPatientParentIllness pmsPatientParentIllness);
Integer delPatient(PmsPatientDto.GetPatientById param); Integer delPatient(PmsPatientDto.GetPatientById param);
// //
// Long insertPatientIllnessHistory(AmsPatientReportDto.EditPatientIllnessHistory param,Long patientId); // Long insertPatientIllnessHistory(AmsPatientReportDto.EditPatientIllnessHistory param,Long patientId);

562
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/LtHisConnectionServiceImpl.java

@ -2,6 +2,8 @@ package com.ccsens.client.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -16,27 +18,28 @@ import com.ccsens.client.persist.dao.PmsPatientDao;
import com.ccsens.client.service.ILtHisConnectionService; import com.ccsens.client.service.ILtHisConnectionService;
import com.ccsens.client.service.IPmsPatientService; import com.ccsens.client.service.IPmsPatientService;
import com.ccsens.common.annotation.DataSource; import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysRole;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.common.core.domain.model.LoginUser; import com.ccsens.common.core.domain.model.LoginUser;
import com.ccsens.common.enums.DataSourceType; import com.ccsens.common.enums.DataSourceType;
import com.ccsens.common.utils.IDGenerator; import com.ccsens.common.utils.IDGenerator;
import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.framework.datasource.DynamicDataSourceContextHolder;
import com.ccsens.system.domain.SysUserRole;
import com.ccsens.system.domain.dto.PmsPatientDto; import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.po.PmsPatient; import com.ccsens.system.domain.po.*;
import com.ccsens.system.domain.po.PmsPatientBody;
import com.ccsens.system.domain.po.PmsPatientBodyExample;
import com.ccsens.system.domain.po.PmsPatientExample;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
import com.ccsens.system.persist.mapper.PmsPatientBodyMapper; import com.ccsens.system.persist.mapper.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -59,6 +62,19 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
private PmsPatientDao patientDao; private PmsPatientDao patientDao;
@Resource @Resource
private PmsPatientBodyMapper patientBodyMapper; private PmsPatientBodyMapper patientBodyMapper;
@Resource
private SysDeptMapper sysDeptMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private SysUserRoleMapper userRoleMapper;
@Resource
private SysRoleMapper sysRoleMapper;
@Value("${hospitalId:}")
private Long hospitalId;
@Value("${generalPassword:}")
private String generalPassword;
/** /**
* 前端调用查询列表接口如果有数据则直接返回 * 前端调用查询列表接口如果有数据则直接返回
@ -75,6 +91,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
//【RP1.1.4S054】查询患者档案信息 //【RP1.1.4S054】查询患者档案信息
private static final String URL_SUFFIX_RP_1_1_4 = "/patient-service/api/v1/patient/archives/get?cardNo="; private static final String URL_SUFFIX_RP_1_1_4 = "/patient-service/api/v1/patient/archives/get?cardNo=";
//查询住院记录http://200.1.8.36:7801/roc/patient-service/api/v1/patient/getFinIprList
//【RP2.1.6S062】查询门诊患者挂号记录 //【RP2.1.6S062】查询门诊患者挂号记录
private static final String URL_SUFFIX_RP_2_1_6 = "/patient-service/api/v1/register/patient/getFinOprRegList"; private static final String URL_SUFFIX_RP_2_1_6 = "/patient-service/api/v1/register/patient/getFinOprRegList";
@ -85,15 +102,40 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
//【RE2.1.5S234】新 获取病案首页基本信息 //【RE2.1.5S234】新 获取病案首页基本信息
private static final String URL_SUFFIX_RE_2_1_5 = "/patient-service/api/v1/patient/getFinOprRegList?inPatientNo="; private static final String URL_SUFFIX_RE_2_1_5 = "/patient-service/api/v1/patient/getFinOprRegList?inPatientNo=";
//【RC1.1.1S001】查询科室列表
private static final String URL_SUFFIX_RC_1_1_1 = "/curr-web/api/v1/common/dept/query";
//【RC1.1.3S003】查询人员列表
private static final String URL_SUFFIX_RC_1_1_3 = "/curr-web/api/v1/common/employee/query";
@Override @Override
public List<PmsPatientVo.PatientList> queryHisPatient(String cardNo) { public List<PmsPatientVo.PatientList> queryHisPatient(String cardNo) {
LoginUser loginUser = null; LoginUser loginUser = null;
try { try {
loginUser = getLoginUser(); loginUser = getLoginUser();
}catch (Exception e){ } catch (Exception e) {
} }
try { try {
//先试用传入的值查询病例视图
String visitNo = cardNo;
List<Map<String, Object>> blxx = new ArrayList<>();
try {
blxx = hisConnectionDao.getBlxxByVisitNo(cardNo);
log.info("查询视图blxx成功:{}", blxx.get(0));
} catch (Exception e) {
log.error("查询视图blxx异常", e);
}
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
if (CollUtil.isNotEmpty(blxx)) {
Map<String, Object> item = blxx.get(0);
Object object = item.get("患者卡号");
if(ObjectUtil.isNotNull(object)){
cardNo = object.toString();
}
}
PmsPatientVo.PatientList patientByCardNo = getPatientByCardNo(cardNo); PmsPatientVo.PatientList patientByCardNo = getPatientByCardNo(cardNo);
if (ObjectUtil.isNotNull(patientByCardNo)) { if (ObjectUtil.isNotNull(patientByCardNo)) {
//检查当前患者信息是否在系统内已存在 //检查当前患者信息是否在系统内已存在
@ -103,7 +145,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
List<PmsPatient> pmsPatients = patientDao.selectByExample(example); List<PmsPatient> pmsPatients = patientDao.selectByExample(example);
if (CollUtil.isEmpty(pmsPatients)) { if (CollUtil.isEmpty(pmsPatients)) {
pmsPatient = new PmsPatient(); pmsPatient = new PmsPatient();
}else { } else {
pmsPatient = pmsPatients.get(0); pmsPatient = pmsPatients.get(0);
} }
//查找到患者信息,先添加基本信息 //查找到患者信息,先添加基本信息
@ -114,6 +156,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
pmsPatient.setNameFull(PinyinUtil.getPinyin(pmsPatient.getName(), "")); pmsPatient.setNameFull(PinyinUtil.getPinyin(pmsPatient.getName(), ""));
pmsPatient.setNameInitial(PinyinUtil.getFirstLetter(pmsPatient.getName(), "")); pmsPatient.setNameInitial(PinyinUtil.getFirstLetter(pmsPatient.getName(), ""));
pmsPatient.setPatientNumber(cardNo); pmsPatient.setPatientNumber(cardNo);
pmsPatient.setMobile(patientByCardNo.getPhone());
PmsPatientVo.PatientInfo pmsPatientVo = patientService.editPatient(pmsPatient); PmsPatientVo.PatientInfo pmsPatientVo = patientService.editPatient(pmsPatient);
//保存id //保存id
@ -122,48 +165,53 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
try { try {
//根据就诊流水号查找当前患者是否有baby信息 //根据就诊流水号查找当前患者是否有baby信息
PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample(); PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample();
patientBodyExample.createCriteria().andOutpatientNoEqualTo(cardNo).andPatientIdEqualTo(patientByCardNo.getPatientId()).andDelFlagEqualTo((byte) 0); patientBodyExample.createCriteria().andOutpatientNoEqualTo(visitNo).andPatientIdEqualTo(patientByCardNo.getPatientId()).andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = patientBodyMapper.selectByExample(patientBodyExample); List<PmsPatientBody> pmsPatientBodies = patientBodyMapper.selectByExample(patientBodyExample);
if(CollUtil.isEmpty(pmsPatientBodies)){ if (CollUtil.isEmpty(pmsPatientBodies)) {
Map<String, List<Map<String, Object>>> patientOtherMsgByCardNo = getPatientOtherMsgByCardNo(cardNo,patientByCardNo.getPatientId()); Map<String, List<Map<String, Object>>> patientOtherMsgByCardNo = getPatientOtherMsgByCardNo(visitNo, cardNo, patientByCardNo.getPatientId());
addOtherMsg(patientOtherMsgByCardNo, patientByCardNo); // log.info("查询其他信息成功:{}", patientOtherMsgByCardNo);
// addOtherMsg(patientOtherMsgByCardNo, patientByCardNo);
} }
}catch (Exception e){ } catch (Exception e) {
log.error("获取患者其他信息失败", e); log.error("获取患者其他信息失败", e);
} }
List<PmsPatientVo.PatientList> list = new ArrayList<>(); List<PmsPatientVo.PatientList> list = new ArrayList<>();
list.add(patientByCardNo); list.add(patientByCardNo);
return list; return list;
}else { } else {
return null; return null;
} }
}catch (Exception e){ } catch (Exception e) {
log.error("查询患者失败", e); log.error("查询患者失败", e);
return null; return null;
} }
} }
public void addOtherMsg(Map<String, List<Map<String, Object>>> patientOtherMsgByCardNo, PmsPatientVo.PatientList patientByCardNo) {
if(CollUtil.isNotEmpty(patientOtherMsgByCardNo)){ // public void addOtherMsg(Map<String, List<Map<String, Object>>> patientOtherMsgByCardNo, PmsPatientVo.PatientList patientByCardNo) {
//不为空则添加其他信息 // if (CollUtil.isNotEmpty(patientOtherMsgByCardNo)) {
patientOtherMsgByCardNo.forEach((key, valueList) -> { // //不为空则添加其他信息
if(CollUtil.isNotEmpty(valueList)){ // patientOtherMsgByCardNo.forEach((key, valueList) -> {
valueList.forEach(value -> { // if (CollUtil.isNotEmpty(valueList)) {
com.alibaba.fastjson2.JSONObject valueJson = com.alibaba.fastjson2.JSONObject.parseObject(JSONUtil.toJsonStr(value)); // valueList.forEach(value -> {
valueJson.put("patientId", patientByCardNo.getPatientId()); // com.alibaba.fastjson2.JSONObject valueJson = com.alibaba.fastjson2.JSONObject.parseObject(JSONUtil.toJsonStr(value));
PmsPatientDto.EditOtherMsg param = new PmsPatientDto.EditOtherMsg(); // valueJson.put("patientId", patientByCardNo.getPatientId());
param.setEditType(key); // PmsPatientDto.EditOtherMsg param = new PmsPatientDto.EditOtherMsg();
param.setModel(valueJson); // param.setEditType(key);
patientService.editPatientOtherMsgByHis(param); // param.setModel(valueJson);
}); // log.info("添加其他信息:{}--{}", key, value);
} // patientService.editPatientOtherMsgByHis(param);
}); // });
} // }
} // });
// }
// }
@Override @Override
public PmsPatientVo.PatientList getPatientByCardNo(String cardNo) { public PmsPatientVo.PatientList getPatientByCardNo(String cardNo) {
PmsPatientVo.PatientList patientVo; PmsPatientVo.PatientList patientVo;
//调用"【RP1.1.4S054】查询患者档案信息"接口 //调用"【RP1.1.4S054】查询患者档案信息"接口
String url = URL_PREFIX + URL_SUFFIX_RP_1_1_4 + cardNo; String url = URL_PREFIX + URL_SUFFIX_RP_1_1_4 + cardNo;
@ -187,14 +235,14 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
log.warn("查询患者档案信息接口返回data为空"); log.warn("查询患者档案信息接口返回data为空");
return null; return null;
} }
// 取第一个患者信息 // 患者信息
patientVo = new PmsPatientVo.PatientList(); patientVo = new PmsPatientVo.PatientList();
patientVo.setPatientName(data.getStr("patientName")); patientVo.setPatientName(data.getStr("patientName"));
String genderCode = data.getStr("genderCode"); String genderCode = data.getStr("genderCode");
//TODO 性别需要实际调用接口后确定 //TODO 性别需要实际调用接口后确定
if ("1".equals(genderCode) || genderCode.contains("男")) { if ("1".equals(genderCode) || genderCode.contains("男")) {
patientVo.setSex((byte) 0); patientVo.setSex((byte) 0);
} else if ("0".equals(genderCode) || genderCode.contains("女")) { } else if ("0".equals(genderCode) || genderCode.contains("女") || "2".equals(genderCode)) {
patientVo.setSex((byte) 1); patientVo.setSex((byte) 1);
} }
patientVo.setBirthday(data.getStr("birthDate")); patientVo.setBirthday(data.getStr("birthDate"));
@ -210,10 +258,10 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
patientVo.setIdCardEncrypt(data.getStr("idCardNumber")); patientVo.setIdCardEncrypt(data.getStr("idCardNumber"));
patientVo.setAboBloodType(data.getStr("bloodCode")); patientVo.setAboBloodType(data.getStr("bloodCode"));
//TODO 职业和婚姻状况待定 //TODO 职业和婚姻状况待定
if(ObjectUtil.isNotNull(data.getStr("mari"))){ if (ObjectUtil.isNotNull(data.getStr("mari"))) {
patientVo.setMaritalStatus(Byte.valueOf(data.getStr("mari"))); patientVo.setMaritalStatus(Byte.valueOf(data.getStr("mari")));
} }
if(ObjectUtil.isNotNull(data.getStr("profCode"))){ if (ObjectUtil.isNotNull(data.getStr("profCode"))) {
patientVo.setCareer(Byte.valueOf(data.getStr("profCode"))); patientVo.setCareer(Byte.valueOf(data.getStr("profCode")));
} }
log.info("处理后的patient信息: {}", patientVo); log.info("处理后的patient信息: {}", patientVo);
@ -225,7 +273,13 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
} }
@Override @Override
public Map<String, List<Map<String, Object>>> getPatientOtherMsgByCardNo(String cardNo, Long patientId) { public Map<String, List<Map<String, Object>>> getPatientOtherMsgByCardNo(String visitNo, String cardNo, Long patientId) {
PmsPatientBody pmsPatientBody = new PmsPatientBody();
PmsPatientPersonal pmsPatientPersonal = new PmsPatientPersonal();
PmsPatientDiagnosis PmsPatientDiagnosis = new PmsPatientDiagnosis();
PmsPatientParentIllness pmsPatientParentIllness = new PmsPatientParentIllness();
//1.查询所有需要的信息 //1.查询所有需要的信息
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("cardNo", cardNo); params.put("cardNo", cardNo);
@ -241,17 +295,17 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
//查视图过敏信息 //查视图过敏信息
List<Map<String, Object>> gmxx = new ArrayList<>(); List<Map<String, Object>> gmxx = new ArrayList<>();
try { try {
gmxx = hisConnectionDao.getGmxx(cardNo); gmxx = hisConnectionDao.getGmxxByVisitNo(visitNo);
log.info("查询视图gmxx成功:{}", gmxx.get(0)); log.info("查询视图gmxx成功:{}", gmxx);
}catch (Exception e){ } catch (Exception e) {
log.error("查询视图gmxx异常", e); log.error("查询视图gmxx异常", e);
} }
//查视图病历信息 //查视图病历信息
List<Map<String, Object>> blxx = new ArrayList<>(); List<Map<String, Object>> blxx = new ArrayList<>();
try { try {
blxx = hisConnectionDao.getBlxx(cardNo); blxx = hisConnectionDao.getBlxxByVisitNo(visitNo);
log.info("查询视图blxx成功:{}", blxx.get(0)); log.info("查询视图blxx成功:{}", blxx);
}catch (Exception e){ } catch (Exception e) {
log.error("查询视图blxx异常", e); log.error("查询视图blxx异常", e);
} }
@ -260,34 +314,29 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
// 病史信息 - PmsPatientPersonal // 病史信息 - PmsPatientPersonal
List<Map<String, Object>> personalList = new ArrayList<>(); List<Map<String, Object>> personalList = new ArrayList<>();
Map<String, Object> personal = new HashMap<>(); Map<String, Object> personal = new HashMap<>();
personal.put("patientId", patientId); // personal.put("patientId", patientId);
personal.put("visitNo", cardNo); // personal.put("visitNo", visitNo);
pmsPatientPersonal.setPatientId(patientId);
pmsPatientPersonal.setVisitNo(visitNo);
if (CollUtil.isNotEmpty(blxx)) { if (CollUtil.isNotEmpty(blxx)) {
Map<String, Object> item = blxx.get(0); Map<String, Object> item = blxx.get(0);
log.info("视图blxx信息: {}", item); log.info("视图blxx信息: {}", item);
Map<String, Object> smokingMap = extractSmokingInfo((String) item.get("是否吸烟")); extractSmokingInfo((String) item.get("是否吸烟"),pmsPatientPersonal);
Map<String, Object> drinkMap = extractDrinkInfo((String) item.get("是否饮酒")); extractDrinkInfo((String) item.get("是否饮酒"),pmsPatientPersonal);
personal.putAll(smokingMap); // personal.putAll(smokingMap);
personal.putAll(drinkMap); // personal.putAll(drinkMap);
// personal.put("smokingHistory", item.get("是否吸烟"));
// personal.put("smokingYear", item.get("吸烟年限"));
// personal.put("smokingQuit", item.get("是否戒烟"));
// personal.put("smokingQuitYear", item.get("戒烟年限"));
// personal.put("drinkHistory", item.get("是否饮酒"));
// personal.put("drinkYear", item.get("饮酒年限"));
// personal.put("drinkQuit", item.get("是否戒酒"));
// personal.put("drinkQuitYear", item.get("戒酒年限"));
} }
// 过敏信息 - 也放入PmsPatientPersonal // 过敏信息 - 也放入PmsPatientPersonal
if (CollUtil.isNotEmpty(gmxx)) { if (CollUtil.isNotEmpty(gmxx)) {
Map<String, Object> item = gmxx.get(0); Map<String, Object> item = gmxx.get(0);
personal.put("allergyDrug", item.get("过敏信息")); // personal.put("allergyDrug", item.get("过敏信息"));
} pmsPatientPersonal.setAllergyDrug((String) item.get("过敏信息"));
personalList.add(personal);
if(CollUtil.isNotEmpty(personalList)){
result.put("pmsPatientPersonal", personalList);
} }
// personalList.add(personal);
// if (CollUtil.isNotEmpty(personalList)) {
// result.put("pmsPatientPersonal", personalList);
// }
//TODO "诊断用药(多个)对应数据库现病史 PmsPatientParentIllness" 暂无 //TODO "诊断用药(多个)对应数据库现病史 PmsPatientParentIllness" 暂无
@ -295,51 +344,86 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
List<Map<String, Object>> bodyList = new ArrayList<>(); List<Map<String, Object>> bodyList = new ArrayList<>();
Map<String, Object> bodyInfo = new HashMap<>(); Map<String, Object> bodyInfo = new HashMap<>();
// 基本信息 // 基本信息
bodyInfo.put("outpatientNo", cardNo); // bodyInfo.put("outpatientNo", visitNo);
bodyInfo.put("patientId", patientId); // bodyInfo.put("patientId", patientId);
if(ObjectUtil.isNotNull(zyData) && zyData != null){ pmsPatientBody.setOutpatientNo(visitNo);
bodyInfo.put("age", zyData.getStr("age")); pmsPatientBody.setPatientId(patientId);
bodyInfo.put("department", zyData.getStr("deptName")); if (ObjectUtil.isNotNull(zyData) && zyData != null) {
bodyInfo.put("doctor", zyData.getStr("directorDocName")); // bodyInfo.put("age", zyData.getStr("age"));
bodyInfo.put("admissionDate", zyData.getStr("inDate")); // bodyInfo.put("department", zyData.getStr("deptName"));
bodyInfo.put("admissionCount", zyData.getStr("inTimes")); // bodyInfo.put("doctor", zyData.getStr("directorDocName"));
bodyInfo.put("bedNumber", zyData.getStr("bedNo")); // bodyInfo.put("admissionDate", zyData.getStr("inDate"));
bodyInfo.put("dischargeDate", zyData.getStr("outDate")); // bodyInfo.put("admissionCount", zyData.getStr("inTimes"));
bodyInfo.put("diagnosisType","2"); // bodyInfo.put("bedNumber", zyData.getStr("bedNo"));
bodyInfo.put("isMainDiagnosis","1"); // bodyInfo.put("dischargeDate", zyData.getStr("outDate"));
bodyInfo.put("diagnosisName", zyData.getStr("ryDiagnose")); // bodyInfo.put("diagnosisType", "2");
bodyInfo.put("diagnosisCode", zyData.getStr("ryDiagnoseCode")); // bodyInfo.put("isMainDiagnosis", "1");
bodyInfo.put("diagnosisDate", zyData.getStr("inDate")); // bodyInfo.put("diagnosisName", zyData.getStr("ryDiagnose"));
// bodyInfo.put("diagnosisCode", zyData.getStr("ryDiagnoseCode"));
// bodyInfo.put("diagnosisDate", zyData.getStr("inDate"));
pmsPatientBody.setAge(zyData.getStr("age"));
pmsPatientBody.setDepartment(zyData.getStr("deptName"));
pmsPatientBody.setDoctor(zyData.getStr("directorDocName"));
pmsPatientBody.setAdmissionDate(zyData.getStr("inDate"));
pmsPatientBody.setAdmissionCount(zyData.getStr("inTimes"));
pmsPatientBody.setBedNumber(zyData.getStr("bedNo"));
pmsPatientBody.setDischargeDate(zyData.getStr("outDate"));
pmsPatientBody.setDiagnosisType("2");
pmsPatientBody.setIsMainDiagnosis("1");
pmsPatientBody.setDiagnosisName(zyData.getStr("ryDiagnose"));
pmsPatientBody.setDiagnosisCode(zyData.getStr("ryDiagnoseCode"));
pmsPatientBody.setDiagnosisDate(zyData.getStr("inDate"));
//如果住院信息不为空,查病案首页信息 //如果住院信息不为空,查病案首页信息
String baUrl = URL_PREFIX + URL_SUFFIX_RE_2_1_5 + zyData.getStr("inPatientNo"); String baUrl = URL_PREFIX + URL_SUFFIX_RE_2_1_5 + zyData.getStr("inPatientNo");
HttpResponse baResponse = getHttpResponse(baUrl); HttpResponse baResponse = getHttpResponse(baUrl);
JSONObject baData = getApiData(baResponse, "【RE2.1.5S234】新 获取病案首页基本信息"); JSONObject baData = getApiData(baResponse, "【RE2.1.5S234】新 获取病案首页基本信息");
if(ObjectUtil.isNotNull(baData) && baData != null){ if (ObjectUtil.isNotNull(baData) && baData != null) {
bodyInfo.put("admissionMethod", baData.getStr("inWay")); // bodyInfo.put("admissionMethod", baData.getStr("inWay"));
bodyInfo.put("dischargeMethod", baData.getStr("outType")); // bodyInfo.put("dischargeMethod", baData.getStr("outType"));
pmsPatientBody.setAdmissionMethod(baData.getStr("inWay"));
pmsPatientBody.setDischargeMethod(baData.getStr("outType"));
} }
}else if(ObjectUtil.isNotNull(mzData) && mzData != null){ } else if (ObjectUtil.isNotNull(mzData) && mzData != null) {
bodyInfo.put("age", mzData.getStr("age")); // bodyInfo.put("age", mzData.getStr("age"));
bodyInfo.put("department", mzData.getStr("deptName")); // bodyInfo.put("department", mzData.getStr("deptName"));
bodyInfo.put("doctor", mzData.getStr("docName")); // bodyInfo.put("doctor", mzData.getStr("docName"));
bodyInfo.put("admissionDate", mzData.getStr("receptDate")); // bodyInfo.put("admissionDate", mzData.getStr("receptDate"));
pmsPatientBody.setAge(mzData.getStr("age"));
pmsPatientBody.setDepartment(mzData.getStr("deptName"));
pmsPatientBody.setDoctor(mzData.getStr("docName"));
pmsPatientBody.setAdmissionDate(mzData.getStr("receptDate"));
} }
if (CollUtil.isNotEmpty(blxx)) { if (CollUtil.isNotEmpty(blxx)) {
Map<String, Object> item = blxx.get(0); Map<String, Object> item = blxx.get(0);
bodyInfo.put("height", item.get("身高")); // bodyInfo.put("height", item.get("身高"));
bodyInfo.put("weight", item.get("体重")); // bodyInfo.put("weight", item.get("体重"));
bodyInfo.put("temperature", item.get("体温")); // bodyInfo.put("temperature", item.get("体温"));
//TODO 血压需要处理 // //TODO 血压需要处理
bodyInfo.put("bloodPressureShrink", item.get("血压")); // bodyInfo.put("bloodPressureShrink", item.get("血压"));
bodyInfo.put("bloodPressureDiastole", item.get("血压")); // bodyInfo.put("bloodPressureDiastole", item.get("血压"));
bodyInfo.put("pulse", item.get("脉搏")); // bodyInfo.put("pulse", item.get("脉搏"));
bodyInfo.put("creatinine", item.get("肌酐")); // bodyInfo.put("creatinine", item.get("肌酐"));
} pmsPatientBody.setHeight((String) item.get("身高"));
bodyList.add(bodyInfo); pmsPatientBody.setWeight((String) item.get("体重"));
if(CollUtil.isNotEmpty(bodyList)){ pmsPatientBody.setTemperature((String) item.get("体温"));
result.put("pmsPatientBody", bodyList); pmsPatientBody.setPulse((String) item.get("脉搏"));
pmsPatientBody.setCreatinine((String) item.get("肌酐"));
if(ObjectUtil.isNotNull(item.get("血压"))){
String s = (String) item.get("血压");
String[] split = s.split("/");
if(split.length >= 2){
pmsPatientBody.setBloodPressureShrink(split[0]);
pmsPatientBody.setBloodPressureDiastole(split[1]);
}
}
} }
// bodyList.add(bodyInfo);
// if (CollUtil.isNotEmpty(bodyList)) {
// log.info("pmsPatientBody信息: {}", bodyInfo);
// result.put("pmsPatientBody", bodyList);
// }
//TODO 暂无 tz T值 //TODO 暂无 tz T值
// oxygenSaturation 血氧饱和度 // oxygenSaturation 血氧饱和度
@ -349,11 +433,15 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
// hematocrit 凝血酶原时间 // hematocrit 凝血酶原时间
// dimer D-二聚体 // dimer D-二聚体
log.info("pmsPatientBody信息: {}", pmsPatientBody);
log.info("pmsPatientPersonal信息: {}", pmsPatientPersonal);
log.info("pmsPatientDiagnosis信息: {}", PmsPatientDiagnosis);
log.info("pmsPatientParentIllness信息: {}", pmsPatientParentIllness);
patientService.editPatientOtherMsgByHis(pmsPatientBody, pmsPatientPersonal, PmsPatientDiagnosis, pmsPatientParentIllness);
return result; return result;
} }
private JSONObject getApiData(HttpResponse response, String errorString) { private JSONObject getApiData(HttpResponse response, String errorString) {
JSONObject mzData = null; JSONObject mzData = null;
if (response.isOk()) { if (response.isOk()) {
@ -367,7 +455,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
return null; return null;
} }
mzData = dataArray; mzData = dataArray;
}catch (Exception e){ } catch (Exception e) {
log.error(errorString + "接口-请求失败: {}", response.getStatus()); log.error(errorString + "接口-请求失败: {}", response.getStatus());
} }
} else { } else {
@ -397,12 +485,15 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
.execute(); .execute();
} }
public static Map<String, Object> extractSmokingInfo(String text) { public static void extractSmokingInfo(String text,PmsPatientPersonal pmsPatientPersonal) {
Map<String, Object> result = new HashMap<>(); // Map<String, Object> result = new HashMap<>();
if(StrUtil.isEmpty(text)){
return;
}
// 是否吸烟 - 先判断否定情况 // 是否吸烟 - 先判断否定情况
int smokingHistory = (text.contains("否认吸烟史") || text.contains("无吸烟史")) ? 0 : 1; int smokingHistory = (text.contains("否认吸烟史") || text.contains("无吸烟史")) ? 0 : 1;
result.put("smokingHistory", smokingHistory); // result.put("smokingHistory", smokingHistory);
pmsPatientPersonal.setSmokingHistory((byte) smokingHistory);
// 只有有吸烟史时才提取其他信息 // 只有有吸烟史时才提取其他信息
if (smokingHistory == 1) { if (smokingHistory == 1) {
@ -411,15 +502,22 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
Matcher matcher1 = pattern1.matcher(text); Matcher matcher1 = pattern1.matcher(text);
if (matcher1.find()) { if (matcher1.find()) {
String group = matcher1.group(1); String group = matcher1.group(1);
if(StrUtil.isNotBlank(group)){ if (StrUtil.isNotBlank(group)) {
result.put("smokingYear", group); // result.put("smokingYear", group);
try {
pmsPatientPersonal.setSmokingYear(Integer.parseInt(group));
}catch (Exception e){
log.error("吸烟年龄解析异常");
}
} }
} }
//是否戒烟 //是否戒烟
int smokingQuit = text.contains("未戒烟") ? 0 : 1; int smokingQuit = text.contains("未戒烟") ? 0 : 1;
result.put("smokingQuit", smokingQuit); // result.put("smokingQuit", smokingQuit);
pmsPatientPersonal.setSmokingQuit((byte) smokingQuit);
if(smokingQuit == 1){ if (smokingQuit == 1) {
Pattern pattern2 = Pattern.compile("已?戒(?:烟|酒)?\\s*(\\d+)\\s*(月|年)\\s*(?:余)?"); Pattern pattern2 = Pattern.compile("已?戒(?:烟|酒)?\\s*(\\d+)\\s*(月|年)\\s*(?:余)?");
Matcher matcher2 = pattern2.matcher(text); Matcher matcher2 = pattern2.matcher(text);
if (matcher2.find()) { if (matcher2.find()) {
@ -427,23 +525,32 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
String unit = matcher2.group(2); String unit = matcher2.group(2);
if ("月".equals(unit)) { if ("月".equals(unit)) {
result.put("smokingQuitYear", 1); // result.put("smokingQuitYear", 1);
pmsPatientPersonal.setSmokingQuitYear(1);
} else { } else {
result.put("smokingQuitYear", number); // result.put("smokingQuitYear", number);
try {
pmsPatientPersonal.setSmokingQuitYear(Integer.parseInt(number));
}catch (Exception e){
log.error("戒烟年龄解析异常");
}
} }
} }
} }
} }
return result; // return result;
} }
public static Map<String, Object> extractDrinkInfo(String text) { public static void extractDrinkInfo(String text,PmsPatientPersonal pmsPatientPersonal) {
Map<String, Object> result = new HashMap<>(); // Map<String, Object> result = new HashMap<>();
if(StrUtil.isEmpty(text)){
return;
}
// 是否吸烟 - 先判断否定情况 // 是否吸烟 - 先判断否定情况
int drinkHistory = (text.contains("否认饮酒史") || text.contains("无饮酒史")) ? 0 : 1; int drinkHistory = (text.contains("否认饮酒史") || text.contains("无饮酒史")) ? 0 : 1;
result.put("drinkHistory", drinkHistory); // result.put("drinkHistory", drinkHistory);
pmsPatientPersonal.setDrinkHistory((byte) drinkHistory);
// 只有有吸烟史时才提取其他信息 // 只有有吸烟史时才提取其他信息
if (drinkHistory == 1) { if (drinkHistory == 1) {
@ -452,15 +559,21 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
Matcher matcher1 = pattern1.matcher(text); Matcher matcher1 = pattern1.matcher(text);
if (matcher1.find()) { if (matcher1.find()) {
String group = matcher1.group(1); String group = matcher1.group(1);
if(StrUtil.isNotBlank(group)){ if (StrUtil.isNotBlank(group)) {
result.put("drinkYear", group); // result.put("drinkYear", group);
try {
pmsPatientPersonal.setDrinkYear(Integer.parseInt(group));
}catch (Exception e){
log.error("饮酒年龄解析异常");
}
} }
} }
//是否戒烟 //是否戒烟
int drinkQuit = text.contains("未戒酒") ? 0 : 1; int drinkQuit = text.contains("未戒酒") ? 0 : 1;
result.put("drinkQuit", drinkQuit); // result.put("drinkQuit", drinkQuit);
pmsPatientPersonal.setDrinkQuit((byte) drinkQuit);
if(drinkQuit == 1){ if (drinkQuit == 1) {
Pattern pattern2 = Pattern.compile("已?戒(?:烟|酒)?\\s*(\\d+)\\s*(月|年)\\s*(?:余)?"); Pattern pattern2 = Pattern.compile("已?戒(?:烟|酒)?\\s*(\\d+)\\s*(月|年)\\s*(?:余)?");
Matcher matcher2 = pattern2.matcher(text); Matcher matcher2 = pattern2.matcher(text);
if (matcher2.find()) { if (matcher2.find()) {
@ -468,15 +581,216 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService {
String unit = matcher2.group(2); String unit = matcher2.group(2);
if ("月".equals(unit)) { if ("月".equals(unit)) {
result.put("drinkQuitYear", 1); // result.put("drinkQuitYear", 1);
pmsPatientPersonal.setDrinkQuitYear(1);
} else { } else {
result.put("drinkQuitYear", number); // result.put("drinkQuitYear", number);
try {
pmsPatientPersonal.setDrinkQuitYear(Integer.parseInt(number));
}catch (Exception e){
log.error("饮酒年龄解析异常");
}
} }
} }
} }
} }
return result; // return result;
}
@Override
public List<SysDept> syncDeptDataSlave() {
List<SysDept> returnDepts = new ArrayList<>();
//查找部门信息
JSONArray deptData = queryDept();
//循环处理部门信息
for (int i = 0; i < deptData.size(); i++) {
JSONObject dept = deptData.getJSONObject(i);
SysDept sysDept = new SysDept();
sysDept.setDeptCode(dept.getStr("deptCode"));
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isEmpty(sysDepts)) {
sysDept.setParentId(hospitalId);
sysDept.setAncestors("0," + hospitalId);
sysDept.setDeptName(dept.getStr("deptName"));
sysDept.setDeptCode(dept.getStr("deptCode"));
sysDeptMapper.insertDept(sysDept);
returnDepts.add(sysDept);
} else {
sysDept = sysDepts.get(0);
sysDept.setParentId(hospitalId);
sysDept.setAncestors("0," + hospitalId);
sysDept.setDeptName(dept.getStr("deptName"));
sysDept.setDeptCode(dept.getStr("deptCode"));
sysDeptMapper.updateDept(sysDept);
returnDepts.add(sysDept);
}
}
return returnDepts;
} }
@Override
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncDeptDataMaster(List<SysDept> sysDepts) {
log.info("同步Master部门数据--{}--{}", sysDepts.size(), sysDepts.get(0));
if (CollUtil.isNotEmpty(sysDepts)) {
sysDepts.forEach(sysDept -> {
//根据code查找系统的部门信息
SysDept dept = new SysDept();
dept.setDeptCode(sysDept.getDeptCode());
List<SysDept> depts = sysDeptMapper.selectDeptList(dept);
if (CollUtil.isEmpty(depts)) {
sysDeptMapper.insertDept(sysDept);
} else {
SysDept sysDept1 = depts.get(0);
sysDept.setDeptId(sysDept1.getDeptId());
sysDeptMapper.updateDept(sysDept);
}
});
}
}
@Override
public List<SysUser> syncUserDataSlave() {
List<SysUser> returnUsers = new ArrayList<>();
//查询用户信息
JSONArray userData = queryUser();
//柳铁暂不处理部门权限,所有用户都是医院下,也不处理角色权限,所有都是测评师
//查询测评师角色
SysRole role = sysRoleMapper.queryRoleByRoleKey("yy_cps");
for (int i = 0; i < userData.size(); i++) {
JSONObject user = userData.getJSONObject(i);
//根据code查找部门信息
//
// Map<String, Object> userMap = new HashMap<>();
// userMap.put("deptCode", "lnb");
// userMap.put("emplCode", "admin");
// userMap.put("emplName", "adminName");
//
//
// JSONObject user = JSONUtil.parseObj(userMap);
SysDept sysDept = new SysDept();
sysDept.setDeptCode(user.getStr("deptCode"));
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isEmpty(sysDepts)) {
continue;
} else {
sysDept = sysDepts.get(0);
}
SysUser sysUser = new SysUser();
sysUser.setEmplCode(user.getStr("emplCode"));
List<SysUser> sysUsers = sysUserMapper.selectUserList(sysUser);
if (CollUtil.isEmpty(sysUsers)) {
sysUser.setDeptId(sysDept.getDeptId());
sysUser.setUserName("u_" + user.getStr("emplCode"));
sysUser.setNickName(user.getStr("emplName"));
sysUser.setEmplCode(user.getStr("emplCode"));
sysUser.setPassword(SecurityUtils.encryptPassword(generalPassword));
//获取一年后的日期
sysUser.setValidDate(DateUtil.offset(new Date(), DateField.YEAR, 1));
sysUserMapper.insertUser(sysUser);
// 新增用户与角色管理
if (role != null) {
SysUserRole ur = new SysUserRole();
ur.setUserId(sysUser.getUserId());
ur.setRoleId(role.getRoleId());
userRoleMapper.batchUserRole(CollUtil.newArrayList(ur));
}
returnUsers.add(sysUser);
} else {
SysUser u = sysUsers.get(0);
u.setDeptId(sysDept.getDeptId());
u.setNickName(user.getStr("emplName"));
sysUserMapper.updateUser(u);
returnUsers.add(u);
}
}
return returnUsers;
}
@Override
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncUserDataMaster(List<SysUser> sysUsers) {
log.info("同步Master用户数据--{}--{}", sysUsers.size(), sysUsers.get(0));
if (CollUtil.isNotEmpty(sysUsers)) {
for (SysUser sysUser : sysUsers) {
//根据code查找用户
SysUser user = new SysUser();
user.setEmplCode(sysUser.getEmplCode());
List<SysUser> users = sysUserMapper.selectUserList(user);
if (CollUtil.isEmpty(users)) {
sysUser.setDeptId(hospitalId);
sysUser.setPassword(SecurityUtils.encryptPassword(generalPassword));
log.info("master新增用户:{}", sysUser);
sysUserMapper.insertUser(sysUser);
} else {
sysUser.setUserId(users.get(0).getUserId());
log.info("master更新用户:{}", sysUser);
sysUserMapper.updateUser(sysUser);
}
}
}
}
private JSONArray queryUser() {
//调用接口查询用户数据
String url = URL_PREFIX + URL_SUFFIX_RC_1_1_3;
HttpResponse response = getHttpResponse(url);
String userBody;
if (response.isOk()) {
userBody = response.body();
} else {
log.error("【RP1.1.3】查询用户数据接口-请求失败: {}", response.getStatus());
return null;
}
try {
JSONObject json = JSONUtil.parseObj(userBody);
log.info("【RP1.1.3】查询用户数据接口-返回数据: {}", json);
JSONArray dataArray = json.getJSONArray("data");
if (CollUtil.isEmpty(dataArray)) {
log.warn("查询用户数据接口返回data为空");
return null;
}
return dataArray;
} catch (Exception e) {
log.error("【RP1.1.3】查询用户数据接口-解析数据失败: {}", e.getMessage());
return null;
}
}
private JSONArray queryDept() {
//调用接口查询部门数据
String url = URL_PREFIX + URL_SUFFIX_RC_1_1_1;
HttpResponse response = getHttpResponse(url);
String deptBody;
if (response.isOk()) {
deptBody = response.body();
} else {
log.error("【RP1.1.1】查询部门数据接口-请求失败: {}", response.getStatus());
return null;
}
try {
JSONObject json = JSONUtil.parseObj(deptBody);
log.info("【RP1.1.1】查询部门数据接口-返回数据: {}", json);
// 获取data数组(这里应该是JSONArray,不是JSONObject)
JSONArray dataArray = json.getJSONArray("data");
if (CollUtil.isEmpty(dataArray)) {
log.warn("查询部门数据接口返回data为空");
return null;
}
return dataArray;
} catch (Exception e) {
log.error("查询部门信息异常", e);
return null;
}
}
} }

57
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/PmsPatientServiceImpl.java

@ -230,7 +230,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
List<Map<String, Object>> pmsPatientBodyReturn = new ArrayList<>(); List<Map<String, Object>> pmsPatientBodyReturn = new ArrayList<>();
pmsPatientBodyReturn.add(JSON.parseObject(JSON.toJSONString(body), Map.class)); pmsPatientBodyReturn.add(JSON.parseObject(JSON.toJSONString(body), Map.class));
patientOtherMsg.put("pmsPatientBody", pmsPatientBodyReturn); patientOtherMsg.put("pmsPatientBody", pmsPatientBodyReturn);
if (visitNo != null) { if(visitNo != null) {
//烟酒史 //烟酒史
PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample(); PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample();
patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(pmsPatient.getId()) patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(pmsPatient.getId())
@ -421,6 +421,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
@Override @Override
public Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param) { public Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param) {
log.info("编辑病人其他信息:{}", param);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Object model = param.getModel(); Object model = param.getModel();
// 处理model参数 // 处理model参数
@ -434,7 +435,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
// Map转JSONObject // Map转JSONObject
jsonObject = (JSONObject) JSON.toJSON(model); jsonObject = (JSONObject) JSON.toJSON(model);
} }
log.info("处理后的其他信息jsonObject:{}", jsonObject);
// JSONObject jsonObject = null; // JSONObject jsonObject = null;
// if (param.getModel() instanceof JSONArray) { // if (param.getModel() instanceof JSONArray) {
// JSONArray array = (JSONArray) param.getModel(); // JSONArray array = (JSONArray) param.getModel();
@ -587,8 +588,56 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
@Override @Override
@DataSource(DataSourceType.SLAVE) @DataSource(DataSourceType.SLAVE)
public Long editPatientOtherMsgByHis(PmsPatientDto.EditOtherMsg param) { public void editPatientOtherMsgByHis(PmsPatientBody pmsPatientBody, PmsPatientPersonal pmsPatientPersonal, PmsPatientDiagnosis PmsPatientDiagnosis, PmsPatientParentIllness pmsPatientParentIllness) {
return editPatientOtherMsg(param); if(ObjectUtil.isNotNull(pmsPatientBody)){
//根据就诊号和患者id查询就诊信息是否存在
PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample();
patientBodyExample.createCriteria().andOutpatientNoEqualTo(pmsPatientBody.getOutpatientNo()).andPatientIdEqualTo(pmsPatientBody.getPatientId())
.andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample);
if (CollUtil.isNotEmpty(pmsPatientBodies)) {
//存在则修改
log.info("修改就诊信息:{}", pmsPatientBody);
PmsPatientBody oldPatientBody = pmsPatientBodies.get(0);
pmsPatientBody.setId(oldPatientBody.getId());
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
} else {
//不存在则添加
log.info("添加就诊信息:{}", pmsPatientBody);
pmsPatientBody.setId(IDGenerator.nextSnowflakeId());
pmsPatientBodyMapper.insertSelective(pmsPatientBody);
//首次添加就诊信息是,添加诊断和用药信息,后续同步不更新
if(ObjectUtil.isNotNull(PmsPatientDiagnosis)){
log.info("添加诊断信息:{}", PmsPatientDiagnosis);
PmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId());
pmsPatientDiagnosisMapper.insertSelective(PmsPatientDiagnosis);
}
if(ObjectUtil.isNotNull(pmsPatientParentIllness)){
log.info("添加用药信息:{}", pmsPatientParentIllness);
pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId());
pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness);
}
}
}
if(ObjectUtil.isNotNull(pmsPatientPersonal)){
//根据就诊号和患者id查询烟酒史
PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample();
patientPersonalExample.createCriteria().andVisitNoEqualTo(pmsPatientPersonal.getVisitNo()).andPatientIdEqualTo(pmsPatientPersonal.getPatientId())
.andDelFlagEqualTo((byte) 0);
List<PmsPatientPersonal> pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample);
if (CollUtil.isNotEmpty(pmsPatientPersonals)) {
//存在则修改
log.info("修改烟酒史信息:{}", pmsPatientBody);
PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0);
pmsPatientPersonal.setId(oldPatientPersonal.getId());
pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal);
}else {
log.info("添加烟酒史等信息:{}", pmsPatientPersonal);
pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId());
pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal);
}
}
} }
@Override @Override

7
ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml

@ -19,6 +19,13 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/ruisi_cga_yf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://127.0.0.1:3306/ruisi_cga_yf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: 123456 password: 123456
ltszxyyoracle:
# 从数据源开关/默认关闭
enabled: true
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@//200.1.8.115:1521/hisdb
username: interface_lnpg
password: interface_lnpg
# driverClassName: oracle.jdbc.driver.OracleDriver # driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@200.1.8.115:1521:hisdb # url: jdbc:oracle:thin:@200.1.8.115:1521:hisdb
# username: interface_lnpg # username: interface_lnpg

38
ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml

@ -6,23 +6,23 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.0.128:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://200.1.8.141:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Sxinf18aA password: xian#2024!!!
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: true
url: jdbc:mysql://172.28.145.18:23306/ruisi_cga_whszxyjhyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://200.1.8.141:23306/ruisi_cga_ltszxyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: xian#2024!!! password: xian#2024!!!
oracle: ltszxyyoracle:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: true enabled: true
driverClassName: oracle.jdbc.driver.OracleDriver driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@//192.168.1.5:1521/ORCL url: jdbc:oracle:thin:@//200.1.8.115:1521/hisdb
username: USER_LNPGXT username: interface_lnpg
password: Lnpgxt.2026 password: interface_lnpg
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
@ -69,13 +69,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: localhost host: 172.17.0.1
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 1 database: 1
# 密码 # 密码
password: 123456 password: "redis111^#"
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -88,20 +88,6 @@ spring:
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
# 核心:SpringBoot全局UTF-8编码配置
server:
# 配置Tomcat容器UTF-8编码(关键,解决URI中文解码)
tomcat:
uri-encoding: UTF-8 # 强制Tomcat对URI进行UTF-8解码
relaxed-path-chars: [ '%', '#', '&', '=', '|', ',', ';', '\\', ' ', '中' ] # 允许路径包含中文/特殊符号
# 全局请求/响应编码
servlet:
encoding:
enabled: true # 开启编码自动配置
charset: UTF-8 # 编码格式
force: true # 强制所有请求/响应使用UTF-8(覆盖容器默认编码)
force-request: true # 强制请求编码为UTF-8
force-response: true # 强制响应编码为UTF-8
app: app:
# 是否开启调式模式 # 是否开启调式模式
@ -138,6 +124,8 @@ informed:
#clientVersion: v1.8.2.0 #clientVersion: v1.8.2.0
clientVersion: v1.8.3.0 clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改 # 医院id,不同医院部署的时候需要修改
hospitalId: 106 hospitalId: 176
generalPassword: cga123# generalPassword: cga123#
redirectPath: http://200.1.8.141/cga/v2/client/#/sickList

6
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/HisConnectionDao.xml

@ -10,4 +10,10 @@
<select id="getBlxxAll" resultType="java.lang.Object"> <select id="getBlxxAll" resultType="java.lang.Object">
select * from view_lnpg_blxx select * from view_lnpg_blxx
</select> </select>
<select id="getBlxxByVisitNo" resultType="java.util.Map">
select * from view_lnpg_blxx where 患者流水号 = #{visitNo}
</select>
<select id="getGmxxByVisitNo" resultType="java.util.Map">
select * from view_lnpg_gmxx where 患者流水号 = #{visitNo}
</select>
</mapper> </mapper>

185
web_admin/adminapi/index.html

File diff suppressed because one or more lines are too long

BIN
web_admin/adminapi/index.html.gz

Binary file not shown.

2
web_client/src/views/evaluation/index.vue

@ -376,7 +376,7 @@ export default {
const { code, msg, data } = res; const { code, msg, data } = res;
if (code === 200) { if (code === 200) {
this.dictList = data; this.dictList = data;
this.version = "1982749726432432128"; this.version = "1982749703053381632";
} }
}, },
// //

2
web_client/vue.config.js

@ -38,7 +38,7 @@ module.exports = {
// target: "https://www.ylinno.com/cga/v2/api/client/", // target: "https://www.ylinno.com/cga/v2/api/client/",
target: "http://113.45.159.249:59001/cga/v2/api/client/", target: "http://113.45.159.249:59001/cga/v2/api/client/",
// target: "http://127.0.0.1:19331", // target: "http://127.0.0.1:19331",
// target: "http://192.168.1.136:19331", // target: "http://127.0.0.1:19331",
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + settings.proxyUrl]: "", ["^" + settings.proxyUrl]: "",

Loading…
Cancel
Save