--CREATE OR REPLACE FUNCTION fn_GetRequestNameRus("DrugRequestListID" UUID)
--RETURNS varchar(255) AS
-- $$
--Begin
--	return
--	(
--		select case when m.Name = '~' then t.Name else m.Name end 
--		from AKUZ.T_DRUG_REQUEST_LIST l
--		inner join 
--			AKUZ.T_MNN m 
--			on l.Mnn = m.Code
--		left join 
--			AKUZ.T_TRN t 
--			on l.Trn = t.Code
--		where l.BaseDrugRequestItemID = "DrugRequestListID"
--	);
--END $$
--language plpgsql volatile;