public String getColumnText(Object element, int columnIndex) {
logger.debug("get column text: " + columnIndex + ", " + element);
if(element instanceof EncounterParticipant) {
logger.debug("element is an encounter participant");
EncounterParticipant ep = (EncounterParticipant)element;
switch(columnIndex) {
case 0: // marker
return null;
case 1: // order
logger.debug("column 1");
return String.valueOf(ep.getOrder());
case 2: // name
logger.debug("column 2");
return ((EncounterParticipant)element).getLabel();
case 3: // badges
logger.debug("column 3");
// TODO
break;
case 4: // target
logger.debug("column 4");
Object target = ep.getTarget();
logger.trace("target: " + target);
if(target instanceof EncounterParticipant) {
logger.debug("target is an encounter participant");
return ((EncounterParticipant)target).getLabel();
}
else if(target instanceof String) {
return (String)target;
}
return null;
case 5: // notes
logger.debug("column 5");
return ep.getNotes();
}
}
return null;
}