public String findPathnetObservationDate(String labId) {
   Hl7PidDao dao = SpringUtils.getBean(Hl7PidDao.class);
   Date date = dao.findObservationDateByMessageId(ConversionUtils.fromIntString(labId));
   if (date != null) {
     return ConversionUtils.toDateString(date);
   }
   return "";
 }
  public String getMatchingLabs(String labId) {
    String ret = "";
    String accessionNum = "";
    String labDate = "";
    int monthsBetween = 0;

    try {
      Hl7OrcDao orcDao = SpringUtils.getBean(Hl7OrcDao.class);

      // find the accession number
      for (Object[] o :
          orcDao.findFillerAndStatusChageByMessageId(ConversionUtils.fromIntString(labDate))) {
        String fillerOrderNumber = String.valueOf(o[0]);
        Date date = (Date) o[1];
        accessionNum = justGetAccessionNumber(fillerOrderNumber);
        labDate = ConversionUtils.toDateString(date);
      }

      Hl7PidDao pidDao = SpringUtils.getBean(Hl7PidDao.class);

      for (Object[] o : pidDao.findByFillerOrderNumber("%" + accessionNum + "%")) {
        String messageId = String.valueOf(o[0]);
        Date resultsReportStatusChange = (Date) o[1];

        Date dateA = resultsReportStatusChange;
        Date dateB = UtilDateUtilities.StringToDate(labDate, "yyyy-MM-dd HH:mm:ss");
        if (dateA.before(dateB)) {
          monthsBetween = UtilDateUtilities.getNumMonths(dateA, dateB);
        } else {
          monthsBetween = UtilDateUtilities.getNumMonths(dateB, dateA);
        }

        if (monthsBetween < 4) {

          if (ret.equals("")) ret = messageId;
          else ret = ret + "," + messageId;
        }
      }
    } catch (Exception e) {
      logger.error("exception in PathnetResultsData", e);
      return labId;
    }
    return ret;
  }
 public int findNumOfFinalResults(String labId) {
   Hl7PidDao dao = SpringUtils.getBean(Hl7PidDao.class);
   return dao.findByObservationResultStatusAndMessageId("F", ConversionUtils.fromIntString(labId))
       .size();
 }