Ejemplo n.º 1
0
  // TODO:HACK for now! replace with something more flexible
  public String getCSV() {
    String csv = null;
    if (denominator.hasReplaceableValues()) {
      String providerNo = (String) denominator.getReplaceableValues().get("provider_no");
      csv =
          "'"
              + getProviderStringName(providerNo)
              + "','"
              + getNumeratorCount()
              + "','"
              + getDenominatorCount()
              + "','"
              + getPercentageInt()
              + "'";
    } else {
      csv =
          "'"
              + getNumeratorCount()
              + "','"
              + getDenominatorCount()
              + "','"
              + getPercentageInt()
              + "'";
    }

    return csv;
  }
Ejemplo n.º 2
0
  public String getName() {
    StringBuilder name = new StringBuilder();
    name.append(numerator.getNumeratorName());
    name.append("/");
    name.append(denominator.getDenominatorName());
    if (denominator.hasReplaceableValues()) {
      name.append(" (");
      String[] repKeys = denominator.getReplaceableKeys();
      Hashtable repVals = denominator.getReplaceableValues();
      for (int i = 0; i < repKeys.length; i++) {
        // provider_no:999998  if key is provider_no look up provider name
        MiscUtils.getLogger().debug("repKeys " + repKeys[i]);
        if (repKeys[i] != null && repKeys[i].equals("provider_no")) {
          name.append("Provider: " + getProviderStringName("" + repVals.get(repKeys[i])));
        } else {
          name.append(repKeys[i] + ":" + repVals.get(repKeys[i]));
        }
      }
      name.append(")");
    }

    return name.toString();
  }
Ejemplo n.º 3
0
  public void evaluate(
      LoggedInInfo loggedInInfo,
      Denominator deno,
      Numerator numer,
      List<KeyValue> additionalFields) {
    denominator = deno;
    numerator = numer;
    List demoList = deno.getDenominatorList();
    denominatorCount = demoList.size();
    setReportResultList(new ArrayList<Hashtable<String, Object>>());
    for (int i = 0; i < demoList.size(); i++) {
      String demo = (String) demoList.get(i);
      boolean bool = numer.evaluate(loggedInInfo, demo);
      // Object obj = numer.getOutputValues();  // PROBLEM IS THAT THIS WILL ALWAYS HAVE A VALUE
      Hashtable<String, Object> h = new Hashtable<String, Object>();
      h.put("_demographic_no", demo);
      h.put("_report_result", new Boolean(bool));

      if (additionalFields != null) {
        for (KeyValue field : additionalFields) {
          String key = (String) field.getKey();
          String val = (String) field.getValue();

          EctMeasurementsDataBeanHandler ect =
              new EctMeasurementsDataBeanHandler(Integer.valueOf(demo), val);
          Collection<EctMeasurementsDataBean> v = ect.getMeasurementsDataVector();
          // Execute for the value and attach it to the key in the hashtable
          // Object obj =
          if (v.iterator().hasNext()) {
            h.put(key, v.iterator().next());
          }
        }
      }

      getReportResultList().add(h);
      //            if (obj != null){
      //                getReportResultList().add(obj);
      //            }
      if (bool) {
        numeratorCount++;
      }
    }
  }