A woman who died of a heart attack in an emergency department was misdiagnosed as having an adverse reaction to codeine, a coroner has found.