"Omit" requests can omit records from the found set that match specific criteria such as your "deleted" text. "Omit" requests can be set up manual or scripted finds.
But if each referral is specific to just one record in Diagnosis, it would appear that you are not using the correct match fields to link diagnosis and referral records. I'd Match a DiagnosisID in Diagnosis to a DiagnosisID in Referrals if there might be one Diagnosis to possibly more than one referrals. If the reverse might be true, I'd use a ReferralID.
You may find this thread of Scripted Find examples a useful source of ideas: Scripted Find Examples