String endLine = matcher.group(4);
String endCharacter = matcher.group(5);
String scopeTypeText = matcher.group(6);
ScopeType scopeType = ScopeType.valueOf(scopeTypeText.toUpperCase());
ScopeOrCueAnnotation annotation = null;
switch (scopeType)
{
case XCOPE:
String scopeIdString = matcher.group(9);
int scopeId = Integer.parseInt(scopeIdString);
ScopeAnnotation a1 = new ScopeAnnotation();
a1.setScopeId(scopeId);
annotation = a1;
break;
case CUE:
String cueSubTypeString = matcher.group(11);
CueSubType cueSubType = CueSubType.valueOf(cueSubTypeString.toUpperCase());
String scopeRefString = matcher.group(12);
int scopeRef = Integer.parseInt(scopeRefString);
CueAnnotation a2 = new CueAnnotation();
a2.setCueSubType(cueSubType);
a2.setScopeIdReference(scopeRef);
annotation = a2;
break;
}
annotation.setConceptText(conceptText);
annotation.setBegin(new Location(beginLine, beginCharacter));
annotation.setEnd(new Location(endLine, endCharacter));
annotation.setScopeType(scopeType);
// System.out.format(" SCOPE ANNOTATION OBJECT: %s%n", annotation);
// System.out.format(" SCOPE ANNOTATION OBJECT i2b2: %s%n", annotation.toI2B2String());
return annotation;