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.

PATOLOGIE CON ACCERTAMENTI E TERAPIE

Andare in basso

PATOLOGIE CON ACCERTAMENTI E TERAPIE Empty PATOLOGIE CON ACCERTAMENTI E TERAPIE

Messaggio  nanci giacinto Mer 24 Dic 2014 - 16:30

BUON POMERIGGIO E AUGURI A TUTTI GLI ISCRITTI AL FORUM. 
QUESITO: QUESTA QUERY FUNZIONA BENISSIMO MA ESTRAE SOLO I PZ CON IPERTENSIONE ARTERIOSA, INFATTI SE SI TOGLIE IL RIGO "
and (c.cp_code like '401%' or c.cp code like '405%') ALLORA ESTRAE TUTTI I PZ DELL'ARCHIVIO E' DIVENTA MOLTO FATICOSO ELABORARE I DATI ESTRATTI PER DELLE STATISTICHE PERCHE' ESTRAE ANCHE GLI ACCERTAMENTI DEI PZ SENZA LE PATOLOGIE ELENCATE NELLA QUERY. DOMANDA: E' POSSIBILE ESTRARRE SOLO E SOLTANTO I PZ CON LE PATOLOGIE INDICATE NELLA QUERY E SOLO DI QUESTI ESTRARRE ANCHE GLI ACCERTAMENTI E I FARMACI ANCH'ESSI ELENCATI NELLA QUERY?. GRAZIE E DI NUOVO TANTI AUGURI

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 '%creatinina%' and a.ac_des not like '%clearance%creatinina%') 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 'creatinina%'
 
and b.ac_des not like '%clearance%creatinina%') 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()) ____creatinina_ultima15mesi____,
 
(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 '%glicemia%' and a.ac_des not like '%glicemia%post%prandiale%'
and a.ac_des not like '%ultima%misurazione%glicemia%') 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 '%glicemia%'
and b.ac_des not like '%glicemia%post%prandiale%' and a.ac_des not like
'%ultima%misurazione%glicemia%') 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())
_______glicemia_ultimi15mesi________,
 
(select a.ac_val from cart_accert a
where a.codice=p.codice and a.ac_des like '%omocisteina%'
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 '%omocisteina%' 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())
_____OMOCISTEINA_ULTIMI15MESI____,
 
(select a.frequenza from cart_press a
where a.codice=p.codice
and not exists (select b.codice from cart_press b where a.codice=b.codice and
(b.data_open>a.data_open or b.data_open=a.data_open and b.rowid>a.rowid))
and a.data_open between today()-180 and today())
_______FREQUENZA_ULTIMI_6MESI______,
 
 
 
 
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c04%'
and
a.data_open between today()-365 and today()) ____clopidrogel______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c06%'
and
a.data_open between today()-365 and today()) _____cardioaspirin______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c05%'
and a.data_open between today()-365 and today())_____ticlopidina____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c22'
and a.data_open between today ()-365 and today())___prasugel_______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c24'
and a.data_open between today()-365 and today())_____brilique_____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c11'
and a.data_open between today()-365 and today())_____ventavis_____,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c30'
and a.data_open between today()-365 and today())__________duoplavi___,
 
(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______,
 
(select distinct 'si' from cart_terap a
where a.codice=p.codice and a.co_atc like 'c10ax06%'
and a.data_open between today()-365 and today())_______omega3________
 
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 '401%' or c.cp_code like '405%')
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 : 5020
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11

Torna in alto Andare in basso

PATOLOGIE CON ACCERTAMENTI E TERAPIE Empty PATOLOGIE CON ACCERTAMENTI E TERAPIE

Messaggio  nanci giacinto Gio 25 Dic 2014 - 21:48

BUONA SERA E DI NUOVO TANTI AUGURI. HO RISOLTO IL QUESITO. BASTA AGGIUNGERE AL RIGO CON I CODICI PER L'IPERTENSIONE TUTTI I CODICI DELLE ALTRE PATOLOGIE ELENCATE NELLA QUERY.
nanci giacinto
nanci giacinto
Membro Junior
Membro Junior

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

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.