|  | @ -3233,6 +3233,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             wlyyOutpatientDO.setDoctorCancelType(cancelType);
 | 
	
		
			
				|  |  |             wlyyOutpatientDO.setDoctorCancelValue(cancelValue);
 | 
	
		
			
				|  |  |             description = "医生拒绝接诊";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             //系统消息 医生取消复诊
 | 
	
		
			
				|  |  |             SystemMessageDO messageDO = new SystemMessageDO();
 | 
	
		
			
				|  |  |             messageDO.setTitle("医生取消复诊");
 | 
	
		
			
				|  |  |             messageDO.setType("12");
 | 
	
		
			
				|  |  |             messageDO.setSender(wlyyOutpatientDO.getDoctor());
 | 
	
		
			
				|  |  |             messageDO.setSenderName(wlyyOutpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |             messageDO.setRelationCode(wlyyOutpatientDO.getId());
 | 
	
		
			
				|  |  |             messageDO.setReceiver(wlyyOutpatientDO.getPatient());
 | 
	
		
			
				|  |  |             messageDO.setReceiverName(wlyyOutpatientDO.getPatientName());
 | 
	
		
			
				|  |  |             net.sf.json.JSONObject data = new net.sf.json.JSONObject();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             try {
 | 
	
		
			
				|  |  |                 data.put("name",wlyyOutpatientDO.getPatientName());
 | 
	
		
			
				|  |  |                 data.put("age",IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard()));
 | 
	
		
			
				|  |  |                 data.put("gender",IdCardUtil.getSexForIdcard(wlyyOutpatientDO.getIdcard()));
 | 
	
		
			
				|  |  |                 data.put("question",wlyyOutpatientDO.getIcd10Name());
 | 
	
		
			
				|  |  |                 String msg="";
 | 
	
		
			
				|  |  |                 if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
 | 
	
		
			
				|  |  |                     data.put("type","9");
 | 
	
		
			
				|  |  |                    msg+=wlyyOutpatientDO.getPatientName()+",您好! 您有一个图文复诊已被医生取消,取消原因:"+cancelValue+"。取消说明:"+cancelRemark+"。";
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
 | 
	
		
			
				|  |  |                     data.put("type","16");
 | 
	
		
			
				|  |  |                     msg+=wlyyOutpatientDO.getPatientName()+",您好! 您有一个视频复诊已被医生取消,取消原因:"+cancelValue+"。取消说明:"+cancelRemark+"。";
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 data.put("msg",msg);
 | 
	
		
			
				|  |  |                 messageDO.setData(data.toString());
 | 
	
		
			
				|  |  |                 systemMessageService.saveMessage(messageDO);
 | 
	
		
			
				|  |  |             } catch (Exception e) {
 | 
	
		
			
				|  |  |                 e.printStackTrace();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             //推送消息到眼科通
 | 
	
		
			
				|  |  |             BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient());
 | 
	
		
			
				|  |  |             if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
 | 
	
		
			
				|  |  |                 ykyyService.pushNotificationToYktPatient(patient.getYktId(),messageDO.getTitle(),data.get("msg").toString());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         outpatientDao.save(wlyyOutpatientDO);
 | 
	
	
		
			
				|  | @ -3734,7 +3773,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 " d.outpatient_type AS \"outpatientType\"," +
 | 
	
		
			
				|  |  |                 " a.total AS \"consultTotal\"," +
 | 
	
		
			
				|  |  |                 " h.org_name AS \"orgName\"," +
 | 
	
		
			
				|  |  |                 " h.org_code AS \"orgCode\"" +
 | 
	
		
			
				|  |  |                 " h.org_code AS \"orgCode\"," +
 | 
	
		
			
				|  |  |                 " follow.id AS followid "+
 | 
	
		
			
				|  |  |                 " FROM " +
 | 
	
		
			
				|  |  |                 " base_doctor d " +
 | 
	
		
			
				|  |  |                 " JOIN base_doctor_hospital h ON h.doctor_code = d.id "+
 | 
	
	
		
			
				|  | @ -3746,6 +3786,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         if ("0".equalsIgnoreCase(isAttention)) {
 | 
	
		
			
				|  |  |             sql += " join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient !='" + patientid + "' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isEmpty(isAttention)){
 | 
	
		
			
				|  |  |             sql+=" LEFT  JOIN base_doctor_patient_follow follow ON follow.patient='"+patientid+"' AND follow.doctor = d.id ";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(diseaseKey)){
 | 
	
		
			
				|  |  |             sql+=" left join wlyy_doctor_special_disease sp on d.id = sp.doctor_code ";
 | 
	
		
			
				|  |  |         }
 |