本文整理汇总了Java中org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB类的典型用法代码示例。如果您正苦于以下问题:Java DescriptionCAB类的具体用法?Java DescriptionCAB怎么用?Java DescriptionCAB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DescriptionCAB类属于org.ihtsdo.otf.tcc.api.blueprint包,在下文中一共展示了DescriptionCAB类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setActiveStatus
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的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));
}
示例2: modifyDesc
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的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();
}
示例3: syncDescriptions
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
/**
* Sync descriptions. Retire descriptions no longer matching key or name.
* @param modelConceptCB the model concept cb
* @param model the model
* @throws ContradictionException
* @throws InvalidCAB
* @throws IOException
*/
private void syncDescriptions(ConceptCB modelConceptCB, InformationModel model)
throws IOException, InvalidCAB, ContradictionException {
for (DescriptionCAB descCAB : modelConceptCB.getDescriptionCABs()) {
if (descCAB.getText().equals(model.getKey())) {
continue;
}
if (descCAB.getText().equals(model.getName())) {
continue;
}
descCAB.setRetired();
OTFUtility.getBuilder().constructIfNotCurrent(descCAB);
}
}
示例4: addNewVersion
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
@Override
protected void addNewVersion()
{
try
{
int type = getSelectedType();
String langCode = languageCodeCb.getSelectionModel().getSelectedItem();
String term = termTf.getText();
boolean isInitCap = (isCapCb.getSelectionModel().getSelectedItem().equalsIgnoreCase("True"));
if (desc == null) {
OTFUtility.createNewDescription((desc != null) ? desc.getConceptNid() : conceptNid, type, LanguageCode.getLangCode(langCode), term, isInitCap);
} else {
if (desc.isUncommitted()) {
ExtendedAppContext.getDataStore().forget(desc);
}
DescriptionCAB dcab = new DescriptionCAB((desc != null) ? desc.getConceptNid() : conceptNid, type, LanguageCode.getLangCode(langCode), term, isInitCap, desc, OTFUtility.getViewCoordinate(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);
DescriptionChronicleBI dcbi = OTFUtility.getBuilder().constructIfNotCurrent(dcab);
OTFUtility.addUncommitted(dcbi.getEnclosingConcept());
}
}
catch (Exception e)
{
logger_.error("Error saving description", e);
AppContext.getCommonDialogs().showErrorDialog("Unexpected error", "There was an error saving the Description", e.getMessage(), this);
}
}
示例5: createNewDescription
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
public void createNewDescription(ConceptChronicleBI con, int i) throws IOException, InvalidCAB, ContradictionException {
DescriptionCAB newDesc = new DescriptionCAB(con.getConceptNid(),
getTypeNid(i),
LanguageCode.EN_US,
syns.get(i).getTerm(),
syns.get(i).isInitialCaseSig(),
IdDirective.GENERATE_HASH);
OTFUtility.getBuilder().construct(newDesc);
// OTFUtility.addUncommitted(con);
}
示例6: retireDesc
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的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());
}
示例7: modifyDescAttributes
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的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());
}
示例8: retireDesc
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
private void retireDesc(DescriptionVersionBI description) throws ContradictionException, InvalidCAB, IOException
{
DescriptionCAB dcab = description.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE);
dcab.setRetired();
DescriptionChronicleBI dcbi = appDb.getBuilder().constructIfNotCurrent(dcab);
appDb.getDB().addUncommitted(dcbi.getEnclosingConcept());
appDb.getDB().commit();
}
示例9: createUserConcept
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
/**
* Create a concept in the DB, for the specified user. Only call this if {@link #alreadyExists(User)) return false
*/
public static void createUserConcept(User user) throws IOException, InvalidCAB, ContradictionException
{
logger.info("Creating user " + toString(user) + " in DB");
AppContext.getRuntimeGlobals().disableAllCommitListeners();
try
{
BdbTerminologyStore ts = ExtendedAppContext.getDataStore();
String fsn = user.getUniqueFullName();
String preferredName = user.getFullName();
String logonName = user.getUniqueLogonName();
UUID userUUID = UUID.fromString(user.getUUID());
LanguageCode lc = LanguageCode.EN_US;
UUID isA = Snomed.IS_A.getUuids()[0];
IdDirective idDir = IdDirective.PRESERVE_CONCEPT_REST_HASH;
UUID module = TermAux.TERM_AUX_MODULE.getUuids()[0];
UUID parents[] = new UUID[] { TermAux.USER.getUuids()[0] };
ConceptCB cab = new ConceptCB(fsn, preferredName, lc, isA, idDir, module, userUUID, parents);
DescriptionCAB dCab = new DescriptionCAB(cab.getComponentUuid(), Snomed.SYNONYM_DESCRIPTION_TYPE.getUuids()[0], lc, logonName, true,
IdDirective.GENERATE_HASH);
dCab.getProperties().put(ComponentProperty.MODULE_ID, module);
//Mark it as acceptable
RefexCAB rCabAcceptable = new RefexCAB(RefexType.CID, dCab.getComponentUuid(), Snomed.US_LANGUAGE_REFEX.getUuids()[0], IdDirective.GENERATE_HASH,
RefexDirective.EXCLUDE);
rCabAcceptable.put(ComponentProperty.COMPONENT_EXTENSION_1_ID, SnomedMetadataRf2.ACCEPTABLE_RF2.getUuids()[0]);
rCabAcceptable.getProperties().put(ComponentProperty.MODULE_ID, module);
dCab.addAnnotationBlueprint(rCabAcceptable);
cab.addDescriptionCAB(dCab);
//TODO store roles on the concept
//Build this on the lowest level path, otherwise, other code that references this will fail (as it doesn't know about custom paths)
ConceptChronicleBI newCon = ts.getTerminologyBuilder(
new EditCoordinate(TermAux.USER.getLenient().getConceptNid(), TermAux.TERM_AUX_MODULE.getLenient().getNid(), TermAux.WB_AUX_PATH.getLenient()
.getConceptNid()), StandardViewCoordinates.getWbAuxiliary()).construct(cab);
ts.addUncommitted(newCon);
ts.commit(newCon);
}
finally
{
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
示例10: createNewDescription
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
public static void createNewDescription(int conNid, int typeNid, LanguageCode lang, String term, boolean isInitial) throws IOException, InvalidCAB, ContradictionException {
DescriptionCAB newDesc = new DescriptionCAB(conNid, typeNid, lang, term, isInitial, IdDirective.GENERATE_HASH);
getBuilder().construct(newDesc);
addUncommitted(conNid);
}
示例11: createNewDescription
import org.ihtsdo.otf.tcc.api.blueprint.DescriptionCAB; //导入依赖的package包/类
private void createNewDescription(ConceptVersionBI con) throws IOException, InvalidCAB, ContradictionException {
DescriptionCAB newDesc = new DescriptionCAB(con.getConceptNid(), SnomedMetadataRfx.getDES_SYNONYM_NID(), LanguageCode.EN_US,
"Test Description #1", true, IdDirective.GENERATE_HASH);
appDb.getBuilder().construct(newDesc);
appDb.getDB().addUncommitted(con);
}