| 
					
				 | 
			
			
				@ -893,7 +893,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor,String source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject re = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						logger.info("boo"+boo); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -938,7 +938,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 医生未读数量为1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ct.setDoctorRead(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 添加咨询记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType(),source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		// 设置关联指导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		consult.setGuidance(ct.getGuidance()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置咨询标识 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1011,7 +1011,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param type 咨询类型:9在线复诊,13专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type,String source) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = new ConsultDo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setId(UUID.randomUUID().toString().replaceAll("-", "")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setCzrq(new Date()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1022,6 +1022,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setImages(images); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setType(type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setPayStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setSource(source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return consultDao.save(consult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1106,7 +1107,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param reason 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId,String source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						synchronized (outpatientCode.intern()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1227,7 +1228,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								//添加就诊图片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								ct.setImages(wlyyOutpatientDO.getDiseaseImg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								// 添加咨询记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								// 设置关联指导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								consult.setGuidance(ct.getGuidance()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								//关联业务code 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1345,7 +1346,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 添加复诊咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject addConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId,String source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1407,7 +1408,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//添加就诊图片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ct.setImages(wlyyOutpatientDO.getDiseaseImg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 添加咨询记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置关联指导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setGuidance(ct.getGuidance()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//关联业务code 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2569,7 +2570,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param images 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct,String source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置咨询类型:15 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ct.setType(15); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置发病时间 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2632,7 +2633,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 医生未读数量为1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ct.setDoctorRead(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 添加咨询记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置关联指导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		consult.setGuidance(ct.getGuidance()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//关联业务code 
			 |