|
@ -83,8 +83,44 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean exist(String patient, Integer type) {
|
|
|
int count = consultTeamDao.countByPatient(patient, type);
|
|
|
public boolean exist(String patient, Integer type) throws Exception {
|
|
|
DoctorTeamMember member = null;
|
|
|
// 咨询三师
|
|
|
if (type == 1) {
|
|
|
// 查询三师签约信息
|
|
|
SignFamily sc = signFamilyDao.findBySanshiPatientYes(patient);
|
|
|
if(sc == null){
|
|
|
throw new Exception("不存在三师签约");
|
|
|
}
|
|
|
// 设置健康管理师,三师咨询默认给健康管理师处理
|
|
|
//查找病人所在的团队
|
|
|
DoctorTeam doctorTeam = doctorTeamDao.findBySanshiParientCode(patient);
|
|
|
//得到团队的健康管理师
|
|
|
DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findDoctorSanshi2ByTeam(doctorTeam.getCode(), 3);
|
|
|
|
|
|
if (doctorTeamMember == null) {
|
|
|
doctorTeamMember = doctorTeamDoctor.findDoctorSanshi2ByTeam(doctorTeam.getCode(), 2);
|
|
|
}
|
|
|
} else if (type == 2) {
|
|
|
// 咨询家庭医生
|
|
|
SignFamily sf = signFamilyDao.findByjiatingPatient(patient);
|
|
|
if(sf == null){
|
|
|
throw new Exception("不存在家庭签约");
|
|
|
}
|
|
|
// 设置健康管理师,家庭医生咨询默认给健康管理师处理
|
|
|
//查找病人所在的团队
|
|
|
DoctorTeam doctorTeam = doctorTeamDao.findByParientCode(patient);
|
|
|
//得到团队的健康管理师
|
|
|
DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findDoctorJiating2ByTeam(doctorTeam.getCode(), 3);
|
|
|
|
|
|
if (doctorTeamMember == null) {
|
|
|
doctorTeamMember = doctorTeamDoctor.findDoctorJiating2ByTeam(doctorTeam.getCode(), 2);
|
|
|
}
|
|
|
}
|
|
|
if(member == null){
|
|
|
throw new Exception("找不到签约服务团队医生");
|
|
|
}
|
|
|
int count = consultTeamDao.countByPatient(patient, member.getMemberCode());
|
|
|
return count > 0;
|
|
|
}
|
|
|
|
|
@ -913,7 +949,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* 查询居民与某个医生未结束的咨询
|
|
|
*
|
|
|
* @param patient 居民
|
|
|
* @param doctor 医生
|
|
|
* @param doctor 医生
|
|
|
* @return
|
|
|
*/
|
|
|
public List<ConsultTeam> getUnfinishedConsult(String patient, String doctor) {
|
|
@ -954,9 +990,9 @@ public class ConsultTeamService extends ConsultService {
|
|
|
return consultTeamLogDao.findOne(logId);
|
|
|
}
|
|
|
|
|
|
public boolean isExistFamousConsult(String uid) {
|
|
|
ConsultTeam consultTeam = consultTeamDao.findFamousConsultByPatient(uid);
|
|
|
if (consultTeam != null) {
|
|
|
public boolean isExistConsult(String uid, String doctor) {
|
|
|
int consultTeam = consultTeamDao.countByPatient(uid, doctor);
|
|
|
if (consultTeam > 0) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return false;
|