FORUM PER UTENTI MILLEWIN
Attenzione !
Per intervenire sul forum è necessario essere registrati e connessi.

L'Amministratore

****************************************************
“Se tu hai una mela ed io ho una mela, e ce la scambiamo, alla fine tu ed io avremo sempre una mela ciascuno.
Ma se tu hai un’idea ed io ho un’idea, e ce la scambiamo, allora avremo entrambi due idee”.

George Bernard Shaw
****************************************************

Unisciti al forum, è facile e veloce

FORUM PER UTENTI MILLEWIN
Attenzione !
Per intervenire sul forum è necessario essere registrati e connessi.

L'Amministratore

****************************************************
“Se tu hai una mela ed io ho una mela, e ce la scambiamo, alla fine tu ed io avremo sempre una mela ciascuno.
Ma se tu hai un’idea ed io ho un’idea, e ce la scambiamo, allora avremo entrambi due idee”.

George Bernard Shaw
****************************************************
FORUM PER UTENTI MILLEWIN
Vuoi reagire a questo messaggio? Crea un account in pochi click o accedi per continuare.

statine con dosaggio

3 partecipanti

Andare in basso

statine con dosaggio Empty statine con dosaggio

Messaggio  nanci giacinto Ven 27 Mar 2015 - 11:50

BUON GIORNO. E' POSSIBILE MODIFICARE LA SEGUENTE QUERY PER ESTRARRE LE STATINE COMPRENSIVE DEL LORO DOSAGGIO? CREDO SIA IMPOSSIBILE. MA SO CHE I MAGHI ESISTONO. GRAZIE 


select distinct p.nome nome, p.cognome cognome, n.pa_uslcode cod_reg,
v.codmedico codice_medico,
days(p.nascita, today())/365 eta, p.sesso sesso,
today() data_odierna,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '272%')
____dislipidemia____,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '401%')
_____ipertensione________,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '250%')
______diabete____,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '414%')
______CARD_ISCH__________,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '413%')
___ANGINA_PECT_____,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and (a.cp_code like '410%' or a.cp_code like '412%%'))
_____INFARTO_MIOCARDIO_______,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '436%')
_____ICTUS______,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like '411%')
_____SINDRO_CORON___,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and (a.cp_code like '431%' or a.cp_code like '430%'))
_____EMORRAGIA_CEREBRALE______,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and a.cp_code like 'v45.82%')
___ANGIOPLASTICA_CORONARICA____,
 
(select max(a.cp_code) from cart_pazpbl a
where a.codice=p.codice and (a.cp_code like '414.5%%' or a.cp_code like 'v45.81%'))
______BYPASS_AORTOCORONARICO____,
 
(select a.ac_val from cart_accert a
where a.codice=p.codice and a.ac_des like '%LDL%'
and (a.ac_val is not null)
and not exists (select b.codice from cart_accert b where a.codice=b.codice and b.ac_des like '%LDL%' and
(b.data_open>a.data_open or (b.data_open=a.data_open and b.rowid>a.rowid))
and b.ac_val is not null)
and a.data_open between today()-455 and today())____LDL_ultimo15mesi,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'C10AA01%'
and a.data_open between today()-365 and today())____simvastatina____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10aa02%'
and a.data_open between today()-365 and today())______lovastatina______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10aa03%'
and a.data_open between today()-365 and today())_______pravastatina____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10aa04%'
and a.data_open between today()-365 and today())____fluvastatina______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10aa05%'
and a.data_open between today()-365 and today())______atorvatsatina_____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10aa07%'
and a.data_open between today()-365 and today())_____rosuvastatina_____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10ax09%'
and a.data_open between today()-365 and today())_______ezetemibe_____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10ba02%'
and a.data_open between today()-365 and today())______simvaezetimibe______
 
from pazienti p , nos_002 n, cart_pazpbl c, v_pazienti v
where p.codice=n.codice
and c.codice=n.codice
and v.codice=p.codice
and (c.cp_code like '413%' or c.cp_code like '414%' or c.cp_code like '272%'or c.cp_code like '401%' or c.cp_code like '250%' or c.cp_code like '410%' or c.cp_code like '411%'or c.cp_code like '412%' or c.cp_code like '436%' or c.cp_code like '430%' or c.cp_code like '431%' or c.cp_code like '414.5%'or c.cp_code like 'v45.81%' or c.cp_code like 'v45.82%')
and n.pa_drevoca is null
and p.decesso is null
and p.pa_convenzione not like 'I'
 

order by p.cognome, p.nome
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

Messaggi : 128
Punti : 4970
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  Cervino Mer 1 Apr 2015 - 0:55

nanci giacinto ha scritto:BUON GIORNO. E' POSSIBILE MODIFICARE LA SEGUENTE QUERY PER ESTRARRE LE STATINE COMPRENSIVE DEL LORO DOSAGGIO? CREDO SIA IMPOSSIBILE. MA SO CHE I MAGHI ESISTONO. GRAZIE 

Problema non semplice, dato che le cpr possono essere di vario tipo ( ad es. rivestite , masticabili , cps molli , ... ) ; difatti nella tabella di selezione dei Farmaci viene usato un asterico ( quanto meno disturbante ) davanti al numero delle compresse x poter differenziare il dato dal dosaggio (credo) : una soluzione non certo ottimale dal punto di vista dell' Utente : sarebbe preferibile avere :    LASIX 30 cpr 500 mg    anzichè    LASIX*30 CPR 500MG   ( minore sarebbe il rischio di errare nella selezione )

Comunque sul Mille.postgreSQL , si potrebbe provare con :

SELECT  Cast( p.cognome As Char(18)) ,  p.nome ,  p.nascita ,  n.pa_uslcode  As  cod_reg,
Days( p.nascita , Today())*24/8766  As  eta ,  p.sesso , 
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  '272%')
      ___DisLipidemia___ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  '401%')
       __AHT__  ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  '250%')
      ___DM__ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  '414%')
    __CAD___ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  '413%')
    ___Angina_Pect__ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And ( b.cp_code  ILIKE  '410%'  OR  b.cp_code  ILIKE  '412%%'))
     ___IMA__ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE '436%')
    ___Ictus___ ,
   
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE '411%')
   __Sindr_Coron___ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  (b.cp_code  ILIKE  '431%'  OR  b.cp_code  ILIKE  '430%'))
    ___Emorragia_Cerebr___ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b  Where  b.codice = p.codice  And  b.cp_code  ILIKE  'v45.82%')
    ___PTCA___ ,
 
(select Max( b.cp_code)   From  cart_pazpbl b
Where  b.codice = p.codice  And ( b.cp_code  ILIKE  '414.5%%'  OR  b.cp_code  ILIKE  'v45.81%'))
   __ACBPG__ ,
 
( Select  To_Number( a.ac_val , '999' ) From  cart_accert a  Where  a.codice=p.codice And
( a.ac_code Like  ' 617'  And  a.data_open < Today()  And  Ascii( a.ac_val ) Between 48 And 57 )
And Not Exists ( Select a1.codice From cart_accert a1 Where a1.codice = a.codice  And  a1.ac_code Like 
' 617' 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()-455  And  Today() )
    ___LDL_15m___ ,
 
(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA01%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Simvastatin____ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA01%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Simvastatina____ ,
 
(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA02%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Lovastatin____ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA02%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Lovastatina____ ,

(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA03%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Pravastatin____ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA03%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Pravastatina____ ,

(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA04%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Fluvastatin____ ,
 
(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA04%'  And  t.data_open   Between  Today()-365  And  Today() )
    ____Fluvastatina____ ,

(Select  Max( co_des) From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA05%'  And  t.data_open   Between  Today()-365  And  Today() )
    ___Atorvastatin___ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA05%'  And  t.data_open   Between  Today()-365  And  Today() )
   ___Atorvastatina__ ,

(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA07%'  And  t.data_open   Between  Today()-365  And  Today() )
    __Rosuvastatin___ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AA07%'  And  t.data_open   Between  Today()-365  And  Today() )
    __Rosuvastatina__ ,

(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AX09%'  And  t.data_open   Between  Today()-365  And  Today() )
    ___Ezetemib___ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10AX09%'  And  t.data_open   Between  Today()-365  And  Today() )
    ___Ezetemibe__ ,
 
(Select  Max( co_des)  From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10BA02%'  And  t.data_open   Between  Today()-365  And  Today() )
    ___Ezet_Simva___ ,

(Select SubString( Max( co_des) From '%(CPR|cpr|RIV|riv) #"%#"(MG|mg)%' For '#')
 From  cart_terap t  Where  t.codice = p.codice  And  T.co_atc  ILIKE  'C10BA02%'  And  t.data_open   Between  Today()-365  And  Today() )
    __Ezetim_Simva__ ,
 
Today()  _query_d_
 
FROM  ( pazienti p   LEFT JOIN   nos_002 n    ON   p.codice = n.codice ) 
                              LEFT JOIN   v_utenti u    ON   n.pa_medi = u.userid
WHERE    u.codice_regionale     ILIKE    '%'     AND     u.nome    ILIKE    '%'
AND  p.pa_convenzione  =  'S'            AND    Year( nascita)   BETWEEN  1910 And 2015
AND  ( n.pa_drevoca Is Null  OR  n.pa_drevoca >  Today()  OR  ( n.pa_drevoca Between
Date( Today())-365  And Today() And motivo_revoca = 'S'))     AND   p.decesso  IS NULL
AND  p.codice  IN ( Select  b.codice   From   cart_pazpbl b  Where  b.cp_code  ILIKE  '410%'  OR  b.cp_code  ILIKE  '411%' 
OR  b.cp_code  ILIKE  '412%'  OR  b.cp_code  ILIKE  '413%'  OR  b.cp_code  ILIKE  '414%'  OR  b.cp_code  ILIKE  '272%'  OR  b.cp_code  ILIKE  '401%'  OR  b.cp_code  ILIKE  '250%' 
OR  b.cp_code  ILIKE  '436%' OR  b.cp_code  ILIKE  '430%'  OR  b.cp_code  ILIKE  '431%'  OR  b.cp_code  ILIKE  '414.5%'  OR  b.cp_code  ILIKE  'v45.81%' )
ORDER BY   1 , 2             LIMIT  1500             OFFSET   0


Ovviamente le colonne sono doppie a scopo di verifica , se risulta soddisfacente il set estratto, la prima x ogni statina si puo' eliminare .

Saluti ,  Sergio

Cervino
Membro Junior
Membro Junior

Messaggi : 245
Punti : 5042
Voti per importanza dei messaggi : 22
Data d'iscrizione : 03.03.11
Età : 69
Località : Orzivecchi (BS)

Torna in alto Andare in basso

statine con dosaggio Empty STATINE CON DOSAGGIO

Messaggio  nanci giacinto Ven 3 Apr 2015 - 20:00

BUONA SERA IMMAGINAVO CHE NON SI POTESSE FARE. L'ARCHIVIO DEL MIO SERVER E SYSSQL PER CUI NON POSSO APPLICARE LA TUA QUERY. GRAZIE PER L'AIUTO
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

Messaggi : 128
Punti : 4970
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

statine con dosaggio Empty statine con dosaggio

Messaggio  nanci giacinto Lun 8 Giu 2015 - 18:31

BUON POMERIGGIO CI SONO RIUSCITO. QUESTA QUERY ESTRAE TUTTI I NOMI COMMERCIALI E IL RELATIVO DOSAGGIO DELLA SIMVASTATINA, ANCHE DEI GENERICI. HO DOVUTO FARE QUATTRO QUERY, RISPETTIVAMENTE PER LA SIMVASTATINA, PRAVASTATINA, ATORVASTATINA, E NELL'ULTIMA TUTTE LE ALTRE. LE HO DOVUTE DIVIDERE PERCHE' SONO LUNGHISSIME E SI BLOCCANO. QUELLO CHE NON SO FARE E' CALCOLARE COME HO SCRITTO IN UN ALTRO QUESITO DEL PRESENTE FORUM LA DDD (DOSE DEFINITA GIORNALIERA) CON LA QUALE ALLA REGIONE CI CALCOLANO I PARAMETRI DI SFORAMENTO. SALUTI



select distinct p.nome nome, p.cognome cognome, n.pa_uslcode cod_reg,
v.codmedico codice_medico,
days(p.nascita, today())/365 eta, p.sesso sesso,
today() data_odierna,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '272%')


____dislipidemia____,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '401%')


_____ipertensione________,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '250%')


______diabete____,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '414%')


______CARD_ISCH__________,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '413%')


___ANGINA_PECT_____,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and (a.cp_code like '410%' or a.cp_code like '412%%'))


_____INFARTO_MIOCARDIO_______,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '436%')


_____ICTUS______,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like '411%')


_____SINDRO_CORON___,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and (a.cp_code like '431%' or a.cp_code like '430%'))


_____EMORRAGIA_CEREBRALE______,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and a.cp_code like 'v45.82%')


___ANGIOPLASTICA_CORONARICA____,



 

(select max(a.cp_code) from cart_pazpbl a


where a.codice=p.codice and (a.cp_code like '414.5%%' or a.cp_code like 'v45.81%'))


______BYPASS_AORTOCORONARICO____,



 

(select a.ac_val from cart_accert a


where a.codice=p.codice and a.ac_des like '%LDL%'


and (a.ac_val is not null)


and not exists (select b.codice from cart_accert b where a.codice=b.codice and b.ac_des like '%LDL%' and


(b.data_open>a.data_open or (b.data_open=a.data_open and b.rowid>a.rowid))


and b.ac_val is not null)


and a.data_open between today()-455 and today())____LDL_ultimo15mesi,



 

(select a.ac_val from cart_accert a


where a.codice=p.codice and a.ac_des like '%COLESTEROLO%'


and (a.ac_val is not null)


and not exists (select b.codice from cart_accert b where a.codice=b.codice and b.ac_des like '%COLESTEROLO%' and


(b.data_open>a.data_open or (b.data_open=a.data_open and b.rowid>a.rowid))


and b.ac_val is not null)


and a.data_open between today()-455 and today())____COLESTEROLO_ultimo15mesi,



 


 

(select a.ac_val from cart_accert a


where a.codice=p.codice and a.ac_des like '%TRIGLICERIDI%'


and (a.ac_val is not null)


and not exists (select b.codice from cart_accert b where a.codice=b.codice and b.ac_des like '%TRIGLICERIDI%' and


(b.data_open>a.data_open or (b.data_open=a.data_open and b.rowid>a.rowid))


and b.ac_val is not null)


and a.data_open between today()-455 and today())____TRIGLICERIDI_ultimo15mesi,



 


 

(select a.ac_val from cart_accert a


where a.codice=p.codice and a.ac_des like '%HDL%'


and (a.ac_val is not null)


and not exists (select b.codice from cart_accert b where a.codice=b.codice and b.ac_des like '%HDL%' and


(b.data_open>a.data_open or (b.data_open=a.data_open and b.rowid>a.rowid))


and b.ac_val is not null)


and a.data_open between today()-455 and today())____HDL_ultimo15mesi,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'simvastatina%%%%%%%%%10%%'


and a.data_open between today()-365 and today())____simvastatina_10___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'simvastatina%%%%%%%%%%20%%'


and a.data_open between today()-365 and today())____simvastatina_20___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'simvastatina%%%%%%%%%%40%%'


and a.data_open between today()-365 and today())____simvastatina_40___,



 


 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'alpheus%%20%%'


and a.data_open between today()-365 and today())____alpheus_20___,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'alpheus%%40%%'


and a.data_open between today()-365 and today())____alpheus__40__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'krustat%%20%%'


and a.data_open between today()-365 and today())____krustat__20____,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'krustat%%40%%'


and a.data_open between today()-365 and today())____krustat__40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'lipenil%%20%%'


and a.data_open between today()-365 and today())____lipenil__20____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'lipenil%%40%%'


and a.data_open between today()-365 and today())____lipenil__40____,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'liponorm%%10%%'


and a.data_open between today()-365 and today())____liponorm_10____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'liponorm%%20%%'


and a.data_open between today()-365 and today())____liponorm__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'liponorm%%40%%'


and a.data_open between today()-365 and today())____liponorm__40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'medipo%%20%%'


and a.data_open between today()-365 and today())____medipo__20___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'medipo%%40%%'


and a.data_open between today()-365 and today())____medipo__40___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'amistat%%20%%'


and a.data_open between today()-365 and today())____amistat_20___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'amistat%%40%%'


and a.data_open between today()-365 and today())____amistat__40___,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'quibus%%20%%'


and a.data_open between today()-365 and today())____quibus__20____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'quibus%%40%%'


and a.data_open between today()-365 and today())____quibus__40___,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'setorilin%%20%%'


and a.data_open between today()-365 and today())____serotilin_20___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'serotilin%%40%%'


and a.data_open between today()-365 and today())____serotinil__40___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'simbatrix%%20%%'


and a.data_open between today()-365 and today())____simvatrix__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'simbatrix%%40%%'


and a.data_open between today()-365 and today())____simbatrix_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sincol%%20%%'


and a.data_open between today()-365 and today())____sincol_20____,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sincol%%40%%'


and a.data_open between today()-365 and today())____sincol_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvacor%%10%%'


and a.data_open between today()-365 and today())____sinvacor_10___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvacor%%20%%'


and a.data_open between today()-365 and today())____sinvacor_20____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvacor%%40%%'


and a.data_open between today()-365 and today())____sinvacor_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvalip%%20%%'


and a.data_open between today()-365 and today())____sinvalip__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvalip%%40%%'


and a.data_open between today()-365 and today())____sinvalip_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvat%%20%%'


and a.data_open between today()-365 and today())____sinvat__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sinvat%%40%%'


and a.data_open between today()-365 and today())____sinvat_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sivastin%%10%%'


and a.data_open between today()-365 and today())____sivastin_10____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sivastin%%20%%'


and a.data_open between today()-365 and today())____sivastin_20___,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'sivastin%%40%%'


and a.data_open between today()-365 and today())____sivastin_40____,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'turstat%%20%%'


and a.data_open between today()-365 and today())____turstat__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'turstat%%40%%'


and a.data_open between today()-365 and today())____turstat_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'vastgen%%20%%'


and a.data_open between today()-365 and today())____vastgen_20___,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'vastgen%%40%%'


and a.data_open between today()-365 and today())____vastgen_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'vastin%%20%%'


and a.data_open between today()-365 and today())____vastin__20__,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'vastin%%40%%'


and a.data_open between today()-365 and today())____vastin_40____,



 

(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'xipocol%%20%%'


and a.data_open between today()-365 and today())____xipocol_20____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'xipocol%%40%%'


and a.data_open between today()-365 and today())____xipocol_40____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'zocor%%10%%'


and a.data_open between today()-365 and today())____zocor_10____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'zocor%%20%%'


and a.data_open between today()-365 and today())____zocor_20____,


(select distinct 'si' from cart_terap a


where a.codice=p.codice and a.co_des like 'zocor%%40%%'


and a.data_open between today()-365 and today())____zocor_40____



 


 

from pazienti p , nos_002 n, cart_pazpbl c, v_pazienti v
where p.codice=n.codice
and c.codice=n.codice
and v.codice=p.codice


and (c.cp_code like '413%' or c.cp_code like '414%' or c.cp_code like '272%'or c.cp_code like '401%' or c.cp_code like '250%' or c.cp_code like '410%' or c.cp_code like '411%'or c.cp_code like '412%' or c.cp_code like '436%' or c.cp_code like '430%' or c.cp_code like '431%' or c.cp_code like '414.5%'or c.cp_code like 'v45.81%' or c.cp_code like 'v45.82%')


and n.pa_drevoca is null


and p.decesso is null


and p.pa_convenzione not like 'I'



 

order by p.cognome, p.nome
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

Messaggi : 128
Punti : 4970
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  draleo83 Ven 12 Giu 2015 - 19:12

Se (?) ho capito:vuoi estrarre  i PRINCIPI ATTIVI (e non i nomi commerciali) delle statine con il relativo dosaggio ?
Se fosse così, gli ultimi 4 caratteri del nome del farmaco contengono il suo dosaggio ( 3 caratteri invece per il 5 mg)
quindi  per il 10 mg; right(co_des,4)like '10%')
per il 5 mg : right(co_des,3)like '5%')


Es valido per la sola SIMVASTATINA. Per le altre ripetere la triade  cambiando il codice ATC e i dosaggi

(select  distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc ='C10AA01'
and a.data_open between today()-365 and today() and right(co_des,4)like '10%')
____simvastatina_10___,
(select distinct  'si' from cart_terap a
where a.codice=p.codice and a.co_atc ='C10AA01'
and a.data_open between today()-365 and today() and right(co_des,4)like '20%')
____simvastatina_20___,
(select  distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc ='C10AA01'
and a.data_open between today()-365 and today() and right(co_des,4)like '40%')
____simvastatina_40___,


Non ho esaminato il resto perchè funziona bene; e quindi va lasciato com'è
Leonardo Draghini
draleo83
draleo83
Membro Junior
Membro Junior

Messaggi : 225
Punti : 5068
Voti per importanza dei messaggi : 25
Data d'iscrizione : 21.02.11

Torna in alto Andare in basso

statine con dosaggio Empty statine con dosaggio

Messaggio  nanci giacinto Sab 13 Giu 2015 - 14:01

Grazie per l'aiuto, ma quello che mi interessa di più è calcolare la DDD (dose definita giornaliera) perchè è questa che ci calcolano ai fini dell'appropriatezza (e delle successive sanzioni) alla regione. Se  sappiamo calcolare la DDD anche noi, lo possiamo fare  per tempo e ciò ci permette di mettere in atto azioni correttive che ci possono salvaguardare dalle sanzioni.
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

Messaggi : 128
Punti : 4970
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  draleo83 Sab 13 Giu 2015 - 18:35

per poter lavorare ,dal punto di vista informatico, su questa fantomatica DDD, occorrerebbe prima sapere cos'è; cioè, prima, mettere su carta e penna tutto quel che c'è da sapere, su quali parametri si basa, quali procedimenti logici occorre seguire ecc ecc. Poi alla fine, quando si hanno le idee ben chiare su questo, si può provare a trasferire il tutto in linguaggio informatico. Io, prima di leggere il post, ne ignoravo perfino il nome ed ora ne so quanto prima
Leonardo Draghini
draleo83
draleo83
Membro Junior
Membro Junior

Messaggi : 225
Punti : 5068
Voti per importanza dei messaggi : 25
Data d'iscrizione : 21.02.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  Cervino Sab 13 Giu 2015 - 22:49

draleo83 ha scritto:per poter lavorare ,dal punto di vista informatico, su questa fantomatica DDD, occorrerebbe prima sapere cos'è; cioè, prima, mettere su carta e penna tutto quel che c'è da sapere, su quali parametri si basa, quali procedimenti logici occorre seguire ecc ecc. Poi alla fine, quando si hanno le idee ben chiare su questo, si può provare a trasferire il tutto in linguaggio informatico. Io, prima di leggere il post, ne ignoravo perfino il nome ed ora ne so quanto prima
Leonardo Draghini
Ciao Leonardo ,  si tratta di fare un confronto fra : la dose ritenuta terapeutica x un dato farmaco x la maggioranza dei Pazienti ( Defined Daily Doses o DDD : è definita come la dose di mantenimento media ipotizzata al giorno per un farmaco utilizzato per la sua indicazione principale in adulti) -  e le dosi prescritte ( Prescribed Daily Doses : PDDs ) in un lasso di tempo .
per le Statine ho trovato questa tabella :    Atorvastatin 20 mg  -  Fluvastatin 60 mg - Lovastatin 45 mg - Pravastatin 30 mg - Rosuvastatin 10 mg - Simvastatin 30 mg ( variata nel 2009 , ancora attuale ? - la tendenza è verso l' aumento della DDD ) .
Esempio il MdMG prescrive :  30 cpr di Atorvastatina 40 mg ( ipotizzando una DDD = 30 mg ) , il paziente riceverà, se ritirerà la ricetta : 30 * 40 / 30 = 40 DDD ;  se
prescrive : 30 cpr di Atorvastatina 20 mg = 20 DD  ;   se prescrive : 30 cpr di Atorvastatina 80 mg = 80 DDD ; 
ma senza conoscere l' algoritmo preciso utilizzato dalla ASL ( intervallo di tempo , differenza fra dose prescrittata e ritirata e dal paziente ) non è facile predisporre una query ; comunque Giacinto Ti illustrerà meglio i suoi scopi .

Ti saluto , Sergio

Cervino
Membro Junior
Membro Junior

Messaggi : 245
Punti : 5042
Voti per importanza dei messaggi : 22
Data d'iscrizione : 03.03.11
Età : 69
Località : Orzivecchi (BS)

Torna in alto Andare in basso

statine con dosaggio Empty statine con dosaggio

Messaggio  nanci giacinto Lun 15 Giu 2015 - 9:02

Caro Cervino sei stato chiarisssimo. Non so quale algoritmo usa la ASP, ma credo che è standard perche' è un calcolo aritmetico come tu hai spiegato. Ho chiesto aiuto anche ai programmatori millewin ma dopo 10 gg ancora niente. E' sicuro che se riusciamo a calcolare la DDD da soli e per tempo ci possiamo sia difendere meglio dalle contestazioni ASP e  sia modificare le evntuali "inappropriatezze".
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

Messaggi : 128
Punti : 4970
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  draleo83 Gio 18 Giu 2015 - 22:42

Allora: prima di passare agli aspetti informatici, c’è un punto che mi sembra parecchio controverso .Consideriamo -a solo titolo semplificativo- di considerare un periodo di osservazione di un solo mese. Prescrivo ad un paz  per 2 volte 1 conf di statina ( una il giorno 2 del mese e l’altra il 28 dello stesso mese). Se calcolo il DDD ottengo un valore parecchio più alto di quello corretto (perché la seconda confezione non verrà “consumata” il mese in questione, ma il mese successivo, che non è compreso nel periodo di osservazione). D’altra parte se , per calcolare il DDD giusto, non considero l’ultima prescrizione, il num totale delle confezioni prescritte verrà difforme da quello presumibilmente calcolato dalla ASL. Indipendentemente da questo, c’è anche da dire –come osservava Sergio- che il prescritto non coincide mai con quanto effettivamente ritirato dal paz in farmacia. In definitiva se lo scopo  è quello di confrontare i propri dati con quelli della ASL, temo che una query del genere (anche se  fatta in maniera tecnicamente ineccepibile) sia inutile o addirittura fuorviante. Per fare qualcosa che abbia un minimo senso approssimativamente indicativo, occorrerebbe  saperne di più sul sistema utilizzato dalla ASL per fare tali calcoli  . Altrimenti... la query  si può anche fare , ma sarebbe solo un giochino  del tutto inutilizzabile ai fini pratici .
Leonardo Draghini
draleo83
draleo83
Membro Junior
Membro Junior

Messaggi : 225
Punti : 5068
Voti per importanza dei messaggi : 25
Data d'iscrizione : 21.02.11

Torna in alto Andare in basso

statine con dosaggio Empty Re: statine con dosaggio

Messaggio  Contenuto sponsorizzato


Contenuto sponsorizzato


Torna in alto Andare in basso

Torna in alto

- Argomenti simili

 
Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.