src: |
  SELECT 
    t_ghm.code AS ghm_code,
    t_ghm.texte AS ghm_texte,
    t_ghm_racines.code AS ghm_racine_code,
    t_ghm_racines.texte AS ghm_racine_texte,
    aso,
    cmd_id,
    t_cmd.texte AS cmd_texte,
    cas_id,
    t_cas.texte AS cas_texte,
    da_code,
    t_ghm_da.texte AS da_texte,
    gp_code,
    t_ghm_gp.texte AS gp_texte,
    ga_code,
    t_ghm_ga.texte AS ga_texte,
    da_gp_code,
    da_gp_ga_code,
    t_ghm_regroupements.annee_pmsi
  FROM pmsi.t_ghm_regroupements
  JOIN pmsi.t_ghm ON ghm_code = t_ghm.code
  JOIN pmsi.t_ghm_racines ON t_ghm_racines.code = LEFT(t_ghm.code, 5)
  JOIN pmsi.t_ghm_da ON da_code = t_ghm_da.code
  JOIN pmsi.t_ghm_gp ON gp_code = t_ghm_gp.code
  JOIN pmsi.t_ghm_ga ON gp_code = t_ghm_ga.code
  JOIN pmsi.t_cmd ON cmd_id = t_cmd.oid
  JOIN base.t_cas ON cas_id = t_cas.oid
