|
@ -976,7 +976,7 @@ public class FamilyContractService extends BaseService {
|
|
SignFamily sssignFamily = signFamilyDao.findSSByIdcard(p.getIdcard());
|
|
SignFamily sssignFamily = signFamilyDao.findSSByIdcard(p.getIdcard());
|
|
|
|
|
|
if (sssignFamily != null) {
|
|
if (sssignFamily != null) {
|
|
if(StringUtils.isNotEmpty(doctor)) {
|
|
|
|
|
|
if (StringUtils.isNotEmpty(doctor)) {
|
|
if (!doctor.equals(sssignFamily.getDoctor())) {
|
|
if (!doctor.equals(sssignFamily.getDoctor())) {
|
|
result.put("status", -2);
|
|
result.put("status", -2);
|
|
result.put("msg", "居民已签约三师,故全科医生只可为" + sssignFamily.getDoctorName() + "医生,请重新选择全科医生");
|
|
result.put("msg", "居民已签约三师,故全科医生只可为" + sssignFamily.getDoctorName() + "医生,请重新选择全科医生");
|
|
@ -1793,7 +1793,99 @@ public class FamilyContractService extends BaseService {
|
|
public List<SignFamily> findAllSignByPatient(String patient) {
|
|
public List<SignFamily> findAllSignByPatient(String patient) {
|
|
return signFamilyDao.findAllSignByPatient(patient);
|
|
return signFamilyDao.findAllSignByPatient(patient);
|
|
}
|
|
}
|
|
|
|
|
|
public List<SignFamily> findNoHealthSignFamilyNum(String doctor) {
|
|
public List<SignFamily> findNoHealthSignFamilyNum(String doctor) {
|
|
return signFamilyDao.findNoHealthSignFamilyNum(doctor);
|
|
return signFamilyDao.findNoHealthSignFamilyNum(doctor);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断居民与医生是否存在签约关系
|
|
|
|
*
|
|
|
|
* @param patient
|
|
|
|
* @param doctor
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject isPatientAndDoctorExistSign(String patient, String doctor) {
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
SignFamily familySign = signFamilyDao.findFamilySignByPatient(patient);
|
|
|
|
SignFamily sanshiSign = signFamilyDao.findSanshiSignByPatient(patient);
|
|
|
|
|
|
|
|
if (familySign != null) {
|
|
|
|
if (doctor.equals(StringUtils.isEmpty(familySign.getDoctor()) ? "" : familySign.getDoctor()) ||
|
|
|
|
doctor.equals(StringUtils.isEmpty(familySign.getDoctorHealth()) ? "" : familySign.getDoctorHealth())) {
|
|
|
|
if (familySign.getStatus() == 0) {
|
|
|
|
result.put("status", "0");
|
|
|
|
result.put("msg", "已申请家庭签约");
|
|
|
|
} else {
|
|
|
|
result.put("status", "1");
|
|
|
|
result.put("msg", "已有家庭签约");
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sanshiSign != null) {
|
|
|
|
if (doctor.equals(StringUtils.isEmpty(sanshiSign.getDoctor()) ? "" : sanshiSign.getDoctor()) ||
|
|
|
|
doctor.equals(StringUtils.isEmpty(sanshiSign.getDoctorHealth()) ? "" : sanshiSign.getDoctorHealth())) {
|
|
|
|
result.put("status", "2");
|
|
|
|
result.put("msg", "已有三师签约");
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result.put("status", "-1");
|
|
|
|
result.put("msg", "无签约关系");
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断医生与居民是否可签约
|
|
|
|
*
|
|
|
|
* @param patient
|
|
|
|
* @param doctor
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject isPatientAndDoctorCanSign(String patient, String doctor) {
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
Doctor doc = doctorDao.findByCode(doctor);
|
|
|
|
SignFamily familySign = signFamilyDao.findFamilySignByPatient(patient);
|
|
|
|
SignFamily sanshiSign = signFamilyDao.findSanshiSignByPatient(patient);
|
|
|
|
|
|
|
|
if (familySign != null) {
|
|
|
|
if (familySign.getStatus() == 0) {
|
|
|
|
result.put("status", "0");
|
|
|
|
result.put("msg", "已申请签约,不可签约");
|
|
|
|
} else {
|
|
|
|
result.put("status", "-1");
|
|
|
|
result.put("msg", "因已签约家庭医生,不可签约");
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
if (sanshiSign != null) {
|
|
|
|
if (doc.getLevel() == 2) {
|
|
|
|
if (!doctor.equals(StringUtils.isEmpty(sanshiSign.getDoctor()) ? "" : sanshiSign.getDoctor())) {
|
|
|
|
result.put("status", "-2");
|
|
|
|
result.put("msg", "因签约对象不含签约三师中全科,不可签约");
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
List<AdminTeam> teams = adminTeamService.findDoctorsTeams(doctor, sanshiSign.getDoctor());
|
|
|
|
if (teams == null || teams.size() < 1) {
|
|
|
|
result.put("status", "-3");
|
|
|
|
result.put("msg", "因签约对象不与签约三师中全科在同一团队,不可签约");
|
|
|
|
} else {
|
|
|
|
result.put("status", "1");
|
|
|
|
result.put("msg", "可签约");
|
|
|
|
result.put("team", teams);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result.put("status", "1");
|
|
|
|
result.put("msg", "可签约");
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
}
|
|
}
|