|
|
|
@ -258,16 +258,15 @@ public class GMCService { |
|
|
|
|
|
|
|
|
|
|
|
String areaCode = bindInfo.getAreaCode(); |
|
|
|
String areaCode = bindInfo.getAreaCode(); |
|
|
|
if (ObjectUtils.isEmpty(areaCode)) { |
|
|
|
if (ObjectUtils.isEmpty(areaCode)) { |
|
|
|
areaCode = idCardNo.substring(0, 6); |
|
|
|
bindInfo.setAreaCode(idCardNo.substring(0, 6)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String finalAreaCode = areaCode; |
|
|
|
|
|
|
|
JsonResult jsonResult = postFormGMC(request, "/health_card/bindCardGmc", params -> { |
|
|
|
JsonResult jsonResult = postFormGMC(request, "/health_card/bindCardGmc", params -> { |
|
|
|
params.put("enOpenId", enGmcOpenId); // 主服务器的openId
|
|
|
|
params.put("enOpenId", enGmcOpenId); // 主服务器的openId
|
|
|
|
params.put("healthCardId", AesWxHelper.encode(bindInfo.getHealthCardId())); |
|
|
|
params.put("healthCardId", AesWxHelper.encode(bindInfo.getHealthCardId())); |
|
|
|
|
|
|
|
|
|
|
|
params.put("address", bindInfo.getAddress()); |
|
|
|
params.put("address", bindInfo.getAddress()); |
|
|
|
params.put("areaCode", finalAreaCode); |
|
|
|
params.put("areaCode", bindInfo.getAreaCode()); |
|
|
|
params.put("areaAddress", bindInfo.getAreaAddress()); |
|
|
|
params.put("areaAddress", bindInfo.getAreaAddress()); |
|
|
|
params.put("tel", AesWxHelper.encode(bindInfo.getTel())); |
|
|
|
params.put("tel", AesWxHelper.encode(bindInfo.getTel())); |
|
|
|
params.put("sex", bindInfo.getSex()); |
|
|
|
params.put("sex", bindInfo.getSex()); |
|
|
|
@ -307,17 +306,34 @@ public class GMCService { |
|
|
|
log.error("[医共体]主体绑定-数据enEmpiId解密失败"); |
|
|
|
log.error("[医共体]主体绑定-数据enEmpiId解密失败"); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Patient hisBindInfo = new HisPatientDao().bind(false, bindInfo); |
|
|
|
|
|
|
|
if (hisBindInfo == null) { |
|
|
|
|
|
|
|
log.error("[医共体]本院绑定失败"); |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String hisPatientId = hisBindInfo.getHisPatientId(); // 本院患者id
|
|
|
|
|
|
|
|
String hisEmpiId = hisBindInfo.getEmpiId(); // 医共体id
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(hisPatientId) || ObjectUtils.isEmpty(hisEmpiId)) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!hisEmpiId.equals(empiId)) { |
|
|
|
|
|
|
|
log.error("[医共体]本院id和主体医院id不匹配"); |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 主体绑定成功后,清除本院缓存
|
|
|
|
// 主体绑定成功后,清除本院缓存
|
|
|
|
GmcCacheManager.removeCacheGmcUser(openid); |
|
|
|
GmcCacheManager.removeCacheGmcUser(openid); |
|
|
|
|
|
|
|
bindInfo.setHisPatientId(hisPatientId); // 本院患者id
|
|
|
|
|
|
|
|
|
|
|
|
Patient patient = new Patient(); |
|
|
|
bindInfo.setEnGmcOpenId(enGmcOpenId); // 主体医院openid
|
|
|
|
patient.setEnGmcOpenId(enGmcOpenId); // 主体医院openid
|
|
|
|
bindInfo.setEnOpenId(enOpenId); // 本院openid
|
|
|
|
patient.setEnOpenId(enOpenId); // 本院openid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
patient.setGmcUniqueId(gmcUniqueId); // 主体医院唯一id
|
|
|
|
bindInfo.setGmcUniqueId(gmcUniqueId); // 主体医院唯一id
|
|
|
|
patient.setEnEmpiId(enEmpiId); |
|
|
|
bindInfo.setEnEmpiId(enEmpiId); |
|
|
|
patient.setEmpiId(empiId); |
|
|
|
bindInfo.setEmpiId(empiId); |
|
|
|
return patient; |
|
|
|
bindInfo.setPatientId(empiId); // 返回给前端的医共体id
|
|
|
|
|
|
|
|
return bindInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|