<commit_before>package edu.wustl.query.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.query.domain.SelectedConcept;
import edu.wustl.query.util.global.Constants;
/**
 * @author amit_doshi
 * Action Class to responsible to handle the selected permissible values from VI
 */
public class SelectedPermissibleValueAction extends Action {
	
	/**
	 * This method loads the data required for categorySearch.jsp
	 * @param mapping mapping
	 * @param form form
	 * @param request request
	 * @param response response
	 * @throws Exception Exception
	 * @return ActionForward actionForward
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception
	{
		List<SelectedConcept> selectedConceptList=new ArrayList<SelectedConcept>();
		String conceptCodes=request.getParameter("ConceptCodes");
		String conceptName=request.getParameter("ConceptName");
		String[] conceptcodes= conceptCodes.split("#");// codes contains the actual vocab Name+@+version:med Concept code
		String[] conceptNames= conceptName.split(",");// Name contains the actual selected vocab concept code:Concept Name
		
		for(int i=0;i<conceptcodes.length;i++)
		{
			SelectedConcept selectedConcept=new SelectedConcept();
			String vocabName=conceptcodes[i].substring(0,conceptcodes[i].indexOf('@'));
			String vocabVersion=conceptcodes[i].substring(conceptcodes[i].indexOf('@')+1,conceptcodes[i].indexOf(':'));
			String medCode=conceptcodes[i].substring(conceptcodes[i].indexOf(':')+1);
			String conceptCode=conceptNames[i].substring(0,conceptNames[i].indexOf(':'));
			String conceptNam=conceptNames[i].substring(conceptNames[i].indexOf(':')+1);
			
			selectedConcept.setVocabName(vocabName);
			selectedConcept.setVocabVersion(vocabVersion);
			selectedConcept.setMedCode(medCode);
			selectedConcept.setConceptName(conceptNam);
			selectedConcept.setConceptCode(conceptCode);
			selectedConceptList.add(selectedConcept);
		}
		request.getSession().setAttribute(Constants.SELECTED_CONCEPT_LIST, selectedConceptList);
		
		response.getWriter().write("success");
		return null;
	}
}<commit_msg>code formated<commit_after>package edu.wustl.query.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.query.domain.SelectedConcept;
import edu.wustl.query.util.global.Constants;
/**
 * @author amit_doshi
 * Action Class to responsible to handle the selected permissible values from VI
 */
public class SelectedPermissibleValueAction extends Action {
	
	/**
	 * This method loads the data required for categorySearch.jsp
	 * @param mapping mapping
	 * @param form form
	 * @param request request
	 * @param response response
	 * @throws Exception Exception
	 * @return ActionForward actionForward
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception
	{
		List<SelectedConcept> selectedConceptList=new ArrayList<SelectedConcept>();
		String conceptCodes=request.getParameter("ConceptCodes");
		String conceptName=request.getParameter("ConceptName");
		// codes contains the actual vocab Name+@+version:med Concept code
		String[] conceptcodes= conceptCodes.split("#");
		// Name contains the actual selected vocab concept code:Concept Name
		String[] conceptNames= conceptName.split(",");
		
		for(int i=0;i<conceptcodes.length;i++)
		{
			SelectedConcept selectedConcept=new SelectedConcept();
			String vocabName=conceptcodes[i].substring(0,conceptcodes[i].indexOf('@'));
			String vocabVersion=conceptcodes[i].substring(conceptcodes[i].indexOf('@')+1,conceptcodes[i].indexOf(':'));
			String medCode=conceptcodes[i].substring(conceptcodes[i].indexOf(':')+1);
			String conceptCode=conceptNames[i].substring(0,conceptNames[i].indexOf(':'));
			String conceptNam=conceptNames[i].substring(conceptNames[i].indexOf(':')+1);
			
			selectedConcept.setVocabName(vocabName);
			selectedConcept.setVocabVersion(vocabVersion);
			selectedConcept.setMedCode(medCode);
			selectedConcept.setConceptName(conceptNam);
			selectedConcept.setConceptCode(conceptCode);
			selectedConceptList.add(selectedConcept);
		}
		request.getSession().setAttribute(Constants.SELECTED_CONCEPT_LIST, selectedConceptList);
		
		response.getWriter().write("success");
		return null;
	}
}
{'fraction_non_alphanumeric': 0.11666666666666667, 'fraction_numerical': 0.0024390243902439024, 'mean_word_length': 6.501524390243903, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2371289', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1407, 'n_words': 269}