Patients Normalization

Normalize DaySmart Customers into Patients

This process reads customers already saved in ScheduleApp_Plain.CUSTOMERS, groups duplicates by first name, middle name, last name and normalized phone number, and inserts or updates records in ScheduleApp.PATIENTS.

The process uses NewCodeBatch('PATIENTS', ...) to generate internal Patient Ids.