select * from rpt.pan_Orvi_v_pg(
CAST($1 AS int8),
CAST($2 AS int8),
CAST($3 AS int8),
CAST($4 AS int8),
CAST($5 AS int8),
CAST($6 AS int8),
CAST($7 AS int8),
cast(TO_TIMESTAMP($8,'DD.MM.YYYY') as timestamp),
cast(TO_TIMESTAMP($9,'DD.MM.YYYY') as timestamp),
'J06.0', 'J06.9')
