 FROM gn_synthese.synthese s
 LEFT JOIN taxonomie.taxref t ON s.cd_nom=t.cd_nom
 LEFT JOIN gn_profiles.t_altitude_ranges tar ON s.altitude_min <= tar.alt_max_range AND s.altitude_max >= tar.alt_min_range
-CROSS JOIN gn_profiles.get_profiles_parameters(s.cd_nom) p
+CROSS JOIN gn_profiles.get_parameters(s.cd_nom) p
 WHERE p.temporal_precision_days IS NOT NULL 
 	AND p.spatial_precision  IS NOT NULL
 	AND p.active_life_stage IS NOT NULL
 	AND DATE_part('day', s.date_max-s.date_min)<p.temporal_precision_days
     AND ST_MaxDistance(ST_centroid(s.the_geom_local), s.the_geom_local)<p.spatial_precision 
-    AND s.id_nomenclature_valid_status IN (SELECT regexp_split_to_table(profiles_parameter_value, ',')::integer FROM gn_profiles.t_profiles_parameters WHERE profiles_parameter_name='id_valid_status_for_profiles')
+    AND s.id_nomenclature_valid_status IN (SELECT regexp_split_to_table(profiles_parameter_value, ',')::integer FROM gn_profiles.t_parameters WHERE profiles_parameter_name='id_valid_status_for_profiles')
     AND s.altitude_min IS NOT NULL
     AND s.altitude_max IS NOT NULL
 GROUP BY t.cd_ref, period, CASE WHEN p.active_life_stage=true THEN s.id_nomenclature_life_stage ELSE NULL END ,id_altitude_range;

			FROM gn_synthese.synthese s
			LEFT JOIN taxonomie.taxref t ON s.cd_nom=t.cd_nom
			LEFT JOIN gn_profiles.t_altitude_ranges tar ON s.altitude_min <= tar.alt_max_range AND s.altitude_max >= tar.alt_min_range
			CROSS JOIN gn_profiles.get_profiles_parameters(s.cd_nom) p
			WHERE s.id_synthese=myidsynthese
				AND p.temporal_precision_days IS NOT NULL 
				AND p.spatial_precision  IS NOT NULL

	AND (ctp.id_nomenclature_life_stage=myphenology.id_nomenclature_life_stage OR (ctp.id_nomenclature_life_stage IS NULL AND myphenology.id_nomenclature_life_stage IS NULL))
	AND ctp.id_altitude_range=myphenology.id_altitude_range);

	IF valid_count>=(SELECT profiles_parameter_value::integer FROM gn_profiles.t_parameters WHERE profiles_parameter_name='min_occurrence_check_profile_phenology')
	THEN 
		RETURN true;
	ELSE 
