I would like to refer you to an excellent article in the journal orthopedics (2007, vol. 30, p. 920) titled "drug selection in a patient with a history of hypersensitivity
reactions: a practical approach for the orthopedist" by lisa a. Thompson and others. This is what the article says about tramadol: "tramadol is structurally similar to morphine
and codeine, so cross-reactivity can be expected. The package insert cautions against use of tramadol in any reported opioid allergy.â€ as you can see, the authors caution about use of tramadol (ultram) when there is a history of allergic reactions to an opioid, which would include codeine.
Hope that helps. However, there might be other reasons for the symptoms that your mother has been experiencing and a thorough evaluation by a physician with expertise in geriatric medicine could be helpful.