select * from rpt.pan_StickList_pg( 
cast ($1 as bigint), 
cast ($2 as bigint),  
cast ($3 as bigint), 
cast ($4 as bigint), 
cast ($5 as bigint), 
cast ($6 as bigint), 
cast ($7 as bigint), 
cast (dbo.GetDiagCodeByID($8) as varchar),
cast (dbo.GetDiagCodeByID($9) as varchar),
cast ($10 as bigint), 
cast ($11 as bigint), 
cast ($12 as bigint), 
cast ($13 as bigint), 
cast ($14 as bigint), 
cast(to_timestamp($15, 'DD.MM.YYYY') as timestamp),
cast(to_timestamp($16, 'DD.MM.YYYY') as timestamp)
) 

