--do $$
--begin
--	if exists 
--	(
--		select * from pg_proc p
--		inner join pg_namespace n on n.oid = p.pronamespace
--		where p.proname = 'fn_getekbhospreestritemcount'
--		and n.nspname = 'dbo'
--	)
--	then
--		drop function dbo.fn_getekbhospreestritemcount(uuid);
--	end if;
--end;
--$$ language plpgsql;

--CREATE OR REPLACE FUNCTION dbo.fn_GetEkbHospReestrItemCount("HospReestrID" UUID)
--RETURNS Integer AS
-- $$
-- Begin
--	return
--	(
--		select count(*)
--		from akuz.T_HOSPITAL_BREE
--		where  bMain = "HospReestrID"
--	);	
--END $$
--language plpgsql stable;