本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList.getResolvedConceptReferenceCount方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedConceptReferenceList.getResolvedConceptReferenceCount方法的具体用法?Java ResolvedConceptReferenceList.getResolvedConceptReferenceCount怎么用?Java ResolvedConceptReferenceList.getResolvedConceptReferenceCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList
的用法示例。
在下文中一共展示了ResolvedConceptReferenceList.getResolvedConceptReferenceCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printTestCases
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void printTestCases(ResolvedConceptReferenceList rcrl) {
if (rcrl == null) return;
for (int i=0; i<rcrl.getResolvedConceptReferenceCount(); i++) {
int j = i+1;
ResolvedConceptReference rcr = rcrl.getResolvedConceptReference(i);
StringBuffer buf = new StringBuffer();
buf.append("(" + j + ") " + rcr.getEntityDescription().getContent() + " (" + rcr.getCode() + ")");
buf.append("\n\tcoding scheme: " + rcr.getCodingSchemeName());
buf.append("\n\tversion: " + rcr.getCodingSchemeVersion());
if (rcr.getCodeNamespace() != null && rcr.getCodeNamespace().length() > 0) {
buf.append("\n\tnamespace: " + rcr.getCodeNamespace());
}
buf.append("\n");
System.out.println(buf.toString());
}
}
示例2: selectRandomTestCases
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public ResolvedConceptReferenceList selectRandomTestCases(ResolvedConceptReferenceList list, int number) {
ResolvedConceptReferenceList samples = new ResolvedConceptReferenceList();
if (list.getResolvedConceptReferenceCount() == 0) return samples;
int max_to_return = number;
if (max_to_return > list.getResolvedConceptReferenceCount()) {
max_to_return = list.getResolvedConceptReferenceCount();
}
List selected_list = rvGenerator.selectWithNoReplacement(max_to_return, list.getResolvedConceptReferenceCount()-1);
for (int i=0; i<selected_list.size(); i++) {
Integer int_obj = (Integer) selected_list.get(i);
ResolvedConceptReference rcr = list.getResolvedConceptReference(int_obj.intValue());
samples.addResolvedConceptReference(rcr);
}
return samples;
}
示例3: generateResolvedConceptReferences
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public ResolvedConceptReferenceList generateResolvedConceptReferences(String codingScheme, String version, int number) {
if (version == null) {
version = codingSchemeDataUtils.getVocabularyVersionByTag(codingScheme, gov.nih.nci.evs.browser.common.Constants.PRODUCTION);
}
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) {
csvt.setVersion(version);
}
ResolvedConceptReferenceList rcrl = new ResolvedConceptReferenceList();
try {
LocalNameList entityTypes = new LocalNameList();
entityTypes.addEntry("concept");
CodedNodeSet cns = lbSvc.getNodeSet(codingScheme, csvt, entityTypes);
SortOptionList sortOptions = null;
LocalNameList filterOptions = null;
LocalNameList propertyNames = null;
CodedNodeSet.PropertyType[] propertyTypes = null;
boolean resolveObjects = false;
int maxToReturn = number;
ResolvedConceptReferenceList rvrlist = cns.resolveToList(sortOptions, filterOptions, propertyNames, propertyTypes, resolveObjects, maxToReturn);
for (int i=0; i<rvrlist.getResolvedConceptReferenceCount(); i++) {
ResolvedConceptReference rcr = rvrlist.getResolvedConceptReference(i);
rcrl.addResolvedConceptReference(rcr);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return rcrl;
}
示例4: run
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void run(String text)throws LBException{
CodingSchemeSummary css = Util.promptForCodeSystem();
if (css != null) {
LexBIGService lbSvc = LexBIGServiceImpl.defaultInstance();
String scheme = css.getCodingSchemeURN();
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
csvt.setVersion(css.getRepresentsVersion());
CodedNodeSet nodes = lbSvc.getCodingSchemeConcepts(scheme, csvt)
.restrictToStatus(ActiveOption.ALL, null)
.restrictToMatchingDesignations(
text,
SearchDesignationOption.ALL,
MatchAlgorithms.DoubleMetaphoneLuceneQuery.toString(),
null);
// Sort by search engine recommendation & code ...
SortOptionList sortCriteria =
Constructors.createSortOptionList(new String[]{"matchToQuery", "code"});
// Analyze the result ...
ResolvedConceptReferenceList matches =
nodes.resolveToList(sortCriteria, null, null, 10);
if (matches.getResolvedConceptReferenceCount() > 0) {
for (Enumeration refs = matches.enumerateResolvedConceptReference(); refs.hasMoreElements(); ) {
ResolvedConceptReference ref = (ResolvedConceptReference) refs.nextElement();
Util.displayMessage("Matching code: " + ref.getConceptCode());
Util.displayMessage("\tDescription: " + ref.getEntityDescription().getContent());
}
} else {
Util.displayMessage("No match found!");
}
}
}
示例5: getCodeDescription
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Returns the entity description for the given code.
*/
protected String getCodeDescription(LexBIGService lbsvc, String scheme, CodingSchemeVersionOrTag csvt, String code)
throws LBException {
CodedNodeSet cns = lbsvc.getCodingSchemeConcepts(scheme, csvt);
cns = cns.restrictToCodes(Constructors.createConceptReferenceList(code, scheme));
ResolvedConceptReferenceList rcrl = cns.resolveToList(null, noopList_, null, 1);
if (rcrl.getResolvedConceptReferenceCount() > 0) {
EntityDescription desc = rcrl.getResolvedConceptReference(0).getEntityDescription();
if (desc != null)
return desc.getContent();
}
return "<Not assigned>";
}
示例6: getNCImCodes
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public Vector getNCImCodes(String scheme, String version, String code) {
Vector w = new Vector();
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) {
csvt.setVersion(version);
}
try {
ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList(new String[] { code }, scheme);
CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);
if (cns == null) {
return null;
}
cns = cns.restrictToStatus(ActiveOption.ALL, null);
cns = cns.restrictToCodes(crefs);
ResolvedConceptReferenceList matches = cns.resolveToList(null, null, null, 1);
if (matches.getResolvedConceptReferenceCount() > 0) {
ResolvedConceptReference ref = (ResolvedConceptReference) matches.enumerateResolvedConceptReference()
.nextElement();
Entity node = ref.getEntity();
return getNCImCodes(node);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return w;
}
示例7: printTo
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
protected static void printTo(String code, String relation, LexBIGService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
System.out.println("Points to ...");
// Perform the query ...
NameAndValue nv = new NameAndValue();
NameAndValueList nvList = new NameAndValueList();
nv.setName(relation);
nvList.addNameAndValue(nv);
ResolvedConceptReferenceList matches =
lbSvc.getNodeGraph(scheme, csvt, null)
.restrictToAssociations(nvList, null)
.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
true, false, 1, 1, new LocalNameList(), null, null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
ResolvedConceptReference ref =
(ResolvedConceptReference) matches.enumerateResolvedConceptReference().nextElement();
// Print the associations
AssociationList sourceof = ref.getSourceOf();
Association[] associations = sourceof.getAssociation();
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];
EntityDescription ed = ac.getEntityDescription();
System.out.println(
"\t\t" + ac.getConceptCode() + "/"
+ (ed == null?
"**No Description**":ed.getContent()));
}
}
}
}
示例8: printHierarchies
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Discovers all registered hierarchies for the coding scheme and
* display each in turn.
* @param lbSvc
* @param scheme
* @param csvt
* @param maxDepth
* @param hierarchyID
* @throws LBException
*/
protected void printHierarchies(
//LexBIGService lbSvc,
EVSApplicationService lbSvc,
String scheme,
CodingSchemeVersionOrTag csvt,
int maxDepth,
String hierarchyID) throws LBException
{
LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbSvc.getGenericExtension("LexBIGServiceConvenienceMethods");
//EVSApplicationService lbSvc = new RemoteServerUtil2().createLexBIGService();
lbscm.setLexBIGService(lbSvc);
// Validate the ID, if specified ...
if (hierarchyID != null) {
String[] supportedIDs = lbscm.getHierarchyIDs(scheme, csvt);
Arrays.sort(supportedIDs);
if (Arrays.binarySearch(supportedIDs, hierarchyID) < 0) {
Util.displayMessage(
"The specified hierarchy identifier is not supported by the selected code system.");
Util.displayMessage("Supported values: ");
for (String id: supportedIDs)
Util.displayMessage(" " + id);
return;
}
}
// Print all branches from root ...
ResolvedConceptReferenceList roots = lbscm.getHierarchyRoots(scheme, csvt, hierarchyID);
for (int j = 0; j < roots.getResolvedConceptReferenceCount(); j++) {
ResolvedConceptReference root = roots.getResolvedConceptReference(j);
printHierarchyBranch(lbscm, scheme, csvt, null, root, 1, maxDepth, null);
}
}
示例9: matchSynonyms
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Display concepts and related text strings matching the given string.
* @param s The test string.
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
protected void matchSynonyms(String s, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
Util.displayMessage("\n*** Matching synonyms (incorporates partial normalization/stemming).");
// An attempt is made to use a partial normalized form on search by
// removing stop words and utilizing a stemmed query algorithm.
// Query is performed over all text representations (preferred and
// non-preferred) that contain every non-stop word in the given
// string.
//
// On resolve, we sort by lucene score ('matchToQuery' sort algorithm).
StringBuffer searchPhrase = new StringBuffer();
String[] words = toWords(s, true);
for (int i = 0; i < words.length; i++) {
if (i > 0)
searchPhrase.append(" AND ");
searchPhrase.append(words[i]);
}
// Define the code set and add restrictions ...
CodedNodeSet nodes = lbSvc.getCodingSchemeConcepts(scheme, csvt);
nodes.restrictToMatchingDesignations(
searchPhrase.toString(), SearchDesignationOption.ALL, "StemmedLuceneQuery", null);
SortOptionList sortCriteria =
Constructors.createSortOptionList(new String[]{"matchToQuery"});
PropertyType[] fetchTypes =
new PropertyType[] {PropertyType.PRESENTATION};
// Resolve and analyze the result ...
ResolvedConceptReferenceList matches =
nodes.resolveToList(sortCriteria, null, fetchTypes, -1);
// Found a match? If so, sort according to relevance.
if (matches.getResolvedConceptReferenceCount() > 0) {
// NOTE that a match so far only indicates that all of the words in the
// passed in string also exist in a term assigned to the resolved
// concepts. It does not, however, exclude results where the terms
// also have additional words. This code currently processes only
// full matches by calling getReferenceWeight and taking only those
// values with weight '1'.
// List concept references with exact correlation of at least one
// concept term to the compare string.
final List<String> matchWords = Arrays.asList(words);
for (int i = 0; i < matches.getResolvedConceptReferenceCount(); i++) {
ResolvedConceptReference ref = matches.getResolvedConceptReference(i);
if (getReferenceWeight(ref, matchWords) == 1)
printText(ref);
}
} else {
Util.displayMessage("\tNo match found.");
}
}
示例10: getAssociationSourceCodes
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public Vector getAssociationSourceCodes(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 {
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
Boolean restrictToAnonymous = Boolean.FALSE;
cng = cng.restrictToAnonymous(restrictToAnonymous);
NameAndValueList nameAndValueList =
createNameAndValueList(new String[] { assocName }, null);
NameAndValueList nameAndValueList_qualifier = null;
cng =
cng.restrictToAssociations(nameAndValueList,
nameAndValueList_qualifier);
matches =
cng.resolveAsList(ConvenienceMethods.createConceptReference(
code, scheme), false, true, 1, 1, new LocalNameList(),
null, null, _maxReturn);
if (matches.getResolvedConceptReferenceCount() > 0) {
java.util.Enumeration<? extends ResolvedConceptReference> refEnum = matches.enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = (ResolvedConceptReference) refEnum.nextElement();
AssociationList targetof = ref.getTargetOf();
Association[] associations = targetof.getAssociation();
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];
v.add(ac.getReferencedEntry().getEntityCode());
}
}
}
SortUtils.quickSort(v);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return v;
}
示例11: printFrom
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Display relations from the given code to other concepts.
* @param code
* @param relation
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
protected void printFrom(String code, String relation, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
// Perform the query ...
Util.displayMessage("Pointed at by ...");
// Perform the query ...
NameAndValue nv = new NameAndValue();
NameAndValueList nvList = new NameAndValueList();
nv.setName(relation);
nvList.addNameAndValue(nv);
/*
ResolvedConceptReferenceList matches =
lbSvc.getNodeGraph(scheme, csvt, null)
.restrictToAssociations(nvList, null)
.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
false, true, 1, 1, new LocalNameList(), null, null, 1024);
*/
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
cng = cng.restrictToAssociations(nvList, null);
ResolvedConceptReferenceList matches =
cng.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
false, true, 1, 1, new LocalNameList(), null, null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
ResolvedConceptReference ref =
(ResolvedConceptReference) matches.enumerateResolvedConceptReference().nextElement();
// Print the associations
AssociationList targetof = ref.getTargetOf();
Association[] associations = targetof.getAssociation();
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];
EntityDescription ed = ac.getEntityDescription();
Util.displayMessage(
"\t\t" + ac.getConceptCode() + "/"
+ (ed == null?
"**No Description**":ed.getContent()));
}
}
}
}
示例12: getConceptWithProperty
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public Entity getConceptWithProperty(String scheme, String version,
String code, String propertyName) {
try {
CodingSchemeVersionOrTag versionOrTag =
new CodingSchemeVersionOrTag();
if (version != null) versionOrTag.setVersion(version);
ConceptReferenceList crefs =
createConceptReferenceList(new String[] { code }, scheme);
CodedNodeSet cns = null;
try {
cns = lbSvc.getCodingSchemeConcepts(scheme, versionOrTag);
} catch (Exception e1) {
e1.printStackTrace();
return null;
}
//cns = cns.restrictToCodes(crefs);
try {
cns = cns.restrictToCodes(crefs);
LocalNameList propertyNames = new LocalNameList();
if (propertyName != null) propertyNames.addEntry(propertyName);
CodedNodeSet.PropertyType[] propertyTypes = null;
//long ms = System.currentTimeMillis(), delay = 0;
SortOptionList sortOptions = null;
LocalNameList filterOptions = null;
boolean resolveObjects = true; // needs to be set to true
int maxToReturn = 1000;
ResolvedConceptReferenceList rcrl =
cns.resolveToList(sortOptions, filterOptions,
propertyNames, propertyTypes, resolveObjects,
maxToReturn);
//HashMap hmap = new HashMap();
if (rcrl == null) {
_logger.warn("Concep not found.");
return null;
}
if (rcrl.getResolvedConceptReferenceCount() > 0) {
// ResolvedConceptReference[] list =
// rcrl.getResolvedConceptReference();
for (int i = 0; i < rcrl.getResolvedConceptReferenceCount(); i++) {
ResolvedConceptReference rcr =
rcrl.getResolvedConceptReference(i);
Entity c = rcr.getReferencedEntry();
return c;
}
}
return null;
} catch (Exception e) {
_logger.error("Method: SearchUtil.getConceptWithProperty");
_logger.error("* ERROR: getConceptWithProperty throws exceptions.");
_logger.error("* " + e.getClass().getSimpleName() + ": "
+ e.getMessage());
//e.printStackTrace();
}
} catch (Exception ex) {
_logger.error("Method: SearchUtil.getConceptWithProperty");
_logger.error("* ERROR: getConceptWithProperty throws exceptions.");
_logger.error("* " + ex.getClass().getSimpleName() + ": "
+ ex.getMessage());
}
return null;
}
示例13: printSources
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Display association sources for which the given term participates as target.
* @param term
* @param assoc
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
protected void printSources(String term, String assoc, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
// Find all nodes that the term matches.
/*
ResolvedConceptReferenceList nodeList =
lbSvc.getCodingSchemeConcepts(scheme, csvt)
.restrictToMatchingDesignations(
term, SearchDesignationOption.PREFERRED_ONLY, "LuceneQuery", null)
.resolveToList(
ConvenienceMethods.createSortOptionList(new String[] {SortableProperties.code.name()}),
null, new PropertyType[] {PropertyType.PRESENTATION}, 1024);
*/
CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);
cns = cns.restrictToMatchingDesignations(
term, SearchDesignationOption.PREFERRED_ONLY, "LuceneQuery", null);
ResolvedConceptReferenceList nodeList =
cns.resolveToList(
ConvenienceMethods.createSortOptionList(new String[] {SortableProperties.code.name()}),
null, new PropertyType[] {PropertyType.PRESENTATION}, 1024);
// For each node, find and print related sources ...
int nodeCount = nodeList.getResolvedConceptReferenceCount();
for (int i = 0; i < nodeCount; i++) {
ResolvedConceptReference node = (ResolvedConceptReference) nodeList.getResolvedConceptReference(i);
// Get a graph of relationships for which the node
// participate as a target.
/*
ResolvedConceptReferenceList matches =
lbSvc.getNodeGraph(scheme, csvt, null)
.restrictToAssociations(ConvenienceMethods.createNameAndValueList(assoc), null)
.resolveAsList( node,
false, true, 1, 1, new LocalNameList(), null, null, 1024);
*/
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
cng = cng.restrictToAssociations(ConvenienceMethods.createNameAndValueList(assoc), null);
ResolvedConceptReferenceList matches =
cng.resolveAsList( node,
false, true, 1, 1, new LocalNameList(), null, null, 1024);
int matchCount = matches.getResolvedConceptReferenceCount();
if (matchCount > 0) {
Util.displayMessage('\n' + node.getConceptCode() + '/' + node.getEntityDescription().getContent());
for (int j = 0; j < matchCount; j++) {
ResolvedConceptReference match = (ResolvedConceptReference) matches.getResolvedConceptReference(j);
Association a = match.getTargetOf().getAssociation(0);
AssociatedConcept[] acl = a.getAssociatedConcepts().getAssociatedConcept();
String aName = a.getDirectionalName();
for (int k = 0; k < acl.length; k++) {
AssociatedConcept ac = acl[k];
EntityDescription ed = ac.getEntityDescription();
Util.displayMessage(
'\t' + (aName == null ? "[R]" + a.getAssociationName() : aName)
+ ": " + ac.getConceptCode() + '/'
+ (ed == null ? "**No Description**" : ed.getContent()));
}
}
}
}
}
示例14: IllegalStateException
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
@Override
public DirectoryResult<AssociationDirectoryEntry>
execute(
CodedNodeGraph state,
int start,
int maxResults) {
boolean forward = this.direction.equals(Direction.SOURCEOF);
boolean reverse = this.direction.equals(Direction.TARGETOF);
try {
ResolvedConceptReferenceList resultList =
state.resolveAsList(this.focus, forward, reverse, 0, 1, null, null, null, null, -1);
if(resultList.getResolvedConceptReferenceCount() == 0){
return new DirectoryResult<AssociationDirectoryEntry>(
new ArrayList<AssociationDirectoryEntry>(), true);
}
if(resultList.getResolvedConceptReferenceCount() > 1){
throw new IllegalStateException("With a focus, this can never be more than 1.");
}
List<AssociationDirectoryEntry> results =
transform.transformSummaryDescription(
new ResolvedConceptReferenceAssociationPage(
this.direction,
start,
start + maxResults + 1,
resultList.getResolvedConceptReference(0)));
boolean atEnd = true;
if(results.size() == maxResults + 1){
atEnd = false;
results.remove(results.size() - 1);
}
return new DirectoryResult<AssociationDirectoryEntry>(results, atEnd);
} catch (LBException e) {
throw new RuntimeException(e);
}
}
示例15: printTo
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Display relations from the given code to other concepts.
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
@SuppressWarnings("unchecked")
//protected void printTo(String code, LexBIGService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
protected void printTo(String code, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException {
Util.displayMessage("Points to ...");
// Perform the query ...
/*
ResolvedConceptReferenceList matches =
lbSvc.getNodeGraph(scheme, csvt, null)
.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
true, false, 1, 1, new LocalNameList(), null, null, 1024);
*/
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
ResolvedConceptReferenceList matches =
cng.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
true, false, 1, 1, new LocalNameList(), null, null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
Enumeration<ResolvedConceptReference> refEnum =
matches .enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = refEnum.nextElement();
AssociationList sourceof = ref.getSourceOf();
Association[] associations = sourceof.getAssociation();
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
Util.displayMessage("\t" + assoc.getAssociationName());
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
EntityDescription ed = ac.getEntityDescription();
Util.displayMessage(
"\t\t" + ac.getConceptCode() + "/"
+ (ed == null?
"**No Description**":ed.getContent()));
}
}
}
}
}