本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Core.ConceptReference.setCodingScheme方法的典型用法代码示例。如果您正苦于以下问题:Java ConceptReference.setCodingScheme方法的具体用法?Java ConceptReference.setCodingScheme怎么用?Java ConceptReference.setCodingScheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.DataModel.Core.ConceptReference
的用法示例。
在下文中一共展示了ConceptReference.setCodingScheme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}