Program: 84554
Project: 84554
Buggy source:
/** 
 * This method produces a model containing the following mappings: (always) (java.util.Date) now (String) size (Locale) locale (other parameters) (if there's currently an authenticated user) (User) authenticatedUser (Cohort) myPatientSet (the user's selected patient set, PatientSetService.getMyPatientSet()) (if the request has a patientId attribute) (Integer) patientId (Patient) patient (Set<Obs>) patientObs (Set<Encounter>) patientEncounters (List<DrugOrder>) patientDrugOrders (List<DrugOrder>) currentDrugOrders (List<DrugOrder>) completedDrugOrders (Obs) patientWeight // most recent weight obs (Obs) patientHeight // most recent height obs (Double) patientBmi // BMI derived from most recent weight and most recent height (String) patientBmiAsString // BMI rounded to one decimal place, or "?" if unknown (Integer) personId (if the patient has any obs for the concept in the global property 'concept.reasonExitedCare') (Obs) patientReasonForExit (if the request has a personId or patientId attribute) (Person) person (List<Relationship>) personRelationships (Map<RelationshipType, List<Relationship>>) personRelationshipsByType (if the request has an encounterId attribute) (Integer) encounterId (Encounter) encounter (Set<Obs>) encounterObs (if the request has a userId attribute) (Integer) userId (User) user (if the request has a patientIds attribute, which should be a (String) comma-separated list of patientIds) (PatientSet) patientSet (String) patientIds (if the request has a conceptIds attribute, which should be a (String) commas-separated list of conceptIds) (Map<Integer, Concept>) conceptMap (Map<String, Concept>) conceptMapByStringIds
 */
@SuppressWarnings("String_Node_Str") public ModelAndView handleRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  AdministrationService as=Context.getAdministrationService();
  ConceptService cs=Context.getConceptService();
  Object uri=request.getAttribute("String_Node_Str");
  String portletPath="String_Node_Str";
  Map<String,Object> model=null;
{
    HttpSession session=request.getSession();
    String uniqueRequestId=(String)request.getAttribute(WebConstants.INIT_REQ_UNIQUE_ID);
    String lastRequestId=(String)session.getAttribute(WebConstants.OPENMRS_PORTLET_LAST_REQ_ID);
    if (uniqueRequestId.equals(lastRequestId))     model=(Map<String,Object>)session.getAttribute(WebConstants.OPENMRS_PORTLET_CACHED_MODEL);
    if (model == null) {
      log.debug("String_Node_Str");
      model=new HashMap<String,Object>();
      session.setAttribute(WebConstants.OPENMRS_PORTLET_LAST_REQ_ID,uniqueRequestId);
      session.setAttribute(WebConstants.OPENMRS_PORTLET_CACHED_MODEL,model);
    }
  }
  if (uri != null) {
    long timeAtStart=System.currentTimeMillis();
    portletPath=uri.toString();
    if (portletPath.endsWith("String_Node_Str"))     portletPath=portletPath.replace("String_Node_Str","String_Node_Str");
 else     if (portletPath.endsWith("String_Node_Str"))     throw new ServletException("String_Node_Str");
    log.debug("String_Node_Str" + portletPath);
    String id=(String)request.getAttribute("String_Node_Str");
    String size=(String)request.getAttribute("String_Node_Str");
    Map<String,Object> params=(Map<String,Object>)request.getAttribute("String_Node_Str");
    Map<String,Object> moreParams=(Map<String,Object>)request.getAttribute("String_Node_Str");
    model.put("String_Node_Str",new Date());
    model.put("String_Node_Str",id);
    model.put("String_Node_Str",size);
    model.put("String_Node_Str",Context.getLocale());
    model.putAll(params);
    if (moreParams != null) {
      model.putAll(moreParams);
    }
    if (Context.getAuthenticatedUser() != null) {
      model.put("String_Node_Str",Context.getAuthenticatedUser());
      model.put("String_Node_Str",Context.getPatientSetService().getMyPatientSet());
    }
    Integer personId=null;
    Object o=request.getAttribute("String_Node_Str");
    if (o != null) {
      String patientVariation="String_Node_Str";
      Integer patientId=(Integer)o;
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PATIENTS)) {
          Patient p=Context.getPatientService().getPatient(patientId);
          model.put("String_Node_Str",p);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ENCOUNTERS))           model.put("String_Node_Str",Context.getEncounterService().getEncountersByPatient(p));
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_OBS)) {
            List<Obs> patientObs=Context.getObsService().getObservationsByPerson(p);
            model.put("String_Node_Str",patientObs);
            Obs latestWeight=null;
            Obs latestHeight=null;
            String bmiAsString="String_Node_Str";
            try {
              ConceptNumeric weightConcept=cs.getConceptNumeric(cs.getConcept(as.getGlobalProperty("String_Node_Str")).getConceptId());
              ConceptNumeric heightConcept=cs.getConceptNumeric(cs.getConcept(as.getGlobalProperty("String_Node_Str")).getConceptId());
              for (              Obs obs : patientObs) {
                if (obs.getConcept().equals(weightConcept)) {
                  if (latestWeight == null || obs.getObsDatetime().compareTo(latestWeight.getObsDatetime()) > 0)                   latestWeight=obs;
                }
 else                 if (obs.getConcept().equals(heightConcept)) {
                  if (latestHeight == null || obs.getObsDatetime().compareTo(latestHeight.getObsDatetime()) > 0)                   latestHeight=obs;
                }
              }
              if (latestWeight != null)               model.put("String_Node_Str",latestWeight);
              if (latestHeight != null)               model.put("String_Node_Str",latestHeight);
              if (latestWeight != null && latestHeight != null) {
                double weightInKg;
                double heightInM;
                if (weightConcept.getUnits().equals("String_Node_Str"))                 weightInKg=latestWeight.getValueNumeric();
 else                 if (weightConcept.getUnits().equals("String_Node_Str"))                 weightInKg=latestWeight.getValueNumeric() * 0.45359237;
 else                 throw new IllegalArgumentException("String_Node_Str" + weightConcept.getUnits());
                if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric() / 100;
 else                 if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric();
 else                 if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric() * 0.0254;
 else                 throw new IllegalArgumentException("String_Node_Str" + heightConcept.getUnits());
                double bmi=weightInKg / (heightInM * heightInM);
                model.put("String_Node_Str",bmi);
                String temp="String_Node_Str" + bmi;
                bmiAsString=temp.substring(0,temp.indexOf('.') + 2);
              }
            }
 catch (            Exception ex) {
              if (latestWeight != null && latestHeight != null)               log.error("String_Node_Str",ex);
            }
            model.put("String_Node_Str",bmiAsString);
          }
 else {
            model.put("String_Node_Str",new HashSet<Obs>());
          }
          Obs reasonForExitObs=null;
          Concept reasonForExitConcept=cs.getConcept(as.getGlobalProperty("String_Node_Str"));
          if (reasonForExitConcept != null) {
            List<Obs> patientExitObs=Context.getObsService().getObservationsByPersonAndConcept(p,reasonForExitConcept);
            if (patientExitObs != null) {
              log.debug("String_Node_Str" + patientExitObs.size());
              if (patientExitObs.size() == 1) {
                reasonForExitObs=patientExitObs.iterator().next();
                Concept exitReason=reasonForExitObs.getValueCoded();
                Date exitDate=reasonForExitObs.getObsDatetime();
                if (exitReason != null && exitDate != null) {
                  patientVariation="String_Node_Str";
                }
              }
 else {
                if (patientExitObs.size() == 0) {
                  log.debug("String_Node_Str");
                }
 else {
                  log.error("String_Node_Str");
                }
              }
            }
          }
          model.put("String_Node_Str",reasonForExitObs);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ORDERS)) {
            List<DrugOrder> drugOrderList=Context.getOrderService().getDrugOrdersByPatient(p);
            model.put("String_Node_Str",drugOrderList);
            List<DrugOrder> currentDrugOrders=new ArrayList<DrugOrder>();
            List<DrugOrder> discontinuedDrugOrders=new ArrayList<DrugOrder>();
            for (Iterator<DrugOrder> iter=drugOrderList.iterator(); iter.hasNext(); ) {
              DrugOrder next=iter.next();
              if (next.isCurrent() || next.isFuture())               currentDrugOrders.add(next);
              if (next.isDiscontinued())               discontinuedDrugOrders.add(next);
            }
            model.put("String_Node_Str",currentDrugOrders);
            model.put("String_Node_Str",discontinuedDrugOrders);
            List<RegimenSuggestion> standardRegimens=Context.getOrderService().getStandardRegimens();
            if (standardRegimens != null)             model.put("String_Node_Str",standardRegimens);
          }
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PROGRAMS) && Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PATIENT_PROGRAMS)) {
            model.put("String_Node_Str",Context.getProgramWorkflowService().getPatientPrograms(p));
            model.put("String_Node_Str",Context.getProgramWorkflowService().getCurrentPrograms(p,null));
          }
          model.put("String_Node_Str",patientId);
          if (p != null) {
            personId=p.getPatientId();
            model.put("String_Node_Str",personId);
          }
          model.put("String_Node_Str",patientVariation);
        }
      }
    }
    if (personId == null) {
      o=request.getAttribute("String_Node_Str");
      if (o != null) {
        personId=(Integer)o;
        model.put("String_Node_Str",personId);
      }
    }
    if (personId != null) {
      if (!model.containsKey("String_Node_Str")) {
        Person p=(Person)model.get("String_Node_Str");
        if (p == null)         p=Context.getPersonService().getPerson(personId);
        model.put("String_Node_Str",p);
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_RELATIONSHIPS)) {
          List<Relationship> relationships=new ArrayList<Relationship>();
          relationships.addAll(Context.getPersonService().getRelationshipsByPerson(p));
          Map<RelationshipType,List<Relationship>> relationshipsByType=new HashMap<RelationshipType,List<Relationship>>();
          for (          Relationship rel : relationships) {
            List<Relationship> list=relationshipsByType.get(rel.getRelationshipType());
            if (list == null) {
              list=new ArrayList<Relationship>();
              relationshipsByType.put(rel.getRelationshipType(),list);
            }
            list.add(rel);
          }
          model.put("String_Node_Str",relationships);
          model.put("String_Node_Str",relationshipsByType);
        }
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null && !model.containsKey("String_Node_Str")) {
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ENCOUNTERS)) {
          Encounter e=Context.getEncounterService().getEncounter((Integer)o);
          model.put("String_Node_Str",e);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_OBS))           model.put("String_Node_Str",e.getObs());
        }
        model.put("String_Node_Str",(Integer)o);
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null) {
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_USERS)) {
          User u=Context.getUserService().getUser((Integer)o);
          model.put("String_Node_Str",u);
        }
        model.put("String_Node_Str",(Integer)o);
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null && !"String_Node_Str".equals(o) && !model.containsKey("String_Node_Str")) {
      if (!model.containsKey("String_Node_Str")) {
        Cohort ps=new Cohort((String)o);
        model.put("String_Node_Str",ps);
        model.put("String_Node_Str",(String)o);
      }
    }
    o=model.get("String_Node_Str");
    if (o != null && !"String_Node_Str".equals(o)) {
      if (!model.containsKey("String_Node_Str")) {
        log.debug("String_Node_Str" + o);
        Map<Integer,Concept> concepts=new HashMap<Integer,Concept>();
        Map<String,Concept> conceptsByStringIds=new HashMap<String,Concept>();
        String conceptIds=(String)o;
        String[] ids=conceptIds.split("String_Node_Str");
        for (        String cId : ids) {
          try {
            Integer i=Integer.valueOf(cId);
            Concept c=cs.getConcept(i);
            concepts.put(i,c);
            conceptsByStringIds.put(i.toString(),c);
          }
 catch (          Exception ex) {
          }
        }
        model.put("String_Node_Str",concepts);
        model.put("String_Node_Str",conceptsByStringIds);
      }
    }
    populateModel(request,model);
    log.debug(portletPath + "String_Node_Str" + (System.currentTimeMillis() - timeAtStart)+ "String_Node_Str");
  }
  return new ModelAndView(portletPath,"String_Node_Str",model);
}

Fixed version (ground truth):
/** 
 * This method produces a model containing the following mappings: <pre> (always) (java.util.Date) now (String) size (Locale) locale (other parameters) (if there's currently an authenticated user) (User) authenticatedUser (Cohort) myPatientSet (the user's selected patient set, PatientSetService.getMyPatientSet()) (if the request has a patientId attribute) (Integer) patientId (Patient) patient (Set<Obs>) patientObs (Set<Encounter>) patientEncounters (List<DrugOrder>) patientDrugOrders (List<DrugOrder>) currentDrugOrders (List<DrugOrder>) completedDrugOrders (Obs) patientWeight // most recent weight obs (Obs) patientHeight // most recent height obs (Double) patientBmi // BMI derived from most recent weight and most recent height (String) patientBmiAsString // BMI rounded to one decimal place, or "?" if unknown (Integer) personId (if the patient has any obs for the concept in the global property 'concept.reasonExitedCare') (Obs) patientReasonForExit (if the request has a personId or patientId attribute) (Person) person (List<Relationship>) personRelationships (Map<RelationshipType, List<Relationship>>) personRelationshipsByType (if the request has an encounterId attribute) (Integer) encounterId (Encounter) encounter (Set<Obs>) encounterObs (if the request has a userId attribute) (Integer) userId (User) user (if the request has a patientIds attribute, which should be a (String) comma-separated list of patientIds) (PatientSet) patientSet (String) patientIds (if the request has a conceptIds attribute, which should be a (String) commas-separated list of conceptIds) (Map<Integer, Concept>) conceptMap (Map<String, Concept>) conceptMapByStringIds </pre>
 */
@SuppressWarnings("String_Node_Str") public ModelAndView handleRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  AdministrationService as=Context.getAdministrationService();
  ConceptService cs=Context.getConceptService();
  Object uri=request.getAttribute("String_Node_Str");
  String portletPath="String_Node_Str";
  Map<String,Object> model=null;
{
    HttpSession session=request.getSession();
    String uniqueRequestId=(String)request.getAttribute(WebConstants.INIT_REQ_UNIQUE_ID);
    String lastRequestId=(String)session.getAttribute(WebConstants.OPENMRS_PORTLET_LAST_REQ_ID);
    if (uniqueRequestId.equals(lastRequestId))     model=(Map<String,Object>)session.getAttribute(WebConstants.OPENMRS_PORTLET_CACHED_MODEL);
    if (model == null) {
      log.debug("String_Node_Str");
      model=new HashMap<String,Object>();
      session.setAttribute(WebConstants.OPENMRS_PORTLET_LAST_REQ_ID,uniqueRequestId);
      session.setAttribute(WebConstants.OPENMRS_PORTLET_CACHED_MODEL,model);
    }
  }
  if (uri != null) {
    long timeAtStart=System.currentTimeMillis();
    portletPath=uri.toString();
    if (portletPath.endsWith("String_Node_Str"))     portletPath=portletPath.replace("String_Node_Str","String_Node_Str");
 else     if (portletPath.endsWith("String_Node_Str"))     throw new ServletException("String_Node_Str");
    log.debug("String_Node_Str" + portletPath);
    String id=(String)request.getAttribute("String_Node_Str");
    String size=(String)request.getAttribute("String_Node_Str");
    Map<String,Object> params=(Map<String,Object>)request.getAttribute("String_Node_Str");
    Map<String,Object> moreParams=(Map<String,Object>)request.getAttribute("String_Node_Str");
    model.put("String_Node_Str",new Date());
    model.put("String_Node_Str",id);
    model.put("String_Node_Str",size);
    model.put("String_Node_Str",Context.getLocale());
    model.putAll(params);
    if (moreParams != null) {
      model.putAll(moreParams);
    }
    if (Context.getAuthenticatedUser() != null) {
      model.put("String_Node_Str",Context.getAuthenticatedUser());
      model.put("String_Node_Str",Context.getPatientSetService().getMyPatientSet());
    }
    Integer personId=null;
    Object o=request.getAttribute("String_Node_Str");
    if (o != null) {
      String patientVariation="String_Node_Str";
      Integer patientId=(Integer)o;
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PATIENTS)) {
          Patient p=Context.getPatientService().getPatient(patientId);
          model.put("String_Node_Str",p);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ENCOUNTERS))           model.put("String_Node_Str",Context.getEncounterService().getEncountersByPatient(p));
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_OBS)) {
            List<Obs> patientObs=Context.getObsService().getObservationsByPerson(p);
            model.put("String_Node_Str",patientObs);
            Obs latestWeight=null;
            Obs latestHeight=null;
            String bmiAsString="String_Node_Str";
            try {
              ConceptNumeric weightConcept=cs.getConceptNumeric(cs.getConcept(as.getGlobalProperty("String_Node_Str")).getConceptId());
              ConceptNumeric heightConcept=cs.getConceptNumeric(cs.getConcept(as.getGlobalProperty("String_Node_Str")).getConceptId());
              for (              Obs obs : patientObs) {
                if (obs.getConcept().equals(weightConcept)) {
                  if (latestWeight == null || obs.getObsDatetime().compareTo(latestWeight.getObsDatetime()) > 0)                   latestWeight=obs;
                }
 else                 if (obs.getConcept().equals(heightConcept)) {
                  if (latestHeight == null || obs.getObsDatetime().compareTo(latestHeight.getObsDatetime()) > 0)                   latestHeight=obs;
                }
              }
              if (latestWeight != null)               model.put("String_Node_Str",latestWeight);
              if (latestHeight != null)               model.put("String_Node_Str",latestHeight);
              if (latestWeight != null && latestHeight != null) {
                double weightInKg;
                double heightInM;
                if (weightConcept.getUnits().equals("String_Node_Str"))                 weightInKg=latestWeight.getValueNumeric();
 else                 if (weightConcept.getUnits().equals("String_Node_Str"))                 weightInKg=latestWeight.getValueNumeric() * 0.45359237;
 else                 throw new IllegalArgumentException("String_Node_Str" + weightConcept.getUnits());
                if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric() / 100;
 else                 if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric();
 else                 if (heightConcept.getUnits().equals("String_Node_Str"))                 heightInM=latestHeight.getValueNumeric() * 0.0254;
 else                 throw new IllegalArgumentException("String_Node_Str" + heightConcept.getUnits());
                double bmi=weightInKg / (heightInM * heightInM);
                model.put("String_Node_Str",bmi);
                String temp="String_Node_Str" + bmi;
                bmiAsString=temp.substring(0,temp.indexOf('.') + 2);
              }
            }
 catch (            Exception ex) {
              if (latestWeight != null && latestHeight != null)               log.error("String_Node_Str",ex);
            }
            model.put("String_Node_Str",bmiAsString);
          }
 else {
            model.put("String_Node_Str",new HashSet<Obs>());
          }
          Obs reasonForExitObs=null;
          Concept reasonForExitConcept=cs.getConcept(as.getGlobalProperty("String_Node_Str"));
          if (reasonForExitConcept != null) {
            List<Obs> patientExitObs=Context.getObsService().getObservationsByPersonAndConcept(p,reasonForExitConcept);
            if (patientExitObs != null) {
              log.debug("String_Node_Str" + patientExitObs.size());
              if (patientExitObs.size() == 1) {
                reasonForExitObs=patientExitObs.iterator().next();
                Concept exitReason=reasonForExitObs.getValueCoded();
                Date exitDate=reasonForExitObs.getObsDatetime();
                if (exitReason != null && exitDate != null) {
                  patientVariation="String_Node_Str";
                }
              }
 else {
                if (patientExitObs.size() == 0) {
                  log.debug("String_Node_Str");
                }
 else {
                  log.error("String_Node_Str");
                }
              }
            }
          }
          model.put("String_Node_Str",reasonForExitObs);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ORDERS)) {
            List<DrugOrder> drugOrderList=Context.getOrderService().getDrugOrdersByPatient(p);
            model.put("String_Node_Str",drugOrderList);
            List<DrugOrder> currentDrugOrders=new ArrayList<DrugOrder>();
            List<DrugOrder> discontinuedDrugOrders=new ArrayList<DrugOrder>();
            for (Iterator<DrugOrder> iter=drugOrderList.iterator(); iter.hasNext(); ) {
              DrugOrder next=iter.next();
              if (next.isCurrent() || next.isFuture())               currentDrugOrders.add(next);
              if (next.isDiscontinued())               discontinuedDrugOrders.add(next);
            }
            model.put("String_Node_Str",currentDrugOrders);
            model.put("String_Node_Str",discontinuedDrugOrders);
            List<RegimenSuggestion> standardRegimens=Context.getOrderService().getStandardRegimens();
            if (standardRegimens != null)             model.put("String_Node_Str",standardRegimens);
          }
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PROGRAMS) && Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_PATIENT_PROGRAMS)) {
            model.put("String_Node_Str",Context.getProgramWorkflowService().getPatientPrograms(p));
            model.put("String_Node_Str",Context.getProgramWorkflowService().getCurrentPrograms(p,null));
          }
          model.put("String_Node_Str",patientId);
          if (p != null) {
            personId=p.getPatientId();
            model.put("String_Node_Str",personId);
          }
          model.put("String_Node_Str",patientVariation);
        }
      }
    }
    if (personId == null) {
      o=request.getAttribute("String_Node_Str");
      if (o != null) {
        personId=(Integer)o;
        model.put("String_Node_Str",personId);
      }
    }
    if (personId != null) {
      if (!model.containsKey("String_Node_Str")) {
        Person p=(Person)model.get("String_Node_Str");
        if (p == null)         p=Context.getPersonService().getPerson(personId);
        model.put("String_Node_Str",p);
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_RELATIONSHIPS)) {
          List<Relationship> relationships=new ArrayList<Relationship>();
          relationships.addAll(Context.getPersonService().getRelationshipsByPerson(p));
          Map<RelationshipType,List<Relationship>> relationshipsByType=new HashMap<RelationshipType,List<Relationship>>();
          for (          Relationship rel : relationships) {
            List<Relationship> list=relationshipsByType.get(rel.getRelationshipType());
            if (list == null) {
              list=new ArrayList<Relationship>();
              relationshipsByType.put(rel.getRelationshipType(),list);
            }
            list.add(rel);
          }
          model.put("String_Node_Str",relationships);
          model.put("String_Node_Str",relationshipsByType);
        }
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null && !model.containsKey("String_Node_Str")) {
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_ENCOUNTERS)) {
          Encounter e=Context.getEncounterService().getEncounter((Integer)o);
          model.put("String_Node_Str",e);
          if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_OBS))           model.put("String_Node_Str",e.getObs());
        }
        model.put("String_Node_Str",(Integer)o);
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null) {
      if (!model.containsKey("String_Node_Str")) {
        if (Context.hasPrivilege(OpenmrsConstants.PRIV_VIEW_USERS)) {
          User u=Context.getUserService().getUser((Integer)o);
          model.put("String_Node_Str",u);
        }
        model.put("String_Node_Str",(Integer)o);
      }
    }
    o=request.getAttribute("String_Node_Str");
    if (o != null && !"String_Node_Str".equals(o) && !model.containsKey("String_Node_Str")) {
      if (!model.containsKey("String_Node_Str")) {
        Cohort ps=new Cohort((String)o);
        model.put("String_Node_Str",ps);
        model.put("String_Node_Str",(String)o);
      }
    }
    o=model.get("String_Node_Str");
    if (o != null && !"String_Node_Str".equals(o)) {
      if (!model.containsKey("String_Node_Str")) {
        log.debug("String_Node_Str" + o);
        Map<Integer,Concept> concepts=new HashMap<Integer,Concept>();
        Map<String,Concept> conceptsByStringIds=new HashMap<String,Concept>();
        String conceptIds=(String)o;
        String[] ids=conceptIds.split("String_Node_Str");
        for (        String cId : ids) {
          try {
            Integer i=Integer.valueOf(cId);
            Concept c=cs.getConcept(i);
            concepts.put(i,c);
            conceptsByStringIds.put(i.toString(),c);
          }
 catch (          Exception ex) {
          }
        }
        model.put("String_Node_Str",concepts);
        model.put("String_Node_Str",conceptsByStringIds);
      }
    }
    populateModel(request,model);
    log.debug(portletPath + "String_Node_Str" + (System.currentTimeMillis() - timeAtStart)+ "String_Node_Str");
  }
  return new ModelAndView(portletPath,"String_Node_Str",model);
}