DROP PROCEDURE IF EXISTS public.sp_UpdatePatientAddressFromGAR;

CREATE PROCEDURE public.sp_UpdatePatientAddressFromGAR
(
    "AddressId" uuid,
	"AOGUID" uuid default null::uuid,
	"HouseGUID" uuid default null::uuid
)
    language plpgsql
as
$$
Begin

	update akuz.t_patient_address  
	set 
		AOGUID = Coalesce("AOGUID",AOGUID), 
		HouseGUID = Coalesce("HouseGUID",HouseGUID), 
		FIASUpdateDate = current_date
	where AddressId = "AddressId";

End;
$$;