I have a stored proc that I want to pass a value with
Raiserror. I can add the message, and the error fires, but I can't get the value to return. Below is my add message and
the raiserror statement. Any help appreciated

USE master
EXEC sp_addmessage @msgnum = 70001, @severity = 1,
@msgtext = N'There is no cross reference id for patient %1 , appointment not scheduled, contact system admin.',
@lang = 'us_english'


declare @sp_account_id char(12),@hin char(12)
select @sp_account_id = '99999'
BEGIN
SELECT @hin=ext_rec_id
FROM patient_xref
WHERE int_rec_id=@sp_account_id
if @@rowcount = 0
raiserror (70001,1,1,@sp_account_id)
end