<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="ACTI000072" label="Activité. Analyse croisée occupation" title="= SELECT.DATA_LABEL + ' ' + SELECT.REAPRE2 + ' par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" database="iCTI" swf="*CTI_view1" softCode="iCTI_activite" globals="ACTI_globals.XML" componentsFile="ACTI_components.XML" 
        helpFile="iCTI_ACTI_ACTI000123.HTML"
        helpDokuWIkiDir="activite:occupation_sejours" 
        helpDokuWIkiFile="acti000123" 
>
	<VIEWPROPERTIES componentName="PROPERTIES_OCCUPATION"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
		<PROPERTY name="REAPRE_SELECT">
			<value><![CDATA[
						[EVAL 
							if ('[REAPRE]' == '1') {return "";}
							if ('[REAPRE]' == '2') {return " AND est_mouvement_previsionnel = '1'";}
							return " AND est_mouvement_previsionnel <> '1'";
						EVAL]
					]]></value>
		</PROPERTY>
		<PROPERTY name="DATA_SELECT">
			<value><![CDATA[[EVAL 
								switch ('[DATA]') {
								case 'NED':
									return 'AND nb_entrees_directes > 0';
									break;
								case 'NEM':
									return 'AND (nb_entrees_directes > 0 OR nb_entrees_mutation_[VIEW.MUTATION_FIELD] > 0)';
									break;
								case 'NSD':
									return 'AND nb_sorties_directes > 0';
									break;
								case 'NSM':
									return 'AND (nb_sorties_directes > 0 OR nb_sorties_mutation_[VIEW.MUTATION_FIELD] > 0)';
									break;
								case 'NJN':
									return 'AND [VIEW.JOURNEES_FIELD] > 0';
									break;
								case 'NJNS':
									return 'AND nb_jour_sejour_sorti > 0';
									break;
								case 'NEX':
									return 'AND nb_externes > 0';
									break;
								case 'NAM':
									return 'AND nb_ambulatoires > 0';
									break;
								case 'NEDA':
									return 'AND (nb_entrees_directes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NSDA':
									return 'AND (nb_sorties_directes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NEDXA':
									return 'AND (nb_entrees_directes > 0 OR nb_externes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NSDXA':
									return 'AND (nb_sorties_directes > 0 OR nb_externes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NSDXBB':
									return 'AND (nb_sorties_directes > 0 OR nb_bebes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NJNXA':
									return 'AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_externes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'NEDXAS':
									return 'AND (nb_entrees_directes > 0 OR nb_externes > 0 OR nb_ambulatoires > 0 OR nb_seances > 0)';
									break;
								case 'NSDXAS':
									return 'AND (nb_sorties_directes > 0 OR nb_externes > 0 OR nb_ambulatoires > 0 OR nb_seances > 0)';
									break;
								case 'NSDXASSH':
									return "AND (nb_sorties_directes > 0 OR nb_externes > 0 OR nb_ambulatoires > 0 OR CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END > 0)";
									break;
								case 'NJNXAS':
									return 'AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_externes > 0 OR nb_ambulatoires > 0 OR nb_seances > 0)';
									break;
								case 'NSE':
									return "AND nb_seances > 0";
									break;
								case 'NSEDIA':
									return "AND nb_seances_dialyse > 0";
									break;
								case 'NSECHM':
									return "AND nb_seances_chimio > 0";
									break;
								case 'NSEDIV':
									return "AND nb_seances_autre > 0";
									break;
								case 'NBB':
									return "AND nb_bebes > 0";
									break;
                                case 'NBP':
									return "AND no_patient > 0";
									break;
								case 'NCP':
									return "AND [VIEW.CP_FIELD] > 0";
									break;
								case 'NJO':
									return "";
									break;
								case 'NJNM':
									return 'AND [VIEW.JOURNEES_FIELD] > 0';
									break;
								case 'NEXM':
									return 'AND nb_externes > 0';
									break;
								case 'NAMM':
									return 'AND nb_ambulatoires > 0';
									break;
								case 'NSEM':
									return "AND nb_seances > 0";
									break;
								case 'NJNXAM':
									return 'AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_externes > 0 OR nb_ambulatoires > 0)';
									break;
								case 'TAU':
									return 'AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_ambulatoires > 0 OR nb_seances_dans_taux > 0 )';
									break;
								case 'NSHP':
									return "AND v_sejours_1.date_sortie > '[TOPERIODE]' AND v_sejours_1.code_sorti = 1";
									break;
								case 'NJNAS':
									return 'AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_ambulatoires > 0 OR nb_seances > 0)';
									break;
								case 'NSFAC':
									return "AND v_mouvements_sejour_2.est_facture = '1'";
									break;
								case 'NSNFAC':
									return "AND v_mouvements_sejour_2.est_facture = '0'";
									break;
								case 'JRNSORFAC':
									return "AND v_mouvements_sejour_2.est_facture = '1' AND [VIEW.JOURNEES_FIELD] > 0";
									break;
								case 'JRNSORHONFAC':
									return "AND v_mouvements_sejour_2.est_facture = '1' AND ([VIEW.JOURNEES_FIELD] > 0 OR nb_ambulatoires > 0 OR nb_seances > 0)";
									break;
								case 'URG':
									return "AND nb_urgences > 0";
									break;
								case 'EMC':
									return 'AND equivalent_malade_complet > 0';
									break;
								default:
									return '';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="CDATA">
			<value><![CDATA[[EVAL 
								switch ('[DATA]') {
								case 'NED':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_entrees_directes ELSE null END)';
									break;
								case 'NEM':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_entrees_directes + nb_entrees_mutation_[VIEW.MUTATION_FIELD] ELSE null END)';
									break;
								case 'NSD':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes ELSE null END)';
									break;
								case 'NSM':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_sorties_mutation_[VIEW.MUTATION_FIELD] ELSE null END)';
									break;
								case 'NJN':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] ELSE null END)';
									break;
								case 'NJNS':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_jour_sejour_sorti ELSE null END)';
									break;
								case 'NEX':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_externes ELSE null END)';
									break;
								case 'NAM':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_ambulatoires ELSE null END)';
									break;
								case 'NEDA':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_entrees_directes + nb_ambulatoires ELSE null END)';
									break;
								case 'NSDA':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_ambulatoires ELSE null END)';
									break;
								case 'NEDXA':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_entrees_directes + nb_externes + nb_ambulatoires ELSE null END)';
									break;
								case 'NSDXA':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_externes + nb_ambulatoires ELSE null END)';
									break;
								case 'NSDXBB':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_bebes + nb_ambulatoires ELSE null END)';
									break;
								case 'NJNXA':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires ELSE null END)';
									break;
								case 'NEDXAS':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_entrees_directes + nb_externes + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE null END)";
									break;
								case 'NSDXAS':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_externes + nb_ambulatoires + nb_seances_dans_taux ELSE null END)';
									break;
								case 'NSDXASSH':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes + nb_externes + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE null END)";
									break;	
								case 'NJNXAS':
									return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires + nb_seances_dans_taux ELSE null END)';
									break;
								case 'NSE':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_seances ELSE null END)";
									break;
								case 'NBB':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_bebes ELSE null END)";
									break;
                                case 'NBP':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN no_patient ELSE null END)";
									break;
								case 'NCP':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.CP_FIELD] ELSE null END)";
									break;
								case 'NJO':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN date ELSE null END)";
									break;
								case 'NJNM':
										return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] ELSE null END), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NEXM':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_externes ELSE null END), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NAMM':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_ambulatoires ELSE null END), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NSEM':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_seances ELSE null END), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NJNXAM':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires ELSE null END), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'TAU':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux ELSE null END)";
									break;
								case 'NSHP':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN v_sejours_1.date_sortie > '[TOPERIODE]' AND v_sejours_1.code_sorti = 1 THEN v_sejours_1.no_sejour ELSE null END ELSE null END)";
									break;
								case 'NJNAS':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux ELSE null END)";
									break;
								case 'NAD':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND v_sejours_1.date_entree BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NADPRE':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND v_sejours_1.date_entree < '[PERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NSEJ':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NNONSOR':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND code_sorti = 0 THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NFULL':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND v_sejours_1.date_entree BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_sejours_1.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NSFAC':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND date_sortie <= '[TOPERIODE]'::date AND code_sorti = '1' AND v_mouvements_sejour_2.est_facture = '1' THEN v_sejours_1.no_sejour ELSE NULL END)";
									break;
								case 'NSNFAC':
									return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND date_sortie <= '[TOPERIODE]'::date AND code_sorti = '1' AND v_mouvements_sejour_2.est_facture = '0' THEN v_sejours_1.no_sejour ELSE NULL END)";
									break;
								case 'JRNSORFAC':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE AND date_sortie <= '[TOPERIODE]' AND v_mouvements_sejour_2.est_facture = '1' THEN [VIEW.JOURNEES_FIELD] ELSE null END)";
									break;
								case 'JRNSORHONFAC':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE AND date_sortie <= '[TOPERIODE]' AND v_mouvements_sejour_2.est_facture = '1' THEN [VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux ELSE null END)";
									break;
								case 'DMSHES':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE AND type_sejour = '1' AND nb_sorties_directes = 1 THEN duree ELSE 0 END), SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_sorties_directes ELSE null END))";
									break;
								case 'DMSHON':
									return "base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN type_sejour = '1' AND nb_sorties_directes = 1 THEN duree WHEN type_sejour = '2' THEN nb_ambulatoires WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END), SUM(CASE WHEN COLUMNCHECKSEQUENCE AND v_sejours_1.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND nb_sorties_directes + nb_ambulatoires + nb_seances_dans_taux > 0 THEN 1 ELSE 0 END))";
									break;
								case 'URG':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_urgences ELSE 0 END)";
									break;
								case 'EMC':
									return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN equivalent_malade_complet ELSE 0 END)";
									break;
                                case 'GMP':
									return "base.cti_division(
                                        SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN gir_gmp_base*gir_gmp_coefficient ELSE 0 END),
                                        SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN gir_gmp_base ELSE 0 END)
                                        )";
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="TDATA">
			<value><![CDATA[[EVAL 
								switch ('[DATA]') {
								case 'NED':
									return 'SUM(nb_entrees_directes)';
									break;
								case 'NEM':
									return 'SUM(nb_entrees_directes + nb_entrees_mutation_[VIEW.MUTATION_FIELD])';
									break;
								case 'NSD':
									return 'SUM(nb_sorties_directes)';
									break;
								case 'NSM':
									return 'SUM(nb_sorties_directes + nb_sorties_mutation_[VIEW.MUTATION_FIELD])';
									break;
								case 'NJN':
									return 'SUM([VIEW.JOURNEES_FIELD])';
									break;
								case 'NJNS':
									return 'SUM(nb_jour_sejour_sorti)';
									break;
								case 'NEX':
									return 'SUM(nb_externes)';
									break;
								case 'NAM':
									return 'SUM(nb_ambulatoires)';
									break;
								case 'NEDA':
									return 'SUM(nb_entrees_directes + nb_ambulatoires)';
									break;
								case 'NSDA':
									return 'SUM(nb_sorties_directes + nb_ambulatoires)';
									break;
								case 'NEDXA':
									return 'SUM(nb_entrees_directes + nb_externes + nb_ambulatoires)';
									break;
								case 'NSDXA':
									return 'SUM(nb_sorties_directes + nb_externes + nb_ambulatoires)';
									break;
								case 'NSDXBB':
									return 'SUM(nb_sorties_directes + nb_bebes + nb_ambulatoires)';
									break;
								case 'NJNXA':
									return 'SUM([VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires)';
									break;
								case 'NEDXAS':
									return "SUM(nb_entrees_directes + nb_externes + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END)";
									break;
								case 'NSDXAS':
									return 'SUM(nb_sorties_directes + nb_externes + nb_ambulatoires + nb_seances_dans_taux)';
									break;
								case 'NSDXASSH':
									return "SUM(nb_sorties_directes + nb_externes + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END)";
									break;	
								case 'NJNXAS':
									return 'SUM([VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires + nb_seances_dans_taux)';
									break;
								case 'NSE':
									return "SUM(nb_seances)";
									break;
								case 'NSEDIA':
									return "SUM(nb_seances_dialyse)";
									break;
								case 'NSECHM':
									return "SUM(nb_seances_chimio)";
									break;
								case 'NSEDIV':
									return "SUM(nb_seances_autre)";
									break;
								case 'NBB':
									return "SUM(nb_bebes)";
									break;
                                case 'NBP':
									return "COUNT(DISTINCT no_patient)";
									break;
								case 'NCP':
									return "SUM([VIEW.CP_FIELD])";
									break;
								case 'NJO':
									return "COUNT(DISTINCT date)";
									break;
								case 'NJNM':
										return "base.cti_division(SUM([VIEW.JOURNEES_FIELD]), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NEXM':
										return "base.cti_division(SUM(nb_externes), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NAMM':
										return "base.cti_division(SUM(nb_ambulatoires), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NSEM':
										return "base.cti_division(SUM(nb_seances), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'NJNXAM':
										return "base.cti_division(SUM([VIEW.JOURNEES_FIELD] + nb_externes + nb_ambulatoires), MAX(date(date)) - MIN(date(date)) + 1)";
									break;
								case 'TAU':
									return "SUM([VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux)";
									break;
								case 'NSHP':
									return "COUNT(DISTINCT CASE WHEN v_sejours_1.date_sortie > '[TOPERIODE]' AND v_sejours_1.code_sorti = 1 THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NJNAS':
									return "SUM([VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux)";
									break;
								case 'NAD':
									return "COUNT(DISTINCT CASE WHEN v_sejours_1.date_entree BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NADPRE':
									return "COUNT(DISTINCT CASE WHEN v_sejours_1.date_entree < '[PERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NSEJ':
									return "COUNT(DISTINCT v_sejours_1.no_sejour)";
									break;
								case 'NNONSOR':
									return "COUNT(DISTINCT CASE WHEN code_sorti = 0 THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NFULL':
									return "COUNT(DISTINCT CASE WHEN v_sejours_1.date_entree BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_sejours_1.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN v_sejours_1.no_sejour ELSE null END)";
									break;
								case 'NSFAC':
									return "COUNT(DISTINCT CASE WHEN date_sortie <= '[TOPERIODE]'::date AND code_sorti = '1' AND v_mouvements_sejour_2.est_facture = '1' THEN v_sejours_1.no_sejour ELSE NULL END)";
									break;
								case 'NSNFAC':
									return "COUNT(DISTINCT CASE WHEN date_sortie <= '[TOPERIODE]'::date AND code_sorti = '1' AND v_mouvements_sejour_2.est_facture = '0' THEN v_sejours_1.no_sejour ELSE NULL END)";
									break;
								case 'JRNSORFAC':
									return "SUM(CASE WHEN date_sortie <= '[TOPERIODE]' AND v_mouvements_sejour_2.est_facture = '1' THEN [VIEW.JOURNEES_FIELD] ELSE null END)";
									break;
								case 'JRNSORHONFAC':
									return "SUM(CASE WHEN date_sortie <= '[TOPERIODE]' AND v_mouvements_sejour_2.est_facture = '1' THEN [VIEW.JOURNEES_FIELD] + nb_ambulatoires + nb_seances_dans_taux ELSE null END)";
									break;
								case 'DMSHES':
									return "base.cti_division(SUM(CASE WHEN type_sejour = '1' AND nb_sorties_directes = 1 THEN duree ELSE 0 END), SUM(nb_sorties_directes))";
									break;
								case 'DMSHON':
									return "base.cti_division(SUM(CASE WHEN type_sejour = '1' AND nb_sorties_directes = 1 THEN duree WHEN type_sejour = '2' THEN nb_ambulatoires WHEN type_sejour = '5' THEN nb_seances ELSE 0 END), SUM(CASE WHEN v_sejours_1.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND nb_sorties_directes + nb_ambulatoires + nb_seances_dans_taux > 0 THEN 1 ELSE 0 END))";
									break;
								case 'URG':
									return "SUM(nb_urgences)";
									break;
								case 'EMC':
									return "SUM(equivalent_malade_complet)";
									break;
                                case 'GMP':
									return "base.cti_division(
                                        SUM(gir_gmp_base*gir_gmp_coefficient),
                                        SUM(gir_gmp_base)
                                        )";
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="ORDERBY">
			<value><![CDATA[[EVAL 
					
					$groupbys = array(
										'[GROUPBY]', 
										'[GROUPBY_2]', 
										'[GROUPBY_3]',
										substr('[GROUBY]', 0, 6), 
										substr('[GROUBY_2]', 0, 6), 
										substr('[GROUBY_3]', 0, 6)
									);
					$exceptions = array('ANNEE', 'TRIM', 'MOIS', 'JOUR', 'NUMEROTRIM', 'NUMEROMOIS', 'NUMEROJOUR');
					
					$result = array_intersect($groupbys, $exceptions);
					
					if (count($result) > 0) {
						return "DEFAULT";
					}
					else {
						return "indicateurs[2]";
					}
					
			EVAL]]]></value>
		</PROPERTY>
		
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP>
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
            <FIELD name="PERIODE" label="Période" UI="combo" tree="true" width="300" default="2009-01-01" globalListProvider="DATE_DEBUT" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2009-01-31" globalListProvider="DATE_FIN" >
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" width="300" default="SER" tree="true">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY_2" label="" UI="combo" width="300" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1"/>
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY_3" label="" UI="combo" width="300" default="-1" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="LGROUPBY" label="Regroupement" UI="combo" default="-1" width="200" tree="true" visible="false">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
			<FIELD name="LGROUPBY_2" label="Regroupement" UI="combo" default="-1" width="200" tree="true" visible="false">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>				
			<FIELD name="LGROUPBY_3" label="Regroupement" UI="combo" default="-1" width="200" tree="true" visible="false">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>				
		</GROUP>
		<GROUP>
			<FIELD name="COLUMNBY" label="Colonnes" UI="combo" width="300" default="ETA" tree="true">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
			<FIELD name="COLUMNBYCOUNT" label="Nombre" UI="combo" default="10" tree="false">
				<OPTION label="5" data="5"/>
				<OPTION label="6" data="6"/>
				<OPTION label="7" data="7"/>
				<OPTION label="8" data="8"/>
				<OPTION label="9" data="9"/>
				<OPTION label="10" data="10"/>
				<OPTION label="11" data="11"/>
				<OPTION label="12" data="12"/>
				<OPTION label="13" data="13"/>
				<OPTION label="14" data="14"/>
				<OPTION label="15" data="15"/>
				<OPTION label="16" data="16"/>
				<OPTION label="17" data="17"/>
				<OPTION label="18" data="18"/>
				<OPTION label="19" data="19"/>
				<OPTION label="20" data="20"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA" label="Données" UI="combo" width="300" default="NED" default2="0" tree="true">
				<OPTION label="Options" data="" globalListProvider="DATA_OCCUPATION" />
			</FIELD>
			<FIELD name="REAPRE" label="" UI="combo" default="0" visible="= ENV.OPTADM_PREVUS == '1'" showIfNotDefault="true">
				<OPTION data="0" label="Prévus exclus" data2=""/>
				<OPTION data="1" label="Prévus inclus" data2="(Réalisation et Prévisions)"/>
				<OPTION data="2" label="Uniquement prévus" data2="(Prévisions)"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	
	<SELECTIONS componentName="DAYS_SELECTIONS" />
	
	<SELECTIONS label="Modes de calcul" displayText="= var display:String = '';
						display = display + 'Modes de calcul : #B#' + SELECT.QPLACES_LABEL + '. ' + VIEW.OPTADM_DAYOUT + '. ' + SELECT.QJMUT_LABEL  + '#/B#';
						return display;
						">
		<GROUP label="Modes">
			<FIELD name="QPLACES" label="" width="200" UI="combo" default="OUV">
				<OPTION data="OUV" label="Lits et box ouverts"/>
				<OPTION data="THEO" label="Lits et box théoriques"/>
			</FIELD>
			<FIELD name="QJMUT" label="" UI="combo" default="f">
				<OPTION data="d" label="Si mutation, journée affectée à la premiere localisation"/>
				<OPTION data="f" label="Si mutation, journée affectée à la dernière localisation"/>
				<OPTION data="12" label="Si mutation, journée affectée à la localisation occupée à 12h"/>
				<OPTION data="prorata" label="Si mutation, journée affectée au prorata du temps passé"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_OCCUPATION_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_MOUVEMENTS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PATIENTS_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_PASSAGES_SELECTIONS" />

	<QUERIES>
		<QUERY label="">
			<SQL>
				<select><![CDATA[	
					CTIPREPAR_TREE
						WORKTABLE{acti000072_places}
						GROUPBY1{[VIEW.GROUPBY_PLACES_OID_FIELD],, [VIEW.GROUPBY_PLACES_COD_FIELD],, [VIEW.GROUPBY_PLACES_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_PLACES_OID_FIELD],, [VIEW.GROUPBY_2_PLACES_COD_FIELD],, [VIEW.GROUPBY_2_PLACES_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_PLACES_OID_FIELD],, [VIEW.GROUPBY_3_PLACES_COD_FIELD],, [VIEW.GROUPBY_3_PLACES_TXT_FIELD]}
					INDICATORS{
						SUM(CASE WHEN date = '[TOPERIODE]' THEN v_places_1.nb_lits_theoriques ELSE 0 END),,
					}
					FROM activite.v_places_1
					WHERE 
						date BETWEEN '[VIEW.PERIODE]' AND '[VIEW.TOPERIODE]'
						[VIEW.ETAGE_PLACES_SELECT]
						
				]]></select>
			</SQL>
			
			<SQL>
				<select><![CDATA[
			
					CTIPREPAR_TREE
						WORKTABLE{acti000072_places_mois}
						GROUPBY1{[VIEW.GROUPBY_PLACES_OID_FIELD],, [VIEW.GROUPBY_PLACES_COD_FIELD],, [VIEW.GROUPBY_PLACES_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_PLACES_OID_FIELD],, [VIEW.GROUPBY_2_PLACES_COD_FIELD],, [VIEW.GROUPBY_2_PLACES_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_PLACES_OID_FIELD],, [VIEW.GROUPBY_3_PLACES_COD_FIELD],, [VIEW.GROUPBY_3_PLACES_TXT_FIELD]}
						COLUMNBYOID{[VIEW.COLUMNBY_PLACES_OID_FIELD],, [VIEW.COLUMNBY_PLACES_COD_FIELD] ,, [VIEW.COLUMNBY_PLACES_TXT_FIELD],, 1 ,, 20}
					INDICATORS{
						0,,
						SUM(CASE WHEN v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE 0 END)
					}
					INDICATORS_COLUMNS{
						SUM(CASE WHEN COLUMNCHECKSEQUENCE AND v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE 0 END)
						}
					FROM activite.v_places_1
					WHERE 
						date BETWEEN '[VIEW.PERIODE]' AND '[VIEW.TOPERIODE]'
						[VIEW.ETAGE_PLACES_SELECT]
				]]></select>
			</SQL>
			
			<SQL optimizer="V_SEJOURS_X" optimizer2="V_MOUVEMENTS_SEJOUR_X">
				<select><![CDATA[		

					CTISELECT_TREE
						WORKTABLE{acti000072}
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						COLUMNBYOID{[VIEW.COLUMNBY_OID_FIELD],, [VIEW.COLUMNBY_COD_FIELD] ,, [VIEW.COLUMNBY_TXT_FIELD],, [VIEW.TDATA] ,, [COLUMNBYCOUNT]}
						SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						INDICATORS{
							0,
							[VIEW.TDATA],}	
						INDICATORS_COLUMNS{[VIEW.CDATA], }
						ORDERBY{[VIEW.ORDERBY],, DESC}
					FROM #V_SEJOURS_X#, #V_MOUVEMENTS_SEJOUR_X#
					WHERE 
						date BETWEEN '[VIEW.PERIODE]' AND '[VIEW.TOPERIODE]'
						AND v_mouvements_sejour_2.no_sejour = v_sejours_1.no_sejour      
						[VIEW.SEJOURS_SELECT] [VIEW.PATIENTS_SELECT]
						[VIEW.MOUVEMENTS_SELECT] [VIEW.REAPRE_SELECT]
						[VIEW.DATA_SELECT] [VIEW.JOURS_SELECT] [VIEW.PASSAGES_SELECT]
						AND v_sejours_1.type_sejour <> '9'
					AFTER{
					
						UPDATE acti000072 SET 
							indicateurs[1] = acti000072_places.indicateurs[1]
						FROM acti000072_places
						WHERE 
							(acti000072_places.oidt = acti000072.oidt OR acti000072_places.oidt = -111) AND
							(acti000072_places.oid1 = acti000072.oid1 OR acti000072_places.oid1 = -111) AND
							(acti000072_places.oid2 = acti000072.oid2 OR acti000072_places.oid2 = -111)  AND
							(acti000072_places.oid3 = acti000072.oid3 OR acti000072_places.oid3 = -111)
							
						.,
							
						UPDATE acti000072 SET 
							indicateurs[2] = base.cti_division(acti000072.indicateurs[2] , acti000072_places_mois.indicateurs[2]) * 100
						FROM acti000072_places_mois
						WHERE 
							(acti000072_places_mois.oidt = acti000072.oidt OR acti000072_places_mois.oidt = -111) AND
							(acti000072_places_mois.oid1 = acti000072.oid1 OR acti000072_places_mois.oid1 = -111) AND
							(acti000072_places_mois.oid2 = acti000072.oid2 OR acti000072_places_mois.oid2 = -111) AND
							(acti000072_places_mois.oid3 = acti000072.oid3 OR acti000072_places_mois.oid3 = -111) AND
							'[DATA]' = 'TAU'
							
						.,

						UPDATE acti000072 SET 
							indicateurs[3] = base.cti_division(acti000072.indicateurs[3] , acti000072_places_mois.indicateurs[3]) * 100,
							indicateurs[4] = base.cti_division(acti000072.indicateurs[4] , acti000072_places_mois.indicateurs[4]) * 100,
							indicateurs[5] = base.cti_division(acti000072.indicateurs[5] , acti000072_places_mois.indicateurs[5]) * 100,
							indicateurs[6] = base.cti_division(acti000072.indicateurs[6] , acti000072_places_mois.indicateurs[6]) * 100,
							indicateurs[7] = base.cti_division(acti000072.indicateurs[7] , acti000072_places_mois.indicateurs[7]) * 100,
							indicateurs[8] = base.cti_division(acti000072.indicateurs[8] , acti000072_places_mois.indicateurs[8]) * 100,
							indicateurs[9] = base.cti_division(acti000072.indicateurs[9] , acti000072_places_mois.indicateurs[9]) * 100,
							indicateurs[10] = base.cti_division(acti000072.indicateurs[10] , acti000072_places_mois.indicateurs[10]) * 100,
							indicateurs[11] = base.cti_division(acti000072.indicateurs[11] , acti000072_places_mois.indicateurs[11]) * 100,
							indicateurs[12] = base.cti_division(acti000072.indicateurs[12] , acti000072_places_mois.indicateurs[12]) * 100,
							indicateurs[13] = base.cti_division(acti000072.indicateurs[13] , acti000072_places_mois.indicateurs[13]) * 100,
							indicateurs[14] = base.cti_division(acti000072.indicateurs[14] , acti000072_places_mois.indicateurs[14]) * 100,
							indicateurs[15] = base.cti_division(acti000072.indicateurs[15] , acti000072_places_mois.indicateurs[15]) * 100,
							indicateurs[16] = base.cti_division(acti000072.indicateurs[16] , acti000072_places_mois.indicateurs[16]) * 100,
							indicateurs[17] = base.cti_division(acti000072.indicateurs[17] , acti000072_places_mois.indicateurs[17]) * 100,
							indicateurs[18] = base.cti_division(acti000072.indicateurs[18] , acti000072_places_mois.indicateurs[18]) * 100,
							indicateurs[19] = base.cti_division(acti000072.indicateurs[19] , acti000072_places_mois.indicateurs[19]) * 100,
							indicateurs[20] = base.cti_division(acti000072.indicateurs[20] , acti000072_places_mois.indicateurs[20]) * 100,
							indicateurs[21] = base.cti_division(acti000072.indicateurs[21] , acti000072_places_mois.indicateurs[21]) * 100
						FROM acti000072_places_mois
						WHERE 
							(acti000072_places_mois.oidt = acti000072.oidt OR acti000072_places_mois.oidt = -111) AND
							(acti000072_places_mois.oid1 = acti000072.oid1 OR acti000072_places_mois.oid1 = -111) AND
							(acti000072_places_mois.oid2 = acti000072.oid2 OR acti000072_places_mois.oid2 = -111) AND
							(acti000072_places_mois.oid3 = acti000072.oid3 OR acti000072_places_mois.oid3 = -111) AND
							'[DATA]' = 'TAU' AND
							'[COLUMNBY]' = 'NUMEROMOIS'
						 .,
						
						UPDATE acti000072 SET 
							indicateurs[3] = base.cti_division(acti000072.indicateurs[3] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[4] = base.cti_division(acti000072.indicateurs[4] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[5] = base.cti_division(acti000072.indicateurs[5] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[6] = base.cti_division(acti000072.indicateurs[6] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[7] = base.cti_division(acti000072.indicateurs[7] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[8] = base.cti_division(acti000072.indicateurs[8] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[9] = base.cti_division(acti000072.indicateurs[9] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[10] = base.cti_division(acti000072.indicateurs[10] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[11] = base.cti_division(acti000072.indicateurs[11] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[12] = base.cti_division(acti000072.indicateurs[12] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[13] = base.cti_division(acti000072.indicateurs[13] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[14] = base.cti_division(acti000072.indicateurs[14] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[15] = base.cti_division(acti000072.indicateurs[15] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[16] = base.cti_division(acti000072.indicateurs[16] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[17] = base.cti_division(acti000072.indicateurs[17] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[18] = base.cti_division(acti000072.indicateurs[18] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[19] = base.cti_division(acti000072.indicateurs[19] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[20] = base.cti_division(acti000072.indicateurs[20] , acti000072_places_mois.indicateurs[2]) * 100,
							indicateurs[21] = base.cti_division(acti000072.indicateurs[21] , acti000072_places_mois.indicateurs[2]) * 100
						FROM acti000072_places_mois
						WHERE 
							(acti000072_places_mois.oidt = acti000072.oidt OR acti000072_places_mois.oidt = -111) AND
							(acti000072_places_mois.oid1 = acti000072.oid1 OR acti000072_places_mois.oid1 = -111) AND
							(acti000072_places_mois.oid2 = acti000072.oid2 OR acti000072_places_mois.oid2 = -111) AND
							(acti000072_places_mois.oid3 = acti000072.oid3 OR acti000072_places_mois.oid3 = -111) AND
							'[DATA]' = 'TAU' AND
							'[COLUMNBY]' <> 'NUMEROMOIS'
						}

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT"/>
					<FIELD name="LIT"/>
					<FIELD name="N"/>
					<FIELD name="N1"/>
					<FIELD name="N2"/>
					<FIELD name="N3"/>
					<FIELD name="N4"/>
					<FIELD name="N5"/>
					<FIELD name="N6"/>
					<FIELD name="N7"/>
					<FIELD name="N8"/>
					<FIELD name="N9"/>
					<FIELD name="N10"/>
					<FIELD name="N11"/>
					<FIELD name="N12"/>
					<FIELD name="N13"/>
					<FIELD name="N14"/>
					<FIELD name="N15"/>
					<FIELD name="N16"/>
					<FIELD name="N17"/>
					<FIELD name="N18"/>
					<FIELD name="N19"/>
					<FIELD name="N20"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL select="
				SELECT 'TOPERIODE', COALESCE(MAX(date),'[TOPERIODE]') 
				FROM activite.p_mouvements_sejour 
				WHERE date BETWEEN '[PERIODE]' AND '[TOPERIODE]' 
					[VIEW.REAPRE_SELECT]
				UNION 
				SELECT 'PERIODE', COALESCE(MIN(date),'[PERIODE]') 
				FROM activite.p_mouvements_sejour 
				WHERE date BETWEEN '[PERIODE]' AND '[TOPERIODE]' 
					[VIEW.REAPRE_SELECT]
				">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Liste des séjours" shortLabel="Liste séjours" view="ACTI000052.XML" componentName="OCC_BASE_VIEWLINK" component3Name="STANDARD_BASE_VIEWLINK">
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Tableau croisé" label="Tableau croisé" multiTab="true">
            <CHART title="" type="group" subType="h" percentHeight="100" fromTotal="false" visibleCondition="SELECT.GROUPBY == 'ANNEE' &amp;&amp; SELECT.COLUMNBY == 'NUMEROMOIS' &amp;&amp; SELECT.DATA != 'TAU'">			
                <CHART title="Comparatif (10 premiers)" type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="N" sortSeq="A"  condition="ROW.LVL == '1'">
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="N" displayName="SELECT.DATA_LABEL" displayNameCalc="true"/>
                </CHART>
                <CHART title="Evolution" type="lineChart" serieIsCategory="true" fromTotal="false" maxItems="5" maxItemsSortOn="N" sortField="N" sortSeq="D" condition="Number(ROW.LVL) == 1">
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="N1" displayName="VIEW.COLH1" displayNameCalc="true" visibleCondition="VIEW.COLH1 != null"/>
                    <SERIE field="N2" displayName="VIEW.COLH2" displayNameCalc="true" visibleCondition="VIEW.COLH2 != null"/>
                    <SERIE field="N3" displayName="VIEW.COLH3" displayNameCalc="true" visibleCondition="VIEW.COLH3 != null"/>
                    <SERIE field="N4" displayName="VIEW.COLH4" displayNameCalc="true" visibleCondition="VIEW.COLH4 != null"/>
                    <SERIE field="N5" displayName="VIEW.COLH5" displayNameCalc="true" visibleCondition="VIEW.COLH5 != null"/>
                    <SERIE field="N6" displayName="VIEW.COLH6" displayNameCalc="true" visibleCondition="VIEW.COLH6 != null"/>
                    <SERIE field="N7" displayName="VIEW.COLH7" displayNameCalc="true" visibleCondition="VIEW.COLH7 != null"/>
                    <SERIE field="N8" displayName="VIEW.COLH8" displayNameCalc="true" visibleCondition="VIEW.COLH8 != null"/>
                    <SERIE field="N9" displayName="VIEW.COLH9" displayNameCalc="true" visibleCondition="VIEW.COLH9 != null"/>
                    <SERIE field="N10" displayName="VIEW.COLH10" displayNameCalc="true" visibleCondition="VIEW.COLH10 != null"/>
                    <SERIE field="N11" displayName="VIEW.COLH11" displayNameCalc="true" visibleCondition="VIEW.COLH11 != null"/>
                    <SERIE field="N12" displayName="VIEW.COLH12" displayNameCalc="true" visibleCondition="VIEW.COLH12 != null"/>
                    <SERIE field="N13" displayName="VIEW.COLH13" displayNameCalc="true" visibleCondition="VIEW.COLH13 != null"/>
                    <SERIE field="N14" displayName="VIEW.COLH14" displayNameCalc="true" visibleCondition="VIEW.COLH14 != null"/>
                    <SERIE field="N15" displayName="VIEW.COLH15" displayNameCalc="true" visibleCondition="VIEW.COLH15 != null"/>
                    <SERIE field="N16" displayName="VIEW.COLH16" displayNameCalc="true" visibleCondition="VIEW.COLH16 != null"/>
                    <SERIE field="N17" displayName="VIEW.COLH17" displayNameCalc="true" visibleCondition="VIEW.COLH17 != null"/>
                    <SERIE field="N18" displayName="VIEW.COLH18" displayNameCalc="true" visibleCondition="VIEW.COLH18 != null"/>
                    <SERIE field="N19" displayName="VIEW.COLH19" displayNameCalc="true" visibleCondition="VIEW.COLH19 != null"/>
                    <SERIE field="N20" displayName="VIEW.COLH20" displayNameCalc="true" visibleCondition="VIEW.COLH20 != null"/>
                </CHART>
			</CHART>
            <CHART title="" type="group" subType="h" percentHeight="100" fromTotal="false" visibleCondition="(SELECT.GROUPBY != 'ANNEE' || SELECT.COLUMNBY != 'NUMEROMOIS')">			
                <CHART title="Comparatif (10 premiers)" type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="N" sortSeq="A"  condition="ROW.LVL == '1'">
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="N" displayName="SELECT.DATA_LABEL" displayNameCalc="true"/>
                </CHART>
                <CHART title="Répartition (Total)" type="columnChart" serieIsCategory="true" fromTotal="false" >
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="N1" displayName="VIEW.COLH1" displayNameCalc="true" visibleCondition="VIEW.COLH1 != null"/>
                    <SERIE field="N2" displayName="VIEW.COLH2" displayNameCalc="true" visibleCondition="VIEW.COLH2 != null"/>
                    <SERIE field="N3" displayName="VIEW.COLH3" displayNameCalc="true" visibleCondition="VIEW.COLH3 != null"/>
                    <SERIE field="N4" displayName="VIEW.COLH4" displayNameCalc="true" visibleCondition="VIEW.COLH4 != null"/>
                    <SERIE field="N5" displayName="VIEW.COLH5" displayNameCalc="true" visibleCondition="VIEW.COLH5 != null"/>
                    <SERIE field="N6" displayName="VIEW.COLH6" displayNameCalc="true" visibleCondition="VIEW.COLH6 != null"/>
                    <SERIE field="N7" displayName="VIEW.COLH7" displayNameCalc="true" visibleCondition="VIEW.COLH7 != null"/>
                    <SERIE field="N8" displayName="VIEW.COLH8" displayNameCalc="true" visibleCondition="VIEW.COLH8 != null"/>
                    <SERIE field="N9" displayName="VIEW.COLH9" displayNameCalc="true" visibleCondition="VIEW.COLH9 != null"/>
                    <SERIE field="N10" displayName="VIEW.COLH10" displayNameCalc="true" visibleCondition="VIEW.COLH10 != null"/>
                    <SERIE field="N11" displayName="VIEW.COLH11" displayNameCalc="true" visibleCondition="VIEW.COLH11 != null"/>
                    <SERIE field="N12" displayName="VIEW.COLH12" displayNameCalc="true" visibleCondition="VIEW.COLH12 != null"/>
                    <SERIE field="N13" displayName="VIEW.COLH13" displayNameCalc="true" visibleCondition="VIEW.COLH13 != null"/>
                    <SERIE field="N14" displayName="VIEW.COLH14" displayNameCalc="true" visibleCondition="VIEW.COLH14 != null"/>
                    <SERIE field="N15" displayName="VIEW.COLH15" displayNameCalc="true" visibleCondition="VIEW.COLH15 != null"/>
                    <SERIE field="N16" displayName="VIEW.COLH16" displayNameCalc="true" visibleCondition="VIEW.COLH16 != null"/>
                    <SERIE field="N17" displayName="VIEW.COLH17" displayNameCalc="true" visibleCondition="VIEW.COLH17 != null"/>
                    <SERIE field="N18" displayName="VIEW.COLH18" displayNameCalc="true" visibleCondition="VIEW.COLH18 != null"/>
                    <SERIE field="N19" displayName="VIEW.COLH19" displayNameCalc="true" visibleCondition="VIEW.COLH19 != null"/>
                    <SERIE field="N20" displayName="VIEW.COLH20" displayNameCalc="true" visibleCondition="VIEW.COLH20 != null"/>
                </CHART>
            </CHART>
			<CHART title="Comparatif (10 premiers) " type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="TXT" sortSeq="A" 
					visibleCondition="SELECT.GROUPBY != 'ANNEE' &amp;&amp; SELECT.GROUPBY != 'MOIS'" condition="Number(ROW.LVL) == 1">
				<CATEGORY field="TXT" type="Char"/>
				<SERIE field="N" displayName="SELECT.DATA_LABEL" displayNameCalc="true"/>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" key="COD" headerHeight="40" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" 
						sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="80" type="Char" visible="true" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres">
				</COLUMN>
				<COLUMN dataField="LIT" type="Number" width="45" outputFormat="0" visible="false" headerText="Places" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="N" width="80" visible="true" type="Number" outputFormat="= SELECT.DATA2" headerText="Total" textAlign="right" totalFunction="sum" otherFunction="sum">
				</COLUMN>
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" width="40" outputFormat="0%" textAlign="right" visibleCondition="SELECT.DATA != 'TAU' " totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N / TOTALROW.N * 100"/>
				</COLUMN>
				<COLUMN description=" " dataField="N1" width="70" visibleCondition="VIEW.COLH1 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH1" columnData="= VIEW.COLI1" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N2" width="70" visibleCondition="VIEW.COLH2 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH2" columnData="= VIEW.COLI2" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N3" width="70" visibleCondition="VIEW.COLH3 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH3" columnData="= VIEW.COLI3" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N4" width="70" visibleCondition="VIEW.COLH4 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH4" columnData="= VIEW.COLI4" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N5" width="70" visibleCondition="VIEW.COLH5 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH5" columnData="= VIEW.COLI5" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N6" width="70" visibleCondition="VIEW.COLH6 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH6" columnData="= VIEW.COLI6" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N7" width="70" visibleCondition="VIEW.COLH7 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH7" columnData="= VIEW.COLI7" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N8" width="70" visibleCondition="VIEW.COLH8 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH8" columnData="= VIEW.COLI8" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N9" width="70" visibleCondition="VIEW.COLH9 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH9" columnData="= VIEW.COLI9" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N10" width="70" visibleCondition="VIEW.COLH10 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH10" columnData="= VIEW.COLI10" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N11" width="70" visibleCondition="VIEW.COLH11 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH11" columnData="= VIEW.COLI11" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N12" width="70" visibleCondition="VIEW.COLH12 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH12" columnData="= VIEW.COLI12" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N13" width="70" visibleCondition="VIEW.COLH13 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH13" columnData="= VIEW.COLI13" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N14" width="70" visibleCondition="VIEW.COLH14 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH14" columnData="= VIEW.COLI14" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N15" width="70" visibleCondition="VIEW.COLH15 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH15" columnData="= VIEW.COLI15" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N16" width="70" visibleCondition="VIEW.COLH16 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH16" columnData="= VIEW.COLI16" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N17" width="70" visibleCondition="VIEW.COLH17 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH17" columnData="= VIEW.COLI17" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N18" width="70" visibleCondition="VIEW.COLH18 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH18" columnData="= VIEW.COLI18" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N19" width="70" visibleCondition="VIEW.COLH19 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH19" columnData="= VIEW.COLI19" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN description=" " dataField="N20" width="70" visibleCondition="VIEW.COLH20 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH20" columnData="= VIEW.COLI20" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum">
				</COLUMN>
				<COLUMN dataField="NP1" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N1"/>
				</COLUMN>
				<COLUMN dataField="NP2" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP1 + ROW.N2"/>
				</COLUMN>
				<COLUMN dataField="NP3" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP2 + ROW.N3"/>
				</COLUMN>
				<COLUMN dataField="NP4" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP3 + ROW.N4"/>
				</COLUMN>
				<COLUMN dataField="NP5" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP4 + ROW.N5"/>
				</COLUMN>
				<COLUMN dataField="NP6" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP5 + ROW.N6"/>
				</COLUMN>
				<COLUMN dataField="NP7" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP6 + ROW.N7"/>
				</COLUMN>
				<COLUMN dataField="NP8" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP7 + ROW.N8"/>
				</COLUMN>
				<COLUMN dataField="NP9" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP8 + ROW.N9"/>
				</COLUMN>
				<COLUMN dataField="NP10" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP9 + ROW.N10"/>
				</COLUMN>
				<COLUMN dataField="NP11" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP10 + ROW.N11"/>
				</COLUMN>
				<COLUMN dataField="NP12" type="Number" width="40" visible="false" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.NP11 + ROW.N12"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
