Map<String, KnowtatorAnnotation> annotationSlots = new HashMap<String, KnowtatorAnnotation>(
annotation.annotationSlots);
KnowtatorAnnotation.Span coveringSpan = annotation.getCoveringSpan();
if ("Anatomical_site".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_ANATOMICAL_SITE,
stringSlots,
booleanSlots,
annotationSlots,
idAnnotationMap,
delayedFeatures);
KnowtatorAnnotation bodySide = annotationSlots.remove("body_side");
if (bodySide != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, bodySide) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setBodySide(...)
}
});
}
KnowtatorAnnotation bodyLaterality = annotationSlots.remove("body_laterality");
if (bodyLaterality != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, bodyLaterality) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setBodyLaterality(...)
}
});
}
} else if ("Disease_Disorder".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_DISORDER,
stringSlots,
booleanSlots,
annotationSlots,
idAnnotationMap,
delayedFeatures);
KnowtatorAnnotation bodyLocation = annotationSlots.remove("body_location");
if (bodyLocation != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, bodyLocation) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setBodyLocation(...)
}
});
}
KnowtatorAnnotation severity = annotationSlots.remove("severity");
if (severity != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, severity) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setSeverity(...)
}
});
}
} else if ("Medications/Drugs".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_DRUG,
stringSlots,
booleanSlots,
annotationSlots,
idAnnotationMap,
delayedFeatures);
} else if ("Phenomena".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_UNKNOWN /* TODO: is this the correct type? */,
stringSlots,
booleanSlots,
annotationSlots,
idAnnotationMap,
delayedFeatures);
} else if ("Procedure".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_PROCEDURE,
stringSlots,
booleanSlots,
annotationSlots,
idAnnotationMap,
delayedFeatures);
KnowtatorAnnotation bodyLocation = annotationSlots.remove("body_location");
if (bodyLocation != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, bodyLocation) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setBodyLocation(...)
}
});
}
KnowtatorAnnotation historyOf = annotationSlots.remove("historyOf_CU");
if (historyOf != null) {
delayedFeatures.add(new DelayedFeature<EntityMention>(entityMention, historyOf) {
@Override
protected void setValue(TOP valueAnnotation) {
// TODO: this.annotation.setHistoryOf(...)
}
});
}
} else if ("Sign_symptom".equals(annotation.type)) {
EntityMention entityMention = new EntityMention(jCas, coveringSpan.begin, coveringSpan.end);
addEntityMentionFeatures(
annotation,
entityMention,
jCas,
CONST.NE_TYPE_ID_FINDING,