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


Java DescriptionChronicleBI.getVersion方法代码示例

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


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

示例1: getFSN

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
public String getFSN(ConceptChronicleBI concept) throws ContradictionException {
	try {
		if (concept.getDescriptions() != null) {
			for (DescriptionChronicleBI desc : concept.getDescriptions()) {
				int versionCount = desc.getVersions().size();
				DescriptionVersionBI<?> descVer = desc.getVersions().toArray(new DescriptionVersionBI[versionCount])[versionCount - 1];

				DescriptionVersionBI descriptionVersion = desc.getVersion(this.viewCoordinate);
				
				if(descriptionVersion.getTypeNid() == Snomed.FULLY_SPECIFIED_DESCRIPTION_TYPE.getNid()) {
//					|| descVer.getTypeNid() == OTFUtility.getFsnRf1Nid()) {
					return descriptionVersion.getText();
				}
			}
		}
	} catch (IOException e) {
		// noop
	} 
	
	return null;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:22,代码来源:VasTestCodeRunner.java

示例2: getInfarctTargetRoleGroup

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private String getInfarctTargetRoleGroup(ConceptChronicleBI concept) throws ValidationException, IOException, ContradictionException {
 
 StringBuilder sb = new StringBuilder();
 finished:
 for (RelationshipChronicleBI rel : concept.getRelationshipsOutgoing()) {
	 RelationshipVersionBI<?> relVersion = rel.getVersion(OTFUtility.getViewCoordinate());

	 ConceptChronicleBI versionConcept = OTFUtility.getConceptVersion(relVersion.getDestinationNid());

	 Collection<? extends DescriptionChronicleBI> descriptions = versionConcept.getDescriptions(); // Get current, don't itterate versions of desc
	 for(DescriptionChronicleBI desc : descriptions) {
		 
		 DescriptionVersionBI<?> thisVersion = (DescriptionVersionBI<?>) desc.getVersion(OTFUtility.getViewCoordinate());
		 DescriptionVersionBI<?> descVersion = thisVersion;
		 
		 if(descVersion.getText().equals("Infarct")) {
		 sb.append("INFARCT TARGET ROLE GROUP: " + relVersion.getGroup());
		 sb.append("\r\n");
		 break finished;
		 }
	 }
	 relVersion.getGroup();
 }
 
 return sb.toString(); 
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:27,代码来源:VasTestCodeRunner.java

示例3: getDescriptionText

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
/**
 * Returns the description text.
 *
 * @param concept the concept
 * @param type the type
 * @return the description text
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws ContradictionException the contradiction exception
 */
private String getDescriptionText(ConceptChronicleBI concept, String type)
  throws IOException, ContradictionException {
  for (DescriptionChronicleBI desc : concept.getDescriptions()) {
    DescriptionVersionBI<?> descVersion =
        desc.getVersion(OTFUtility.getViewCoordinate());
    // WARNING:
    // LOINC is created using FSN and not PT for this, the
    // metadata concepts do not have PTs.
    String prefName =
        OTFUtility.getConceptVersion(descVersion.getTypeNid())
            .getFullySpecifiedDescription().getText();
    if (descVersion.isActive() && prefName.equals(type)) {
      return descVersion.getText();
    }
  }
  return "";
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:27,代码来源:LoincContentRequestHandler.java

示例4: printAllDescriptions

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private static void printAllDescriptions(ConceptChronicleBI con)
		throws IOException, ContradictionException {
	Collection<? extends DescriptionChronicleBI> allDesc = con
			.getDescriptions();
	int i = 0;

	for (DescriptionChronicleBI descAllVersoins : allDesc) {
		DescriptionVersionBI desc = descAllVersoins.getVersion(vc);

		// Description-based attributes
		if (desc != null) {
			System.out.println("Description #" + ++i);
			printDescription(desc);
		} else {
			System.out
					.println("No Description available at View cordinate");
		}
	}
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:20,代码来源:ConceptPrinter.java

示例5: getCapitalSignificance

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private String getCapitalSignificance(ConceptChronicleBI concept) throws IOException, ContradictionException {
		
		StringBuilder sb = new StringBuilder();
		
		String fsnResult = null;
		String infarctionResult = null;
		int descriptionTypeNid = 0;
		int snomedFsnNid = Snomed.FULLY_SPECIFIED_DESCRIPTION_TYPE.getNid();
//		int snomedFsnNid2 = OTFUtility.getFsnRf1Nid();
		int snomedSynonymNid = Snomed.SYNONYM_DESCRIPTION_TYPE.getNid();
		
		// 3 types of descriptions: FSN, Synonym, Definition	
		for (DescriptionChronicleBI desc : concept.getDescriptions()) {
			DescriptionVersionBI<?> descVersion = desc.getVersion(this.viewCoordinate);
			
			if(descVersion != null) {
			descriptionTypeNid = descVersion.getTypeNid();
			//1F
				if(descriptionTypeNid == snomedFsnNid) {
//					|| descriptionTypeNid == snomedFsnNid2) {

					fsnResult	= Boolean.toString(descVersion.isInitialCaseSignificant());
					sb.append("FSN - isInitialCaseSignificant: " + fsnResult);
					sb.append("\r\n");
				}
					
				// 1G
				if(descriptionTypeNid == snomedSynonymNid) {
					if(descVersion.getText().equals("Infarction of heart")) {
						infarctionResult	= Boolean.toString(descVersion.isInitialCaseSignificant());
						sb.append("Synonym - Infarction of Heart isInitialCaseSignificant: " + infarctionResult);
						sb.append("\r\n");
					}
				}
			}
		}
		return sb.toString();
	}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:39,代码来源:VasTestCodeRunner.java

示例6: retireDesc

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private void retireDesc(DescriptionChronicleBI fullDesc) throws ContradictionException, InvalidCAB, IOException {
	DescriptionVersionBI desc = fullDesc.getVersion(vc);
	DescriptionCAB dcab = desc.makeBlueprint(vc,  IdDirective.PRESERVE, RefexDirective.EXCLUDE);
	dcab.setStatus(Status.INACTIVE);
	
	DescriptionChronicleBI dcbi = appDb.getBuilder().constructIfNotCurrent(dcab);
	
	appDb.getDB().addUncommitted(dcbi.getEnclosingConcept());
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:10,代码来源:ComponentModify.java

示例7: modifyDescAttributes

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
private void modifyDescAttributes(DescriptionChronicleBI fullDesc) throws PropertyVetoException, IOException, ContradictionException, InvalidCAB
{
	DescriptionVersionBI desc = fullDesc.getVersion(vc);
	DescriptionCAB dcab = new DescriptionCAB(desc.getConceptNid(), SnomedMetadataRfx.getDES_SYNONYM_NID(), LanguageCode.DA_DK, "New Text attempt", true, desc, vc, IdDirective.PRESERVE, RefexDirective.EXCLUDE);
	DescriptionChronicleBI dcbi = appDb.getBuilder().constructIfNotCurrent(dcab);
	
	appDb.getDB().addUncommitted(dcbi.getEnclosingConcept());
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:9,代码来源:ComponentModify.java

示例8: getDescFromSctid

import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入方法依赖的package包/类
@GET
@Path("/{id}")
@Produces("text/plain")
@ApiOperation(value = "Find descriptions from an input SCTID.", response = String.class)
@ApiResponses(value = {
    @ApiResponse(code = 422, message = "No descriptions found for SCTID")
})
public String getDescFromSctid(
        @ApiParam(value = "Find all active descriptions for input SCTID.", required = true, defaultValue = "195967001")
        @PathParam("id") String id) throws IOException, JAXBException, Exception {
    System.out.println("Getting descriptions for: " + id);
    System.out.println("SCTID indexer: " + sctIdIndexer);

    if (!id.matches("[0-9]*") || id.length() > 18) {
        return "Incorrect SNOMED id.";
    }

    List<SearchResult> result = sctIdIndexer.query(id, ComponentProperty.LONG_EXTENSION_1, 1);
    System.out.println("result: " + result);
    for (SearchResult r : result) {
        System.out.println("nid: " + r.nid + " score:" + r.score);
    }
    System.out.println("result: " + result);

    if (!result.isEmpty()) {
        ViewCoordinate vc = StandardViewCoordinates.getSnomedInferredLatest();
        ComponentChronicleBI cc = Ts.get().getComponent(result.get(0).nid);
        UUID uuid = Ts.get().getUuidPrimordialForNid(cc.getNid());
        ConceptChronicleBI concept = Ts.get().getComponent(uuid).getEnclosingConcept();
        ConceptVersionBI cv = concept.getVersion(vc);

        ArrayList<Object> list = new ArrayList<>();
        
        for (DescriptionChronicleBI dc : concept.getVersion(vc).getDescriptions()) {
            if (dc.getVersion(vc) != null) {
                DescriptionVersionBI dv = dc.getVersion(vc);
                ConceptChronicleDdo ccDdo = new ConceptChronicleDdo(ts.getSnapshot(vc), concept, VersionPolicy.ACTIVE_VERSIONS, RefexPolicy.REFEX_MEMBERS, RelationshipPolicy.DESTINATION_RELATIONSHIPS);
                DescriptionChronicleDdo dcDdo = new DescriptionChronicleDdo(ts.getSnapshot(vc), ccDdo, dc);
                list.add(new SimpleDescriptionVersionDdo(dcDdo, ts.getSnapshot(vc), dv, cv));
            }
        }
        if (list.size() > 0) {

            ResultList resultList = new ResultList();
            resultList.setTheResults(list);
            StringWriter writer = new StringWriter();

            JaxbForQuery.get().createMarshaller().marshal(resultList, writer);
            return writer.toString();
        }
    }
    return "No descriptions found for " + id + ". Please ensure you have the correct SNOMED id.";

}
 
开发者ID:Apelon-VA,项目名称:OTF-Query-Services,代码行数:55,代码来源:DescriptionsForConceptResource.java


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