1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| SELECT DISTINCT p.NIPATIENT, Left([r6].[REPONSE],40) AS Expr1, p.NOM, p.PRENOM, p.PATRONYME, p.DATENAIS
FROM PENSOINS_BM_LIB_S AS lib3,
PENSOINS_BM_LIB_S AS lib4,
PENSOINS_BM_LIB_S AS lib5,
PENSOINS_BM_LIB_S AS lib6,
PENSOINS_C_QUESTION AS q3,
PENSOINS_BM_REP_S AS r3,
PENSOINS_C_QUESTION AS q4,
PENSOINS_BM_REP_S AS r4,
PENSOINS_C_QUESTION AS q5,
PENSOINS_BM_REP_S AS r5,
PENSOINS_C_QUESTION AS q6,
PENSOINS_BM_REP_S AS r6,
PENSOINS_BM_TH_S AS th3,
PENSOINS_SEJOUR AS sj,
PENSOINS_PATIENT AS p
WHERE (((p.NIPATIENT)=[sj].[NIPATIENT])
AND ((lib3.PARENTE) Like '674,%')
AND ((lib3.NIQ)=[q3].[NIQ])
AND ((lib3.NILIB)=[r3].[NILIB])
AND ((lib3.NIQSUP) Is Null)
AND ((lib3.NILIBSUP) Is Null)
AND ((lib3.NITH)=[th3].[NITH]
And (lib3.NITH)=[lib5].[NITH]
And (lib3.NITH)=[lib4].[NITH]
And (lib3.NITH)=[lib6].[NITH])
AND ((lib4.NIQ)=[q4].[NIQ])
AND ((lib4.NILIB)=[r4].[NILIB])
AND ((q4.LIBABR) Like 'Date de l%')
AND ((lib5.NIQ)=[q5].[NIQ])
AND ((lib5.NILIB)=[r5].[NILIB])
AND ((q5.LIBABR) Like 'Heure de l%')
AND ((lib6.NIQ)=[q6].[NIQ])
AND ((lib6.NILIB)=[r6].[NILIB])
AND ((q6.LIBABR) Like 'Numéro de dossier appareil EFR%')
AND ((sj.NISEJOUR)=[th3].[NISEJOUR])
AND ((Exists (select 1 from PENSOINS_BM_LIB_S lib1 where lib1.PARENTE like '674,%' and lib3.NIQ = Lib1.NIQSUP))=False)); |
Partager