|
@ -796,8 +796,8 @@ public class FamilyContractService extends BaseService {
|
|
|
doctorTeamDoctor.save(wlyyDoctorTeamPatient);
|
|
|
|
|
|
// 患者标签设置
|
|
|
if(!(labelInfoService.setPatientLabels(patient.getCode(),patient.getIdcard(),
|
|
|
patient.getName(),healthLabel,disease,customLabel) == 1)){
|
|
|
if (!(labelInfoService.setPatientLabels(patient.getCode(), patient.getIdcard(),
|
|
|
patient.getName(), healthLabel, disease, customLabel) == 1)) {
|
|
|
throw new Exception("patient sign label settting error:" + patient.getIdcard());
|
|
|
}
|
|
|
|
|
@ -967,8 +967,8 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
|
|
|
// 患者标签设置
|
|
|
if(!(labelInfoService.setPatientLabels(p.getCode(),p.getIdcard(),
|
|
|
p.getName(),healthLabel,disease,customLabel) == 1)){
|
|
|
if (!(labelInfoService.setPatientLabels(p.getCode(), p.getIdcard(),
|
|
|
p.getName(), healthLabel, disease, customLabel) == 1)) {
|
|
|
throw new Exception("patient sign label settting error:" + p.getIdcard());
|
|
|
}
|
|
|
|
|
@ -1475,96 +1475,29 @@ public class FamilyContractService extends BaseService {
|
|
|
result.put("msg", "医生不存在");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(signFamily.getDoctorHealth())) {
|
|
|
// 取消原有健康管理师的家庭签约分组,并新增分组
|
|
|
List<DoctorPatientGroupInfo> groups = doctorPatientGroupInfoDao.findGroupInfoByPatientAndDoctor(signFamily.getDoctorHealth(), patient);
|
|
|
|
|
|
if (groups != null) {
|
|
|
List<DoctorPatientGroupInfo> newGroups = new ArrayList<>();
|
|
|
for (DoctorPatientGroupInfo group : groups) {
|
|
|
if (group.getGroup().equals("1") || group.getGroup().equals("2") || group.getGroup().equals("3")) {
|
|
|
DoctorPatientGroupInfo newGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
newGroup.setDoctor(doctor.getCode());
|
|
|
newGroup.setCzrq(new Date());
|
|
|
newGroup.setGroup(group.getGroup());
|
|
|
newGroup.setPatient(patient);
|
|
|
newGroup.setSignType("2");
|
|
|
newGroup.setStatus(1);
|
|
|
newGroup.setPname(group.getPname());
|
|
|
|
|
|
newGroups.add(newGroup);
|
|
|
}
|
|
|
group.setStatus(0);
|
|
|
group.setCzrq(new Date());
|
|
|
}
|
|
|
if (newGroups.size() > 0) {
|
|
|
doctorPatientGroupInfoDao.save(newGroups);
|
|
|
}
|
|
|
|
|
|
// 更新团队信息
|
|
|
if (StringUtils.isNotEmpty(signFamily.getTeamCode())) {
|
|
|
DoctorTeamMember teamMember = doctorTeamDoctor.findMemberByTeamAndCode(signFamily.getTeamCode(), signFamily.getDoctorHealth());
|
|
|
|
|
|
if (teamMember != null) {
|
|
|
teamMember.setDel("0");
|
|
|
teamMember.setCzrq(new Date());
|
|
|
}
|
|
|
|
|
|
DoctorTeamMember newTeamMember = new DoctorTeamMember();
|
|
|
|
|
|
newTeamMember.setCode(getCode());
|
|
|
newTeamMember.setMemberCode(doctor.getCode());
|
|
|
newTeamMember.setName(doctor.getName());
|
|
|
newTeamMember.setTeam(signFamily.getTeamCode());
|
|
|
newTeamMember.setDel("1");
|
|
|
newTeamMember.setSignType("2");
|
|
|
newTeamMember.setType(3);
|
|
|
newTeamMember.setCzrq(new Date());
|
|
|
|
|
|
doctorTeamDoctor.save(newTeamMember);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
// 新增分组
|
|
|
List<DoctorPatientGroupInfo> groups = doctorPatientGroupInfoDao.findGroupInfoByPatientAndDoctor(signFamily.getDoctor(), patient);
|
|
|
|
|
|
if (groups != null) {
|
|
|
List<DoctorPatientGroupInfo> newGroups = new ArrayList<>();
|
|
|
for (DoctorPatientGroupInfo group : groups) {
|
|
|
if (group.getGroup().equals("1") || group.getGroup().equals("2") || group.getGroup().equals("3")) {
|
|
|
DoctorPatientGroupInfo newGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
newGroup.setDoctor(doctor.getCode());
|
|
|
newGroup.setCzrq(new Date());
|
|
|
newGroup.setGroup(group.getGroup());
|
|
|
newGroup.setPatient(patient);
|
|
|
newGroup.setSignType("2");
|
|
|
newGroup.setStatus(1);
|
|
|
newGroup.setPname(group.getPname());
|
|
|
|
|
|
newGroups.add(newGroup);
|
|
|
}
|
|
|
}
|
|
|
if (newGroups.size() > 0) {
|
|
|
doctorPatientGroupInfoDao.save(newGroups);
|
|
|
}
|
|
|
// 新增团队信息
|
|
|
if (StringUtils.isNotEmpty(signFamily.getTeamCode())) {
|
|
|
DoctorTeamMember newTeamMember = new DoctorTeamMember();
|
|
|
|
|
|
newTeamMember.setCode(getCode());
|
|
|
newTeamMember.setMemberCode(doctor.getCode());
|
|
|
newTeamMember.setName(doctor.getName());
|
|
|
newTeamMember.setTeam(signFamily.getTeamCode());
|
|
|
newTeamMember.setDel("1");
|
|
|
newTeamMember.setSignType("2");
|
|
|
newTeamMember.setType(3);
|
|
|
newTeamMember.setCzrq(new Date());
|
|
|
|
|
|
doctorTeamDoctor.save(newTeamMember);
|
|
|
}
|
|
|
DoctorTeamMember teamMember = doctorTeamDoctor.findMemberByTeamAndCode(signFamily.getTeamCode(), signFamily.getDoctorHealth());
|
|
|
|
|
|
if (teamMember != null) {
|
|
|
teamMember.setDel("0");
|
|
|
teamMember.setCzrq(new Date());
|
|
|
doctorTeamDoctor.save(teamMember);
|
|
|
}
|
|
|
}
|
|
|
// 新增团队信息
|
|
|
if (StringUtils.isNotEmpty(signFamily.getTeamCode())) {
|
|
|
DoctorTeamMember newTeamMember = new DoctorTeamMember();
|
|
|
|
|
|
newTeamMember.setCode(getCode());
|
|
|
newTeamMember.setMemberCode(doctor.getCode());
|
|
|
newTeamMember.setName(doctor.getName());
|
|
|
newTeamMember.setTeam(signFamily.getTeamCode());
|
|
|
newTeamMember.setDel("1");
|
|
|
newTeamMember.setSignType("2");
|
|
|
newTeamMember.setType(3);
|
|
|
newTeamMember.setCzrq(new Date());
|
|
|
|
|
|
doctorTeamDoctor.save(newTeamMember);
|
|
|
}
|
|
|
|
|
|
signFamily.setDoctorHealth(doctor.getCode());
|
|
|
signFamily.setDoctorHealthName(doctor.getName());
|