Person tbl holds personal information for everyone (patient, and emergency contacts).Due to bad data entry, we have some people name misspelled under the person tbl who are either husband or wife (relationship type W or H) to the patient. To resolve the issue 1) We need to identify if the person is listed more than one time, and who are related to the same patient with same relation type (Wife or husband) and has same phone to find the names which are misspelled.
For example, I have person name first name Lina and Linda entered twice, she has relationtype = W to patient 1, and also she got same phones listed in phone tbl. We want to list both records of Lina and Linda who is wife of patient 1 and her phone is the same in phone tbl. That way we identify that Linda name was typed incorrectly.
Below is the schema, I am also attaching same data as well.
Person_Info: PersonID, Person Info contains everyone (patient, vistor, Emergecy contact) First and last names
Patien_Info: PatientID, table contains patient ID and other information
Patient_PersonRelation: Person_ID, patientID, relation
Adress: Contains address of all person and patient (key PersonID)
Phone: Contains phone # of everyone (key is personID)