NIH | National Cancer Institute | NCI Wiki  

			//Instantiate the search extension
         	LexBIGService lbsvc = LexBIGServiceImpl.defaultInstance();
         	SourceAssertedValueSetSearchExtensionImpl assertedVSsvc = null;
       		try {
        	assertedVSsvc = (SourceAssertedValueSetSearchExtensionImpl) lbsvc
                   .getGenericExtension("AssertedValueSetSearchExtension");
    		} catch (LBException e) {
        	e.printStackTrace();
    		}
			//Search for results based on an exact match of the unique identifier of the value set member
	        ResolvedConceptReferencesIterator itr = assertedVSsvc.
                search("C48323", null, null, MatchAlgorithm.CODE_EXACT,
                false, false);
			while(itr.hasNext()){
				ResolvedConceptReference ref = itr.next();
				System.out.println("description: " + ref.getEntityDescription().getContent()):
			}
			//Search for results based on an exact match of the preferred text designation of the value set member
	        ResolvedConceptReferencesIterator itr = assertedVSsvc.
                search("Black", null, null,
                MatchAlgorithm.PRESENTATION_EXACT, false, false);
			while(itr.hasNext()){
				ResolvedConceptReference ref = itr.next();
				System.out.println("description: " + ref.getEntityDescription().getContent()):
			}

            //Search for results based on an containing match of the preferred text designation of the value set member
            ResolvedConceptReferencesIterator itr = assertedVSsvc.
                search("Blinding", null, null,
                MatchAlgorithm.PRESENTATION_CONTAINS, false, false);
            while(itr.hasNext()){
                ResolvedConceptReference ref = itr.next();
                System.out.println("description: " + ref.getEntityDescription().getContent()):
            }

			//Search for results based on an lucene query parser match of the preferred text designation of the value set member
            ResolvedConceptReferencesIterator itr = assertedVSsvc.
                search("BlindingWhite", null, null,
                MatchAlgorithm.LUCENE, false, false);
            while(itr.hasNext()){
                ResolvedConceptReference ref = itr.next();
                System.out.println("description: " + ref.getEntityDescription().getContent()):
            }

		    //Search for results based on an exact match of some property of the value set member
			//Also, restrict the search to a given value set designation
			CodingSchemeReference csRef = new CodingSchemeReference();
        	csRef.setCodingScheme("http://evs.nci.nih.gov/valueset/FDA/C54453");
        	csRef.setVersionOrTag(Constructors.createCodingSchemeVersionOrTagFromVersion("0.1.5.1"));
        	ResolvedConceptReferencesIterator itr = assertedVSsvc.search("Black", csRef,  MatchAlgorithm.PROPERTY_EXACT);
			while(itr.hasNext()){
				ResolvedConceptReference ref = itr.next();
				System.out.println("description: " + ref.getEntityDescription().getContent()):
			}
  • No labels