Notifications
Clear all
Topic starter
Does anyone have a Crystal Report that would list potential duplicate patients based on DOB and similar names?
Posted : May 8, 2012 3:26 am
Here is sql query that will look for merges
/* Duplicate Charts */ select distinct(per.socsecno), select per.socsecno, per2.socsecno as "Dup SSN", per.medrecno, per2.medrecno as "Dup MRN", per.pid, per2.pid as "Dup PID", per.lastname, per2.lastname as "Dup Last", per.firstname, per2.firstname as "Dup Name", per.dateofbirth, per2.dateofbirth as "Dup DOB", (select loc.abbrevname from ml.locreg loc where loc.locid = per.homelocation) as "LOCATION", (select loc.abbrevname from ml.locreg loc where loc.locid = per2.homelocation) as "Dup LOCATION" from ml.person per, ml.person per2 where (substr(per.medrecno,2) = per2.medrecno or substr(per2.medrecno,2) = per.medrecno ) /* where per.socsecno = per2.socsecno */ and per.pid <> per2.pid and (per.medrecno is not null and per2.medrecno is not null) and per.lastname = per2.lastname and per.ispatient = 'Y' and per.pstatus = 'A' and per2.pstatus = 'A' and (per.homelocation <> '1358928943000600' and per2.homelocation <> '1358928943000600') /* and per.socsecno is not null and per.socsecno <>'000-00-0000' */ /*and per.db_updated_date>= (sysdate-21) */ and upper(per.lastname) not like upper('%MRG%') and upper(per2.lastname) not like upper('%MRG%') order by per.lastname, per.firstname
Posted : May 8, 2012 5:52 am
Topic starter
Thanks, I'll give this a try!
Posted : May 8, 2012 6:03 am