Value Sets for the Analysis of Real-World Patient Data: Problems, Theory, and Solutions