A finite element analysis of flows of an Oldroyd-B fluid is developed, to simulate blood flow in an arteriovenous fistula. The model uses a combination of a standard conforming finite element approximation for the momentum equation, and the discontinuous Galerkin method, with upwinding, for the equation governing the evolution of the extra stress. The model is verified for a range of values of Weissenberg number We by applying it to the benchmark problem of flow past a cylinder in a channel. The main application is to flow in an arteriovenous fistula, the geometry of which is based on patient-specific data. Results for Oldroyd-B fluids are compared with those for a Newtonian fluid as well as with data from patient-specific velocity MRI scans. Features such as streamlines and regions of recirculation are similar across a range of values of We and the Newtonian case. There is however a strong dependence of maximum wall shear stress on We, with values for the viscoelastic fluid in all cases being higher than that for the Newtonian case.