( Select Cast( DateFormat( a.data_open , 'yyyy-mm-dd' ) As Char(14)) From cart_accert aWhere a.codice=p.codice And ( a.ac_des Like 'Tempo%Protrombina%' And a.ac_val Is Not Null ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And (a1.data_open > a.data_open Or (a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null ) And a.data_open Between Today()-180 And Today() )_PT_Inr_d_

( Select Cast( DateFormat( a.data_open , 'yyyy-mm-dd' ) As Char(14)) From cart_accert aWhere a.codice=p.codice And ( a.ac_des Like 'Tempo%Protrombina%' And a.ac_val Is Not Null ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And (a1.data_open > a.data_open Or (a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null ) And a.data_open Between Today()-180 And Today() )_PT_Inr_d_

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AA%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AA%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_TAO_,

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AC%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AC%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_AntiAggreganti_,

(Select Max( a.data_open) From cart_accert a Where a.codice=p.codice And ( a.ac_des Like 'Tempo%Protrombina%' And a.ac_val Is Not Null ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And ( a1.data_open > a.data_open Or ( a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null )And a.data_open Between Today()-180 And Today() )_PT_Inr_d_

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AA%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AA%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_TAO_,

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AC%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AC%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_AntiAggreganti_,

(Select Max( a.data_open) From cart_accert a Where a.codice=p.codice And ( a.ac_des Like 'Tempo%Protrombina%' And a.ac_val Is Not Null ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And ( a1.data_open > a.data_open Or ( a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null )And a.data_open Between Today()-180 And Today() )_PT_Inr_d_

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AA%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AA%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_TAO_,

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AC%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AC%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_AntiAggreganti_,

(Select Max( a.data_open) From cart_accert a Where a.codice=p.codice And ( a.ac_des Like 'Tempo%Protrombina%' And a.ac_val Is Not Null ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And ( a1.data_open > a.data_open Or ( a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null )And a.data_open Between Today()-180 And Today() )_PT_Inr_d_

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AA%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AA%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_TAO_,

(Select Max( t.data_open) From cart_terap t Where t.codice=p.codice And t.co_atc Like 'B01AC%' And Not Exists ( Select t1.codice From cart_terap t1 Where t1.codice = t.codice And t1.co_atc Like 'B01AC%' And ( t1.data_open > t.data_open Or ( t1.data_open = t.data_open And t1.rowid > t.rowid)) ) And t.data_open Between Today()-180 And Today() )_AntiAggreganti_ ,

(Select Max( a.data_open) From cart_accert a Where a.codice=p.codice And ( a.ac_NT_code Like '90.75.4' ) And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice And a1.ac_des Like 'Tempo%Protrombina%' And ( a1.data_open > a.data_open Or ( a1.data_open = a.data_open And a1.rowid > a.rowid)) And a1.ac_val Is Not Null )And a.data_open Between Today()-180 And Today() )_PT_Inr_d_ ,