Ejemplo n.º 1
0
  private static synchronized void doLoad() {
    if (loaded) return;

    try {
      Display.masterLog("Loading Manufacturers...");
      RcopiaDb manufacturerDb =
          DatabaseFactory.instance().get(MANUFACTURER, Display.getMasterLogger());

      manufacturers = manufacturerDb.getAll();
      createMap();
    } catch (Exception e) {
      e.printStackTrace();
      ErrorMailServer.instance().mail("Cannot load manufacturer list: " + e.getMessage());
      throw new RuntimeException("Cannot load manufacturer list: " + e.getMessage());
    }

    loaded = true;
  }
Ejemplo n.º 2
0
  private void doLoad() {
    if (logger == null) logger = new Logger();

    if (loaded) return;

    try {
      logger.log("Loading State Prescription Variances...");
      RcopiaDb db = DatabaseFactory.instance().get(STATE_PHARMACY_VARIANCES, logger);

      ArrayList variances = db.getAll();
      createMap(variances);
    } catch (Exception e) {
      logger.log(e);
      ErrorMailServer.instance()
          .mail("Cannot load State Prescription Variances: " + e.getMessage());
      throw new SystemErrorException(
          "Cannot load  State Prescription Variances: " + e.getMessage());
    }

    loaded = true;
  }
Ejemplo n.º 3
0
  private static void loadDoses() throws IOException {
    RcopiaDb db = DatabaseFactory.instance().get(DOSE_CHECK, Display.getMasterLogger());

    ArrayList doses = db.getAll();

    Iterator iter = doses.iterator();
    while (iter.hasNext()) {
      RcopiaInfo info = (RcopiaInfo) iter.next();
      if (info.isDeleted()) continue;

      long drugID = info.getInt(DRUG_ID);
      if (drugID == 0) continue;

      if (!Y.equalsIgnoreCase(info.getString(IS_MAINTENANCE_DOSE))) continue;

      ArrayList list = (ArrayList) doseMap.get(drugID);
      if (list == null) {
        list = new ArrayList();
        doseMap.put(drugID, list);
      }

      list.add(info);
    }
  }