Added query code for reg patient and address