dep:
  - v_ages_jours_1
src: |
  SELECT p_rss.oid AS rss_id,
      COALESCE(p_rsa.age_jours, '-1'::integer::numeric) AS age_jours,
      COALESCE(v_ages_jours_1.oid, '-1'::integer) AS age_jours_id,
      COALESCE(v_ages_jours_1.code, chr(1) || '**'::text) AS age_jours_code,
      COALESCE(v_ages_jours_1.texte, 'Non renseigné'::text) AS age_jours_texte,
      p_rsa.top_uhcd
     FROM pmsi.p_rss
       LEFT JOIN pmsi.p_rsa ON p_rsa.rss_id = p_rss.oid
       LEFT JOIN pmsi.v_ages_jours_1 ON v_ages_jours_1.oid::numeric = p_rsa.age_jours;