public String getHtmlfilename(int diskId, String providerNo) {
   String obj = "";
   List<BillingONFilename> results = filenameDao.findByDiskIdAndProvider(diskId, providerNo);
   for (BillingONFilename result : results) {
     obj = result.getHtmlFilename();
   }
   return obj;
 }
  public List getMRIList(String sDate, String eDate, String status) {
    List retval = new Vector();
    BillingDiskNameData obj = null;

    try {
      List<BillingONDiskName> results =
          diskNameDao.findByCreateDateRangeAndStatus(
              dateformatter.parse(sDate), dateformatter.parse(eDate), status);

      for (BillingONDiskName b : results) {
        obj = new BillingDiskNameData();
        obj.setId("" + b.getId());
        obj.setMonthCode(b.getMonthCode());
        obj.setBatchcount("" + b.getBatchCount());
        obj.setOhipfilename(b.getOhipFilename());
        obj.setGroupno(b.getGroupNo());
        obj.setClaimrecord(b.getClaimRecord());
        obj.setCreatedatetime(tsFormatter.format(b.getCreateDateTime()));
        obj.setUpdatedatetime(tsFormatter.format(b.getTimestamp()));
        obj.setStatus(b.getStatus());
        obj.setTotal(b.getTotal());

        List<BillingONFilename> ff = filenameDao.findByDiskIdAndStatus(b.getId(), status);
        Vector vecHtmlfilename = new Vector();
        Vector vecProviderohipno = new Vector();
        Vector vecProviderno = new Vector();
        Vector vecClaimrecord = new Vector();
        Vector vecStatus = new Vector();
        Vector vecTotal = new Vector();
        Vector vecFilenameId = new Vector();

        for (BillingONFilename f : ff) {
          vecFilenameId.add("" + f.getId());
          vecHtmlfilename.add(f.getHtmlFilename());
          vecProviderohipno.add(f.getProviderOhipNo());
          vecProviderno.add(f.getProviderNo());
          vecClaimrecord.add(f.getClaimRecord());
          vecStatus.add(f.getStatus());
          vecTotal.add(f.getTotal());
        }
        obj.setVecFilenameId(vecFilenameId);
        obj.setHtmlfilename(vecHtmlfilename);
        obj.setProviderohipno(vecProviderohipno);
        obj.setProviderno(vecProviderno);
        obj.setVecClaimrecord(vecClaimrecord);
        obj.setVecStatus(vecStatus);
        obj.setVecTotal(vecTotal);
        retval.add(obj);
      }
    } catch (Exception e) {
      MiscUtils.getLogger().error("Error", e);
      retval = null;
    }
    return retval;
  }
  public BillingDiskNameData getDisknameObj(String diskId) {
    BillingDiskNameData obj = new BillingDiskNameData();

    BillingONDiskName b = diskNameDao.find(Integer.valueOf(diskId));
    if (b != null) {
      obj.setId("" + b.getId());
      obj.setMonthCode(b.getMonthCode());
      obj.setBatchcount("" + b.getBatchCount());
      obj.setOhipfilename(b.getOhipFilename());
      obj.setGroupno(b.getGroupNo());
      obj.setClaimrecord(b.getCreator());
      obj.setClaimrecord(b.getClaimRecord());
      obj.setCreatedatetime(tsFormatter.format(b.getCreateDateTime()));
      obj.setStatus(b.getStatus());
      obj.setTotal(b.getTotal());
      obj.setUpdatedatetime(tsFormatter.format(b.getTimestamp()));

      List<BillingONFilename> ff = filenameDao.findCurrentByDiskId(b.getId());
      Vector vecHtmlfilename = new Vector();
      Vector vecProviderohipno = new Vector();
      Vector vecProviderno = new Vector();
      Vector vecClaimrecord = new Vector();
      Vector vecStatus = new Vector();
      Vector vecTotal = new Vector();
      Vector vecFilenameId = new Vector();
      for (BillingONFilename f : ff) {
        vecFilenameId.add("" + f.getId());
        vecHtmlfilename.add(f.getHtmlFilename());
        vecProviderohipno.add(f.getProviderOhipNo());
        vecProviderno.add(f.getProviderNo());
        vecClaimrecord.add(f.getClaimRecord());
        vecStatus.add(f.getStatus());
        vecTotal.add(f.getTotal());
      }

      obj.setVecFilenameId(vecFilenameId);
      obj.setHtmlfilename(vecHtmlfilename);
      obj.setProviderohipno(vecProviderohipno);
      obj.setProviderno(vecProviderno);
      obj.setVecClaimrecord(vecClaimrecord);
      obj.setVecStatus(vecStatus);
      obj.setVecTotal(vecTotal);
    }

    return obj;
  }
  // add disk file
  public int addBillingDiskName(BillingDiskNameData val) {
    BillingONDiskName b = new BillingONDiskName();
    b.setMonthCode(val.monthCode);
    b.setBatchCount(Integer.parseInt(val.batchcount));
    b.setOhipFilename(val.ohipfilename);
    b.setGroupNo(val.groupno);
    b.setCreator(val.creator);
    b.setClaimRecord(val.claimrecord);
    b.setCreateDateTime(new Date());
    b.setStatus(val.status);
    b.setTotal(val.total);

    diskNameDao.persist(b);

    int retval = b.getId();

    if (b.getId() > 0) {
      // add filenames, if needed
      for (int i = 0; i < val.providerohipno.size(); i++) {
        BillingONFilename f = new BillingONFilename();
        f.setDiskId(b.getId());
        f.setHtmlFilename((String) val.htmlfilename.get(i));
        f.setProviderOhipNo((String) val.providerohipno.get(i));
        f.setProviderNo((String) val.providerno.get(i));
        f.setClaimRecord((String) val.vecClaimrecord.get(0));
        f.setStatus((String) val.vecStatus.get(0));
        f.setTotal((String) val.vecTotal.get(0));
        filenameDao.persist(f);
      }

    } else {
      retval = 0;
    }

    return retval;
  }