Liebe Tomedos
hier nochmal ein kleines 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 '%Z8%' )
)
Wie kann ich jetzt noch als Zusatz eine EBM Leisung hinzufügen a la
AND
( EBMCode = "03230" )