fix materialization code selection

the change to selecting oids from the source data criteria broke materialization.  There are two issues.  The first is that we are only selecting the oid for the encounter and not the oid for coded field values or coded results.  The second issue is that the value set hash is not been constructed properly.  This fixes both those issues