Example #1
0
  private static void createMap() throws IOException {
    if (manufacturers == null) return;

    Iterator iter = manufacturers.iterator();
    while (iter.hasNext()) {
      RcopiaInfo item = (RcopiaInfo) iter.next();
      map.put(item.getID(), item);
    }
  }
  private static ArrayList getTestDescriptions(RcopiaUser user) throws IOException {
    RcopiaDb db = user.getDb(DRUG_HISTORY_ITEM);
    String cond = CREATEDDATE + "> sysdate-7";
    db.setResultMax(100);

    ArrayList list = db.getByConditions(cond);
    ArrayList descriptions = new ArrayList();
    if (list == null) return descriptions;

    Iterator iter = list.iterator();
    while (iter.hasNext()) {
      RcopiaInfo info = (RcopiaInfo) iter.next();
      String desc =
          info.getString(DRUG_NAME)
              + " "
              + info.getString("drug_strength_num")
              + " "
              + info.getString("drug_strength_unit_code");
      descriptions.add(desc);
    }

    return descriptions;
  }
Example #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);
    }
  }
  private void createMap(ArrayList variances) throws IOException {
    if (variances == null) return;

    Iterator iter = variances.iterator();
    while (iter.hasNext()) {
      RcopiaInfo variance = (RcopiaInfo) iter.next();
      String stateCode = variance.getString(STATECODE);
      if (Str.isEmpty(stateCode)) {
        logger.log("No statecode in variance record " + variance.getID());
        continue;
      }

      String key = variance.getString(KEY);
      String value = variance.getString(VALUE);

      HashMap stateMap = (HashMap) varianceMap.get(stateCode);
      if (stateMap == null) {
        stateMap = new HashMap();
        varianceMap.put(stateCode, stateMap);
      }

      stateMap.put(key, value);
    }
  }
  public int compare(Object obj1, Object obj2) {
    if (!(obj1 instanceof RcopiaInfo)) {
      throw new IllegalArgumentException(
          "InfoComparator cannot compare object to type " + obj1.getClass().getName());
    }

    if (!(obj2 instanceof RcopiaInfo)) {
      throw new IllegalArgumentException(
          "InfoComparator cannot compare object to type " + obj2.getClass().getName());
    }

    RcopiaInfo one = (RcopiaInfo) obj1;
    RcopiaInfo two = (RcopiaInfo) obj2;

    // this_patient_inverted_name, charges_provider_inverted_name,
    // charges_visit_date
    String name1 = one.getString(patientKeyName);
    String name2 = two.getString(patientKeyName);

    int comp = name1.compareTo(name2);
    if (comp != 0) return comp;

    name1 = one.getString(providerName);
    name2 = two.getString(providerName);

    comp = name1.compareTo(name2);
    if (comp != 0) return comp;

    Date lastupdateDate1 = one.getDate(dateKeyName);
    Date lastupdateDate2 = two.getDate(dateKeyName);

    if (lastupdateDate2 == null) return -1;

    if (lastupdateDate2.before(lastupdateDate1)) return -1;
    else return 1;
  }
Example #6
0
  private int compareRcopiaInfo(RcopiaInfo one, RcopiaInfo two) {
    String oneNote = one.getString(LIST_NOTE);
    String twoNote = two.getString(LIST_NOTE);

    return compareString(oneNote, twoNote);
  }