Well, it grabs the first mapping with that name in that domain...

Initially I had only a single domain per ctable mapping but then wanted to have it show up for multiple domains (e.g. psi, psi-unicef). Its uses are:
* used to query couch for all mapping for a domain (on the ctable mapping list page for a domain) - might be irrelevant now since you can view all the ctable mappings for all domains (though having a domain still helps to give it context).
* used to prefix the mapping name to create the SQL table name - could use the doc ID but that gives horrible table names.

I'm open to suggestions for improvements...