WIP: converting medapp db to new rim db