fix issues with user-defined codes

* client-side: data criteria constructor didn't work with preset data
* server-side: patient builder didn't allow for a user-defined code source