NIH | National Cancer Institute | NCI Wiki  

WIKI MAINTENANCE NOTICE

Please be advised that NCI Wiki will be undergoing maintenance Monday, July 22nd between 1700 ET and 1800 ET and will be unavailable during this period.
Please ensure all work is saved before said time.

If you have any questions or concerns, please contact the CBIIT Atlassian Management Team.

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

Java Code Snippet
       // Create a basic service object for data retrieval
       LexBIGServiceImpl lbs = LexBIGServiceImpl.defaultInstance();
       
       // Create a list of unique references (concept codes) for this coding scheme.
       // Parameters:  
       //       A String array initialized with a single concept code
       //       The name of the target Coding Scheme.
       ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList( 
                       new String[], SAMPLE_SCHEME);
       
       // Initialize a coding scheme version object the version of the
       // sample scheme.
       CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
       csvt.setVersion(VERSION);
       
       // Initialize a CodedNodeSet Object with all possible concepts in our sample coding
       // scheme, then restrict the node set to a single node using restrictToCodes(crefs)
       CodedNodeSet nodes = lbs.getCodingSchemeConcepts(SAMPLE_SCHEME, csvt).
                       restrictToCodes(crefs);
        
       // Build a potential list of references from the current (and already restricted) set
       // and restrict them to the single property name "textualPresentation" and
       // allow the list a size of 1.
       ResolvedConceptReferenceList matches = nodes.resolveToList(
                       null, ConvenienceMethods.createLocalNameList("textualPresentation"), null, 1);
       
       // Check the list size to see if any references are returned.  If true
       // get the only referenced entity in the list and print out it's "presentation"
       // or textual representation.
       if(matches.getResolvedConceptReferenceCount() > 0)
       {
           ResolvedConceptReference ref = (ResolvedConceptReference)matches.
                       enumerateResolvedConceptReference().nextElement();
           Entity entry = ref.getReferencedEntry();
           System.out.println("Matching Name: " +
                   entry.getPresentation(0).getValue().getContent() );
  • No labels