Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
[GF#33228] Update NCBO REST client code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimong committed Mar 5, 2014
1 parent 9765a26 commit 526744d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion software/build/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ lex.evs.api.url=http://ncias-d499-v.nci.nih.gov:29780/lexevsapi61
; ncit.url = URL to NCIt application
; meddra_security_token = MedDRA security token
; ncbo_api_key = NCBO API key
ncbo_widget_info=NCI_Thesaurus|NCI_Thesaurus|NCIT;CTCAE|CTCAE|CTCAE;NPO|NPO|NPO;GO|GO|GO;SNOMED Clinical Terms|SNOMEDCT|SNOMEDCT;HGNC|HUGO|HUGO;HL7|HL7|HL7;LOINC|LOINC|LOINC;ICD-9-CM|ICD9CM|ICD9CM;MA|MA|MA;RadLex|RADLEX|RADLEX;ICD-10-CM|ICD10CM|ICD10CM;OBI|OBI|OBI;PDQ|PDQ|PDQ;NDFRT|NDFRT|NDFRT;
ncbo_widget_info=NPO|http://purl.bioontology.org/ontology/npo#|NPO;GO|http://purl.obolibrary.org/obo/|GO;SNOMED Clinical Terms|http://purl.bioontology.org/ontology/SNOMEDCT/|SNOMEDCT;HGNC|http://ncicb.nci.nih.gov/xml/owl/EVS/Hugo.owl#|HUGO;NCI_Thesaurus|http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#|NCIT;LOINC|http://purl.bioontology.org/ontology/LNC/|LOINC;ICD-9-CM|http://purl.bioontology.org/ontology/ICD9CM/|ICD9CM;MA|http://purl.obolibrary.org/obo/|MA;RadLex|http://www.owl-ontologies.com/RADLEX.owl#|RADLEX;ICD-10-CM|http://purl.bioontology.org/ontology/ICD10CM/|ICD10CM;OBI|http://purl.obolibrary.org/obo/|OBI;PDQ|http://purl.bioontology.org/ontology/PDQ/|PDQ;NDFRT|http://purl.bioontology.org/ontology/NDFRT/|NDFRT;
; license_page_option = Display license page flag
; audio_captcha_background_noise_on = Set to false to turn off the background noise for audio captcha (default to true)
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class Constants {
public static final String NCBO_WIDGET_QUERY_STRING = "http://bioportal.bioontology.org/widgets/visualization?ontology=";

//public static final String DEFAULT_NCBO_WIDGET_INFO = "NCI_Thesaurus|1032|NCIT;";
public static final String DEFAULT_NCBO_WIDGET_INFO = "NCI_Thesaurus|NCI_Thesaurus|NCIT;";
public static final String DEFAULT_NCBO_WIDGET_INFO = "NCI_Thesaurus|http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#|NCIT;";

public static final String[] NAV_TYPE_VALUES = {"terminologies", "mappings", "valuesets"};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public static String getDefaultOntologiesToSearchOnStr() {
String value = (String) item.getValue();
/*
if (value.indexOf("Metathesaurus") == -1) {
buf.append(value + "|");
buf.append(value + "|);");
}
*/
if (value.indexOf("NCI_Thesaurus") != -1 || value.indexOf("NCI Thesaurus") != -1) {
Expand Down Expand Up @@ -844,6 +844,12 @@ private static void setCodingSchemeMap() {
}
}
_formalName2NCImSABHashMap = createFormalName2NCImSABHashMap();

//KLO
if (!_localName2FormalNameHashMap.containsKey(Constants.NCIT)) {
_localName2FormalNameHashMap.put(Constants.NCIT, Constants.NCIT_CS_NAME);
}

dumpHashMap(_formalName2NCImSABHashMap);

setMappingDisplayNameHashMap();
Expand Down Expand Up @@ -6292,8 +6298,8 @@ public static HashMap getNCBOWidgetString() {
public static HashMap getNCBOWidgetString() {
String ncbo_widget_info = NCItBrowserProperties.getNCBO_WIDGET_INFO();
if (isNull(ncbo_widget_info)) {
System.out.println("(*) ncbo_widget_info: " + ncbo_widget_info);
System.out.println("(*) computeNCBOWidgetString ... ");
//System.out.println("(*) ncbo_widget_info: " + ncbo_widget_info);
//System.out.println("(*) computeNCBOWidgetString ... ");
ncbo_widget_info = computeNCBOWidgetString();
}
//System.out.println("(*) ncbo_widget_info: " + ncbo_widget_info);
Expand Down Expand Up @@ -6378,17 +6384,34 @@ public static String getNCBOOntologyAbbreviation(String dictionary) {
return (String) v.elementAt(1);
}

public static String getNCBOOntologyNamespace(String dictionary) {
boolean bool = visualizationWidgetSupported(dictionary);
if (!bool) return null;
String csName = getCSName(dictionary);
String ncbo_widget_info_str = (String) _visualizationWidgetHashMap.get(csName);
if (ncbo_widget_info_str == null) return null;
Vector v = parseData(ncbo_widget_info_str);
if (v == null) return null;
return (String) v.elementAt(0);
}


public static String createVisualizationWidgetURL(String abbreviation, String code) {
String api_key = NCItBrowserProperties.getNCBO_API_KEY();
if (abbreviation.compareTo(Constants.NCIT) == 0) {
return NCBO_WIDGET_QUERY_STRING + abbreviation + "&class="
+ HTTPUtils.encode(Constants.NCIT_NAMESPACE + code)
+ "&apikey=" + getAPIKey();
} else {
return NCBO_WIDGET_QUERY_STRING + abbreviation + "&class="
+ HTTPUtils.encode(Constants.NCBO_PURL + abbreviation + "/" + code)
+ "&apikey=" + getAPIKey();
String api_key = getAPIKey();
//String csName = (String) localname2CSNameMap.get(abbreviation);
String csName = getCSName(abbreviation);
String purl = getNCBOOntologyNamespace(csName);

System.out.println("(**********) " + purl);
if (purl == null) return null;

if (purl.contains("obo")) {
code = code.replaceAll(":", "_");
}

return NCBO_WIDGET_QUERY_STRING + abbreviation + "&class="
+ HTTPUtils.encode(purl + code)
+ "&apikey=" + getAPIKey();
}

public static String getVisualizationWidgetURL(String dictionary, String code) {
Expand Down

0 comments on commit 526744d

Please sign in to comment.