Doxycycline can stay in the system for months after stopping the medication.
Vomiting can be a common side effect, but not
vomiting blood generally. Plus, your dog probably has had Doxy before as this is the "go to" drug to treat Lymes disease, so an allergy is unlikely.
Drug interaction is unlikely as these two medications can be given together if necessary given there is no liver problems (counterindicated for Rimadyl) or kidney problems (counterindicated for Doxy).