Use MetadataUtils.getEncounterType(...)