本文整理汇总了Java中org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI类的典型用法代码示例。如果您正苦于以下问题:Java DescriptionChronicleBI类的具体用法?Java DescriptionChronicleBI怎么用?Java DescriptionChronicleBI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DescriptionChronicleBI类属于org.ihtsdo.otf.tcc.api.description包,在下文中一共展示了DescriptionChronicleBI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getFullySpecifiedName
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
public static String getFullySpecifiedName(ConceptChronicleBI concept) {
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];
if (descVer.getTypeNid() == getFSNNid() || descVer.getTypeNid() == getFsnRf1Nid()) {
if (descVer.getStatus() == Status.ACTIVE) {
return descVer.getText();
}
}
}
}
} catch (IOException e) {
// noop
}
return null;
}
示例3: getConceptComponents
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
public static Set<ComponentVersionBI> getConceptComponents(
ConceptVersionBI conceptWithComp) throws IOException, ContradictionException {
Set<ComponentVersionBI> retSet = new HashSet<>();
retSet.add(conceptWithComp);
for(DescriptionChronicleBI desc : conceptWithComp.getDescriptions()) {
retSet.add(desc.getVersion(conceptWithComp.getViewCoordinate()));
}
for(RelationshipChronicleBI rel : conceptWithComp.getRelationshipsOutgoing()) {
retSet.add(rel.getVersion(conceptWithComp.getViewCoordinate()));
}
for(RefexChronicleBI<?> refsetMember : conceptWithComp.getRefsetMembers()) {
retSet.add(refsetMember.getVersion(conceptWithComp.getViewCoordinate()));
}
for(RefexDynamicChronicleBI<?> dynRef : conceptWithComp.getRefexesDynamic()) {
retSet.add(dynRef.getVersion(conceptWithComp.getViewCoordinate()));
}
return retSet;
}
示例4: 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;
}
示例5: 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();
}
示例6: 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();
}
示例7: 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 "";
}
示例8: ttyIs
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
private boolean ttyIs(UUID tty, ConceptChronicleBI cc) throws IOException, ContradictionException
{
for (DescriptionChronicleBI d : cc.getDescriptions())
{
for (RefexDynamicVersionBI<?> rdv : d.getRefexesDynamicActive(vc_))
{
if (rdv.getAssemblageNid() == getNid(RxNormDescType))
{
if (((RefexDynamicUUIDBI)rdv.getData(0)).getDataUUID().equals(IN))
{
return true;
}
}
}
}
return false;
}
示例9: 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");
}
}
}
示例10: setActiveStatus
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
public void setActiveStatus(DescriptionVersionBI desc, Status status) throws IOException, ContradictionException, InvalidCAB {
DescriptionCAB descCAB = desc.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.EXCLUDE);
descCAB.setStatus(status);
int authorNid = TermAux.USER.getLenient().getConceptNid();
int editPathNid = TermAux.SNOMED_CORE.getLenient().getConceptNid();
EditCoordinate ec = new EditCoordinate(authorNid, Snomed.CORE_MODULE.getLenient().getNid(), editPathNid);
TerminologyBuilderBI tb = Ts.get().getTerminologyBuilder(ec, vc);
DescriptionChronicleBI descChronicle = tb.construct(descCAB);
Ts.get().addUncommitted(desc.getEnclosingConcept().getVersion(vc));
Ts.get().commit();
System.out.println(descChronicle.getVersion(vc));
}
示例11: modifyDesc
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
public void modifyDesc(String text, int nid) throws IOException, ContradictionException, InvalidCAB {
DescriptionVersionBI desc = Ts.get().getConceptVersion(vc, nid).getPreferredDescription();
DescriptionCAB descCAB = desc.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.EXCLUDE);
descCAB.setText(text);
int authorNid = TermAux.USER.getLenient().getConceptNid();
int editPathNid = TermAux.SNOMED_CORE.getLenient().getConceptNid();
EditCoordinate ec = new EditCoordinate(authorNid, Snomed.CORE_MODULE.getLenient().getNid(), editPathNid);
TerminologyBuilderBI tb = Ts.get().getTerminologyBuilder(ec, vc);
DescriptionChronicleBI descChronicle = tb.construct(descCAB);
Ts.get().addUncommitted(desc.getEnclosingConcept().getVersion(vc));
Ts.get().commit();
}
示例12: 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()));
}
}
}
}
示例13: 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()));
}
}
}
}
}
示例14: indexChronicle
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
@Override
protected boolean indexChronicle(ComponentChronicleBI chronicle) {
if (chronicle instanceof DescriptionChronicleBI) {
return true;
}
return false;
}
示例15: process
import org.ihtsdo.otf.tcc.api.description.DescriptionChronicleBI; //导入依赖的package包/类
/**
* Processes the components, annotations, and language refset members of the
* specified <code>concept</code>. Any components that has a stamp nid in the
* set of specified stamp nids will be written to the release file.
*
* @param concept the concept to process
* @throws Exception indicates an exception has occurred
*/
private void process(ConceptChronicleBI concept) throws Exception {
boolean write = true;
// NO NEED for this check because each component individually checks
//if (concept.getVersion(viewCoordinate).getPathNid() != pathNid) {
// write = false;
//}
if (write) {
ConceptAttributeChronicleBI ca = concept.getConceptAttributes();
processConceptAttribute(ca);
if (concept.getDescriptions() != null) {
for (DescriptionChronicleBI d : concept.getDescriptions()) {
// also processes text definitions
processDescription(d);
if (d.getAnnotations() != null) {
for (RefexChronicleBI<?> annot : d.getAnnotations()) {
annot.getNid();
if (possibleLangRefexNids.contains(annot.getNid())) {
langRefexNids.add(annot.getNid());
processLangRefsets(annot);
}
}
}
}
}
if (concept.getRelationshipsOutgoing() != null) {
for (RelationshipChronicleBI r : concept.getRelationshipsOutgoing()) {
processRelationship(r);
}
}
}
}