subsetToCodesInUse function

Filter a codelist to keep only the codes being used in patient records