本文整理汇总了Java中org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI.getVersions方法的典型用法代码示例。如果您正苦于以下问题:Java DescriptionChronicleBI.getVersions方法的具体用法?Java DescriptionChronicleBI.getVersions怎么用?Java DescriptionChronicleBI.getVersions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI
的用法示例。
在下文中一共展示了DescriptionChronicleBI.getVersions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFields
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
@Override
protected void addFields(ComponentChronicleBI chronicle, Document doc) {
if (chronicle instanceof DescriptionChronicleBI) {
DescriptionChronicleBI desc = (DescriptionChronicleBI) chronicle;
String lastDescText = null;
for (DescriptionVersionBI descriptionVersion : desc.getVersions()) {
if ((lastDescText == null) ||
(lastDescText.equals(descriptionVersion.getText()) == false)) {
doc.add(new TextField(ComponentProperty.DESCRIPTION_TEXT.name(),
descriptionVersion.getText(), Field.Store.NO));
lastDescText = descriptionVersion.getText();
}
}
}
}
示例2: threeE
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private String threeE(ConceptChronicleBI concept) throws ValidationException, IOException, ContradictionException {
StringBuilder sb = new StringBuilder();
boolean ihdFound = false;
int versionCount = 1;
for (RelationshipChronicleBI rel : concept.getRelationshipsOutgoing()) { //Each Relationship
Collection<? extends RelationshipVersionBI<?>> relVersions = rel.getVersions();
for(RelationshipVersionBI<?> version : relVersions) { //Each Relationship Version
ConceptChronicleBI versionConcept = OTFUtility.getConceptVersion(version.getDestinationNid());
Collection<? extends DescriptionChronicleBI> descriptions = versionConcept.getDescriptions();
for(DescriptionChronicleBI desc : descriptions) { //Each Description Chronicle
Collection<? extends DescriptionVersionBI<?>> descVersions = (Collection<? extends DescriptionVersionBI<?>>) desc.getVersions();
for(DescriptionVersionBI<?> descVersion : descVersions) {
if(descVersion.getText().equals("Ischemic heart disease")) {
sb.append("Version " + versionCount++ + ": " + descVersion.toString());
sb.append("\r\n");
}
}
}
}
}
return sb.toString();
}
示例3: getQueryMatches
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
@Override
public void getQueryMatches(ConceptVersionBI conceptVersion) throws IOException, ContradictionException {
for (DescriptionChronicleBI dc : conceptVersion.getDescriptions()) {
for (DescriptionVersionBI dv : dc.getVersions()) {
if (dv.getText().matches(regex) && Ts.get().getComponentVersion(viewCoordinate, dv.getNid()).isActive()) {
addToResultsCache((dv.getNid()));
}
}
}
}
示例4: getQueryMatches
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
@Override
public void getQueryMatches(ConceptVersionBI conceptVersion) throws IOException, ContradictionException {
for (DescriptionChronicleBI dc : conceptVersion.getDescriptions()) {
if (cache.contains(dc.getNid())) {
for (DescriptionVersionBI dv : dc.getVersions()) {
if (dv.getText().matches(regex)) {
addToResultsCache((dv.getNid()));
}
}
}
}
}
示例5: getDescriptionOnly
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private String getDescriptionOnly(ConceptChronicleBI concept) throws IOException, ContradictionException {
StringBuilder sb = new StringBuilder();
sb.append("\r\n");
int count = 1;
for (DescriptionChronicleBI desc : concept.getDescriptions()) {
for(DescriptionVersionBI<?> thisDescVersion : desc.getVersions()) {
sb.append("Description Term " + count++ + ": " + thisDescVersion.getNid() + " - ");
sb.append(thisDescVersion.getText());
sb.append("\r\n");
}
}
return sb.toString();
}
示例6: printAllVersions
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
public void printAllVersions(DescriptionChronicleBI fullDesc) throws IOException {
int i = 0;
for (DescriptionVersionBI desc : fullDesc.getVersions()) {
System.out.println("Version #" + i++);
printDescription(desc);
System.out.println("\n\n");
}
}
示例7: getLoincConceptNid
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private int getLoincConceptNid(SelectionCriteria sc) throws IOException, ParseException, PropertyVetoException
{
if (sc.getValueId() != null && sc.getValueId().length() > 0)
{
ConceptChronicleBI cc;
if (Utility.isUUID(sc.getValueId()))
{
cc = ts_.getConcept(UUID.fromString(sc.getValueId()));
}
else
{
LuceneDynamicRefexIndexer refexIndexer = AppContext.getService(LuceneDynamicRefexIndexer.class);
if (refexIndexer == null)
{
throw new RuntimeException("No sememe indexer found, aborting.");
}
List<SearchResult> searchResults = refexIndexer.query(new RefexDynamicString("\"" + sc.getValueId() + "\""), getNid(LOINC_NUM), false,
new Integer[] {0}, 5, null);
if (searchResults.size() != 1)
{
throw new RuntimeException("Unexpected - multiple hits on ID " + sc.getValueId());
}
else
{
cc = ts_.getComponent(searchResults.get(0).getNid()).getEnclosingConcept();
}
}
for (DescriptionChronicleBI dc : cc.getDescriptions())
{
for (DescriptionVersionBI<?> dv : dc.getVersions())
{
if (dv.getText().equals(sc.getValue()))
{
return cc.getNid();
}
}
}
//TODO maybe fail?
System.err.println("ERROR -------------------");
System.err.println("ERROR - The concept '" + cc + "' did not have a description that matched the expected value of '" + sc.getValue() + "' from the spreadsheet");
System.err.println("ERROR -------------------");
return cc.getNid();
}
else
{
throw new RuntimeException("Not yet handeled");
}
}