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.

ESTRAZIONE ESENZIONI -fasce reddito

5 partecipanti

Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  Gabriele Barani Gio 31 Mar 2016 - 20:12

Ciao a tutti ,

è possibile una query che mi fornisca un elenco di tutti gli assistiti con
- nome cognome
- codice fiscale
-indirizzo
-fascia di reddito
-esenzioni ticket ( patologia / reddito / invalidità ... altro )

Grazie

Gabriele Barani

Gabriele Barani
Nuovo Membro
Nuovo Membro

Messaggi : 18
Punti : 4842
Voti per importanza dei messaggi : 0
Data d'iscrizione : 20.02.11
Età : 71
Località : PARMA

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  draleo83 Sab 2 Apr 2016 - 19:01

per ciascun paz estrae  la lista delle esenzioni ATTIVE e NON scadute . Se il paz non c'è significa che: o non ha esenzioni, oppure sono scadute oppure sono disattivate.  Nella mia regione funziona bene (mi sembra), ma poiché i codici delle esenzioni variano da regione a regione, dubito che possa funzionare bene anche a te. In tal caso ....lavoro da certosino per sostituire i codici delle esenzioni

SELECT cast(p.codfiscale as char (20)), p.cognome,p.nome,
list(case e.Cod_ese when 'RE34' then 'R1' when 'RE37' then 'R2' when 'RE38' then 'R3' 
when 'RE1' then 'E01' when 'RE2' then 'E02' when 'RE3' then 'E03' when 'RE4' then 'E04'
when 'C02' then 'C02' when 'A08' then 'C01' when 'A04' then 'C03' when 'A05' then 'C04'
when 'A07' then 'C06' when 'A10' then 'S01' when 'A03' then 'S02' when 'B14' then 'S03'
when 'A01' then 'G01' when 'B11' then 'G02' when 'A11' then 'L01' when 'A02' then 'L02' when 'B12' then 'L03'
 when 'M006' then '006'  when 'M007' then '007' when 'M009' then '009' when 'M013' then '013'  when 'M017' then '017'when 'M031' then '0031' when 'M048' then '048'
When 'MA31'then 'A031' when 'MB02' then '0B02' when 'MA02' then '002'   when 'M014' then '014' when 'M016' then '016'  when 'M019' then '019'  when 'M021' then '021'  when 'M025' then '025' when 'M027' then '027' when 'M035' then '035' when 'M040' then '040' when 'M044' then '044'
when 'M045' then '045' when 'M046' then '046' when 'M056' then '056'
 when 'MC02' then '02'  when 'M023'  then '023'
 when 'ST1' then 'P01095' when 'CN1' then 'P01096'
else 'ALTRA' END) lista_esenz
FROM v_pazienti p LEFT OUTER join cart_paz_ese e
where   ascii(e.sigla_si )<90  AND (e.dscdese is NULL OR e.dscdese > Today() )
GROUP BY p.codfiscale,p.cognome,p.nome
ORDER BY 2,3
draleo83
draleo83
Membro Junior
Membro Junior

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

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  mario shirt Dom 3 Apr 2016 - 13:56

draleo83 ha scritto:
SELECT cast(p.codfiscale as char (20)), p.cognome,p.nome,
list(case e.Cod_ese when 'RE34' then 'R1' when 'RE37' then 'R2' when 'RE38' then 'R3' 
when 'RE1' then 'E01' when 'RE2' then 'E02' when 'RE3' then 'E03' when 'RE4' then 'E04'
when 'C02' then 'C02' when 'A08' then 'C01' when 'A04' then 'C03' when 'A05' then 'C04'
when 'A07' then 'C06' when 'A10' then 'S01' when 'A03' then 'S02' when 'B14' then 'S03'
when 'A01' then 'G01' when 'B11' then 'G02' when 'A11' then 'L01' when 'A02' then 'L02' when 'B12' then 'L03'
 when 'M006' then '006'  when 'M007' then '007' when 'M009' then '009' when 'M013' then '013'  when 'M017' then '017'when 'M031' then '0031' when 'M048' then '048'
When 'MA31'then 'A031' when 'MB02' then '0B02' when 'MA02' then '002'   when 'M014' then '014' when 'M016' then '016'  when 'M019' then '019'  when 'M021' then '021'  when 'M025' then '025' when 'M027' then '027' when 'M035' then '035' when 'M040' then '040' when 'M044' then '044'
when 'M045' then '045' when 'M046' then '046' when 'M056' then '056'
 when 'MC02' then '02'  when 'M023'  then '023'
 when 'ST1' then 'P01095' when 'CN1' then 'P01096'
else 'ALTRA' END) lista_esenz
FROM v_pazienti p LEFT OUTER join cart_paz_ese e
where   ascii(e.sigla_si )<90  AND (e.dscdese is NULL OR e.dscdese > Today() )
GROUP BY p.codfiscale,p.cognome,p.nome
ORDER BY 2,3

non va con postgress Exclamation Exclamation Exclamation
Mario
mario shirt
mario shirt
Membro Junior
Membro Junior

Messaggi : 254
Punti : 5179
Voti per importanza dei messaggi : 4
Data d'iscrizione : 21.02.11
Età : 68

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  draleo83 Dom 3 Apr 2016 - 16:51

Lo immaginavo. Ma non ho Postgres. Sicuramente qualcuno potrà adattarla
draleo83
draleo83
Membro Junior
Membro Junior

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

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  drtulino Dom 3 Apr 2016 - 17:58

mario shirt ha scritto:
draleo83 ha scritto:
SELECT cast(p.codfiscale as char (20)), p.cognome,p.nome,
list(case e.Cod_ese when 'RE34' then 'R1' when 'RE37' then 'R2' when 'RE38' then 'R3' 
when 'RE1' then 'E01' when 'RE2' then 'E02' when 'RE3' then 'E03' when 'RE4' then 'E04'
when 'C02' then 'C02' when 'A08' then 'C01' when 'A04' then 'C03' when 'A05' then 'C04'
when 'A07' then 'C06' when 'A10' then 'S01' when 'A03' then 'S02' when 'B14' then 'S03'
when 'A01' then 'G01' when 'B11' then 'G02' when 'A11' then 'L01' when 'A02' then 'L02' when 'B12' then 'L03'
 when 'M006' then '006'  when 'M007' then '007' when 'M009' then '009' when 'M013' then '013'  when 'M017' then '017'when 'M031' then '0031' when 'M048' then '048'
When 'MA31'then 'A031' when 'MB02' then '0B02' when 'MA02' then '002'   when 'M014' then '014' when 'M016' then '016'  when 'M019' then '019'  when 'M021' then '021'  when 'M025' then '025' when 'M027' then '027' when 'M035' then '035' when 'M040' then '040' when 'M044' then '044'
when 'M045' then '045' when 'M046' then '046' when 'M056' then '056'
 when 'MC02' then '02'  when 'M023'  then '023'
 when 'ST1' then 'P01095' when 'CN1' then 'P01096'
else 'ALTRA' END) lista_esenz
FROM v_pazienti p LEFT OUTER join cart_paz_ese e
where   ascii(e.sigla_si )<90  AND (e.dscdese is NULL OR e.dscdese > Today() )
GROUP BY p.codfiscale,p.cognome,p.nome
ORDER BY 2,3

non va con postgress Exclamation Exclamation Exclamation
Mario
Mario, per postgresql prova al seguente link: https://utentimillewin.forumattivo.it/t1372-elenco-pazienti-con-esenzione#9203
In questa sessione ci sono le query per chi ha Sybase.
drtulino
drtulino
Moderatore
Moderatore

Messaggi : 1856
Punti : 7038
Voti per importanza dei messaggi : 91
Data d'iscrizione : 20.02.11
Età : 60
Località : Monte Argentario (GR)

https://www.facebook.com/groups/utentimillewin/

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  mario shirt Dom 3 Apr 2016 - 19:15

drtulino ha scritto:
mario shirt ha scritto:


non va con postgress Exclamation Exclamation Exclamation
Mario
Mario, per postgresql prova al seguente link: https://utentimillewin.forumattivo.it/t1372-elenco-pazienti-con-esenzione#9203
In questa sessione ci sono le query per chi ha Sybase.


Non mi ero accorto che non ero al posto giusto Sleep Sleep

Mario
mario shirt
mario shirt
Membro Junior
Membro Junior

Messaggi : 254
Punti : 5179
Voti per importanza dei messaggi : 4
Data d'iscrizione : 21.02.11
Età : 68

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  drtulino Dom 3 Apr 2016 - 19:19

mario shirt ha scritto:
drtulino ha scritto:
mario shirt ha scritto:


non va con postgress Exclamation Exclamation Exclamation
Mario
Mario, per postgresql prova al seguente link: https://utentimillewin.forumattivo.it/t1372-elenco-pazienti-con-esenzione#9203
In questa sessione ci sono le query per chi ha Sybase.


Non mi ero accorto che non ero al posto giusto Sleep Sleep

Mario

Very Happy Very Happy Very Happy Very Happy
drtulino
drtulino
Moderatore
Moderatore

Messaggi : 1856
Punti : 7038
Voti per importanza dei messaggi : 91
Data d'iscrizione : 20.02.11
Età : 60
Località : Monte Argentario (GR)

https://www.facebook.com/groups/utentimillewin/

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  Cervino Lun 4 Apr 2016 - 23:46

mario shirt ha scritto:.....  non va con postgress Exclamation    Mario
La query  di  Leonardo  non  funziona  sul  MillePS  solo  perché  manca  il  link  esplicito  fra  v_pazienti  e  cart_paz_ese   ;  inoltre  non è chiaro cosa intendi x fascie di Reddito ;  prova con :

SELECT  Cast( p.codice_fiscale As char (24)), p.cognome ,  p.nome ,
LIST(    Case  e.Cod_ese   WHEN  'RE34'  THEN  'R1'  WHEN  'RE37'  THEN  'R2'   WHEN  'RE38'  THEN  'R3' 
WHEN  'RE1'  THEN  'E01'  WHEN  'RE2'  THEN  'E02'  WHEN  'RE3'   THEN  'E03'    WHEN  'RE4'   THEN  'E04' 
WHEN  'C02'  THEN  'C02'  WHEN  'A08'  THEN  'C01'  WHEN  'A04'   THEN  'C03'  WHEN  'A05'   THEN  'C04'
WHEN  'A07'  THEN  'C06'  WHEN  'A10'  THEN  'S01'   WHEN  'A03'   THEN  'S02'  WHEN  'B14'   THEN  'S03' 
WHEN  'A01'  THEN  'G01'  WHEN  'B11'  THEN  'G02'  WHEN  'A11'   THEN  'L01'  WHEN  'A02'   THEN  'L02'
WHEN  'B12'  THEN  'L03'   WHEN  'M006' THEN  '006'  WHEN  'M007'  THEN  '007'  WHEN  'M009'  THEN  '009' 
WHEN  'M013'  THEN  '013'   WHEN  'M017'  THEN  '017' WHEN  'M031'  THEN  '0031'  WHEN  'M048'  THEN  '048' 
WHEN 'MA31'  THEN  'A031'  WHEN  'MB02'  THEN  '0B02'  WHEN  'MA02'  THEN  '002' WHEN  'M014'  THEN  '014' 
WHEN  'M016'  THEN  '016'   WHEN  'M019'  THEN  '019'   WHEN  'M021'  THEN  '021'   WHEN  'M025'  THEN  '025' 
WHEN  'M027'  THEN  '027'   WHEN  'M035'  THEN  '035'  WHEN  'M040'  THEN  '040'  WHEN  'M044'  THEN  '044'    
WHEN  'M045'  THEN  '045'  WHEN  'M046'  THEN  '046'  WHEN  'M056'  THEN  '056'  WHEN  'MC02'  THEN  '02'  
WHEN  'M023'   THEN  '023'   WHEN  'ST1'  THEN  'P01095'  WHEN  'CN1'  THEN  'P01096'   ELSE  'Altra'  END) AS  lista_esenz
FROM  ((  pazienti p   LEFT Outer JOIN   nos_002 n   ON   p.codice = n.codice )
                                LEFT Outer JOIN   v_utenti u    ON   n.pa_medi = u.userid )
                                LEFT Outer JOIN   cart_paz_ese e  ON  p.codice  =  e.codice
WHERE   u.nome  LIKE   '%'         AND      u.codice_regionale   LIKE   '%'
AND   p.pa_convenzione = 'S'      AND      YEAR( p.nascita)   Between  1910  And  2016
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   ascii(e.sigla_si ) <90   AND ( e.dscdese is NULL  OR  e.dscdese > Today() )
GROUP BY  p.codice_fiscale ,  p.cognome ,  p.nome
ORDER BY  2  ,3


Saluti ,  Sergio ,  Orzivecchi  , BS

Cervino
Membro Junior
Membro Junior

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

Torna in alto Andare in basso

ESTRAZIONE ESENZIONI -fasce reddito  Empty Re: ESTRAZIONE ESENZIONI -fasce reddito

Messaggio  Contenuto sponsorizzato


Contenuto sponsorizzato


Torna in alto Andare in basso

Torna in alto


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