Page History
Code Block | ||||
---|---|---|---|---|
|
<source lang = java>
import java.util.List; import gov.nih.nci.system.applicationservice.ApplicationException; import gov.nih.nci.system.client.ApplicationServiceProvider; import org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeRenderingList; import org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering; import org.LexGrid.LexBIG.Exceptions.LBInvocationException; import org.LexGrid.LexBIG.caCore.interfaces.LexEVSApplicationService; import org.LexGrid.LexBIG.caCore.interfaces.LexEVSDataService; import org.LexGrid.LexBIG.caCore.interfaces.LexEVSDistributed; import org.LexGrid.LexBIG.caCore.interfaces.LexEVSService; import org.LexGrid.codingSchemes.CodingScheme; public class RemoteTestClient { private String serviceUrl = "http://lexevsapi.nci.nih.gov/lexevsapi50"; private LexEVSService lexevsService; public static void main(String args[]) throws Exception { RemoteTestClient client = new RemoteTestClient(); client.queryLexEVSDistributed(); //client.queryLexEVSDataService(); } public RemoteTestClient() throws Exception { lexevsService = (LexEVSApplicationService)ApplicationServiceProvider .getApplicationServiceFromUrl(serviceUrl, "EvsServiceInfo"); } public void queryLexEVSDistributed() throws LBInvocationException { LexEVSDistributed distributedSvc = lexevsService; CodingSchemeRenderingList csrl = distributedSvc.getSupportedCodingSchemes(); CodingSchemeRendering[] csr = csrl.getCodingSchemeRendering(); for(int i=0;i<csr.length;i++){ System.out.println("\t\tOutput: " + "Coding Scheme: " + csr[i].getCodingSchemeSummary().getLocalName()); System.out.println("\t\tOutput: " + " -- Version: " + csr[i].getCodingSchemeSummary().getRepresentsVersion()); System.out.println("\t\tOutput: " + " -- URI: " + csr[i].getCodingSchemeSummary().getCodingSchemeURI()); } } public void queryLexEVSDataService() throws ApplicationException { LexEVSDataService dataSvc = lexevsService; CodingScheme codingScheme = new CodingScheme(); List<CodingScheme> results = dataSvc.search(CodingScheme.class, codingScheme); for(CodingScheme cs : results){ System.out.println("\t\tOutput: " + "Coding Scheme: " + cs.getLocalName()); System.out.println("\t\tOutput: " + " -- Version: " + cs.getRepresentsVersion()); System.out.println("\t\tOutput: " + " -- URI: " + cs.getCodingSchemeURI()); } } } |
...