|
@ -2279,6 +2279,9 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
|
|
|
|
|
|
String oldDoctor = signFamily.getDoctor();
|
|
|
String oldHdoctor = signFamily.getDoctorHealth();
|
|
|
|
|
|
if (signFamily == null) {
|
|
|
result.put("status", -1);
|
|
|
result.put("msg", "居民不存在家庭签约");
|
|
@ -2377,7 +2380,7 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
|
|
|
//1.4.2更新重点关注列表,取消关注
|
|
|
updateTrackPatient(patient,signFamily.getDoctorHealth());
|
|
|
updateTrackPatient(patient,oldHdoctor,oldDoctor,doctor,healthDoctor);
|
|
|
|
|
|
signFamily.setDoctorHealth(docHealth.getCode());
|
|
|
signFamily.setDoctorHealthName(docHealth.getName());
|
|
@ -2431,7 +2434,7 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
|
|
|
//1.4.2更新重点关注列表,取消关注
|
|
|
updateTrackPatient(patient,signFamily.getDoctor());
|
|
|
updateTrackPatient(patient,oldDoctor,oldHdoctor,doctor,healthDoctor);
|
|
|
|
|
|
signFamily.setDoctor(docQk.getCode());
|
|
|
signFamily.setDoctorName(docQk.getName());
|
|
@ -4325,11 +4328,58 @@ public class FamilyContractService extends BaseService {
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public void updateTrackPatient(String patient,String oldDoctor){
|
|
|
TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(oldDoctor,patient);
|
|
|
if(trackPatient!=null){
|
|
|
trackPatient.setDel("0");
|
|
|
trackPatientDao.save(trackPatient);
|
|
|
/**
|
|
|
* 设置取消关注
|
|
|
* @param patient
|
|
|
* @param oldDoctor 患者签约旧的要取消关注的医生
|
|
|
* @param oldDoctor2 患者旧的签约的另一个医生
|
|
|
* @param newDoctor 患者新签约的全科医生
|
|
|
* @param newHDoctor 患者新签约的健康管理师
|
|
|
*/
|
|
|
public void updateTrackPatient(String patient,String oldDoctor,String oldDoctor2,String newDoctor,String newHDoctor){
|
|
|
|
|
|
//是否需要修改
|
|
|
boolean flag = false;
|
|
|
|
|
|
if(StringUtils.isBlank(oldDoctor)){
|
|
|
return ;
|
|
|
}
|
|
|
//1.两个都修改
|
|
|
if(StringUtils.isNotBlank(newDoctor)&&StringUtils.isNotBlank(newHDoctor)){
|
|
|
if((!oldDoctor.equals(newDoctor))&&(!oldDoctor.equals(newHDoctor))){
|
|
|
flag = true;
|
|
|
}
|
|
|
//只改全科
|
|
|
}else if(StringUtils.isNotBlank(newDoctor)&&StringUtils.isBlank(newHDoctor)){
|
|
|
if(!oldDoctor.equals(newDoctor)){
|
|
|
if(StringUtils.isBlank(oldDoctor2)){
|
|
|
flag = true;
|
|
|
}else{
|
|
|
if(!oldDoctor.equals(oldDoctor2)){
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//只改健管
|
|
|
}else if(StringUtils.isBlank(newDoctor)&&StringUtils.isNotBlank(newHDoctor)){
|
|
|
if(!oldDoctor.equals(newHDoctor)){
|
|
|
if(StringUtils.isBlank(oldDoctor2)){
|
|
|
flag = true;
|
|
|
}else{
|
|
|
if(!oldDoctor.equals(oldDoctor2)){
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
return ;
|
|
|
}
|
|
|
if(flag){
|
|
|
TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(oldDoctor,patient);
|
|
|
if(trackPatient!=null){
|
|
|
trackPatient.setDel("0");
|
|
|
trackPatientDao.save(trackPatient);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|