How about a merge command syntax where we can specify which variable to link between the master and the using instead of requiring both variables to have the same name.
Code:
merge 1:1 patientid == patient_num using "demo_data.dta", keep(master match)