src: |
  ( SELECT DISTINCT t_specialites_medecin.oid,
      (t_specialites_medecin.code::text || ' '::text) || t_specialites_medecin.texte::text AS texte,
      '1'::text AS level,
      'specialite'::text AS level_name,
      t_specialites_medecin.code AS tri1,
      ''::text AS tri2
     FROM pmsi.t_specialites_medecin,
      pmsi.t_medecins
    WHERE t_medecins.specialite_id = t_specialites_medecin.oid AND (t_medecins.oid IN ( SELECT DISTINCT p_rss.medecin_rss_id
             FROM pmsi.p_rss
            ORDER BY p_rss.medecin_rss_id))
    ORDER BY t_specialites_medecin.oid, ((t_specialites_medecin.code::text || ' '::text) || t_specialites_medecin.texte::text), '1'::text, 'specialite'::text, t_specialites_medecin.code, ''::text)
  UNION
  ( SELECT DISTINCT t_medecins.oid,
      ((((t_medecins.nom || ' '::text) || t_medecins.prenom) || ' ('::text) || t_medecins.code) || ')'::text AS texte,
      '2'::text AS level,
      'medecin'::text AS level_name,
      t_specialites_medecin.code AS tri1,
      t_medecins.nom AS tri2
     FROM pmsi.t_medecins,
      pmsi.t_specialites_medecin
    WHERE t_medecins.specialite_id = t_specialites_medecin.oid AND (t_medecins.oid IN ( SELECT DISTINCT p_rss.medecin_rss_id
             FROM pmsi.p_rss
            ORDER BY p_rss.medecin_rss_id))
    ORDER BY t_medecins.oid, (((((t_medecins.nom || ' '::text) || t_medecins.prenom) || ' ('::text) || t_medecins.code) || ')'::text), '2'::text, 'medecin'::text, t_specialites_medecin.code, t_medecins.nom)
    ORDER BY 5, 6;