src: |
  SELECT p_vidhosp.rss_id,
      p_vidhosp.matricule_assure,
      p_vidhosp.cle_matricule_assure,
      p_vidhosp.date_naissance,
      p_vidhosp.sexe,
      p_vidhosp.no_sejour_administratif,
      p_vidhosp.code_pec_fj_id,
      t_pec_fj.code AS code_pec_fj_code,
      t_pec_fj.texte AS code_pec_fj_texte,
      p_vidhosp.type_contrat_oc_id,
      t_type_contrat_oc.code AS type_contrat_oc_code,
      t_type_contrat_oc.texte AS type_contrat_oc_texte,
      p_vidhosp.code_pec,
      p_vidhosp.facturation_18euros,
      p_vidhosp.nombre_venues,
      p_vidhosp.montant_tm,
      p_vidhosp.montant_fj,
      p_vidhosp.montant_remboursable_amo,
      p_vidhosp.montant_parcours_soins,
      p_vidhosp.base_remboursement,
      p_vidhosp.taux_remboursement,
      p_vidhosp.no_rsa,
      p_vidhosp.cmu,
      p_vidhosp.motif_non_facturation_id,
      t_motif_non_facturation.code AS motif_non_facturation_code,
      t_motif_non_facturation.texte AS motif_non_facturation_texte,
      p_vidhosp.hospit_nouveau_ne,
      p_vidhosp.prelevement_organe,
      p_vidhosp.montant_remboursable_amc,
      p_vidhosp.regime_id,
      t_grands_regimes.code AS regime_code,
      t_grands_regimes.texte AS regime_texte,
      p_vidhosp.exoneration_tm_id,
      t_exoneration_tm.code AS exoneration_tm_code,
      t_exoneration_tm.texte AS exoneration_tm_texte,
      p_vidhosp.nature_pec_id,
      t_nature_assurance.code AS nature_pec_code,
      t_nature_assurance.texte AS nature_pec_texte,
      p_vidhosp.code_pec_id,
      t_pec.code AS code_pec_code,
      t_pec.texte AS code_pec_texte,
      p_vidhosp.code_participation_assure,
      p_vidhosp.rang_naissance,
      p_vidhosp.rang_beneficiaire,
      p_vidhosp.no_entree,
      p_vidhosp.no_caisse_gestionnaire,
      p_vidhosp.no_centre_gestionnaire,
      p_vidhosp.code_gestion,
      p_vidhosp.taux_remboursement_utilise,
      p_vidhosp.code_pec_fj_utilise
     FROM pmsi.p_vidhosp
       JOIN base.t_grands_regimes ON t_grands_regimes.oid = p_vidhosp.regime_id
       JOIN base.t_nature_assurance ON t_nature_assurance.oid = p_vidhosp.nature_pec_id
       JOIN base.t_exoneration_tm ON t_exoneration_tm.oid = p_vidhosp.exoneration_tm_id
       JOIN base.t_pec ON t_pec.oid = p_vidhosp.code_pec_id
       JOIN base.t_pec_fj ON t_pec_fj.oid = p_vidhosp.code_pec_fj_id
       JOIN base.t_type_contrat_oc ON t_type_contrat_oc.oid = p_vidhosp.type_contrat_oc_id
       JOIN base.t_motif_non_facturation ON t_motif_non_facturation.oid = p_vidhosp.motif_non_facturation_id;