当前位置: 首页>>代码示例>>Java>>正文


Java ResolvedConceptReference.getEntityDescription方法代码示例

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


在下文中一共展示了ResolvedConceptReference.getEntityDescription方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemText

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Returns the text representing the given item.  Note that in
 * general this method assumes the presentations have been constrianed
 * during the initial query by HCD qualification.
 * @param rcr Concept resolved from a query.
 * @param hcd The hierarchical code to reflect in printed output.
 * @return The first embedded text presentation, or the item
 * description if no presentation is found.
 */
protected String getItemText(ResolvedConceptReference rcr, String hcd) {
	StringBuffer sb = new StringBuffer(rcr.getConceptCode());
	boolean presFound = false;
	if (rcr.getReferencedEntry() != null) {
		Presentation[] presentations = rcr.getReferencedEntry().getPresentation();
		for (int i = 0; i < presentations.length && !presFound; i++) {
			Presentation p = presentations[i];
			PropertyQualifier[] quals = p.getPropertyQualifier();
			for (int j = 0; j < quals.length && !presFound; j++) {
				PropertyQualifier pq = quals[j];
				if (presFound = "HCD".equals(pq.getPropertyQualifierId()) && hcd.equals(pq.getContent())) {
					sb.append(':').append(p.getText().getContent());
				}
			}
		}
	}
	if (!presFound && rcr.getEntityDescription() != null)
		sb.append(':').append(rcr.getEntityDescription().getContent());
	return sb.toString();
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:30,代码来源:FindUMLSContextsForCUI.java

示例2: print

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Prints the.
 *
 * @param ref the ref
 * @param depth the depth
 */
private static void print(ResolvedConceptReference ref, int depth){
	String code = ref.getConceptCode();

	String description;
	if(ref.getEntityDescription() != null){
		description = ref.getEntityDescription().getContent();
	} else {
		description = "";
	}

	System.out.println(buildPrefix(depth) + "Code: " + code + ", Description: " + description + " Hash: " + ref.hashCode());
	if(ref.getSourceOf() != null){
		print(ref.getSourceOf(), depth+1);
	}
	if(ref.getTargetOf() != null){
		print(ref.getTargetOf(), depth+1);
	}
}
 
开发者ID:NCIP,项目名称:camod,代码行数:25,代码来源:PrintUtility.java

示例3: testSimpleSearchUtilsByCode

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
@Test
   public void testSimpleSearchUtilsByCode() throws Exception {
       int m = 0;
	String scheme = "HL7";
	String version = "V3 R2.36";
	System.out.println(scheme + " (" + version + ")");
	String code = "10458:BRTH";
	System.out.println("search by code: " + code);

	int searchOption = SimpleSearchUtils.BY_CODE;
	String matchText = code;
	String matchAlgorithm = "exactMatch";

	try {
		ResolvedConceptReferencesIterator iterator = new SimpleSearchUtils(lbSvc).search(scheme, version,
			matchText, searchOption, matchAlgorithm);
		int numberRemaining = iterator.numberRemaining();
		while (iterator.hasNext()) {
			ResolvedConceptReference rcr = (ResolvedConceptReference) iterator.next();
			if (rcr == null) {
				System.out.println("rcr == null..");
			} else {
				EntityDescription ed = rcr.getEntityDescription();
				String pt = "";
				if (ed == null) {
					System.out.println("EntityDescription is null");
				} else {
					pt = rcr.getEntityDescription().getContent();
				}
				System.out.println(pt + "(code: " + rcr.getCode() + ")");
			}
		}

	} catch (Exception ex) {
		ex.printStackTrace();
		m++;
	}
	assertTrue(m == 0);
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:40,代码来源:TestSimpleSearchUtils.java

示例4: displayRef

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
protected static void displayRef(ResolvedConceptReference ref) {
if (ref.getEntityDescription() != null) {
       System.out.println(ref.getConceptCode() + ":" + ref.getEntityDescription().getContent());
} else {
	System.out.println(ref.getConceptCode() + ":");
}
  }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:8,代码来源:SimpleSearchUtils.java

示例5: displayRef

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
protected static void displayRef(int count, ResolvedConceptReference ref){
	if (ref.getEntityDescription() != null) {
	    System.out.println("(" + count + ") " + ref.getConceptCode() + " (" + ref.getEntityDescription().getContent()
	    + ") namespace: " + ref.getCodeNamespace() + ", coding scheme: " + ref.getCodingSchemeName() + ", version: " + ref.getCodingSchemeVersion());
	} else {
	    System.out.println("(" + count + ") " + ref.getConceptCode() + " (" + ""
	    + ") namespace: " + ref.getCodeNamespace() + ", coding scheme: " + ref.getCodingSchemeName() + ", version: " + ref.getCodingSchemeVersion());

	}
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:11,代码来源:ValueSetSearchUtils.java

示例6: dumpResolvedConceptReference

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public static void dumpResolvedConceptReference(ResolvedConceptReference rcr) {
	if (rcr.getEntityDescription() != null) {
		System.out.println(rcr.getEntityDescription().getContent() + "(" + rcr.getConceptCode() + ")");
	} else {
		System.out.println("(" + rcr.getConceptCode() + ")");
	}
	System.out.println("\tURI: " + rcr.getCodingSchemeURI());
	System.out.println("\tCoding Scheme: " + rcr.getCodingSchemeName());
	System.out.println("\tCoding Scheme Version: " + rcr.getCodingSchemeVersion());
	System.out.println("\tnamespace: " + rcr.getCodeNamespace());
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:12,代码来源:ValueSetSearchUtils.java

示例7: getCodeDescription

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Returns the entity description for the given resolved concept reference.
 */
protected String getCodeDescription(ResolvedConceptReference ref) throws LBException {
    EntityDescription desc = ref.getEntityDescription();
    if (desc != null)
        return desc.getContent();
    return "<Not assigned>";
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:10,代码来源:TreeUtils.java

示例8: printChainForNode

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Handles recursive display of hierarchy for an individual node,
 * up to the maximum specified depth.
 * @param lbscm
 * @param scheme
 * @param sab
 * @param csvt
 * @param ref
 * @param currentDepth
 * @param maxDepth
 * @param assocName
 * @throws LBException
 */
protected void printChainForNode(
		LexBIGServiceConvenienceMethods lbscm,
		String scheme,
		String sab,
		CodingSchemeVersionOrTag csvt,
		ResolvedConceptReference ref,
		int currentDepth,
		int maxDepth,
		String assocName) throws LBException
{
	// Print the referenced node; indent based on current depth ...
	StringBuffer indent = new StringBuffer();
	for (int i = 0; i <= currentDepth; i++)
		indent.append("    ");

	String code = ref.getConceptCode();
	EntityDescription desc = ref.getEntityDescription();
	Util.displayMessage(new StringBuffer()
		.append(indent)
		.append(assocName != null ? (assocName+"->") : "")
		.append(code).append(':').append(desc != null ? desc.getContent() : "")
		.toString());

	if (currentDepth < maxDepth) {
		AssociationList aList = lbscm.getHierarchyLevelNext(
			scheme, csvt, null, code, false,
			ConvenienceMethods.createNameAndValueList(sab, "Source"));
		for (int i = 0; i < aList.getAssociationCount(); i++) {
			Association assoc = aList.getAssociation(i);
			AssociatedConceptList acList = assoc.getAssociatedConcepts();
			for (Iterator<AssociatedConcept> nodes = acList.iterateAssociatedConcept(); nodes.hasNext(); ) {
				printChainForNode(lbscm, scheme, sab, csvt, nodes.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName());
			}
		}
	}
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:50,代码来源:ListHierarchyMetaBySource.java

示例9: printPath

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Print the description of concepts in the path, indenting
 * for each represented level.
 * @param path Chain of concept references, root first.
 */
protected void printPath(List<ResolvedConceptReference> path) {
       for (int i = 0; i < path.size(); i++) {
           StringBuffer sb = new StringBuffer(256);
           ResolvedConceptReference ref = path.get(i);
           for (int j = 0; j <= i; j++) sb.append("  ");
           sb.append(ref.getConceptCode());
           if (ref.getEntityDescription() != null)
               sb.append(':').append(ref.getEntityDescription().getContent());
           Util.displayMessage(sb.toString());
       }	    
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:ProfileScheme.java

示例10: printHierarchyBranch

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Handles recursive display of hierarchy for the given start node,
 * up to the maximum specified depth.
 * @param lbscm
 * @param scheme
 * @param csvt
 * @param hierarchyID
 * @param branchRoot
 * @param currentDepth
 * @param maxDepth
 * @param assocName
 * @throws LBException
 */
protected void printHierarchyBranch(
		LexBIGServiceConvenienceMethods lbscm,
		String scheme,
		CodingSchemeVersionOrTag csvt,
		String hierarchyID,
		ResolvedConceptReference branchRoot,
		int currentDepth,
		int maxDepth,
		String assocName) throws LBException
{
	// Print the referenced node; indent based on current depth ...
	StringBuffer indent = new StringBuffer();
	for (int i = 0; i < currentDepth; i++)
		indent.append("    ");

	String code = branchRoot.getConceptCode();
	EntityDescription desc = branchRoot.getEntityDescription();
	Util.displayMessage(new StringBuffer()
		.append(indent)
		.append(assocName != null ? (assocName+"->") : "")
		.append(code).append(':').append(desc != null ? desc.getContent() : "")
		.toString());

	// Print each association and recurse ...
	if (currentDepth < maxDepth) {
		AssociationList assocList = lbscm.getHierarchyLevelNext(scheme, csvt, hierarchyID, code, false, null);
		if (assocList != null)
			for (int i = 0; i < assocList.getAssociationCount(); i++) {
				Association assoc = assocList.getAssociation(i);
				AssociatedConceptList nodes = assoc.getAssociatedConcepts();
				for (Iterator<AssociatedConcept> subsumed = nodes.iterateAssociatedConcept(); subsumed.hasNext(); ) {
					printHierarchyBranch(lbscm, scheme, csvt, hierarchyID, subsumed.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName());
				}
			}
	}
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:50,代码来源:ListHierarchy.java

示例11: transformSummaryDescription

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
@Override
public EntityDirectoryEntry transformSummaryDescription(ResolvedConceptReference reference) {
	EntityDirectoryEntry entry = new EntityDirectoryEntry();
	entry.setAbout(this.getUriHandler().getEntityUri(reference));
	
	entry.setName(
		ModelUtils.createScopedEntityName(
			reference.getCode(), 
			this.sanitizeNamespace(reference.getCodeNamespace())));

	DescriptionInCodeSystem description = new DescriptionInCodeSystem();
	description.setDescribingCodeSystemVersion(
		this.getTransformUtils().toCodeSystemVersionReference(
			reference.getCodingSchemeName(), 
			reference.getCodingSchemeVersion(),
			reference.getCodingSchemeURI()));
	
	description.setHref(this.getTransformUtils().createEntityHref(reference));
	
	if(reference.getEntityDescription() != null){
		description.setDesignation(reference.getEntityDescription().getContent());
	}
	
	entry.addKnownEntityDescription(description);

	return entry;
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:28,代码来源:EntityTransform.java

示例12: extract

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
@Override
public String extract(ResolvedConceptReference ref) {
	if(ref.getEntityDescription() != null) {
		return ref.getEntityDescription().getContent();
	} else {
		return "";
	}
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:9,代码来源:MappingExtensionBulkDownloader.java

示例13: printConcepts

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
protected void printConcepts(String code, ResolvedConceptReferenceList list, 
        boolean isTargetList) throws LBException {
    StringBuffer buffer = new StringBuffer();
    if (isTargetList)
        buffer.append("* Pointed at by ...\n");
    else buffer.append("* Pointed to ...\n");

    if (list.getResolvedConceptReferenceCount() <= 0) {
        buffer.append(INDENT + "* " + code + ": 0 results.");
        Util.displayMessage(buffer.toString());
        return;
    }

    ResolvedConceptReference concept = (ResolvedConceptReference) 
        list.enumerateResolvedConceptReference().nextElement();
    AssociationList aList = isTargetList ? concept.getTargetOf() : concept.getSourceOf();
    Association[] associations = aList.getAssociation();
    int ctr = 0;
    for (int i = 0; i < associations.length; i++) {
        Association assoc = associations[i];
        AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
        for (int j = 0; j < acl.length; j++) {
            AssociatedConcept ac = acl[j];
            String childCode = ac.getConceptCode();
            EntityDescription ed = ac.getEntityDescription();
            String content = ed == null? "** No Description **" : ed.getContent(); 
            String msg = INDENT + (++ctr) + ") " + childCode + ": " + content;
            
            int childCount = numOfChildren(childCode);
            msg += "; children: " + childCount;
            if (_displayConcepts)
                buffer.append(msg + "\n");
        }
    }
    String parentCode = concept.getConceptCode();
    EntityDescription desc = concept.getEntityDescription();
    if (desc != null)
        buffer.append(INDENT + "* Concept name: " + desc.getContent() + "\n");
    buffer.append(INDENT + "* " + parentCode + " (children=" + ctr + ")");
    Util.displayMessage(buffer.toString());
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:42,代码来源:FindRelatedCodes2.java

示例14: printHierarchyBranch

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
 * Handles recursive display of hierarchy for the given start node,
 * up to the maximum specified depth.
 * @param hierarchyID
 * @param branchRoot
 * @param currentDepth
 * @param maxDepth
 * @param assocName
 * @param displayConcepts
 * @throws LBException
 */
protected void printHierarchyBranch(
        int ctr,
        String hierarchyID,
        ResolvedConceptReference branchRoot,
        int currentDepth,
        int maxDepth,
        String assocName,
        boolean displayConcepts) throws LBException
{
    // Print the referenced node; indent based on current depth ...
    StringBuffer indent = new StringBuffer();
    for (int i = 0; i < currentDepth-1; i++)
        indent.append(INDENT);

    String code = branchRoot.getConceptCode();
    EntityDescription desc = branchRoot.getEntityDescription();
    String conceptInfo = code + ":" + (desc != null ? desc.getContent() : "");
    if (displayConcepts)
        _buffer.append(indent + Integer.toString(ctr) + ") " + 
            (assocName != null ? (assocName+"->") : "") +
            conceptInfo + "\n");

    // Print each association and recurse ...
    if (currentDepth < maxDepth) {
        AssociationList assocList = _lbscm.getHierarchyLevelNext(
            _scheme, _csvt, hierarchyID, code, false, null);
        if (assocList == null)
            return;
        int j = 0;
        for (int i = 0; i < assocList.getAssociationCount(); i++) {
            Association assoc = assocList.getAssociation(i);
            AssociatedConceptList nodes = assoc.getAssociatedConcepts();
            for (Iterator<AssociatedConcept> subsumed = nodes.iterateAssociatedConcept(); subsumed.hasNext(); ) {
                printHierarchyBranch(++j, hierarchyID, subsumed.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName(), displayConcepts);
            }
        }
        if (currentDepth == 1 || displayConcepts)
            _buffer.append(indent + "* " + conceptInfo + " (children=" + j + ")\n");
    }
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:52,代码来源:ListHierarchy2.java

示例15: transformEntityReference

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public EntityReference transformEntityReference(ResolvedConceptReferencesIterator itr) {
	
	try {
		if(! itr.hasNext()){
			return null;
		} else {
			
			EntityReference reference = new EntityReference();
			
			while(itr.hasNext()){
				ResolvedConceptReference ref = itr.next();
				
				//skip ResolvedValueSets
				if(this.commonResolvedValueSetUtils.isResolvedValueSet(
					new UriVersionPair(ref.getCodingSchemeURI(), ref.getCodingSchemeVersion()))){
					continue;
				}
				
				if(reference.getAbout() == null){
					reference.setAbout(this.getUriHandler().getEntityUri(ref));
				}
				if(reference.getName() == null){
					reference.setName(
							ModelUtils.createScopedEntityName(
								ref.getCode(), 
								this.sanitizeNamespace(ref.getCodeNamespace())));
				}
		
				DescriptionInCodeSystem description = new DescriptionInCodeSystem();
				description.setDescribingCodeSystemVersion(
					this.getTransformUtils().toCodeSystemVersionReference(
						ref.getCodingSchemeName(), 
						ref.getCodingSchemeVersion(),
						ref.getCodingSchemeURI()));
				
				description.setHref(this.getTransformUtils().createEntityHref(ref));
				
				if(ref.getEntityDescription() != null){
					description.setDesignation(ref.getEntityDescription().getContent());
				}
				
				reference.addKnownEntityDescription(description);
			}

			return reference;
		}
	} catch (LBException e) {
		//LexEVS did not find it or it is invalid... return null.
		return null;
	}
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:52,代码来源:EntityTransform.java


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