diff --git a/software/ncitbrowser/lib/lexbig.jar b/software/ncitbrowser/lib/lexbig.jar index 7c0b5e5a7..ff16f8a68 100644 Binary files a/software/ncitbrowser/lib/lexbig.jar and b/software/ncitbrowser/lib/lexbig.jar differ diff --git a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/servlet/AjaxServlet.java b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/servlet/AjaxServlet.java index 766b110df..3329c6900 100644 --- a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/servlet/AjaxServlet.java +++ b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/servlet/AjaxServlet.java @@ -2933,6 +2933,10 @@ public static String valueSetSearchAction(HttpServletRequest request) { java.lang.String valueSetDefinitionRevisionId = null; String msg = null; + +long ms = System.currentTimeMillis(); + + String selectValueSetSearchOption = HTTPUtils.cleanXSS((String) request.getParameter("selectValueSetSearchOption")); if (DataUtils.isNull(selectValueSetSearchOption)) { @@ -2977,9 +2981,18 @@ public static String valueSetSearchAction(HttpServletRequest request) { searchOption = SimpleSearchUtils.BY_NAME; } +System.out.println(checked_vocabularies); + +System.out.println("AjaxServlet valueSetSearchAction involking ValueSetSearchUtils -- " + matchText + ", " + algorithm); +_logger.debug("AjaxServlet valueSetSearchAction involking ValueSetSearchUtils -- " + matchText + ", " + algorithm); + ResolvedConceptReferencesIteratorWrapper wrapper = new ValueSetSearchUtils().searchResolvedValueSetCodingSchemes(checked_vocabularies, matchText, searchOption, algorithm); +System.out.println("Run time (ms): " + (System.currentTimeMillis() - ms)); +_logger.debug("Run time (ms): " + (System.currentTimeMillis() - ms)); + + if (wrapper == null) { msg = "No match found."; if (searchOption == SimpleSearchUtils.BY_CODE) { diff --git a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/DataUtils.java b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/DataUtils.java index cad685b77..8af2c61ea 100644 --- a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/DataUtils.java +++ b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/DataUtils.java @@ -235,6 +235,8 @@ public class DataUtils { private static HashMap _listOfCodingSchemeVersionsUsedInResolutionHashMap = null; + private static HashMap _RVSCSFormalName2VersionHashMap = null; + // ================================================================================== @@ -473,6 +475,12 @@ public static AbsoluteCodingSchemeVersionReferenceList getListOfCodingSchemeVers return null; } + public static Vector getRVSCSVersionsByFormalName(String RVSCS_formalname) { + if (!_RVSCSFormalName2VersionHashMap.containsKey(RVSCS_formalname)) return null; + return (Vector) _RVSCSFormalName2VersionHashMap.get(RVSCS_formalname); + } + + private static void setCodingSchemeMap() { //LexEVSResolvedValueSetServiceImpl lexEVSResolvedValueSetService = new LexEVSResolvedValueSetServiceImpl(); @@ -504,6 +512,7 @@ private static void setCodingSchemeMap() { _formalName2VersionsHashMap = new HashMap(); _versionReleaseDateHashMap = new HashMap(); _listOfCodingSchemeVersionsUsedInResolutionHashMap = new HashMap(); + _RVSCSFormalName2VersionHashMap = new HashMap(); Vector nv_vec = new Vector(); boolean includeInactive = false; @@ -578,11 +587,24 @@ private static void setCodingSchemeMap() { } try { + CodingScheme cs = lbSvc.resolveCodingScheme(formalname, vt); if (isResolvedValueSetCodingScheme(cs)) { String cs_uri = cs.getCodingSchemeURI(); String cs_name = cs.getCodingSchemeName(); + String cs_version = cs.getRepresentsVersion(); + + String cs_formalname = cs.getFormalName(); + Vector w = (Vector) _RVSCSFormalName2VersionHashMap.get(cs_formalname); + if (w == null) { + w = new Vector(); + } + w.add(cs_version); + System.out.println("(*) " + cs_formalname + " -> " + cs_version); + + _RVSCSFormalName2VersionHashMap.put(cs_formalname, w); + HashMap hmap = new HashMap(); AbsoluteCodingSchemeVersionReferenceList acsvr = getListOfCodingSchemeVersionsUsedInResolution(cs_name); if (acsvr != null) { @@ -594,8 +616,6 @@ private static void setCodingSchemeMap() { _listOfCodingSchemeVersionsUsedInResolutionHashMap.put(cs_name, hmap); } - - } else { Vector prop_quals = getSupportedPropertyQualifier(cs); diff --git a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/SimpleSearchUtils.java b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/SimpleSearchUtils.java index 4f5ff642a..fec9c2223 100644 --- a/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/SimpleSearchUtils.java +++ b/software/ncitbrowser/src/java/gov/nih/nci/evs/browser/utils/SimpleSearchUtils.java @@ -204,8 +204,25 @@ public ResolvedConceptReferencesIteratorWrapper search( return search(schemes, versions, matchText, searchOption, algorithm); } + + private void printNumberOfMatches(ResolvedConceptReferencesIterator iterator) { + if (iterator == null) { + System.out.println("Iterator is null"); + return; + } + try { + int numRemaining = iterator.numberRemaining(); + System.out.println("Number of matches: " + numRemaining); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public ResolvedConceptReferencesIteratorWrapper search( Vector schemes, Vector versions, String matchText, int searchOption, String algorithm) throws LBException { + System.out.println("search by " + matchText + ", algorithm: " + algorithm); + if (schemes == null|| versions == null) return null; if (schemes.size() != versions.size()) return null; if (schemes.size() == 0) return null; @@ -232,6 +249,7 @@ public ResolvedConceptReferencesIteratorWrapper search( for (int i=0; i