IE8 (and below) don't support forEach natively - are we using an es5 shim to ensure this functionality is supported? I'm pretty sure OpenMRS is supposed to support IE8 still, though I couldn't find the official browser spec. (a side note on style - manipulating a variable that is outside the scope of the foreach inside the foreach seems dicey - seems like you're really trying to do something more like map, but shoeing it into forEach)