| 
					
				 | 
			
			
				@ -90,7 +90,7 @@ public class ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " b.doctor = h.doctor_code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "AND b.patient = '"+patient+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "AND b.type = "+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "AND b.type = "+type+" "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isEmpty(orgCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String doctor = sessionId.split("_")[1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += "AND b.doctor = '"+doctor+"' "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -589,12 +589,16 @@ public class ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (ct.getType()==23){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tmpDO.setDoctorCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tmpDO.setPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tmpDO.setType(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tmpDO.setRelationCode(ct.getConsult()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctorPatientTmpDao.save(tmpDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(doctorPatientTmpDao.findByPatientAndDoctorCodeAndType(patient,doctor,1)==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                tmpDO.setDoctorCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                tmpDO.setPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                tmpDO.setType(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                tmpDO.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                tmpDO.setRelationCode(ct.getConsult()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                doctorPatientTmpDao.save(tmpDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |