try {
Set<StatusIndicator> s = _statusIndicatorFSM.execute(fsmTokenList);
if (s.size() > 0) {
StatusIndicator finalSi = null;
Iterator<StatusIndicator> siItr = s.iterator();
while (siItr.hasNext()) {
StatusIndicator si = siItr.next();
if (finalSi == null) {
finalSi = si;
} else if ((si.getStatus() == StatusIndicator.FAMILY_HISTORY_STATUS)
&& (finalSi.getStatus() == StatusIndicator.HISTORY_STATUS)) {
// family history always overrides history
finalSi = si;
} else if ((scope == ContextAnnotator.LEFT_SCOPE) && (si.getEndOffset() > finalSi.getEndOffset())) {
// pick one with closest proximity to focus
finalSi = si;
} else if ((scope == ContextAnnotator.RIGHT_SCOPE)
&& (si.getStartOffset() < finalSi.getStartOffset())) {
// pick one w/ closest proximity to focus
finalSi = si;
}
}
ContextHit ctxHit = new ContextHit(finalSi.getStartOffset(), finalSi.getEndOffset());