• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ConceptReference类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Core.ConceptReference的典型用法代码示例。如果您正苦于以下问题:Java ConceptReference类的具体用法?Java ConceptReference怎么用?Java ConceptReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConceptReference类属于org.LexGrid.LexBIG.DataModel.Core包,在下文中一共展示了ConceptReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: codedNodeGraph2CodedNodeSetIterator

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * Return Iterator for codedNodeGraph
 *
 * @param cng
 * @param graphFocus
 * @param resolveForward
 * @param resolveBackward
 * @param resolveAssociationDepth
 * @param maxToReturn
 * @return
 */
public ResolvedConceptReferencesIterator codedNodeGraph2CodedNodeSetIterator(
        CodedNodeGraph cng, ConceptReference graphFocus,
        boolean resolveForward, boolean resolveBackward,
        int resolveAssociationDepth, int maxToReturn) {
    CodedNodeSet cns = null;

    try {
        cns = cng.toNodeList(graphFocus, resolveForward, resolveBackward,
                resolveAssociationDepth, maxToReturn);
        if (cns == null) return null;
        return cns.resolve(null, null, null);
    } catch (Exception ex) {
        _logger.warn(ex.getMessage());
    }

    return null;
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:29,代码来源:SearchCart.java


示例2: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ConceptReferenceList createConceptReferenceList(
     String[] codes, String codingSchemeName, String ns) {
     if (codes == null) {
         return null;
     }
     ConceptReferenceList list = new ConceptReferenceList();
     for (int i = 0; i < codes.length; i++) {
         ConceptReference cr = new ConceptReference();
         cr.setCodingSchemeName(codingSchemeName);
         cr.setConceptCode(codes[i]);
         if (ns != null) {
	cr.setCodeNamespace(ns);
}

         list.addConceptReference(cr);
     }
     return list;
 }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:19,代码来源:TestConceptDetails.java


示例3: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(String[] codes, String codingSchemeName)
{
	if (codes == null)
	{
		return null;
	}
	ConceptReferenceList list = new ConceptReferenceList();
	for (int i = 0; i < codes.length; i++)
	{
		ConceptReference cr = new ConceptReference();
		cr.setCodingScheme(codingSchemeName);
		cr.setConceptCode(codes[i]);
		list.addConceptReference(cr);
	}
	return list;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:SearchUtils.java


示例4: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(String[] codes, String codingSchemeName)
{
    if (codes == null)
    {
        return null;
    }
    ConceptReferenceList list = new ConceptReferenceList();
    for (int i = 0; i < codes.length; i++)
    {
        ConceptReference cr = new ConceptReference();
        cr.setCodingSchemeName(codingSchemeName);
        cr.setConceptCode(codes[i]);
        list.addConceptReference(cr);
    }
    return list;
}
 
开发者ID:NCIP,项目名称:nci-mapping-tool,代码行数:17,代码来源:MappingUtils.java


示例5: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * @param codes
 * @param codingSchemeName
 * @return
 */
private ConceptReferenceList createConceptReferenceList(String[] codes,
        String codingSchemeName) {
    if (codes == null)
        return null;
    ConceptReferenceList list = new ConceptReferenceList();
    for (int i = 0; i < codes.length; i++) {
        ConceptReference cr = new ConceptReference();
        cr.setCodingSchemeName(codingSchemeName);
        cr.setConceptCode(codes[i]);
        list.addConceptReference(cr);
    }
    return list;
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:19,代码来源:SearchCart.java


示例6: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(
     Vector codes, String codingSchemeName) {
     if (codes == null) {
         return null;
     }
     ConceptReferenceList list = new ConceptReferenceList();
     for (int i = 0; i < codes.size(); i++) {
String code = (String) codes.elementAt(i);
         ConceptReference cr = new ConceptReference();
         if (codingSchemeName != null) cr.setCodingSchemeName(codingSchemeName);
         cr.setConceptCode(code);
         list.addConceptReference(cr);
     }
     return list;
 }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:16,代码来源:CartActionBean.java


示例7: createConceptReferenceList

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ConceptReferenceList createConceptReferenceList(
    String[] codes, String codingSchemeName) {
    if (codes == null) {
        return null;
    }
    ConceptReferenceList list = new ConceptReferenceList();
    for (int i = 0; i < codes.length; i++) {
        ConceptReference cr = new ConceptReference();
        cr.setCodingSchemeName(codingSchemeName);
        cr.setConceptCode(codes[i]);
        list.addConceptReference(cr);
    }
    return list;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:15,代码来源:ViewInHierarchyUtils.java


示例8: getAssociationSources

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public Vector getAssociationSources(String scheme, String version, String code, String assocName)
{
	CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
	if (version != null) csvt.setVersion(version);
	ResolvedConceptReferenceList matches = null;
	Vector v = new Vector();
	try {
		//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
		LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
		CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
		NameAndValueList nameAndValueList =
			createNameAndValueList(
				new String[] {assocName}, null);

		NameAndValueList nameAndValueList_qualifier = null;
		cng = cng.restrictToAssociations(nameAndValueList, nameAndValueList_qualifier);
           ConceptReference graphFocus = ConvenienceMethods.createConceptReference(code, scheme);

           boolean resolveForward = false;
           boolean resolveBackward = true;

           int resolveAssociationDepth = 1;
           int maxToReturn = 1000;

        ResolvedConceptReferencesIterator iterator = codedNodeGraph2CodedNodeSetIterator(
						cng,
						graphFocus,
						resolveForward,
						resolveBackward,
						resolveAssociationDepth,
						maxToReturn);

		v = resolveIterator(iterator, maxToReturn, code);
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return v;
   }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:39,代码来源:SearchUtils.java


示例9: getAssociationTargets

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public Vector getAssociationTargets(String scheme, String version, String code, String assocName)
{
	CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
	if (version != null) csvt.setVersion(version);
	ResolvedConceptReferenceList matches = null;
	Vector v = new Vector();
	try {
		//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
		LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
		CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
		NameAndValueList nameAndValueList =
			createNameAndValueList(
				new String[] {assocName}, null);

		NameAndValueList nameAndValueList_qualifier = null;
		cng = cng.restrictToAssociations(nameAndValueList, nameAndValueList_qualifier);
           ConceptReference graphFocus = ConvenienceMethods.createConceptReference(code, scheme);

           boolean resolveForward = true;
           boolean resolveBackward = false;

           int resolveAssociationDepth = 1;
           int maxToReturn = 1000;

        ResolvedConceptReferencesIterator iterator = codedNodeGraph2CodedNodeSetIterator(
						cng,
						graphFocus,
						resolveForward,
						resolveBackward,
						resolveAssociationDepth,
						maxToReturn);

		v = resolveIterator(iterator, maxToReturn, code);
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return v;
   }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:39,代码来源:SearchUtils.java


示例10: isCodeInValueSet

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static Boolean isCodeInValueSet(String code, String codingScheme, String vsd_uri) {
 try {
	String URL = "http://ncias-q541-v.nci.nih.gov:29080/lexevsapi60";
	URL = "http://localhost:19280/lexevsapi60";
	LexEVSDistributed distributed =
		(LexEVSDistributed)
		ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");

	LexEVSValueSetDefinitionServices vds = distributed.getLexEVSValueSetDefinitionServices();

             java.lang.String valueSetDefinitionRevisionId = null;
             AbsoluteCodingSchemeVersionReferenceList csVersionList = getEntireAbsoluteCodingSchemeVersionReferenceList();
             java.lang.String csVersionTag = null;

             ResolvedValueSetCodedNodeSet rvs_cns = vds.getCodedNodeSetForValueSetDefinition(
		 new URI(vsd_uri),
                  valueSetDefinitionRevisionId,
                  csVersionList,
                  csVersionTag);

             if (rvs_cns == null) return false;
             CodedNodeSet cns = rvs_cns.getCodedNodeSet();
             ConceptReference conceptReference = new ConceptReference();
             conceptReference.setConceptCode(code);
             if (codingScheme != null) {
		conceptReference.setCodingSchemeName(codingScheme);
	}
             java.lang.Boolean bool_obj = cns.isCodeInSet(conceptReference);
             return bool_obj;

 } catch (Exception ex) {
	ex.printStackTrace();
 }
 Boolean retval = null;
       return retval;
}
 
开发者ID:NCIP,项目名称:nci-value-set-editor,代码行数:37,代码来源:ValueSetUtils.java


示例11: matchesEntities

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public boolean matchesEntities(CodingScheme cs,
		Set<EntityNameOrURI> entities) throws LBException {
	if (entities == null || entities.isEmpty()) {
		return true;
	}
	ConceptReferenceList conceptReferenceList = new ConceptReferenceList();
	for (EntityNameOrURI entity : entities) {
		if (entity.getEntityName() != null) {
			ConceptReference conceptRef = new ConceptReference();
			conceptRef.setCode(entity.getEntityName().getName());
			conceptRef.setCodeNamespace(entity.getEntityName()
					.getNamespace());
			conceptReferenceList.addConceptReference(conceptRef);
		}

	}

	CodingSchemeVersionOrTag version = Constructors
			.createCodingSchemeVersionOrTagFromVersion(cs
					.getRepresentsVersion());
	CodedNodeSet cns = lexBIGService.getNodeSet(cs.getCodingSchemeURI(),
			version, null).restrictToCodes(conceptReferenceList);
	ResolvedConceptReferenceList rcrl = cns.resolveToList(null, null, null,
			null, false, -1);
	if (rcrl.getResolvedConceptReferenceCount() < 1) {
		return false;
	} else {
		return true;
	}
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:31,代码来源:CommonResolvedValueSetUtils.java


示例12: codes2CodedNodeSet

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public CodedNodeSet codes2CodedNodeSet() {
	if (_codes == null) return null;
	CodedNodeSet cns = null;
	CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
	if (this._version != null)
		csvt.setVersion(this._version);

	try {
		LexBIGService lbSvc = null;
		lbSvc = new RemoteServerUtil().createLexBIGService();

		LocalNameList entityTypes = new LocalNameList();
		entityTypes.addEntry("concept");

		cns = lbSvc.getNodeSet(this._vocabulary, csvt, entityTypes);
		//ResolvedConceptReferencesIterator iterator = toIterator();
		ConceptReferenceList codeList = new ConceptReferenceList();

		String codes = _codes;

		codes = codes.trim();
		if (codes.compareTo("") == 0) {
			return null;
		}

		String lines[] = codes.split("\\n");
		for(int i = 0; i < lines.length; i++) {
			String t = lines[i];
			ConceptReference cr = new ConceptReference();
			cr.setConceptCode(t);
			codeList.addConceptReference(cr);
		}
		cns.restrictToCodes(codeList);
	} catch (Exception ex) {

	}
	return cns;
}
 
开发者ID:NCIP,项目名称:nci-mapping-tool,代码行数:39,代码来源:ComponentObject.java


示例13: getAssociatedConcepts

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * Returns Associated Concepts
 *
 * @param scheme
 * @param version
 * @param code
 * @param assocName
 * @param forward
 * @return
 */
public Vector<Entity> getAssociatedConcepts(String scheme, String version,
        String code, Vector<String> assocNames, boolean forward) {

        CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
        if (version != null) csvt.setVersion(version);
        boolean resolveForward = true;
        boolean resolveBackward = false;

        // Set backward direction
        if (!forward) {
            resolveForward = false;
            resolveBackward = true;
        }

        Vector<Entity> v = new Vector<Entity>();

        try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();

            CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);

            // Restrict coded node graph to the given association
            NameAndValueList nameAndValueList = createNameAndValueList(
                    assocNames, null);
            cng = cng.restrictToAssociations(nameAndValueList, null);

            ConceptReference graphFocus =
                ConvenienceMethods.createConceptReference(code, scheme);

            ResolvedConceptReferencesIterator iterator =
                codedNodeGraph2CodedNodeSetIterator(cng, graphFocus,
                    resolveForward, resolveBackward, RESOLVEASSOCIATIONDEPTH,
                    MAXTORETURN);
            v = resolveIterator(iterator, MAXTORETURN, code);

        } catch (Exception ex) {
            _logger.warn(ex.getMessage());
        }
        return v;
    }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:51,代码来源:CartActionBean.java


示例14: resolveOneHit

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
protected List<? extends ResolvedConceptReference> resolveOneHit(ResolvedConceptReference hit) throws LBException{
	List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();

	CodingSchemeVersionOrTag tagOrVersion = new CodingSchemeVersionOrTag();
	if (hit.getCodingSchemeVersion() != null) tagOrVersion.setVersion(hit.getCodingSchemeVersion());

          CodedNodeGraph cng = null;

          if (lbSvc == null) {
		return null;
	}


		cng = lbSvc.getNodeGraph(
			hit.getCodingSchemeName(),
			tagOrVersion,
			null);

          Boolean restrictToAnonymous = Boolean.FALSE;
          cng = cng.restrictToAnonymous(restrictToAnonymous);

          LocalNameList localNameList = new LocalNameList();
          localNameList.addEntry("concept");

          cng = cng.restrictToEntityTypes(localNameList);


	if (_associationNameAndValueList != null) {
		cng =
			cng.restrictToAssociations(
				_associationNameAndValueList,
				_associationQualifierNameAndValueList);
	}

	else {
		String scheme = hit.getCodingSchemeName();
		SimpleDataUtils simpleDataUtils = new SimpleDataUtils(lbSvc);
		boolean isMapping = simpleDataUtils.isMapping(scheme, null);
		if (isMapping) {
			NameAndValueList navl = simpleDataUtils.getMappingAssociationNames(scheme, null);
			if (navl != null) {
				cng = cng.restrictToAssociations(navl, null);
			}
		}
	}

	ConceptReference focus = new ConceptReference();
	focus.setCode(hit.getCode());

	focus.setCodingSchemeName(hit.getCodingSchemeName());
	focus.setCodeNamespace(hit.getCodeNamespace());

	LocalNameList propertyNames = new LocalNameList();
	CodedNodeSet.PropertyType[] propertyTypes = null;
	SortOptionList sortCriteria = null;

	ResolvedConceptReferenceList list =
		cng.resolveAsList(focus,
			_resolveForward, _resolveBackward, 0,
			_resolveAssociationDepth, propertyNames, propertyTypes, sortCriteria,
			_maxToReturn);

	for(ResolvedConceptReference ref : list.getResolvedConceptReference()){
		if (ref.getSourceOf() != null && this.getAssociations(ref.getSourceOf()).size() > 0) {
			returnList.addAll(this.getAssociations(ref.getSourceOf()));
		}

		//if(ref.getSourceOf() != null){
		//	returnList.addAll(this.getAssociations(ref.getSourceOf()));
		//}

		if (ref.getTargetOf() != null && this.getAssociations(ref.getTargetOf()).size() > 0) {
			returnList.addAll(this.getAssociations(ref.getTargetOf()));
		}
		//if(ref.getTargetOf() != null){
			//returnList.addAll(this.getAssociations(ref.getTargetOf()));
		//}
	}
	return returnList;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:81,代码来源:SearchByAssociationIteratorDecorator.java


示例15: codedNodeGraph2CodedNodeSetIterator

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ResolvedConceptReferencesIterator codedNodeGraph2CodedNodeSetIterator(
						CodedNodeGraph cng,
						ConceptReference graphFocus,
						boolean resolveForward,
						boolean resolveBackward,
						int resolveAssociationDepth,
						int maxToReturn) {
        CodedNodeSet cns = null;
        try {
		 cns = cng.toNodeList(graphFocus,
						 resolveForward,
						 resolveBackward,
						 resolveAssociationDepth,
						 maxToReturn);

		 if (cns == null)
		 {
			 _logger.warn("cng.toNodeList returns null???");
			 return null;
		 }


	     SortOptionList sortCriteria = null;
		    //Constructors.createSortOptionList(new String[]{"matchToQuery", "code"});

		 LocalNameList propertyNames = null;
		 CodedNodeSet.PropertyType[] propertyTypes = null;
		 ResolvedConceptReferencesIterator iterator = null;
		 try {
			 iterator = cns.resolve(sortCriteria, propertyNames, propertyTypes);
		 } catch (Exception e) {
			 e.printStackTrace();
		 }

 		 if(iterator == null)
 		 {
			 _logger.warn("cns.resolve returns null???");
		 }
 		 return iterator;

     } catch (Exception ex) {
		 ex.printStackTrace();
		 return null;
	 }
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:46,代码来源:SearchUtils.java


示例16: addPathFromRoot

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * The given path represents a multi-tier association with associated
 * concepts and targets.  This method expands the association content
 * and adds results to the given tree item, recursing as necessary to
 * process each level in the path.
 * <p>
 * Nodes in the association acts as the backbone for the display.
 * For each backbone node, additional children are resolved one level
 * deep along with an indication of further expandability.
 */
protected void addPathFromRoot(TreeItem ti,
        LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
        String scheme, CodingSchemeVersionOrTag csvt,
        Association path, String[] associationsToNavigate, boolean associationsNavigatedFwd,
        Map<String, EntityDescription> codesToDescriptions)
    throws LBException {

    // First, add the branch point from the path ...
    ConceptReference branchRoot = path.getAssociationReference();
    String branchCode = branchRoot.getConceptCode();
    String branchCodeDescription = codesToDescriptions.containsKey(branchCode) ? codesToDescriptions
            .get(branchCode).getContent() : getCodeDescription(lbsvc, scheme, csvt, branchCode);

    TreeItem branchPoint = new TreeItem(branchCode, branchCodeDescription);
    String branchNavText = getDirectionalLabel(lbscm, scheme, csvt, path, associationsNavigatedFwd);

    // Now process elements in the branch ...
    AssociatedConceptList concepts = path.getAssociatedConcepts();
    for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {

        // Add all immediate leafs in the branch, and indication of
        // sub-nodes. Do not process codes already in the backbone here;
        // they will be printed in the recursive call ...
        AssociatedConcept concept = concepts.getAssociatedConcept(i);
        String code = concept.getConceptCode();
        TreeItem branchItem = new TreeItem(code, getCodeDescription(concept));
        branchPoint.addChild(branchNavText, branchItem);

        addChildren(branchItem, lbsvc, lbscm, scheme, csvt, code, codesToDescriptions.keySet(),
                associationsToNavigate, associationsNavigatedFwd);

        // Recurse to process the remainder of the backbone ...
        AssociationList nextLevel = concept.getSourceOf();
        if (nextLevel != null) {
            if (nextLevel.getAssociationCount() != 0) {
                // More levels left to process ...
                for (int j = 0; j < nextLevel.getAssociationCount(); j++)
                    addPathFromRoot(branchPoint, lbsvc, lbscm, scheme, csvt, nextLevel.getAssociation(j), associationsToNavigate,
                            associationsNavigatedFwd, codesToDescriptions);
            } else {
                // End of the line ...
                // Always add immediate children ot the focus code.
                addChildren(branchItem, lbsvc, lbscm, scheme,
                    csvt, concept.getConceptCode(), Collections.EMPTY_SET,
                    associationsToNavigate, associationsNavigatedFwd);
            }
        }
    }

    // Add the populated tree item to those tracked from root.
    ti.addChild(branchNavText, branchPoint);
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:63,代码来源:TreeUtils.java


示例17: addChildren

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
     * Populate child nodes for a single branch of the tree,
     * and indicates whether further expansion (to grandchildren)
     * is possible.
     */
    protected void addChildren(TreeItem ti,
            LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt,
            String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
            boolean associationsNavigatedFwd)
        throws LBException {

        // Resolve the next branch, representing children of the given
        // code, navigated according to the provided relationship and
        // direction.  Resolve the children as a code graph, looking 2
        // levels deep but leaving the final level unresolved.
        CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
        ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
        cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
/*
        ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
                !associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
        // to be reversed after loading the patch
        ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
                !associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);

        // The resolved branch will be represented by the first node in
        // the resolved list.  The node will be subdivided by source or
        // target associations (depending on direction). The associated
        // nodes define the children.
        for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
            ResolvedConceptReference node = nodes.next();
            AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();

            // Process each association defining children ...
            for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
                Association child = pathsToChildren.next();
                String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);

                // Each association may have multiple children ...
                AssociatedConceptList branchItemList = child.getAssociatedConcepts();
                for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
                        .hasNext();) {
                    AssociatedConcept branchItemNode = branchNodes.next();
                    String branchItemCode = branchItemNode.getConceptCode();

                    // Add here if not in the list of excluded codes.
                    // This is also where we look to see if another level
                    // was indicated to be available.  If so, mark the
                    // entry with a '+' to indicate it can be expanded.
                    if (!codesToExclude.contains(branchItemCode)) {
                        TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
                        AssociationList grandchildBranch =
                            associationsNavigatedFwd
                                ? branchItemNode.getSourceOf()
                                : branchItemNode.getTargetOf();
                        if (grandchildBranch != null)
                            childItem.expandable = true;
                        ti.addChild(childNavText, childItem);
                    }
                }
            }
        }
    }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:66,代码来源:TreeUtils.java


示例18: reverseAssoc

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * Recursive call to reverse order of the given association list, adding
 * results to the given list. In context of this program we use this
 * technique to determine the path from root, starting from the path to root
 * provided by the standard convenience method.
 */
protected AssociationList reverseAssoc(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
        CodingSchemeVersionOrTag csvt, Association assoc, AssociationList addTo,
        Map<String, EntityDescription> codeToEntityDescriptionMap) throws LBException {

    ConceptReference acRef = assoc.getAssociationReference();
    AssociatedConcept acFromRef = new AssociatedConcept();
    acFromRef.setCodingScheme(acRef.getCodingScheme());
    acFromRef.setConceptCode(acRef.getConceptCode());
    AssociationList acSources = new AssociationList();
    acFromRef.setIsNavigable(Boolean.TRUE);
    acFromRef.setSourceOf(acSources);

    // Use cached description if available (should be cached
    // for all but original root) ...
    if (codeToEntityDescriptionMap.containsKey(acRef.getConceptCode()))
        acFromRef.setEntityDescription(codeToEntityDescriptionMap.get(acRef.getConceptCode()));
    // Otherwise retrieve on demand ...
    else
        acFromRef.setEntityDescription(Constructors.createEntityDescription(getCodeDescription(lbsvc, scheme, csvt,
                acRef.getConceptCode())));

    AssociatedConceptList acl = assoc.getAssociatedConcepts();
    for (AssociatedConcept ac : acl.getAssociatedConcept()) {
        // Create reverse association (same non-directional name)
        Association rAssoc = new Association();
        rAssoc.setAssociationName(assoc.getAssociationName());

        // On reverse, old associated concept is new reference point.
        ConceptReference ref = new ConceptReference();
        ref.setCodingScheme(ac.getCodingScheme());
        ref.setConceptCode(ac.getConceptCode());
        rAssoc.setAssociationReference(ref);

        // And old reference is new associated concept.
        AssociatedConceptList rAcl = new AssociatedConceptList();
        rAcl.addAssociatedConcept(acFromRef);
        rAssoc.setAssociatedConcepts(rAcl);

        // Set reverse directional name, if available.
        String dirName = assoc.getDirectionalName();
        if (dirName != null)
            try {
                rAssoc.setDirectionalName(lbscm.isForwardName(scheme, csvt, dirName) ? lbscm
                        .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt) : lbscm
                        .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt));
            } catch (LBException e) {
            }

        // Save code desc for future reference when setting up
        // concept references in recursive calls ...
        codeToEntityDescriptionMap.put(ac.getConceptCode(), ac.getEntityDescription());

        AssociationList sourceOf = ac.getSourceOf();
        if (sourceOf != null)
            for (Association sourceAssoc : sourceOf.getAssociation()) {
                AssociationList pos = reverseAssoc(lbsvc, lbscm, scheme, csvt, sourceAssoc, addTo,
                        codeToEntityDescriptionMap);
                pos.addAssociation(rAssoc);
            }
        else
            addTo.addAssociation(rAssoc);
    }
    return acSources;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:71,代码来源:TreeUtils.java


示例19: getAssociationTargets

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public HashMap getAssociationTargets(String scheme, String version, String code, String assocName)
	{
        HashMap hmap = new HashMap();
        TreeItem ti = null;
        long ms = System.currentTimeMillis();
        Util.StopWatch stopWatch = new Util.StopWatch(); //DYEE

        Set<String> codesToExclude = Collections.EMPTY_SET;

		CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
		if (version != null) csvt.setVersion(version);
		ResolvedConceptReferenceList matches = null;
		Vector v = new Vector();
		try {
			//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
			LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
			LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbSvc
					.getGenericExtension("LexBIGServiceConvenienceMethods");
			lbscm.setLexBIGService(lbSvc);

            String name = getCodeDescription(lbSvc, scheme, csvt, code);
            ti = new TreeItem(code, name);
            ti.expandable = false;

			CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
			ConceptReference focus = Constructors.createConceptReference(code, scheme);
			cng = cng.restrictToAssociations(Constructors.createNameAndValueList(assocName), null);
			boolean associationsNavigatedFwd = true;
/*
			ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
					!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
			ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
					!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);

			for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
				ResolvedConceptReference node = nodes.next();
				AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();

				// Process each association defining children ...
				for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
					Association child = pathsToChildren.next();
					String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);

					// Each association may have multiple children ...
					AssociatedConceptList branchItemList = child.getAssociatedConcepts();
					for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
							.hasNext();) {
						AssociatedConcept branchItemNode = branchNodes.next();
						String branchItemCode = branchItemNode.getConceptCode();

						// Add here if not in the list of excluded codes.
						// This is also where we look to see if another level
						// was indicated to be available.  If so, mark the
						// entry with a '+' to indicate it can be expanded.
						if (!codesToExclude.contains(branchItemCode)) {
							TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
							ti.expandable = true;
							AssociationList grandchildBranch =
								associationsNavigatedFwd
									? branchItemNode.getSourceOf()
									: branchItemNode.getTargetOf();
							if (grandchildBranch != null)
								childItem.expandable = true;
							ti.addChild(childNavText, childItem);
						}
					}
				}
			}
			hmap.put(code, ti);

		} catch (Exception ex) {
			ex.printStackTrace();
		}
		_logger.debug("Run time (milliseconds) getSubconcepts: " + (System.currentTimeMillis() - ms) + " to resolve " );
		_logger.debug("DYEE: getSubconcepts: " + stopWatch.getResult() + " to resolve " );
		return hmap;
    }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:79,代码来源:TreeUtils.java


示例20: addChildren

import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
 * Populate child nodes for a single branch of the tree,
 * and indicates whether further expansion (to grandchildren)
 * is possible.
 */
protected void addChildren(TreeItem ti,
        LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
        String scheme, CodingSchemeVersionOrTag csvt,
        String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
        boolean associationsNavigatedFwd)
    throws LBException {

    // Resolve the next branch, representing children of the given
    // code, navigated according to the provided relationship and
    // direction.  Resolve the children as a code graph, looking 2
    // levels deep but leaving the final level unresolved.
    CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
    ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
    cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
    ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
            !associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);

    // The resolved branch will be represented by the first node in
    // the resolved list.  The node will be subdivided by source or
    // target associations (depending on direction). The associated
    // nodes define the children.
    for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
        ResolvedConceptReference node = nodes.next();
        AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();

        // Process each association defining children ...
        for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
            Association child = pathsToChildren.next();
            String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);

            // Each association may have multiple children ...
            AssociatedConceptList branchItemList = child.getAssociatedConcepts();
            for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
                    .hasNext();) {
                AssociatedConcept branchItemNode = branchNodes.next();
                String branchItemCode = branchItemNode.getConceptCode();

                // Add here if not in the list of excluded codes.
                // This is also where we look to see if another level
                // was indicated to be available.  If so, mark the
                // entry with a '+' to indicate it can be expanded.
                if (!codesToExclude.contains(branchItemCode)) {
                    TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
                    AssociationList grandchildBranch =
                        associationsNavigatedFwd
                            ? branchItemNode.getSourceOf()
                            : branchItemNode.getTargetOf();
                    if (grandchildBranch != null)
                        childItem.expandable = true;
                    ti.addChild(childNavText, childItem);
                }
            }
        }
    }
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:61,代码来源:BuildTreeForCode2.java



注:本文中的org.LexGrid.LexBIG.DataModel.Core.ConceptReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OperationalAttributes类代码示例发布时间:2022-05-22
下一篇:
Java Utility类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap