本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference.getEntity方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedConceptReference.getEntity方法的具体用法?Java ResolvedConceptReference.getEntity怎么用?Java ResolvedConceptReference.getEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference
的用法示例。
在下文中一共展示了ResolvedConceptReference.getEntity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNCImCodes
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的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;
}
示例2: printProps
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
* Display properties for the given code.
*
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @return
* @throws LBException
*/
protected boolean printProps(PrintWriter pw, String scheme, CodingSchemeVersionOrTag csvt, String code)
throws LBException {
// Perform the query ...
pw.println("Coding scheme|" + scheme);
pw.println("Version|" + csvt.getVersion());
List<String> namespaces = getDistinctNamespacesOfCode(scheme, csvt.getVersion(), code);
String namespace = namespaces.get(0);
pw.println("Namespace|" + namespace);
pw.println("code|" + code);
ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList(new String[] { code }, scheme);
CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);
if (cns == null) {
pw.println("CNS == NULL???");
return false;
}
cns = cns.restrictToStatus(ActiveOption.ALL, null);
cns = cns.restrictToCodes(crefs);
ResolvedConceptReferenceList matches = cns.resolveToList(null, null, null, 1);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
ResolvedConceptReference ref = (ResolvedConceptReference) matches.enumerateResolvedConceptReference()
.nextElement();
Entity node = ref.getEntity();
printProperties(pw, node);
}
return true;
}
示例3: getNCImCodes
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的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;
}
示例4: getPropertyValues
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public HashMap getPropertyValues(String scheme, String version, String propertyType, String propertyName) {
HashMap hmap = new HashMap();
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
if (version != null) versionOrTag.setVersion(version);
try {
CodedNodeSet cns = getNodeSet(scheme, versionOrTag);
SortOptionList sortOptions = null;
LocalNameList filterOptions = null;
LocalNameList propertyNames = Constructors.createLocalNameList(propertyName);
CodedNodeSet.PropertyType[] propertyTypes = null;
boolean resolveObjects = true;
ResolvedConceptReferencesIterator iterator = cns.resolve(sortOptions, filterOptions, propertyNames,
propertyTypes, resolveObjects);
while (iterator != null && iterator.hasNext()) {
ResolvedConceptReference rcr = iterator.next();
Entity concept = rcr.getEntity();
Vector v = getPropertyValues(concept, propertyType, propertyName);
if (v != null) {
if (v.size() > 0) {
String key = concept.getEntityCode();
String value = (String) v.elementAt(0);
hmap.put(key, value);
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
return hmap;
}
示例5: getEVSConcept
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
private EVSConcept getEVSConcept(ResolvedConceptReference rcRef) {
EVSConcept evsConcept = new EVSConcept();
evsConcept.setCode(rcRef.getCode());
Entity entity = rcRef.getEntity();
evsConcept.setDefinitions(getEntityDefinitions(entity));
evsConcept = setProperties(evsConcept, entity);
return evsConcept;
}
示例6: transformFullDescription
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
@Override
public EntityListEntry transformFullDescription(ResolvedConceptReference reference) {
Assert.isTrue(reference.getEntity() != null,
"The Entity is null. Please resolve the CodedNodeSet with Resolve = true");
Entity entity = reference.getEntity();
NamedEntityDescription namedEntity = new NamedEntityDescription();
namedEntity.setAbout(this.getUriHandler().getEntityUri(reference));
namedEntity.setEntityID(
ModelUtils.createScopedEntityName(
entity.getEntityCode(),
this.sanitizeNamespace(entity.getEntityCodeNamespace())));
String codingSchemeName =
this.getCodingSchemeNameTranslator().translateFromLexGrid(reference.getCodingSchemeName());
namedEntity.setDescribingCodeSystemVersion(
this.getTransformUtils().toCodeSystemVersionReference(
codingSchemeName,
reference.getCodingSchemeVersion(),
reference.getCodingSchemeURI()));
namedEntity.setDesignation(this.toDesignation(entity.getPresentation()));
namedEntity.setProperty(this.toProperty(
codingSchemeName,
reference.getCodingSchemeURI(),
reference.getCodingSchemeVersion(),
entity.getAllProperties()));
namedEntity.setDefinition(this.toDefinition(entity.getDefinition()));
namedEntity.setNote(this.toNote(entity.getComment()));
namedEntity.setChildren(
this.getUrlConstructor().createChildrenUrl(
codingSchemeName,
reference.getCodingSchemeVersion(),
entity.getEntityCode()));
try {
namedEntity.setParent(this.getParents(reference));
} catch (Exception e) {
log.warn("Error resolving Parents for: " + reference.getCode());
if(log.isDebugEnabled()){
log.debug(e);
}
}
URIAndEntityName entityType = new URIAndEntityName();
entityType.setName("Class");
entityType.setNamespace("owl");
entityType.setUri("http://www.w3.org/2002/07/owl#Class");
namedEntity.addEntityType(entityType);
String entityHref = this.getTransformUtils().createEntityHref(reference);
//NOTE: We probably want to check this with the CodedNodeGraph to
//see if there actually are associations to link to. That's added
//expense that I'm not sure if we want.
namedEntity.setSubjectOf(
entityHref + "/" + URIHelperInterface.SUBJECTOF);
namedEntity.setTargetOf(
entityHref + "/" + URIHelperInterface.TARGETOF);
EntityDescription ed = new EntityDescription();
ed.setNamedEntity(namedEntity);
EntityListEntry listEntry = new EntityListEntry();
listEntry.setEntry(ed);
listEntry.setResourceName(
EncodingUtils.encodeScopedEntityName(
ModelUtils.createScopedEntityName(
reference.getCode(),
this.sanitizeNamespace(reference.getCodeNamespace()))));
listEntry.setHref(this.getTransformUtils().createEntityHref(reference));
return listEntry;
}