##parameters=bed=None,mode=None,datastructure=None
# $Id: apply_admission.py 543 2006-09-24 07:44:32Z henrik $
"""
format the bed for readability
"""

if datastructure is not None:
    bed = datastructure.get('bed')
if not bed:
    return ''
hall,block,room,letter = bed.split('_')
res = context.portal_catalog(portal_type="AccoHall",id=hall)
if res and len(res) == 1:
    hall_title = res[0].Title
return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
