Liebe Tomedos
ich habe ein kleines SQL Problem:
select d.*
from patient as p
left join patientendetails as pd on (p.patientendetails_ident = pd.ident)
left join patientendetailsrelationen as pdr on (pd.patientendetailsrelationen_ident = pdr.ident)
left join patientendetailsrelationen_kvscheine as pdrkv on (pdrkv.patientendetailsrelationen_ident = pdr.ident)
left join kvschein as kv on (pdrkv.kvscheine_ident = kv.ident)
join kvschein_quartalsdiagnosen on (kvschein_ident = kv.ident)
left join diagnose as d on (quartalsdiagnosen_ident = d.ident)
left join icdkatalogeintrag as icd on (d.icdkatalogeintrag_ident = icd.ident)
where
kv.visible=true
and p.ident = $[patientident]$
and d.visible=true
and pd.privatpatient = FALSE
and
( icd.code ilike '%I10.90%' ) or
( icd.code ilike '%G25.81%' )
Das Problem ist - es wird auch bei Privatpatienten ausgeführt obwohl "pd.privatpatient = FALSE " im WHERE steht?