Modeling Healthcare Quality via Compact Representations of Electronic Health Records