| 
					
				 | 
			
			
				@ -243,7 +243,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 查询居民与某个医生未结束的咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 查询居民与某个医生未结束的专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param patient 居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param doctor  医生 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -257,7 +257,34 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.patient= '" +patient+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.to_doctor='" +doctor+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.del='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.type<> 9 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND (a.type<> 9 or a.type<> 16)" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.`status`=0"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String consultCode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (rstotal != null && rstotal.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							consultCode = rstotal.get(0).get("consultCode").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return consultCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 查询全科医生与某个医生未结束的专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param patient 居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param doctor  医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public String  getUnfinishedConsultByActualSender(String actualSender, String doctor) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT a.consult as consultCode " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.consult=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.to_doctor='" +doctor+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.actual_sender='" +actualSender+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.del='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.type<> 12 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.`status`=0"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1286,8 +1313,13 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject getConsultInfoAndPatientInfo(String consult,String patientCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						BasePatientDO basePatientDO = basePatientDao.findById(patientCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultDo consultDo = consultDao.findOne(consult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						BasePatientDO basePatientDO = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(StringUtils.isEmpty(patientCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							patientCode = consultDo.getPatient(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						basePatientDO = basePatientDao.findById(patientCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject patientinfoObj = new JSONObject(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1888,7 +1920,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.photo AS patientphoto " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.id=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.patient=d.id AND b.patient='"+patinet+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.actual_sender='"+doctor+"' "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1954,7 +1986,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS total " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.id=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.patient=d.id AND b.patient='"+patient+"' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.actual_sender='"+doctor+"' "; 
			 |