PATOLOGIE CON ACCERTAMENTI E TERAPIE
Pagina 1 di 1
PATOLOGIE CON ACCERTAMENTI E TERAPIE
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
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- Membro Junior
- Messaggi : 128
Punti : 5208
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11
PATOLOGIE CON ACCERTAMENTI E TERAPIE
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- Membro Junior
- Messaggi : 128
Punti : 5208
Voti per importanza dei messaggi : -1
Data d'iscrizione : 02.03.11
Argomenti simili
» estrazione patologie con icd9
» Indagine spesa sostenuta per alcune patologie
» pz con alcuni accertamenti
» accertamenti
» accertamenti cuppizzabili
» Indagine spesa sostenuta per alcune patologie
» pz con alcuni accertamenti
» accertamenti
» accertamenti cuppizzabili
Pagina 1 di 1
Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.