else if (uaHit.getUaLocation() != null)
casConsumerOutData.append(((PADLocation) uaHit
.getUaLocation()).getSegmentID());
// add location and term data
PADLocation ual = uaHit.getUaLocation();
PADTerm uat = uaHit.getUaTerm();
if (ual != null) {
casConsumerOutData.append(COLLECTION_SEPARATOR
+ ual.getCoveredText());
casConsumerOffSetData.append(ual.getBegin() + "-"
+ ual.getEnd() + ":");
if (ual.getPolarity() == -1
&& uat == null
|| (ual.getPolarity() == -1 && uat != null
&& uat.getTypeID() != disorderStenosis && ual
.getPolarity() == -1)) {
negatedCase = true;
} else if (ual.getIsStandAlone() != 1
&& ual.getPolarity() != -1
&& ual.getUncertainty() == disorderPatent) {
probableCase = true;
probableCount++;
} else
probableCase = false;
} else {
casConsumerOutData.append(COLLECTION_SEPARATOR + " ");
casConsumerOffSetData.append("-1:");
if (uat.getTypeID() == disorderStenosis
&& uat.getPolarity() != -1)
noStenosis = false;
if (uat != null && uat.getPolarity() == -1
&& uat.getTypeID() != disorderStenosis
&& uat.getTypeID() != anatomicalSiteExclusion)
negatedCase = true;
else if (uat != null
&& ((uat.getIsStandAlone() != 1 || uat.getTypeID() == disorderPatent) && uat
.getPolarity() != -1)) {
probableCase = true;
probableCount++;
} else
probableCase = false;
}
if (uat != null) {
casConsumerOutData.append(COLLECTION_SEPARATOR
+ uat.getCoveredText());
casConsumerOffSetData.append(uat.getBegin() + "-"
+ uat.getEnd() + ")");
if (uat.getTypeID() == disorderStenosis
&& uat.getPolarity() != -1)
noStenosis = false;
if (uat.getPolarity() == -1
&& uat.getTypeID() != disorderStenosis
&& uat.getUncertainty() != disorderPatent
&& uat.getTypeID() != anatomicalSiteExclusion
&& uat.getIsStandAlone() != 1)
negatedCase = true;
else if (uat.getUncertainty() == disorderPatent
&& uat.getIsStandAlone() != 1) {
probableCase = true;
probableCount++;
} else if (!negatedCase)
probableCase = false;
} else {
casConsumerOutData.append(COLLECTION_SEPARATOR + " ");
casConsumerOffSetData.append("-1)");
if (ual != null && ual.getPolarity() == -1
&& ual.getUncertainty() != disorderPatent)
negatedCase = true;
else if (ual.getIsStandAlone() != 1
&& ual.getPolarity() != -1
&& ual.getUncertainty() == disorderPatent) {
probableCase = true;
probableCount++;
}
else
probableCase = false;
}
if (probableCase)
globalProbable = true;
if ((negatedCase || probableCase)) {
count--;
negCount = true;
if (uat != null && !probableCase
&& uat.getTypeID() != disorderStenosis
&& uat.getTypeID() != disorderPatent) {
if (ual == null || (ual != null)
&& ual.getTypeID() != disorderPatent
&& ual.getPolarity() == -1)
balanceCount--;
}
} else
balanceCount++;
}
annotItr = indexes.getAnnotationIndex(PADLocation.type).iterator();
while (annotItr.hasNext()) {
PADLocation location = (PADLocation) annotItr.next();
Iterator<?> annotHitItr = indexes.getAnnotationIndex(
PADHit.type).iterator();
boolean skip = false;
if (location.getCoveredText().indexOf("vein") != -1) {
noVein = false;
veinCount++;
}
while (annotHitItr.hasNext() && !skip) {
PADHit uaHit = ((PADHit) annotHitItr.next());
if (uaHit.getUaLocation() != null
&& location.getBegin() == uaHit.getUaLocation()
.getBegin())
skip = true;
}
if (!skip) {
if (location.getPolarity() == -1) {
locTermsOnly = true;
}
if (location.getPolarity() != -1) {
locOnlyCount++;
casConsumerOffSetData.append("(");
casConsumerOffSetData.append("-1:");
casConsumerOffSetData.append(location.getBegin() + "-"
+ location.getEnd() + ")");
casConsumerOutData.append(COLLECTION_SEPARATOR);
casConsumerOutData.append(location.getSegmentID());
casConsumerOutData.append(COLLECTION_SEPARATOR
+ "**NO TERM**");
casConsumerOutData.append(COLLECTION_SEPARATOR
+ location.getCoveredText());
} else if (location.getPolarity() != -1
&& location.getTypeID() != disorderStenosis
&& location.getTypeID() != anatomicalSiteExclusion
&& location.getUncertainty() == disorderPatent)
locOnlyCount--;
}
}
annotItr = indexes.getAnnotationIndex(PADTerm.type).iterator();
while (annotItr.hasNext()) {