public List<HashMap<String, Object>> getMedicineUsageByList(List<Drug> drugList,Date startDate, Date endate){
		List<HashMap<String, Object>> result =new ArrayList<HashMap<String,Object>>();
		startDate.setDate(1);
		do{
			HashMap<String, Object> mp = new HashMap();
			mp.put("month", getMonthDetailsByDate(startDate));
			
			Date queryStartDate = new Date();
			queryStartDate.setTime(startDate.getTime());
			queryStartDate.setDate(1);
			
			Date queryEndDate = new Date();
			queryEndDate.setTime(startDate.getTime());
			queryEndDate.setDate(1);
			queryEndDate.setMonth(queryEndDate.getMonth()+1);
			queryEndDate.setDate(queryEndDate.getDate() - 1);
			
			TreatmentDao edao = (TreatmentDao) WebApplicationContextUtils
			.getRequiredWebApplicationContext(getServletContext()).getBean("TreatmentDao");
			
			
			
			List<Treatment> tr =  edao.getTreatmentsByDate(queryStartDate, queryEndDate);
			for (Treatment treatment : tr) {
				List<TreatmentDrug> tdr = (List<TreatmentDrug>) treatment.getTreatmentDrug();
				for (TreatmentDrug treatmentDrug : tdr) {
					long drugId = treatmentDrug.getDrugId();
					String duration = treatmentDrug.getDuration();
					String[] durArr = duration.split("-");
					long quantity = 0;
					for (int i = 0; i < durArr.length; i++) {
						if(durArr[i].trim().length() > 0 ){
							try{
								quantity = quantity + Long.parseLong(durArr[i].trim());
							}catch(Throwable e){
								
							}
						}
						
					}
					long noOfDays = treatmentDrug.getNoOfDays();
					long totalQuantity = quantity * noOfDays;
					for (Drug dg : drugList){
						
						if(mp.get(dg.getDrugName()) == null){
							mp.put(dg.getDrugName(), new Long(0));
						}
						if(dg.getDrugId() ==  drugId){
							mp.put(dg.getDrugName(), new Long(((Long)mp.get(dg.getDrugName())).longValue() + totalQuantity));
						}
						
					}
				}
			}
			startDate.setMonth(startDate.getMonth() + 1);
			result.add(mp);
		}while(!(startDate.getTime() > endate.getTime()));
		
		return result;
	}