public boolean deleteReminder(String pid,int alertType){
		logger.error("Deleting the patient with patient id:"+pid+" for alert:"+alertType);
		boolean deletePatient=false;PAlert patientAlert=null;
		Patient patient=getPatient(pid);
		List list=getpatientAlert(pid,alertType);
		if(list!=null && list.size()>0)
			patientAlert=(PAlert) list.get(0);
		else{
			logger.info("Patient with pid:"+pid+"\t is not register for this alert");
			return false;
		}
		
		List allList=getpatientAllAlert(pid);
		
		if(allList.size()==1 && patient!=null)
			deletePatient=true;
		try{
			Session session = HibernateUtil.getSessionFactory().openSession();
			session.beginTransaction();
			if(patientAlert!=null){
				session.delete(patientAlert);
				if(deletePatient)
					session.delete(patient);
			}
			session.getTransaction().commit();
			session.close();
			return true;
		}
		catch(Exception ex){
			logger.error("unable to delete patient");
			return false;
		}
	}