|
|
|
@ -93,6 +93,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
|
|
|
|
//【RP1.1.4S054】查询患者档案信息
|
|
|
|
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】查询门诊患者挂号记录
|
|
|
|
private static final String URL_SUFFIX_RP_2_1_6 = "/patient-service/api/v1/register/patient/getFinOprRegList"; |
|
|
|
@ -117,6 +118,23 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
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); |
|
|
|
} |
|
|
|
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); |
|
|
|
if (ObjectUtil.isNotNull(patientByCardNo)) { |
|
|
|
//检查当前患者信息是否在系统内已存在
|
|
|
|
@ -137,6 +155,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
pmsPatient.setNameFull(PinyinUtil.getPinyin(pmsPatient.getName(), "")); |
|
|
|
pmsPatient.setNameInitial(PinyinUtil.getFirstLetter(pmsPatient.getName(), "")); |
|
|
|
pmsPatient.setPatientNumber(cardNo); |
|
|
|
pmsPatient.setMobile(patientByCardNo.getPhone()); |
|
|
|
|
|
|
|
PmsPatientVo.PatientInfo pmsPatientVo = patientService.editPatient(pmsPatient); |
|
|
|
//保存id
|
|
|
|
@ -145,10 +164,10 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
try { |
|
|
|
//根据就诊流水号查找当前患者是否有baby信息
|
|
|
|
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); |
|
|
|
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); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
@ -188,6 +207,8 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PmsPatientVo.PatientList getPatientByCardNo(String cardNo) { |
|
|
|
|
|
|
|
|
|
|
|
PmsPatientVo.PatientList patientVo; |
|
|
|
//调用"【RP1.1.4S054】查询患者档案信息"接口
|
|
|
|
String url = URL_PREFIX + URL_SUFFIX_RP_1_1_4 + cardNo; |
|
|
|
@ -211,7 +232,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
log.warn("查询患者档案信息接口返回data为空"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
// 取第一个患者信息
|
|
|
|
// 患者信息
|
|
|
|
patientVo = new PmsPatientVo.PatientList(); |
|
|
|
patientVo.setPatientName(data.getStr("patientName")); |
|
|
|
String genderCode = data.getStr("genderCode"); |
|
|
|
@ -249,7 +270,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
} |
|
|
|
|
|
|
|
@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) { |
|
|
|
//1.查询所有需要的信息
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("cardNo", cardNo); |
|
|
|
@ -285,7 +306,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
List<Map<String, Object>> personalList = new ArrayList<>(); |
|
|
|
Map<String, Object> personal = new HashMap<>(); |
|
|
|
personal.put("patientId", patientId); |
|
|
|
personal.put("visitNo", cardNo); |
|
|
|
personal.put("visitNo", visitNo); |
|
|
|
if (CollUtil.isNotEmpty(blxx)) { |
|
|
|
Map<String, Object> item = blxx.get(0); |
|
|
|
log.info("视图blxx信息: {}", item); |
|
|
|
@ -319,7 +340,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
List<Map<String, Object>> bodyList = new ArrayList<>(); |
|
|
|
Map<String, Object> bodyInfo = new HashMap<>(); |
|
|
|
// 基本信息
|
|
|
|
bodyInfo.put("outpatientNo", cardNo); |
|
|
|
bodyInfo.put("outpatientNo", visitNo); |
|
|
|
bodyInfo.put("patientId", patientId); |
|
|
|
if (ObjectUtil.isNotNull(zyData) && zyData != null) { |
|
|
|
bodyInfo.put("age", zyData.getStr("age")); |
|
|
|
@ -362,6 +383,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
} |
|
|
|
bodyList.add(bodyInfo); |
|
|
|
if (CollUtil.isNotEmpty(bodyList)) { |
|
|
|
log.info("pmsPatientBody信息: {}", bodyInfo); |
|
|
|
result.put("pmsPatientBody", bodyList); |
|
|
|
} |
|
|
|
|
|
|
|
@ -560,28 +582,28 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
public List<SysUser> syncUserDataSlave() { |
|
|
|
List<SysUser> returnUsers = new ArrayList<>(); |
|
|
|
//查询用户信息
|
|
|
|
// JSONArray userData = queryUser();
|
|
|
|
JSONArray userData = queryUser(); |
|
|
|
//柳铁暂不处理部门权限,所有用户都是医院下,也不处理角色权限,所有都是测评师
|
|
|
|
//查询测评师角色
|
|
|
|
SysRole role = sysRoleMapper.queryRoleByRoleKey("yy_cps"); |
|
|
|
// for (int i = 0; i < userData.size(); i++) {
|
|
|
|
// JSONObject user = userData.getJSONObject(i);
|
|
|
|
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); |
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
continue; |
|
|
|
} else { |
|
|
|
sysDept = sysDepts.get(0); |
|
|
|
} |
|
|
|
@ -612,7 +634,7 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
sysUserMapper.updateUser(u); |
|
|
|
returnUsers.add(u); |
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
return returnUsers; |
|
|
|
} |
|
|
|
|
|
|
|
|