Notifications
Clear all
Topic starter
We are currently on EMR 9.8. I need to be able to run a script or a report to find duplicate
medical record numbers in the emr. I need help with this right away. Thanks
[email protected]
Posted : October 17, 2014 8:12 am
This script should do it for you...
SELECT First, Last, PatientProfileID, PatientId, MedicalRecordNumber
FROM PatientProfile
WHERE MedicalRecordNumber IN (
SELECT MedicalRecordNumber
FROM
(
SELECT ROW_NUMBER() OVER (PARTITION BY MedicalRecordNumber ORDER BY PatientProfileId DESC) AS MRN_COUNT, *
FROM PatientProfile
WHERE MedicalRecordNumber IS NOT NULL) AS TEMP
WHERE MRN_COUNT > 1)
Posted : October 20, 2014 5:22 am
Topic starter
Thanks so much!
Posted : October 20, 2014 9:39 am