<commit_before><%@ page import="java.util.*" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ page import="gov.nih.nci.evs.browser.utils.DataUtils"%>
<%@ page import="gov.nih.nci.evs.browser.utils.HTTPUtils"%>

<%@ page import="gov.nih.nci.evs.browser.utils.ValueSetHierarchy"%>

<%@ page import="gov.nih.nci.evs.browser.properties.NCItBrowserProperties" %>
<%@ page import="gov.nih.nci.evs.browser.common.Constants" %>
<%@ page import="org.LexGrid.valueSets.ValueSetDefinition" %>

<%
String context_path = request.getContextPath();
String redirect_url = null;
String source_scheme = ValueSetHierarchy.SOURCE_SCHEME;
String source_version = ValueSetHierarchy.getSourceSchemeVersion();

HashMap hmap = ValueSetHierarchy.getValueSetSourceHierarchy();
HashMap VSDURI2VSD_map = ValueSetHierarchy.getValueSetDefinitionURI2VSD_map();


String ontology_node_id = request.getParameter("ontology_node_id");
System.out.println("(*) node: " + ontology_node_id + " clicked.");

ValueSetDefinition vsd = ValueSetHierarchy.findValueSetDefinitionByURI(ontology_node_id);


if (vsd != null) {
    redirect_url = context_path + "/pages/value_set_search_results.jsf?nav_type=valuesets&vsd_uri=" + ontology_node_id
       + "&nav_type=valuesets";
} else {
    if (ValueSetHierarchy._valueSetDefinitionSourceCode2Name_map.containsKey(ontology_node_id)) {
        redirect_url = context_path + "/pages/concept_details.jsf?nav_type=terminology&dictionary="
            + source_scheme
            + "&version="
            + source_version
            + "&code=" 
            + ontology_node_id
            + "&nav_type=terminologies";
            
    } else {
        String formalname = DataUtils.getFormalName(ontology_node_id);
        String version = DataUtils.getVocabularyVersionByTag(formalname, "PRODUCTION");
        redirect_url = context_path + "/pages/vocabulary.jsf?dictionary=" 
            + HTTPUtils.cleanXSS(formalname)
            + "&version="
            + version
            + "&nav_type=terminologies";
    }
}

String url = response.encodeRedirectURL(redirect_url);
response.sendRedirect(url);

%>     <commit_msg>[#30829] Display value set hierarchy. [KLO, 040211]<commit_after><%@ page import="java.util.*" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ page import="gov.nih.nci.evs.browser.utils.DataUtils"%>
<%@ page import="gov.nih.nci.evs.browser.utils.HTTPUtils"%>

<%@ page import="gov.nih.nci.evs.browser.utils.ValueSetHierarchy"%>

<%@ page import="gov.nih.nci.evs.browser.properties.NCItBrowserProperties" %>
<%@ page import="gov.nih.nci.evs.browser.common.Constants" %>
<%@ page import="org.LexGrid.valueSets.ValueSetDefinition" %>

<%
String context_path = request.getContextPath();
String redirect_url = null;
String source_scheme = ValueSetHierarchy.SOURCE_SCHEME;
String source_version = ValueSetHierarchy.getSourceSchemeVersion();

HashMap hmap = ValueSetHierarchy.getValueSetSourceHierarchy();
HashMap VSDURI2VSD_map = ValueSetHierarchy.getValueSetDefinitionURI2VSD_map();


String ontology_node_id = request.getParameter("ontology_node_id");
System.out.println("(*) node: " + ontology_node_id + " clicked.");

ValueSetDefinition vsd = ValueSetHierarchy.findValueSetDefinitionByURI(ontology_node_id);


if (vsd != null) {
    redirect_url = context_path + "/pages/value_set_search_results.jsf?nav_type=valuesets&vsd_uri=" + ontology_node_id
       + "&nav_type=valuesets";
} else {
    if (ValueSetHierarchy._valueSetDefinitionSourceCode2Name_map.containsKey(ontology_node_id)) {
        redirect_url = context_path + "/pages/concept_details.jsf?nav_type=terminology&dictionary="
            + source_scheme
            + "&version="
            + source_version
            + "&code=" 
            + ontology_node_id
            + "&nav_type=terminologies";
            
    } else {
        String formalname = DataUtils.getFormalName(ontology_node_id);
        String version = DataUtils.getVocabularyVersionByTag(formalname, "PRODUCTION");
        formalname = formalname.replaceAll(" ", "%20");
        redirect_url = context_path + "/pages/vocabulary.jsf?dictionary=" 
            + HTTPUtils.cleanXSS(formalname)
            + "&version="
            + version
            + "&nav_type=terminologies";
    }
}

String url = response.encodeRedirectURL(redirect_url);
response.sendRedirect(url);

%>     
{'fraction_non_alphanumeric': 0.1346947642841625, 'fraction_numerical': 0.004127742776450141, 'mean_word_length': 3.693170234454638, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1086918', 'n_tokens_mistral': 1552, 'n_tokens_neox': 1496, 'n_words': 185}