本文整理汇总了Java中org.ihtsdo.otf.tcc.api.spec.ValidationException类的典型用法代码示例。如果您正苦于以下问题:Java ValidationException类的具体用法?Java ValidationException怎么用?Java ValidationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValidationException类属于org.ihtsdo.otf.tcc.api.spec包,在下文中一共展示了ValidationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computePossibleComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computePossibleComponents(NativeIdSetBI incomingPossibleComponents) throws IOException, ValidationException, ContradictionException {
this.notSet = new ConcurrentBitSet();
for (Clause c : getChildren()) {
for (ClauseComputeType cp : c.getComputePhases()) {
switch (cp) {
case PRE_ITERATION:
notSet.or(c.computePossibleComponents(incomingPossibleComponents));
break;
case ITERATION:
c.computePossibleComponents(incomingPossibleComponents);
break;
case POST_ITERATION:
c.computePossibleComponents(incomingPossibleComponents);
break;
}
}
}
return incomingPossibleComponents;
}
示例2: computePossibleComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computePossibleComponents(NativeIdSetBI incomingPossibleComponents) throws IOException, ValidationException, ContradictionException {
if (this.viewCoordinateKey.equals(this.enclosingQuery.currentViewCoordinateKey)) {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getVCLetDeclarations().get(viewCoordinateKey);
} else {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getLetDeclarations().get(viewCoordinateKey);
}
int conceptNid = this.conceptSpec.getNid();
int refsetNid = this.refsetSpec.getNid();
ConceptVersionBI conceptVersion = Ts.get().getConceptVersion(viewCoordinate, refsetNid);
for (RefexVersionBI<?> rm : conceptVersion.getCurrentRefsetMembers(viewCoordinate)) {
if (rm.getReferencedComponentNid() == conceptNid) {
getResultsCache().add(refsetNid);
}
}
return getResultsCache();
}
示例3: computePossibleComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computePossibleComponents(NativeIdSetBI incomingPossibleComponents) throws IOException, ValidationException, ContradictionException {
if (this.viewCoordinateKey.equals(this.enclosingQuery.currentViewCoordinateKey)) {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getVCLetDeclarations().get(viewCoordinateKey);
} else {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getLetDeclarations().get(viewCoordinateKey);
}
int parentNid = this.conceptSpec.getNid();
NativeIdSetBI kindOfSet = Ts.get().isKindOfSet(parentNid, viewCoordinate);
int refsetNid = this.refsetSpec.getNid();
ConceptVersionBI conceptVersion = Ts.get().getConceptVersion(viewCoordinate, refsetNid);
for (RefexVersionBI<?> rm : conceptVersion.getCurrentRefsetMembers(viewCoordinate)) {
if (kindOfSet.contains(rm.getReferencedComponentNid())) {
getResultsCache().add(refsetNid);
}
}
return getResultsCache();
}
示例4: computePossibleComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computePossibleComponents(NativeIdSetBI incomingPossibleComponents) throws IOException, ValidationException, ContradictionException {
if (this.viewCoordinateKey.equals(this.enclosingQuery.currentViewCoordinateKey)) {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getVCLetDeclarations().get(viewCoordinateKey);
} else {
this.viewCoordinate = (ViewCoordinate) this.enclosingQuery.getLetDeclarations().get(viewCoordinateKey);
}
NativeIdSetBI relTypeSet = new ConcurrentBitSet();
relTypeSet.add(this.relType.getNid());
if (this.relTypeSubsumption) {
relTypeSet.or(Ts.get().isKindOfSet(this.relType.getNid(), viewCoordinate));
}
NativeIdSetBI relationshipSet = Bdb.getMemoryCache().getDestRelNids(this.targetSpec.getNid(), relTypeSet, this.viewCoordinate);
getResultsCache().or(relationshipSet);
int relTypetNid = this.relType.getNid();
if (this.relTypeSubsumption) {
NativeIdSetBI relTypeSubsumptionSet = Ts.get().isKindOfSet(relTypetNid, viewCoordinate);
getResultsCache().or(Bdb.getMemoryCache().getDestRelNids(this.targetSpec.getNid(), relTypeSubsumptionSet, viewCoordinate));
}
return getResultsCache();
}
示例5: getInformationModelChildren
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public Set<InformationModel> getInformationModelChildren(
InformationModel model) throws ValidationException, IOException,
ContradictionException {
ConceptVersionBI modelConcept =
OTFUtility.getConceptVersion(model.getUuid());
Set<InformationModel> models = new HashSet<>();
for (RelationshipChronicleBI rel : modelConcept.getRelationshipsIncoming()) {
RelationshipVersionBI<?> relVersion =
rel.getVersion(OTFUtility.getViewCoordinate());
// Look for matching typeId and "active" flag
if (relVersion.getTypeNid() == Snomed.IS_A.getLenient().getNid()
&& relVersion.isActive()) {
// Add the model
models.add(getInformationModel(OTFUtility.getConceptVersion(
relVersion.getDestinationNid()).getPrimordialUuid()));
}
}
return models;
}
示例6: getVisibility
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
private VisibilityKind getVisibility(Collection<? extends RefexChronicleBI<?>> attributeAnnotations)
throws ValidationException, IOException {
/** TODO (artf231829) - BAC
StringMember visibilityAnnotation = getSingleAnnotation(attributeAnnotations,
FHIMMetadataBinding.FHIM_VISIBILITY_REFSET, StringMember.class);
// If none, abort.
if (visibilityAnnotation == null) {
return null;
}
String name = visibilityAnnotation.getString1();
return VisibilityKind.valueOf(name);
**/
return null;
}
示例7: getDefaultValue
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
private String getDefaultValue(
Collection<? extends RefexChronicleBI<?>> attributeAnnotations)
throws ValidationException, IOException {
/** TODO (artf231831) - BAC
List<StringMember> defaultValueAnnotations = filterAnnotations(attributeAnnotations,
FHIMMetadataBinding.FHIM_DEFAULTVALUES_REFSET, StringMember.class);
// If no default value annotations, abort.
int defaultValueCount = defaultValueAnnotations.size();
if (defaultValueCount == 0) {
return null;
}
// Otherwise, expect exactly one default value annotation.
if (defaultValueCount != 1) {
LOG.warn("Expected 1 default value annotation, found " + defaultValueCount);
}
StringMember defaultValueAnnotation = defaultValueAnnotations.get(0);
return defaultValueAnnotation.getString1();
**/ return null;
}
示例8: getAssociationTypes
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
public static List<ConceptChronicleBI> getAssociationTypes() throws NumberFormatException, ValidationException, IOException, ParseException
{
ArrayList<ConceptChronicleBI> result = new ArrayList<>();
LuceneDynamicRefexIndexer indexer = AppContext.getService(LuceneDynamicRefexIndexer.class);
if (indexer == null)
{
throw new RuntimeException("Required index is not available");
}
List<SearchResult> refexes = indexer.queryAssemblageUsage(ISAAC.ASSOCIATION_REFEX.getNid(), Integer.MAX_VALUE, null);
for (SearchResult sr : refexes)
{
result.add(ExtendedAppContext.getDataStore().getComponent(sr.getNid()).getEnclosingConcept());
}
return result;
}
示例9: getIsaRelationships
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
private String getIsaRelationships(ConceptChronicleBI concept) throws ValidationException, IOException, ContradictionException {
StringBuilder sb = new StringBuilder();
for (RelationshipChronicleBI rel : concept.getRelationshipsOutgoing()) {
RelationshipVersionBI<?> relVersion = rel.getVersion(OTFUtility.getViewCoordinate());
if(relVersion != null) {
if(relVersion.getTypeNid() == Snomed.IS_A.getNid()) {
sb.append("IS-A Relationship: " + OTFUtility.getDescription(relVersion.getConceptNid()) + " \r\n");
}
}
}
return sb.toString();
}
示例10: getFindingSiteRelationships
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
private String getFindingSiteRelationships(ConceptChronicleBI concept) throws ValidationException, IOException, ContradictionException {
StringBuilder sb = new StringBuilder();
int count = 1;
for (RelationshipChronicleBI rel : concept.getRelationshipsOutgoing()) {
RelationshipVersionBI<?> relVersion = rel.getVersion(OTFUtility.getViewCoordinate());
if(relVersion != null) {
if(relVersion.getTypeNid() == Snomed.FINDING_SITE.getNid()) {
// Every relationship has a triple: source, destination and type
sb.append("Finding Site Relationship (Destination) " + count + ": " + OTFUtility.getDescription(relVersion.getDestinationNid()) + " \r\n");
}
}
}
return sb.toString();
}
示例11: getInfarctTargetRoleGroup
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的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();
}
示例12: threeE
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的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();
}
示例13: createNewConcept
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的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;
}
示例14: computeComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computeComponents(NativeIdSetBI incomingComponents) throws IOException, ValidationException, ContradictionException {
this.forSet = enclosingQuery.getForSet();
assert forSet != null;
for (Clause c : getChildren()) {
notSet.or(c.computeComponents(incomingComponents));
}
forSet.andNot(notSet);
return forSet;
}
示例15: computePossibleComponents
import org.ihtsdo.otf.tcc.api.spec.ValidationException; //导入依赖的package包/类
@Override
public NativeIdSetBI computePossibleComponents(NativeIdSetBI searchSpace) throws IOException, ValidationException, ContradictionException {
NativeIdSetBI results = new ConcurrentBitSet();
for (Clause clause : getChildren()) {
results.union(clause.computePossibleComponents(searchSpace));
}
return results;
}