本文整理汇总了Java中org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB类的典型用法代码示例。如果您正苦于以下问题:Java InvalidCAB类的具体用法?Java InvalidCAB怎么用?Java InvalidCAB使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvalidCAB类属于org.ihtsdo.otf.tcc.api.blueprint包,在下文中一共展示了InvalidCAB类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRefexStatus
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
protected static void setRefexStatus(UUID refexUUID, Status status) throws IOException
{
try
{
RefexDynamicVersionBI<?> rdv = readCurrentRefex(refexUUID);
if (rdv.getStatus() == status)
{
LOG.warn("Tried set the status to the value it already has. Doing nothing");
}
else
{
RefexDynamicCAB mappingCab = rdv.makeBlueprint(OTFUtility.getViewCoordinateAllowInactive(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);
mappingCab.setStatus(status);
RefexDynamicChronicleBI<?> rdc = OTFUtility.getBuilder().construct(mappingCab);
ConceptChronicleBI cc = ExtendedAppContext.getDataStore().getConcept(rdc.getConceptNid());
ExtendedAppContext.getDataStore().addUncommitted(cc);
ExtendedAppContext.getDataStore().commit(cc);
}
}
catch (InvalidCAB | ContradictionException e)
{
LOG.error("Unexpected!", e);
throw new IOException("Internal error");
}
}
示例2: updateMappingItem
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
/**
* Store the values passed in as a new revision of a mappingItem (the old revision remains in the DB)
* @param mappingItem - The MappingItem with revisions (contains fields where the setters have been called)
* @throws IOException
*/
public static void updateMappingItem(MappingItem mappingItem) throws IOException
{
try
{
RefexDynamicVersionBI<?> rdv = readCurrentRefex(mappingItem.getPrimordialUUID());
RefexDynamicCAB mappingItemCab = rdv.makeBlueprint(OTFUtility.getViewCoordinateAllowInactive(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);
mappingItemCab.getData()[2] = (mappingItem.getEditorStatusConcept() != null ? new RefexDynamicUUID(mappingItem.getEditorStatusConcept()) : null);
mappingItemCab.validate(OTFUtility.getViewCoordinateAllowInactive());
RefexDynamicChronicleBI<?> rdc = OTFUtility.getBuilder().construct(mappingItemCab);
ConceptChronicleBI cc = ExtendedAppContext.getDataStore().getConcept(rdc.getConceptNid());
AppContext.getRuntimeGlobals().disableAllCommitListeners();
ExtendedAppContext.getDataStore().addUncommitted(cc);
ExtendedAppContext.getDataStore().commit(cc);
}
catch (InvalidCAB | ContradictionException | PropertyVetoException e)
{
LOG.error("Unexpected!", e);
throw new IOException("Internal error");
}
finally
{
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
示例3: saveInformationModel
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
@Override
public void saveInformationModel(InformationModel model) throws IOException,
InvalidCAB, ContradictionException, NoSuchAlgorithmException,
PropertyVetoException {
if (model == null) {
throw new IOException("Model unexpectedly null");
}
LOG.info("Save information model: " + model.getType().getDisplayName()
+ ", " + model.getKey());
// disable commit listeners for this operation
try {
AppContext.getRuntimeGlobals().disableAllCommitListeners();
syncInformationModelConcept(model);
} catch (Exception e) {
LOG.error("Coudn't Disable WF Init & Commit CEM Information Model", e);
} finally {
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
示例4: handleConstraintEnumerationRefex
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
public void handleConstraintEnumerationRefex() {
if (value.endsWith("_VALUESET_CODE")) {
if (!valueSetExists()) {
try {
// Create Enumeration
AppContext.getRuntimeGlobals().disableAllCommitListeners();
RefexDynamicUsageDescriptionBuilder.createNewRefexDynamicUsageDescriptionConcept(value, value, "Value Set Sememe for " + value,
new RefexDynamicColumnInfo[] {},
InformationModels.CEM_ENUMERATIONS.getUuids()[0], false, null);
} catch (IOException | ContradictionException | InvalidCAB
| PropertyVetoException e) {
LOGGER.error("Unable to create CEM enumeration for " + value);
}
finally
{
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
}
}
示例5: createNewConcept
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
public ConceptChronicleBI createNewConcept() throws ValidationException, IOException, InvalidCAB, ContradictionException {
String fsn = getConceptFSN();
String prefTerm = getConceptPT();
LOG.debug("Creating concept {}", fsn);
UUID isA = Snomed.IS_A.getUuids()[0];
UUID parentCons[] = new UUID[parents.size()];
for (int i = 0; i < parents.size(); i++) {
parentCons[i] = parents.get(i).getPrimordialUuid();
}
IdDirective idDir = IdDirective.GENERATE_HASH;
LanguageCode lc = LanguageCode.EN_US;
UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parentCons);
newConCB.setDefined(!isPrimitive);
ConceptChronicleBI newCon = OTFUtility.getBuilder().construct(newConCB);
// OTFUtility.addUncommitted(newCon);
return newCon;
}
示例6: modifyExtensionAnnotatedRefset
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
private void modifyExtensionAnnotatedRefset(RefexChronicleBI<?> memberChron) throws ContradictionException, InvalidCAB, IOException {
RefexVersionBI<?> mem = memberChron.getVersion(vc);
RefexCAB bp = mem.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE);
if (bp.getMemberUUID() == null) {
bp.setMemberUuid(mem.getPrimordialUuid());
}
// Change String
bp.put(ComponentProperty.STRING_EXTENSION_1, "Modified Testing String");
// Change Description to Pref Term
int parentRefsetPT = appDb.getRefsetIdentity().getVersion(vc).getPreferredDescription().getNid();
bp.put(ComponentProperty.COMPONENT_EXTENSION_1_ID, parentRefsetPT);
RefexChronicleBI<?> cabi = appDb.getBuilder().constructIfNotCurrent(bp);
ConceptVersionBI refCon = appDb.getDB().getConcept(mem.getReferencedComponentNid()).getVersion(appDb.getVC());
appDb.getDB().addUncommitted(refCon);
}
示例7: modifyExtensionRefsetMember
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
private void modifyExtensionRefsetMember(RefexChronicleBI<?> memberChron) throws ContradictionException, InvalidCAB, IOException {
RefexVersionBI<?> mem = memberChron.getVersion(vc);
RefexCAB bp = mem.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE);
if (bp.getMemberUUID() == null) {
bp.setMemberUuid(mem.getPrimordialUuid());
}
// Change String
bp.put(ComponentProperty.STRING_EXTENSION_1, "Modified Testing String");
// Change Description to Pref Term
int parentRefsetPT = appDb.getRefsetIdentity().getVersion(vc).getPreferredDescription().getNid();
bp.put(ComponentProperty.COMPONENT_EXTENSION_1_ID, parentRefsetPT);
RefexChronicleBI<?> cabi = appDb.getBuilder().constructIfNotCurrent(bp);
ConceptVersionBI refCon = appDb.getDB().getConcept(mem.getAssemblageNid()).getVersion(appDb.getVC());
appDb.getDB().addUncommitted(refCon);
}
示例8: createNewRefsetConcept
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
private ConceptChronicleBI createNewRefsetConcept(ConceptVersionBI parent, String fsn, String prefTerm, boolean isAnnotated) throws IOException, InvalidCAB, ContradictionException {
LanguageCode lc = LanguageCode.EN_US;
UUID isA = Snomed.IS_A.getUuids()[0];
IdDirective idDir = IdDirective.GENERATE_HASH;
UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
UUID parents[] = new UUID[1];
parents[0] = parent.getPrimordialUuid();
ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parents);
ConceptChronicleBI newCon = appDb.getBuilder().construct(newConCB);
newCon.setAnnotationStyleRefex(isAnnotated);
appDb.getDB().addUncommitted(newCon);
return newCon;
}
示例9: addExtensionMember
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
private void addExtensionMember(ConceptVersionBI refCon, ConceptChronicleBI refComp) throws IOException, InvalidCAB, ContradictionException {
RefexCAB newMember = new RefexCAB(RefexType.CID_STR,refComp.getConceptNid(), refCon.getNid(), IdDirective.GENERATE_HASH, RefexDirective.INCLUDE);
int parentRefsetFSN = appDb.getRefsetIdentity().getVersion(vc).getFullySpecifiedDescription().getNid();
newMember.put(ComponentProperty.COMPONENT_EXTENSION_1_ID, parentRefsetFSN);
newMember.put(ComponentProperty.STRING_EXTENSION_1, "Testing String");
RefexChronicleBI<?> newMemChron = appDb.getBuilder().construct(newMember);
if (!refCon.isAnnotationStyleRefex()) {
appDb.getDB().addUncommitted(refCon);
} else {
appDb.getDB().addUncommitted(refComp);
}
}
示例10: createNewConcept
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
private ConceptChronicleBI createNewConcept(ConceptVersionBI con) throws IOException, InvalidCAB, ContradictionException {
String fsn = "New Test Concept (observable entity)";
String prefTerm = "New Test Concept PT";
LanguageCode lc = LanguageCode.EN_US;
UUID isA = Snomed.IS_A.getUuids()[0];
IdDirective idDir = IdDirective.GENERATE_HASH;
UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
UUID parents[] = new UUID[1];
parents[0] = con.getPrimordialUuid();
ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parents);
ConceptChronicleBI newCon = appDb.getBuilder().construct(newConCB);
appDb.getDB().addUncommitted(newCon);
return newCon;
}
示例11: setActiveStatus
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的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));
}
示例12: modifyDesc
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的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();
}
示例13: updateComment
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
/**
* Store the values passed in as a new revision of a comment (the old revision remains in the DB)
* @param comment - The MappingItemComment with revisions (contains fields where the setters have been called)
* @throws IOException
*/
public static void updateComment(MappingItemComment comment) throws IOException
{
try
{
RefexDynamicVersionBI<?> rdv = readCurrentRefex(comment.getPrimordialUUID());
RefexDynamicCAB commentCab = rdv.makeBlueprint(OTFUtility.getViewCoordinateAllowInactive(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);
commentCab.getData()[0] = new RefexDynamicString(comment.getCommentText());
commentCab.getData()[1] = (StringUtils.isNotBlank(comment.getCommentContext()) ? new RefexDynamicString(comment.getCommentContext()) : null);
commentCab.validate(null);
RefexDynamicChronicleBI<?> rdc = OTFUtility.getBuilder().construct(commentCab);
ConceptChronicleBI cc = ExtendedAppContext.getDataStore().getConcept(rdc.getConceptNid());
AppContext.getRuntimeGlobals().disableAllCommitListeners();
ExtendedAppContext.getDataStore().addUncommitted(cc);
ExtendedAppContext.getDataStore().commit(cc);
}
catch (InvalidCAB | ContradictionException | PropertyVetoException e)
{
LOG.error("Unexpected!", e);
throw new IOException("Internal error");
}
finally
{
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
示例14: setConceptStatus
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的package包/类
protected static void setConceptStatus(UUID conceptUUID, Status status) throws IOException
{
try
{
ConceptVersionBI concept = ExtendedAppContext.getDataStore().getConceptVersion(OTFUtility.getViewCoordinateAllowInactive(), conceptUUID);
ConceptAttributeVersionBI<?> conAttrib = concept.getConceptAttributes().getVersion(OTFUtility.getViewCoordinateAllowInactive());
if (conAttrib.getStatus() == status)
{
LOG.warn("Tried set the status to the value it already has. Doing nothing");
}
else
{
ConceptAttributeAB conceptAttribCab = conAttrib.makeBlueprint(OTFUtility.getViewCoordinateAllowInactive(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);
conceptAttribCab.setStatus(status);
OTFUtility.getBuilder().construct(conceptAttribCab);
AppContext.getRuntimeGlobals().disableAllCommitListeners();
ExtendedAppContext.getDataStore().addUncommitted(concept);
ExtendedAppContext.getDataStore().commit(concept);
}
}
catch (InvalidCAB | ContradictionException e)
{
LOG.error("Unexpected!", e);
throw new IOException("Internal error");
}
finally
{
AppContext.getRuntimeGlobals().enableAllCommitListeners();
}
}
示例15: syncDescriptions
import org.ihtsdo.otf.tcc.api.blueprint.InvalidCAB; //导入依赖的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);
}
}