export function createFormation(raw) { var taux = 0 var latitude = null var longitude = null if (raw.voe_tot && raw.voe_tot > 0) { taux = Math.round((raw.acc_tot / raw.voe_tot) * 100) } if (raw.g_olocalisation_des_formations) { latitude = raw.g_olocalisation_des_formations.lat longitude = raw.g_olocalisation_des_formations.lon } return { id: raw.cod_uai + "-" + raw.lib_for_voe_ins, nom: raw.lib_for_voe_ins, etablissement: raw.g_ea_lib_vx, ville: raw.ville_etab, departement: raw.dep, departementLib: raw.dep_lib, region: raw.region_etab_aff, academie: raw.acad_mies, contrat: raw.contrat_etab, filiere: raw.fili, selectivite: raw.select_form, capacite: raw.capa_fin, candidats: raw.voe_tot, admis: raw.acc_tot, tauxAcces: taux, latitude: latitude, longitude: longitude, pctFemmes: raw.pct_f, pctBoursiers: raw.pct_bours, pctNeoBac: raw.pct_neobac, pctGeneral: raw.pct_bg, pctTechno: raw.pct_bt, pctPro: raw.pct_bp, pctSansMention: raw.pct_sansmention, pctAB: raw.pct_ab, pctB: raw.pct_b, pctTB: raw.pct_tb, pctTBF: raw.pct_tbf, pctDebutPhase: raw.pct_acc_debutpp, pctDateBac: raw.pct_acc_datebac, pctFinPhase: raw.pct_acc_finpp, admisDebutPhase: raw.acc_debutpp, admisDateBac: raw.acc_datebac, admisFinPhase: raw.acc_finpp, // phase principale voePPGeneral: raw.nb_voe_pp_bg, voePPTechno: raw.nb_voe_pp_bt, voePPPro: raw.nb_voe_pp_bp, voePPAutres: raw.nb_voe_pp_at, voePPTotal: raw.nb_voe_pp, classesPPGeneral: raw.nb_cla_pp_bg, classesPPTechno: raw.nb_cla_pp_bt, classesPPPro: raw.nb_cla_pp_bp, classesPPAutres: raw.nb_cla_pp_at, classesPPTotal: raw.nb_cla_pp, propositionsPPGeneral: raw.prop_tot_bg, propositionsPPTechno: raw.prop_tot_bt, propositionsPPPro: raw.prop_tot_bp, propositionsPPAutres: raw.prop_tot_at, propositionsPPTotal: raw.prop_tot, acceptesPPGeneral: raw.acc_bg, acceptesPPTechno: raw.acc_bt, acceptesPPPro: raw.acc_bp, acceptesPPAutres: raw.acc_at, acceptesPPTotal: raw.acc_pp, // phase complémentaire voePCGeneral: raw.nb_voe_pc_bg, voePCTechno: raw.nb_voe_pc_bt, voePCPro: raw.nb_voe_pc_bp, voePCAutres: raw.nb_voe_pc_at, voePCTotal: raw.nb_voe_pc, classesPCTotal: raw.nb_cla_pc, acceptesPCTotal: raw.acc_pc } }