Esempio n. 1
0
 /**
  * mark the pv if NVP concept
  *
  * @param curBean evs bean object
  * @param session HttpSession object
  */
 @SuppressWarnings("unchecked")
 public void markNVPConcept(EVS_Bean curBean, HttpSession session) {
   Vector<String> vNVP = (Vector) session.getAttribute("NVPConcepts");
   if (vNVP == null) vNVP = new Vector<String>();
   String conID = curBean.getCONCEPT_IDENTIFIER();
   if (conID != null && vNVP.contains(conID)) curBean.setNAME_VALUE_PAIR_IND(1);
   else curBean.setNAME_VALUE_PAIR_IND(0);
 }
Esempio n. 2
0
  /**
   * get the vocab attributes from teh user bean using filter attr and filter value to check and
   * return its equivaltnt attrs
   *
   * @param eUser EVS_userbean obtained from the database at login
   * @param sFilterValue string existing value
   * @param filterAttr int existing vocab name
   * @param retAttr int returning vocab name
   * @return value from returning vocab
   */
  public String getVocabAttr(
      EVS_UserBean eUser,
      String sFilterValue,
      int filterAttr,
      int retAttr) // String sFilterAttr, String sRetAttr)
      {
    // go back if origin is emtpy
    if (sFilterValue == null || sFilterValue.equals("")) return "";

    String sRetValue =
        sFilterValue; // sFilterValue is the value but the full name of 2) Select EVS Vocabulary
                      // from the front end (cdecurate) e.g. Logical Observation Identifier Names
                      // and Codes instead of LOINC
    Hashtable eHash = eUser.getVocab_Attr();
    Vector vVocabs = eUser.getVocabNameList();
    if (vVocabs == null) vVocabs = new Vector();
    // handle teh special case to make sure vocab for api query is valid
    if (filterAttr == EVSSearch.VOCAB_NULL) // (sFilterAttr == null || sFilterAttr.equals(""))
    {
      // it is valid vocab name
      if (vVocabs.contains(sFilterValue)) return sFilterValue; // found it
      // first check if filter value is from diplay vocab list
      Vector vDisplay = eUser.getVocabDisplayList();
      if (vDisplay != null && vDisplay.contains(sFilterValue)) {
        int iIndex = vDisplay.indexOf(sFilterValue);
        sRetValue = (String) vVocabs.elementAt(iIndex);
        return sRetValue; // found it
      }
      // filter it as dborigin
      filterAttr = EVSSearch.VOCAB_DBORIGIN; // sFilterAttr = "vocabDBOrigin";
    }
    for (int i = 0; i < vVocabs.size(); i++) {
      String sName = (String) vVocabs.elementAt(i);
      EVS_UserBean usrVocab = (EVS_UserBean) eHash.get(sName);
      String sValue = "";
      // check if the vocab is meta thesaurus
      String sMeta = usrVocab.getIncludeMeta();
      if (sMeta != null && !sMeta.equals("") && sMeta.equals(sFilterValue))
        return EVSSearch.META_VALUE; // "MetaValue";
      // get teh data from teh bean to match search
      if (filterAttr == EVSSearch.VOCAB_DISPLAY) // (sFilterAttr.equalsIgnoreCase("vocabDisplay"))
      sValue = usrVocab.getVocabDisplay();
      else if (filterAttr
          == EVSSearch.VOCAB_DBORIGIN) // (sFilterAttr.equalsIgnoreCase("vocabDBOrigin"))
      sValue = usrVocab.getVocabDBOrigin();
      else if (filterAttr == EVSSearch.VOCAB_NAME) // (sFilterAttr.equalsIgnoreCase("vocabName"))
      sValue = usrVocab.getVocabName();
      // do matching and return the value
      // System.out.println(sFilterValue + " getvocab " + sValue);
      //  if (sFilterValue.equalsIgnoreCase(sValue))  //check it later
      if (sFilterValue.contains(sValue)) {
        // get its value from teh bean for the return attr
        if (retAttr == EVSSearch.VOCAB_DISPLAY) // (sRetAttr.equalsIgnoreCase("vocabDisplay"))
        sRetValue = usrVocab.getVocabDisplay();
        else if (retAttr
            == EVSSearch.VOCAB_DBORIGIN) // (sRetAttr.equalsIgnoreCase("vocabDBOrigin"))
        sRetValue = usrVocab.getVocabDBOrigin();
        else if (retAttr == EVSSearch.VOCAB_NAME) // (sRetAttr.equalsIgnoreCase("vocabName"))
        sRetValue = usrVocab.getVocabName();
        break;
      }
    }
    // return the first vocab if null
    //  if ((sRetValue == null || sRetValue.equals("")) && vVocabs != null)
    //    sRetValue = (String)vVocabs.elementAt(0);
    // System.out.println(sRetValue + sFilterValue + filterAttr + retAttr);
    if (sRetValue == null) sRetValue = "";
    return sRetValue;
  }