Exemplo n.º 1
0
  public String findPathnetOrderingProvider(String labId) {
    Hl7OrcDao dao = SpringUtils.getBean(Hl7OrcDao.class);
    for (Object[] o : dao.findOrcAndPidByMessageId(ConversionUtils.fromIntString(labId))) {
      Hl7Orc orc = (Hl7Orc) o[0];
      return justGetDocName(orc.getOrderingProvider());
    }

    return "";
  }
Exemplo n.º 2
0
  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;
  }