0% found this document useful (0 votes)
23 views

L ISTEp ATIENT

This SQL query selects and unions data from various tables in a syglab database to retrieve information about consultations (appointments) such as the number, dates, users, patients, and status. It joins the consultation table with patient, acte_demmande_valide (external demand act), and other tables to retrieve the data for external consultations. It also joins consultation_int_service (internal consultation), consultation_int_service_patient_int, patient, and acte_demmander_int (internal demand act) tables to retrieve similar data for internal consultations.

Uploaded by

Microtech Dz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

L ISTEp ATIENT

This SQL query selects and unions data from various tables in a syglab database to retrieve information about consultations (appointments) such as the number, dates, users, patients, and status. It joins the consultation table with patient, acte_demmande_valide (external demand act), and other tables to retrieve the data for external consultations. It also joins consultation_int_service (internal consultation), consultation_int_service_patient_int, patient, and acte_demmander_int (internal demand act) tables to retrieve similar data for internal consultations.

Uploaded by

Microtech Dz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT

`syglab`.`consultation`.`Num_cons` AS `Num_cons`,
`syglab`.`consultation`.`idconsultation` AS `IDRDV`,
`syglab`.`consultation`.`Date_prise_rdv` AS `Date_prise_rdv`,
`syglab`.`consultation`.`Date_rdv` AS `Date_rdv`,
`syglab`.`consultation`.`IDUtilisateur` AS `IDUtilisateur`,
`syglab`.`consultation`.`ActionLe` AS `ActionLe`,
`syglab`.`consultation`.`IDPatient` AS `IDPatient`,
`syglab`.`patient`.`Pat_nom` AS `Pat_nom`,
`syglab`.`patient`.`Pat_prenom` AS `Pat_prenom`,
`syglab`.`patient`.`Pat_Date_naissance` AS `Pat_Date_naissance`,
`syglab`.`patient`.`Pat_Sexe` AS `Pat_Sexe`,
'Ext' AS `type`,
`syglab`.`acte_demmande_valide`.`statut` AS `statut`
FROM (((`rdv`
LEFT JOIN `consultation`
ON ((`syglab`.`consultation`.`IDRDV` = `syglab`.`rdv`.`IDRDV`)))
LEFT JOIN `patient`
ON ((`syglab`.`rdv`.`IDPatient` = `syglab`.`patient`.`IDPatient`)))
JOIN `acte_demmande_valide`
ON ((`syglab`.`acte_demmande_valide`.`Idconsultation` =
`syglab`.`consultation`.`idconsultation`)))
UNION
SELECT DISTINCT
`syglab`.`consultation_int_service_patient_int`.`Num_cons` AS `Num_cons`,
`syglab`.`consultation_int_service_patient_int`.`IDConsultation_Int` AS `IDRDV`,
`syglab`.`consultation_int_service`.`Const_date` AS `Date_prise_rdv`,
`syglab`.`consultation_int_service`.`Const_date` AS `Date_rdv`,
`syglab`.`consultation_int_service_patient_int`.`IDUtilisateur` AS
`IDUtilisateur`,
`syglab`.`consultation_int_service`.`ActionLe` AS `ActionLe`,
`syglab`.`consultation_int_service_patient_int`.`IDPatientint` AS `IDPatient`,
`syglab`.`patient`.`Pat_nom` AS `Pat_nom`,
`syglab`.`patient`.`Pat_prenom` AS `Pat_prenom`,
`syglab`.`patient`.`Pat_Date_naissance` AS `Pat_Date_naissance`,
`syglab`.`patient`.`Pat_Sexe` AS `Pat_Sexe`,
'Int' AS `type`,
`syglab`.`acte_demmander_int`.`statut` AS `statut`
FROM (((`consultation_int_service`
LEFT JOIN `consultation_int_service_patient_int`
ON ((`syglab`.`consultation_int_service_patient_int`.`IDConsultation_Int` =
`syglab`.`consultation_int_service`.`IDConsultation_Int`)))
LEFT JOIN `patient`
ON ((`syglab`.`patient_int222`.`IDPatientint` =
`syglab`.`patient_int222`.`IDPatientint`)))
LEFT JOIN `acte_demmander_int`
ON ((`syglab`.`acte_demmander_int`.`IDConsultation_Int_IDPatientint1` =
`syglab`.`consultation_int_service_patient_int`.`IDConsultation_Int_IDPatientint1`)
))

You might also like