<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="ACTI000078" label="Activité. Facturation actes" title="= SELECT.QUELMONTANT2 + ' par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.QUELLEDATE_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_ACTI000078.HTML"
    helpDokuWIkiDir="activite:activite_facturee_et_valorisee:activite_honoraire" 
    helpDokuWIkiFile="acti000078" 
>    
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS_H"/>
	
	
	
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
		<PROPERTY name="GRBY_DATE">
			<value>
					<![CDATA[
						[EVAL 
							$groupbys = array(
										'[GROUPBY]',
										substr('[GROUBY]', 0, 6)
									);
					$exceptions = array('ANNEE', 'TRIM', 'TRIM', 'JOUR', 'NUMEROTRIM', 'NUMEROMOIS', 'NUMEROJOUR','SEMAINEANNE','JOURS','SEMAINEWE','ANNEEF', 'TRIMF', 'MOISF', 'JOURF', 'NUMEROTRIMF', 'NUMEROMOISF', 'NUMEROJOURF','SEMAINEANNEF','JOURSF','SEMAINEWEF','ANNEEEX', 'TRIMEX', 'MOISEX', 'JOUREX', 'NUMEROTRIMEX', 'NUMEROMOISEX', 'NUMEROJOUREX','SEMAINEANNEEX','JOURSEX','SEMAINEWEEX','ANNEEA', 'TRIMA', 'MOISA', 'JOURA', 'NUMEROTRIMA', 'NUMEROMOISA', 'NUMEROJOURA','SEMAINEANNEA','JOURSA','SEMAINEWEA');
					$result = array_intersect($groupbys, $exceptions);
					
					if (count($result) > 0) {
						return "1";
					}
					else {
						return "-1";
					}
						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', 'TRIM', 'JOUR', 'NUMEROTRIM', 'NUMEROMOIS', 'NUMEROJOUR','SEMAINEANNE','JOURS','SEMAINEWE','ANNEEF', 'TRIMF', 'MOISF', 'JOURF', 'NUMEROTRIMF', 'NUMEROMOISF', 'NUMEROJOURF','SEMAINEANNEF','JOURSF','SEMAINEWEF','ANNEEEX', 'TRIMEX', 'MOISEX', 'JOUREX', 'NUMEROTRIMEX', 'NUMEROMOISEX', 'NUMEROJOUREX','SEMAINEANNEEX','JOURSEX','SEMAINEWEEX','ANNEEA', 'TRIMA', 'MOISA', 'JOURA', 'NUMEROTRIMA', 'NUMEROMOISA', 'NUMEROJOURA','SEMAINEANNEA','JOURSA','SEMAINEWEA');
					
					$result = array_intersect($groupbys, $exceptions);
					
					if (count($result) > 0) {
						return "DEFAULT";
					}
					else {
						return "indicateurs[3]";
					}
					
			EVAL]]]></value>
		</PROPERTY>		
		<PROPERTY name="MT1">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_facture';
									break;
								case '2':
									return 'montant_comptabilise';
									break;
								case 'MTFACI':
									return 'montant_facture + COALESCE(montant_facture_actes_inclus_dans_sejour,0)';
									break;
								case 'MTI':
									return 'COALESCE(montant_facture_actes_inclus_dans_sejour,0)';
									break;
                                case '3':
									return 'montant_facture + montant_non_facture';
									break;
								default:
									return 'montant_facture';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MT2">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_facture_1';
									break;
								case '2':
									return 'montant_comptabilise_1';
									break;
								case 'MTFACI':
									return 'montant_facture_1 + COALESCE(montant_facture_1_actes_inclus_dans_sejour,0)';
									break;
								case 'MTI':
									return 'COALESCE(montant_facture_1_actes_inclus_dans_sejour,0)';
									break;
                                case '3':
									return 'montant_facture_1 + montant_non_facture';
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MT3">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_facture_2 + montant_facture_22';
									break;
								case '2':
									return 'montant_comptabilise_2 + montant_comptabilise_22';
									break;
								case 'MTFACI':
									return 'montant_facture_2 + COALESCE(montant_facture_2_actes_inclus_dans_sejour,0) + montant_facture_22 + COALESCE(montant_facture_22_actes_inclus_dans_sejour,0)';
									break;
								case 'MTI':
									return 'COALESCE(montant_facture_2_actes_inclus_dans_sejour,0) + COALESCE(montant_facture_22_actes_inclus_dans_sejour,0)';
									break;
                                case '3':
									return 'montant_facture_2 + montant_non_facture';
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MT4">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_facture_0';
									break;
								case '2':
									return 'montant_comptabilise_0';
									break;
								case 'MTFACI':
									return 'montant_facture_0 + COALESCE(montant_facture_0_actes_inclus_dans_sejour,0)';
									break;
								case 'MTI':
									return 'COALESCE(montant_facture_0_actes_inclus_dans_sejour,0)';
									break;
                                case '3':
									return 'montant_facture_0 + montant_non_facture';
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MT5">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_depassement';
									break;
								case '2': case '3':
									return 'montant_depassement';
									break;
								case 'MTFACI':
									return 'montant_depassement';
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MT6">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1':
									return 'montant_non_facture';
									break;
								case 'MTFACI':
									return 'montant_non_facture';
									break;
                                case '3':
									return 'montant_non_facture';
									break;
								default:
									return '0';
								}
					EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="MONTANT_SELECT">
			<value><![CDATA[[EVAL 
								switch ('[QUELMONTANT]') {
								case '1': case '3':
									return 'AND (montant_facture <> 0 OR montant_depassement <> 0 OR montant_non_facture <> 0)';
									break;
								case '2':
									return 'AND (montant_comptabilise <> 0)';
									break;
								case 'MTFACI':
									return 'AND (montant_facture <> 0 OR montant_depassement <> 0 OR montant_non_facture <> 0 OR COALESCE(montant_facture_actes_inclus_dans_sejour,0) <> 0)';
									break;
								case 'MTI':
									return 'AND (COALESCE(montant_facture_actes_inclus_dans_sejour,0) <> 0)';
									break;
								default:
									return '';
								}
					EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="QUELLEDATE" label="" UI="combo" default="1" default2="date_fin">
				<OPTION label="Date activité" data="1" data2="date_fin"/>
				<OPTION label="Date sortie" data="2" data2="v_factures_lignes_h_3.date_fin_facture"/>
				<OPTION label="Date facture" data="3" data2="v_factures_lignes_h_3.date_facture"/>
				<OPTION label="Date vente" data="4" data2="date_vente"/>
			</FIELD>
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
            <FIELD name="PERIODE" label="de" UI="combo" tree="true" width="200" default="2007-01-01" globalListProvider="DATE_DEBUT" >
				<OPTION dataLink="MOIS_D" treeLevelField="lvl" dataField="date" data2Field="mois" labelField="txt"/>
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2007-01-31" globalListProvider="DATE_FIN" >
				<OPTION dataLink="MOIS_F" treeLevelField="lvl" dataField="date" data2Field="mois" labelField="txt"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" default="PRF" tree="true">
				<OPTION label="PRESTATIONS_H_GROUPBY" data="" globalListProvider="PRESTATIONS_H_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" default="-1" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="PRESTATIONS_H_GROUPBY" data="" globalListProvider="PRESTATIONS_H_GROUPBY"/>
			</FIELD>
		</GROUP>
        <GROUP>
			<FIELD name="GROUPBY_3" label="" UI="combo" default="-1" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="PRESTATIONS_H_GROUPBY" data="" globalListProvider="PRESTATIONS_H_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="QUELMONTANT" label="" UI="combo" default="1">
				<OPTION label="Montant facturé" data="1" data2="Facturation actes"/>
				<OPTION label="Montant facturé et inclus dans séjour" data="MTFACI" data2="Facturation actes et actes inclus dans séjour" condition="ENV.TYPEETS != '1'"/>
				<OPTION label="Montant inclus dans séjour" data="MTI" data2="Actes inclus dans séjour" condition="ENV.TYPEETS != '1'"/>
				<OPTION label="Montant comptabilisé" data="2" data2="Comptabilisation actes"/>
				<OPTION label="Montant Total" data="3" data2="Montant Facturé + Valorisé"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_H_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_H_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PATIENTS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PASSAGES_SELECTIONS" />
	<QUERIES>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[
						SELECT 'X_PERIODE', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '3 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(date_debut) FROM activite.p_factures ))::text;
				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="">
			<SQL optimizer="V_FACTURES_LIGNES_H_X" optimizer2="V_SEJOURS_X">
				<select><![CDATA[	
					-- le JOIN se fait selon RULE 0011 ou 0111 de part le dboptimizer #V_FACTURES_LIGNES_H_X#
					
					
					
					CTISELECT_TREE
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						COUNT(DISTINCT v_factures_lignes_h_3.sejour_id),,
						COUNT(DISTINCT CASE WHEN v_factures_lignes_h_3.sejour_id = 0 THEN v_factures_lignes_h_3.no_sejour ELSE NULL END),,
						COUNT(DISTINCT v_factures_lignes_h_3.no_sejour),,
						COUNT(DISTINCT CASE WHEN montant_depassement <> 0 THEN v_factures_lignes_h_3.sejour_id ELSE NULL END),,
						SUM([VIEW.MT1]),,
						SUM([VIEW.MT2]),,
						SUM([VIEW.MT3]),,
						SUM([VIEW.MT4]),,
						SUM([VIEW.MT5]),,
						SUM([VIEW.MT6]),,
						
                        base.cti_sum_distinct_on(DISTINCT array[v_factures_lignes_h_3.no_facture::text || '|' || protocole_id::text,CASE WHEN nb_prestation >= 0 THEN '1' ELSE '-1' END]),,
						base.cti_sum_distinct_on(DISTINCT array[v_factures_lignes_h_3.no_facture::text || '|' || protocole_id::text,CASE WHEN protocole_id = 0 THEN '0' WHEN nb_prestation >= 0 THEN '1' ELSE '-1' END]),,
						SUM(nb_rubrique),,
						SUM(nb_rubrique * coefficient),,
						SUM(nb_prestation),,
						SUM(nb_prestation * coefficient),,
						COUNT(DISTINCT CASE WHEN  montant_facture_0 <> 0 and montant_facture_0 != 0  then  v_factures_lignes_h_3.sejour_id ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN tiers_payant_1_id <> 0 and montant_facture_1 != 0  then  v_factures_lignes_h_3.sejour_id ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN tiers_payant_2_id <> 0 and montant_facture_2 != 0   then  v_factures_lignes_h_3.sejour_id ELSE NULL END)
					}
					ORDERBY{[VIEW.ORDERBY],, DESC}
					FROM #V_FACTURES_LIGNES_H_X#
					JOIN #V_SEJOURS_X#
					WHERE 
						v_factures_lignes_h_3.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.MONTANT_SELECT]
							
						[VIEW.SEJOURS_SELECT]
						[VIEW.ACTES_SELECT]
						[VIEW.PASSAGES_SELECT]
						[VIEW.PATIENTS_SELECT]
				
				
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT" />
					<FIELD name="SEJ"/>
					<FIELD name="SEJVAL"/>
					<FIELD name="SEJTOT"/>
					<FIELD name="SEJD"/>
					<FIELD name="M1"/>
					<FIELD name="M2"/>
					<FIELD name="M3"/>
					<FIELD name="M4"/>
					<FIELD name="M5"/>
					<FIELD name="M6"/>
					<FIELD name="PRO"/>
					<FIELD name="PRO2"/>
					<FIELD name="NR"/>
					<FIELD name="NCR"/>
					<FIELD name="NP"/>
					<FIELD name="NCP"/>
					<FIELD name="SEJPAT"/>
					<FIELD name="SEJAMO"/>
					<FIELD name="SEJAMC"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="(&#8721;) Dernier Mois/Année " shortLabel="Mois/Année"   rowContext="false" buttonType="VIEWLINKPOPUP">
				<VIEWITEM label="Dernier mois" shortLabel="Dernier mois"  view="ACTI000080.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" componentName="PRESTATIONS_BASE_VIEWLINK">
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'JOURS'; 		break;
								case 'TRIM' :			s = 'JOURS';		break;
								case 'MOIS' :			s = 'JOURS';		break;
								case 'NUMEROMOIS' :		s = 'JOURS';		break;
								case 'NUMEROTRIM' :		s = 'JOURS';		break;
								case 'SEMAINEWE' :		s = 'JOURS';		break;
								case 'SEMAINEANNE' :	s = 'JOURS';		break;
								case 'NUMEROJOUR' :		s = 'JOURS';		break;
								case 'JOURS' :			s = 'JOURS';		break;
								case 'JOUR' :			s = 'JOURS';		break;
								
								case 'ANNEEF' :			s = 'JOURSF'; 		break;
								case 'TRIMF' :			s = 'JOURSF';		break;
								case 'MOISF' :			s = 'JOURSF';		break;
								case 'NUMEROMOISF' :	s = 'JOURSF';		break;
								case 'NUMEROTRIMF' :	s = 'JOURSF';		break;
								case 'SEMAINEWEF' :		s = 'JOURSF';		break;
								case 'SEMAINEANNEF' :	s = 'JOURSF';		break;
								case 'NUMEROJOURF' :	s = 'JOURSF';		break;
								case 'JOURSF' :			s = 'JOURSF';		break;
								case 'JOURF' :			s = 'JOURSF';		break;
								
								case 'ANNEEA' :			s = 'JOURSA'; 		break;
								case 'TRIMA' :			s = 'JOURSA';		break;
								case 'MOISA' :			s = 'JOURSA';		break;
								case 'NUMEROMOISA' :	s = 'JOURSA';		break;
								case 'NUMEROTRIMA' :	s = 'JOURSA';		break;
								case 'SEMAINEWEA' :		s = 'JOURSA';		break;
								case 'SEMAINEANNEA' :	s = 'JOURSA';		break;
								case 'NUMEROJOURA' :	s = 'JOURSA';		break;
								case 'JOURSA' :			s = 'JOURSA';		break;
								case 'JOURA' :			s = 'JOURSA';		break;
								
								case 'ANNEEV' :			s = 'JOURSV'; 		break;
								case 'TRIMV' :			s = 'JOURSV';		break;
								case 'MOISV' :			s = 'JOURSV';		break;
								case 'NUMEROMOISV' :	s = 'JOURSV';		break;
								case 'NUMEROTRIMV' :	s = 'JOURSV';		break;
								case 'SEMAINEWEV' :		s = 'JOURSV';		break;
								case 'SEMAINEANNEV' :	s = 'JOURSV';		break;
								case 'NUMEROJOURV' :	s = 'JOURSV';		break;
								case 'JOURSV' :			s = 'JOURSV';		break;
								case 'JOURV' :			s = 'JOURSV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'JOURSA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'JOURS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'JOURSF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'JOURSV';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />
					<ARG name="DATA4" value="'NBDEP'" />
					<ARG name="DATA5" value="'MTDEP'" />
					<ARG name="DATA6" value="'0'" />
					<ARG name="DATA7" value="'0'" />
					<ARG name="DATA8" value="'0'" />
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernier mois" data="2" shortLabel="&#8721; dernier  mois"  view="ACTI000158.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'JOURS'; 		break;
								case 'TRIM' :			s = 'JOURS';		break;
								case 'MOIS' :			s = 'JOURS';		break;
								case 'NUMEROMOIS' :		s = 'JOURS';		break;
								case 'NUMEROTRIM' :		s = 'JOURS';		break;
								case 'SEMAINEWE' :		s = 'JOURS';		break;
								case 'SEMAINEANNE' :	s = 'JOURS';		break;
								case 'NUMEROJOUR' :		s = 'JOURS';		break;
								case 'JOURS' :			s = 'JOURS';		break;
								case 'JOUR' :			s = 'JOURS';		break;
								
								case 'ANNEEF' :			s = 'JOURSF'; 		break;
								case 'TRIMF' :			s = 'JOURSF';		break;
								case 'MOISF' :			s = 'JOURSF';		break;
								case 'NUMEROMOISF' :	s = 'JOURSF';		break;
								case 'NUMEROTRIMF' :	s = 'JOURSF';		break;
								case 'SEMAINEWEF' :		s = 'JOURSF';		break;
								case 'SEMAINEANNEF' :	s = 'JOURSF';		break;
								case 'NUMEROJOURF' :	s = 'JOURSF';		break;
								case 'JOURSF' :			s = 'JOURSF';		break;
								case 'JOURF' :			s = 'JOURSF';		break;
								
								case 'ANNEEA' :			s = 'JOURSA'; 		break;
								case 'TRIMA' :			s = 'JOURSA';		break;
								case 'MOISA' :			s = 'JOURSA';		break;
								case 'NUMEROMOISA' :	s = 'JOURSA';		break;
								case 'NUMEROTRIMA' :	s = 'JOURSA';		break;
								case 'SEMAINEWEA' :		s = 'JOURSA';		break;
								case 'SEMAINEANNEA' :	s = 'JOURSA';		break;
								case 'NUMEROJOURA' :	s = 'JOURSA';		break;
								case 'JOURSA' :			s = 'JOURSA';		break;
								case 'JOURA' :			s = 'JOURSA';		break;
								
								case 'ANNEEV' :			s = 'JOURSV'; 		break;
								case 'TRIMV' :			s = 'JOURSV';		break;
								case 'MOISV' :			s = 'JOURSV';		break;
								case 'NUMEROMOISV' :	s = 'JOURSV';		break;
								case 'NUMEROTRIMV' :	s = 'JOURSV';		break;
								case 'SEMAINEWEV' :		s = 'JOURSV';		break;
								case 'SEMAINEANNEV' :	s = 'JOURSV';		break;
								case 'NUMEROJOURV' :	s = 'JOURSV';		break;
								case 'JOURSV' :			s = 'JOURSV';		break;
								case 'JOURV' :			s = 'JOURSV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'JOURSA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'JOURS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'JOURSF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'JOURSV';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE"/>
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="TYPE_COMPARAISON" value="return '2';" />
				</VIEWITEM>
				<VIEWITEM  label="Dernière année" data="2" shortLabel="derniere  année"  view="ACTI000080.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'NUMEROMOIS'; 		break;
								case 'TRIM' :			s = 'NUMEROMOIS';		break;
								case 'MOIS' :			s = 'NUMEROMOIS';		break;
								case 'NUMEROMOIS' :		s = 'NUMEROMOIS';		break;
								case 'NUMEROTRIM' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEWE' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEANNE' :	s = 'NUMEROMOIS';		break;
								case 'NUMEROJOUR' :		s = 'NUMEROMOIS';		break;
								case 'JOURS' :			s = 'NUMEROMOIS';		break;
								case 'JOUR' :			s = 'NUMEROMOIS';		break;
								
								case 'ANNEEF' :			s = 'NUMEROMOISF'; 		break;
								case 'TRIMF' :			s = 'NUMEROMOISF';		break;
								case 'MOISF' :			s = 'NUMEROMOISF';		break;
								case 'NUMEROMOISF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROTRIMF' :	s = 'NUMEROMOISF';		break;
								case 'SEMAINEWEF' :		s = 'NUMEROMOISF';		break;
								case 'SEMAINEANNEF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROJOURF' :	s = 'NUMEROMOISF';		break;
								case 'JOURSF' :			s = 'NUMEROMOISF';		break;
								case 'JOURF' :			s = 'NUMEROMOISF';		break;
								
								case 'ANNEEA' :			s = 'NUMEROMOISA'; 		break;
								case 'TRIMA' :			s = 'NUMEROMOISA';		break;
								case 'MOISA' :			s = 'NUMEROMOISA';		break;
								case 'NUMEROMOISA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROTRIMA' :	s = 'NUMEROMOISA';		break;
								case 'SEMAINEWEA' :		s = 'NUMEROMOISA';		break;
								case 'SEMAINEANNEA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROJOURA' :	s = 'NUMEROMOISA';		break;
								case 'JOURSA' :			s = 'NUMEROMOISA';		break;
								case 'JOURA' :			s = 'NUMEROMOISA';		break;
								
								case 'ANNEEV' :			s = 'NUMEROMOISV'; 		break;
								case 'TRIMV' :			s = 'NUMEROMOISV';		break;
								case 'MOISV' :			s = 'NUMEROMOISV';		break;
								case 'NUMEROMOISV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROTRIMV' :	s = 'NUMEROMOISV';		break;
								case 'SEMAINEWEV' :		s = 'NUMEROMOISV';		break;
								case 'SEMAINEANNEV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROJOURV' :	s = 'NUMEROMOISV';		break;
								case 'JOURSV' :			s = 'NUMEROMOISV';		break;
								case 'JOURV' :			s = 'NUMEROMOISV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'NUMEROMOISA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'NUMEROMOIS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'NUMEROMOISF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'NUMEROMOISV';			break;}
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />
					<ARG name="DATA4" value="'NBDEP'" />
					<ARG name="DATA5" value="'MTDEP'" />
					<ARG name="DATA6" value="'0'" />
					<ARG name="DATA7" value="'0'" />
					<ARG name="DATA8" value="'0'" />
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernière Année" shortLabel="&#8721; derniere année"  view="ACTI000158.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE_D" value="return VIEW.COMP_PERIODE_D;" />
					<ARG name="TOPERIODE_D" value="return VIEW.COMP_TOPERIODE_D;" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;" />
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'NUMEROMOIS'; 		break;
								case 'TRIM' :			s = 'NUMEROMOIS';		break;
								case 'MOIS' :			s = 'NUMEROMOIS';		break;
								case 'NUMEROMOIS' :		s = 'NUMEROMOIS';		break;
								case 'NUMEROTRIM' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEWE' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEANNE' :	s = 'NUMEROMOIS';		break;
								case 'NUMEROJOUR' :		s = 'NUMEROMOIS';		break;
								case 'JOURS' :			s = 'NUMEROMOIS';		break;
								case 'JOUR' :			s = 'NUMEROMOIS';		break;
								
								case 'ANNEEF' :			s = 'NUMEROMOISF'; 		break;
								case 'TRIMF' :			s = 'NUMEROMOISF';		break;
								case 'MOISF' :			s = 'NUMEROMOISF';		break;
								case 'NUMEROMOISF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROTRIMF' :	s = 'NUMEROMOISF';		break;
								case 'SEMAINEWEF' :		s = 'NUMEROMOISF';		break;
								case 'SEMAINEANNEF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROJOURF' :	s = 'NUMEROMOISF';		break;
								case 'JOURSF' :			s = 'NUMEROMOISF';		break;
								case 'JOURF' :			s = 'NUMEROMOISF';		break;
								
								case 'ANNEEA' :			s = 'NUMEROMOISA'; 		break;
								case 'TRIMA' :			s = 'NUMEROMOISA';		break;
								case 'MOISA' :			s = 'NUMEROMOISA';		break;
								case 'NUMEROMOISA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROTRIMA' :	s = 'NUMEROMOISA';		break;
								case 'SEMAINEWEA' :		s = 'NUMEROMOISA';		break;
								case 'SEMAINEANNEA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROJOURA' :	s = 'NUMEROMOISA';		break;
								case 'JOURSA' :			s = 'NUMEROMOISA';		break;
								case 'JOURA' :			s = 'NUMEROMOISA';		break;
								
								case 'ANNEEV' :			s = 'NUMEROMOISV'; 		break;
								case 'TRIMV' :			s = 'NUMEROMOISV';		break;
								case 'MOISV' :			s = 'NUMEROMOISV';		break;
								case 'NUMEROMOISV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROTRIMV' :	s = 'NUMEROMOISV';		break;
								case 'SEMAINEWEV' :		s = 'NUMEROMOISV';		break;
								case 'SEMAINEANNEV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROJOURV' :	s = 'NUMEROMOISV';		break;
								case 'JOURSV' :			s = 'NUMEROMOISV';		break;
								case 'JOURV' :			s = 'NUMEROMOISV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'NUMEROMOISA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'NUMEROMOIS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'NUMEROMOISF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'NUMEROMOISV';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>		
			<VIEWLINK label="Comparatif" shortLabel="Comparatif"  view="ACTI000080.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" visible="= SELECT.GROUPBY != 'JOUR'">
					<ARG name="PERIODE" value="return VIEW.COMP_PERIODE;" />
					<ARG name="PERIODE_D" value="return VIEW.COMP_PERIODE_D;" />
					<ARG name="TOPERIODE_D" value="return VIEW.COMP_TOPERIODE_D;" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />
					<ARG name="DATA4" value="'NBDEP'" />
					<ARG name="DATA5" value="'MTDEP'" />
					<ARG name="DATA6" value="'0'" />
					<ARG name="DATA7" value="'0'" />
					<ARG name="DATA8" value="'0'" />
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="ACTI000157.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;" />
				<ARG name="GROUPBY_3" value="'-1'" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />
					<ARG name="DATA4" value="'0'" />
					<ARG name="DATA5" value="'0'" />
					<ARG name="DATA6" value="'0'" />
					<ARG name="DATA7" value="'0'" />
					<ARG name="DATA8" value="'0'" />
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
				<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>	
			<VIEWLINK label="Effets" shortLabel="Effets"  view="ACTI000160.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
                    <ARG name="PERIODE" value="return VIEW.COMP_PERIODE;" />
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="DATA01" value="'1.1'" />
                    <ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"   rowContext="false" buttonType="VIEWLINK_EVO_COMP" >			
				<VIEWITEM label="Standard" shortLabel="Evolution comparative" view="ACTI000159.XML" rowContext="false" enabled="true" buttonType="VIEWLINK_EVO_COMP">
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="if (SELECT.QUELLEDATE == '1' ) {return 'NUMEROMOISA';}
												 if (SELECT.QUELLEDATE == '2' ) {return 'NUMEROMOIS';}
												 if (SELECT.QUELLEDATE == '3'  ) {return 'NUMEROMOISF';}
												 if (SELECT.QUELLEDATE == '4'  ) {return 'NUMEROMOISV';}
						" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />					
					<ARG name="DATA4" value="'NBDEP'" />
					<ARG name="DATA5" value="'MTDEP'" />					
					<ARG name="DATA6" value="'0'" />
					<ARG name="DATA7" value="'0'" />
					<ARG name="DATA8" value="'0'" />					
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />					
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />					
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
				<VIEWITEM label="Détaillée" shortLabel="Evol. comparative" view="ACTI000159.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="if (SELECT.QUELLEDATE == '1' ) {return 'NUMEROMOISA';}
												 if (SELECT.QUELLEDATE == '2' ) {return 'NUMEROMOIS';}
												 if (SELECT.QUELLEDATE == '3'  ) {return 'NUMEROMOISF';}
												 if (SELECT.QUELLEDATE == '4'  ) {return 'NUMEROMOISV';}
						" />
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFAC'" />
					<ARG name="DATA3" value="'MMTFAC'" />					
					<ARG name="DATA4" value="'NBDEP'" />
					<ARG name="DATA5" value="'MTDEP'" />					
					<ARG name="DATA6" value="'MTCONV'" />
					<ARG name="DATA7" value="'NBPRE'" />
					<ARG name="DATA8" value="'0'" />					
					<ARG name="DATA9" value="'0'" />
					<ARG name="DATA10" value="'0'" />					
					<ARG name="DATA011" value="'0'" />
					<ARG name="DATA012" value="'0'" />
					<ARG name="DATA013" value="'0'" />					
					<ARG name="DATA014" value="'0'" />
					<ARG name="DATA1015" value="'0'" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="ACTI000079.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" component2Name="PRESTATIONS_BASE_VIEWLINK">
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="DATA" value="'NBSEJ'" /> 
				<ARG name="QUELMONTANT" value="return SELECT.QUELMONTANT;" /> 
				<ARG name="PERIODICITE" value="'MONTH'" />   
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="ACTI000081.XML" enabled="true" rowContext="false" buttonType="ANALYSE_CROISEE" visible="= SELECT.GROUPBY != 'JOUR'">
				<ARG name="ALIAS_PERIODE" value="return '-1'"/>
				<ARG name="PERIODE" value="return VIEW.X_PERIODE.substr(0,4)+'-01-01';"/>
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;"/> 
				<ARG name="DATA" value="'NBSEJ'" />
				<ARG name="COLUMNBY" value="'NUMEROMOISA'"/>
				<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
				<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="GROUPBY">
						<value>
							<![CDATA[			
								if(SELECT.QUELLEDATE == '1') {s = 'ANNEEA';}
								if(SELECT.QUELLEDATE == '2') {s = 'ANNEE';}
								if(SELECT.QUELLEDATE == '3') {s = 'ANNEEF';}
								if(SELECT.QUELLEDATE == '4') {s = 'ANNEEV';}
							return s;
							]]>
						</value>
					</ARG>
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_2;" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse" shortLabel="Analyse" view="ACTI000078.XML" enabled="true" rowContext="false" buttonType="ANALYSE" >
				<ARG name="ALIAS_PERIODE" value="return '-1'" />
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01'" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;" />
				<ARG name="GROUPBY_3" value="return '-1';" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
			</VIEWLINK>	
			<VIEWLINK label="Séjours" shortLabel="Séjours" view="ACTI000021.XML" componentName="PRESTATIONS_H_BASE_VIEWLINK" component2Name="STANDARD_BASE_VIEWLINK" component3Name="ETA_DOS_BASE_VIEWLINK">
			</VIEWLINK>
            <VIEWLINK label="Actes" shortLabel="Actes" view="ACTI000170.XML" componentName="PRESTATIONS_H_BASE_VIEWLINK" component2Name="STANDARD_BASE_VIEWLINK" component3Name="ETA_DOS_BASE_VIEWLINK">
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Facturation" label="Facturation" multiTab="true">
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="VIEW.GRBY_DATE == '-1' " >				
				<CHART title="C.A Total (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="M1" 
						maxItemsSortSeq="D" 
						sortField="M1" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A.Total'" displayNameCalc="true"/>
				</CHART>
				<CHART title="Décomposition C.A" type="columnChart" subType="stacked" maxItems="10" maxItemsSortOn="M5" maxItemsSortSeq="D" sortField="M5" sortSeq="D"
					 condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M1" displayName="if (SELECT.QUELMONTANT != 'MF-ENF') {return 'Total facturé'} else {return 'Facturé'}" displayNameCalc="true"/>
					<SERIE field="M5" displayName="if (SELECT.QUELMONTANT != 'MF-ENF') {return 'dépassements'} else {return 'En-cours'}" displayNameCalc="true"/>
				</CHART>
			</CHART> 			
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="VIEW.GRBY_DATE == '1'" >				
				<CHART title="C.A Total(10 premiers)"
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="COD" 
						maxItemsSortSeq="D" 
						sortField="COD"
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M5" displayName="'C.A. dépassements'" displayNameCalc="true"/>
				</CHART>
				<CHART title="Décomposition C.A" type="columnChart" subType="stacked" maxItems="10" maxItemsSortOn="COD" maxItemsSortSeq="D" sortField="COD" sortSeq="A" condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M1" displayName="if (SELECT.QUELMONTANT != 'MF-ENF') {return 'Total facturé'} else {return 'Facturé'}" displayNameCalc="true"/>
					<SERIE field="M5" displayName="if (SELECT.QUELMONTANT != 'MF-ENF') {return 'dépassements'} else {return 'En-cours'}" displayNameCalc="true"/>
				</CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="48" variableRowHeight="true" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<HEADERROWSTYLE name="textAlign" value="center"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="80" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
					<HEADERCELLSTYLE name="textAlign" value="left"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" maxWidth="300" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="*ROW">
                <HEADERCELLSTYLE name="textAlign" value="left"/>
				</COLUMN>
				<COLUMN dataField="SEJ" width="80" type="Number" outputFormat="#" headerText="Nombre@LF@séjours@LF@facturés" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre de séjours">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>	
				<COLUMN dataField="SEJVAL" width="80" type="Number" outputFormat="#" headerText="Nombre@LF@séjours@LF@valorisés" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre de séjours non facturés">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>			
				<COLUMN dataField="SEJTOT" width="80" type="Number" outputFormat="#" headerText="Nombre@LF@séjours@LF@total" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre de séjours total">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>			
				<COLUMN dataField="M1" width="80" type="Number" outputFormat="#E" visible="true" 
						headerText="
									if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé  Total'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. total facturé et actes inclus'}
									if (SELECT.QUELMONTANT == 'MTI') {return ' C.A. total Actes inclus dans séjour'}
									if (SELECT.QUELMONTANT == '2') {return 'C.A. Total comptabilisé'}
									if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. total en-cours'}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. total'}
									if (SELECT.QUELMONTANT == '3') {return 'C.A. total'}
									" 
						headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="sum" 
						description="=if (SELECT.QUELMONTANT == '1') {return 'Chiffre d\'affaires total facturé'}
									  if (SELECT.QUELMONTANT == 'MTFACI') {return 'Chiffre d\'affaires total facturé et actes inclus'}
									  if (SELECT.QUELMONTANT == 'MTI') {return 'Chiffre d\'affaires total Actes inclus dans séjour'}
									  if (SELECT.QUELMONTANT == '2') {return 'Chiffre d\'affaires total comptabilisé'}
									  if (SELECT.QUELMONTANT == 'ENF') {return 'Chiffre d\'affaires total en-cours'}
									  if (SELECT.QUELMONTANT == 'MF-ENF') {return 'Chiffre d\'affaires total'}
									  if (SELECT.QUELMONTANT == '3') {return 'Chiffre d\'affaires total facturé + valorisé'}
									">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="MFP" type="Number" headerText="%" width="50" visible="true" outputFormat="0%" textAlign="center" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
						description="=	if (SELECT.QUELMONTANT == '1') {return '% C.A. total facturé = (C.A. facturé de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. total facturé et actes inclus = (C.A. facturé et actes inclus de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == 'MTI') {return '% C.A.total Actes inclus dans séjour = (C.A. Actes inclus dans séjour de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == '2') {return '% total comptabilisé = (C.A. comptabilisé de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == 'ENF') {return '% total en-cours = (C.A. en-cours de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == 'MF-ENF') {return '% total = (C.A. total de la ligne / C.A. total)'}
										if (SELECT.QUELMONTANT == '3') {return '% total = (C.A. total de la ligne / C.A. total)'}
									">
					<CALC formula="ROW.M1 / TOTALROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>				
				<COLUMN dataField="MMFP" type="Number" headerText="C.A. moyen " width="50" visible="true" outputFormat="0E" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
						description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. moyen = C.A. facturé  Total  / Nombre de séjours '}
									  if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. moyen = C.A. total facturé et actes inclus / Nombre de séjours '}
									  if (SELECT.QUELMONTANT == 'MTI') {return 'C.A. moyen = C.A. total Actes inclus dans séjour/ Nombre de séjours '}
									  if (SELECT.QUELMONTANT == '2') {return 'C.A. moyen = C.A. total comptabilisé / Nombre de séjours '}
									  if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. moyen = C.A. total en-cours / Nombre de séjours '}
									  if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. moyen = C.A. total/ Nombre de séjours '}
									  if (SELECT.QUELMONTANT == '3') {return 'C.A. moyen = C.A. total/ Nombre de séjours '}
				
									">
					<CALC formula="ROW.M1 / ROW.SEJ "/>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="SEJD" width="90" type="Number" outputFormat="#" headerText="Nombre@LF@dépassements" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre d'interventions avec dépassements">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="M5" width="90" type="Number" visibleCondition="VIEW.MT5 != '0'" 
						headerText="
									if (SELECT.QUELMONTANT == '1') {return 'C.A. dépassements'}
									if (SELECT.QUELMONTANT == '2') {return 'C.A. dépassements'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. dépassements'}
									if (SELECT.QUELMONTANT == 'MTI') {return ''}
									if (SELECT.QUELMONTANT == 'ENF') {return ''}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
									if (SELECT.QUELMONTANT == '3') {return 'C.A. dépassements'}
									" 
					headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="sum" 
					description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. dépassements inclus dans le C.A. total facturé'}
								if (SELECT.QUELMONTANT == '2') {return 'C.A. dépassements inclus dans le C.A. total comptabilisé'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. dépassements inclus dans le C.A. total facturé'}
								if (SELECT.QUELMONTANT == 'MTI') {return ''}
								if (SELECT.QUELMONTANT == 'ENF') {return ''}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
								if (SELECT.QUELMONTANT == '3') {return 'C.A. dépassements inclus dans le C.A. total facturé + valorisé'}
								">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MFDEPP" type="Number" headerText="%" width="45" visible="true" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
				description="=if (SELECT.QUELMONTANT == '1') {return '% C.A. dépassements = (C.A. dépassements / C.A. facturé)'}
								if (SELECT.QUELMONTANT == '2') {return '% C.A. dépassements = (C.A. dépassements / C.A. comptabilisé)'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. dépassements = (C.A. dépassements / C.A. facturé)'}
								if (SELECT.QUELMONTANT == 'MTI') {return ''}
								if (SELECT.QUELMONTANT == 'ENF') {return ''}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
                                if (SELECT.QUELMONTANT == '3') {return '% C.A. dépassements = (C.A. dépassements / C.A. facturé + valorisé)'}
							">
					<CALC formula="ROW.M5 / ROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>				
				<COLUMN dataField="MCONV" type="Number" headerText="C.A. conventionné" width="90" visible="true" outputFormat="0E" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
				description="=if (SELECT.QUELMONTANT == '1') {return 'Chiffre d\'affaire conventionné = C.A. facturé - C.A. dépassements'}
								if (SELECT.QUELMONTANT == '2') {return 'Chiffre d\'affaire conventionné = C.A. comptabilisé - C.A. dépassements'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'Chiffre d\'affaire conventionné = C.A. facturé - C.A. dépassements'}
								if (SELECT.QUELMONTANT == 'MTI') {return ''}
								if (SELECT.QUELMONTANT == 'ENF') {return ''}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
								if (SELECT.QUELMONTANT == '3') {return 'Chiffre d\'affaire conventionné = (C.A. facturé + valorisé) - C.A. dépassements'}
							">
					<CALC formula="ROW.M1 - ROW.M5"/>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="PRO" width="80" type="Number" outputFormat="#" headerText="Nombre@LF@protocoles@LF@N/S compris" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre protocoles y compris non saisis (dans ce cas on compte 1 par séjour)">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="PRO2" width="80" type="Number" outputFormat="#" headerText="Nombre@LF@protocoles@LF@Significatifs" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre protocoles significatifs (dans ce cas, les protocoles non saisis ne comptent pas)">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="NP" width="80" type="Number"  outputFormat="#" headerText="Nombre@LF@actes" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre actes">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="NCP" width="80" type="Number"  outputFormat="#" headerText="Coefficient@LF@actes" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Coefficient actes">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="M6" width="90" type="Number" visibleCondition="VIEW.MT6 != '0'" 
						headerText="
									if (SELECT.QUELMONTANT == '1') {return 'Montant valorisé'}
									if (SELECT.QUELMONTANT == '3') {return 'Montant valorisé'}
									if (SELECT.QUELMONTANT == '2') {return ''}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'Montant valorisé'}
									if (SELECT.QUELMONTANT == 'MTI') {return ''}
									if (SELECT.QUELMONTANT == 'ENF') {return ''}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
									" 
						headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="sum" description="Montants non-Facturés">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
       <ONGLET name="TIE" excelLabel="Ventilation Tiers" label="Ventilation Tiers" multiTab="true" >
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition=" SELECT.QUELMONTANT == '1' &amp;&amp; VIEW.GRBY_DATE == '1'" >				
				<CHART title="C.A Facturé (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="COD" 
						maxItemsSortSeq="D" 
						sortField="COD" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A.Facturé'" displayNameCalc="true"/>
				</CHART>
				<CHART 
					title="C.A. Facturé par tiers" 
					type="columnChart" 
					subType="stacked" 
					maxItems="20" 
					maxItemsSortOn="COD" 
					maxItemsSortSeq="D" 
					sortField="COD" 
					sortSeq="A"  
					condition="ROW.LVL == '1' ">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M2" displayName="AMO"/>
					<SERIE field="M3" displayName="AMC"/>
					<SERIE field="M4" displayName="Patient"/>
				</CHART>
			</CHART>
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="SELECT.QUELMONTANT == '1' &amp;&amp; VIEW.GRBY_DATE == '-1'" >				
				<CHART title="C.A Facturé (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="M1" 
						maxItemsSortSeq="D" 
						sortField="M1" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A Facturé'" displayNameCalc="true"/>
				</CHART>
				<CHART 
					title="C.A. Facturé par tiers" 
					type="columnChart" 
					subType="stacked" 
					maxItems="10" 
					maxItemsSortOn="M4" 
					maxItemsSortSeq="D" 
					sortField="M4" 
					sortSeq="D" 
					condition="ROW.LVL == '1' ">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M2" displayName="AMO"/>
					<SERIE field="M3" displayName="AMC"/>
					<SERIE field="M4" displayName="Patient"/>
				</CHART>
			</CHART>
            <CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="SELECT.QUELMONTANT == '3' &amp;&amp; VIEW.GRBY_DATE == '-1'" >				
				<CHART title="C.A Total (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="M1" 
						maxItemsSortSeq="D" 
						sortField="M1" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A Total'" displayNameCalc="true"/>
				</CHART>
				<CHART 
					title="C.A. Total par tiers" 
					type="columnChart" 
					subType="stacked" 
					maxItems="10" 
					maxItemsSortOn="M4" 
					maxItemsSortSeq="D" 
					sortField="M4" 
					sortSeq="D" 
					condition="ROW.LVL == '1' ">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M2" displayName="AMO"/>
					<SERIE field="M3" displayName="AMC"/>
					<SERIE field="M4" displayName="Patient"/>
				</CHART>
			</CHART>
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="SELECT.QUELMONTANT == '2' &amp;&amp; VIEW.GRBY_DATE == '1'" >	
				<CHART title="C.A Comptabilisé (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="COD" 
						maxItemsSortSeq="D" 
						sortField="COD" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A Comptabilisé'" displayNameCalc="true"/>
				</CHART>
				<CHART title="C.A. Comptabilisé par tiers" 
					type="columnChart" 
					subType="stacked" 
					maxItems="10" 
					maxItemsSortOn="COD" 
					maxItemsSortSeq="D" 
					sortField="COD" 
					sortSeq="A"
					condition="ROW.LVL == '1' &amp;&amp; ROW.M4 > 1">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M2" displayName="AMO"/>
					<SERIE field="M3" displayName="AMC"/>
					<SERIE field="M4" displayName="Patient"/>
				</CHART>
			</CHART>
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10" visibleCondition="SELECT.QUELMONTANT == '2' &amp;&amp; VIEW.GRBY_DATE == '-1'" >	
				<CHART title="C.A Comptabilisé (10 premiers)" 
						type="pieChart" 
						maxItems="10" 
						maxItemsSortOn="M1" 
						maxItemsSortSeq="D" 
						sortField="M1" 
						sortSeq="D"
                        condition="ROW.LVL == '1'">
							<CATEGORY field="TXT" type="Char"/>
							<SERIE field="M1" displayName="'C.A Comptabilisé'" displayNameCalc="true"/>
				</CHART>
				<CHART title="C.A. Comptabilisé par tiers" 
					type="columnChart" 
					subType="stacked" 
					maxItems="20" 
					maxItemsSortOn="M4" 
					maxItemsSortSeq="D" 
					sortField="M4" 
					sortSeq="D"
					condition="ROW.LVL == '1' &amp;&amp; ROW.M4 > 1">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="M2" displayName="AMO"/>
					<SERIE field="M3" displayName="AMC"/>
					<SERIE field="M4" displayName="Patient"/>
				</CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="48" variableRowHeight="true" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<HEADERROWSTYLE name="textAlign" value="center"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="80" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" maxWidth="300" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="*ROW">
				</COLUMN>
				<COLUMN dataField="SEJ"
                    width="70"
                    type="Number"
                    visible="true"
                    outputFormat="#"
                    headerText="Séjours facturés"
                    fixed="false"
                    textAlign="right"
                    totalFunction="sum"
                    otherFunction="sum">
                    <description><![CDATA[
                        <B>Nombre de séjours facturés</B>
                        
                        Nombre de séjours avec au moins une ligne facturée
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="SEJVAL"
                    width="70"
                    type="Number"
                    visible="true"
                    outputFormat="#"
                    headerText="Séjours valorisés"
                    fixed="false"
                    textAlign="right"
                    totalFunction="sum"
                    otherFunction="sum">
                    <description><![CDATA[
                        <B>Nombre de séjours non facturés</B>
                        
                        Nombre de séjours avec aucune ligne facturée
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="SEJTOT"
                    width="70"
                    type="Number"
                    visible="true"
                    outputFormat="#"
                    headerText="Séjours total"
                    fixed="false"
                    textAlign="right"
                    totalFunction="sum"
                    otherFunction="sum">
                    <description><![CDATA[
                        <B>Nombre de séjours</B>
                        
                        Nombre de séjours au global
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
                <COLUMN dataField="NP" width="80" type="Number"  outputFormat="#" headerText="Nombre@LF@actes" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre actes">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>					
				</COLUMN>
				<COLUMN dataField="M1"
                    width="90"
                    type="Number"
                    outputFormat="#E"
                    visible="true"
					headerText="
								if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé  Total'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. total facturé et actes inclus'}
								if (SELECT.QUELMONTANT == 'MTI') {return ' C.A. total Actes inclus dans séjour'}
								if (SELECT.QUELMONTANT == '2') {return 'C.A. Total comptabilisé'}
								if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. total en-cours'}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. total'}
								if (SELECT.QUELMONTANT == '3') {return 'C.A. total'}
								" 
					headerTextCalc="true"
					description="=if (SELECT.QUELMONTANT == '1') {return 'Chiffre d\'affaires total facturé'}
								  if (SELECT.QUELMONTANT == 'MTFACI') {return 'Chiffre d\'affaires total facturé et actes inclus'}
								  if (SELECT.QUELMONTANT == 'MTI') {return 'Chiffre d\'affaires total Actes inclus dans séjour'}
								  if (SELECT.QUELMONTANT == '2') {return 'Chiffre d\'affaires total comptabilisé'}
								  if (SELECT.QUELMONTANT == 'ENF') {return 'Chiffre d\'affaires total en-cours'}
								  if (SELECT.QUELMONTANT == 'MF-ENF') {return 'Chiffre d\'affaires total'}
								  if (SELECT.QUELMONTANT == '3') {return 'Chiffre d\'affaires total'}
								" 
                    textAlign="right"
                    totalFunction="sum"
                    otherFunction="">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="MFP" type="Number" headerText="%" width="50" visible="true" outputFormat="0%" textAlign="center" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
				description="=if (SELECT.QUELMONTANT == '1') {return '% C.A. total facturé = (C.A. facturé de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. total facturé et actes inclus = (C.A. facturé et actes inclus de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == 'MTI') {return '% C.A.total Actes inclus dans séjour = (C.A. Actes inclus dans séjour de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == '2') {return '% total comptabilisé = (C.A. comptabilisé de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == 'ENF') {return '% total en-cours = (C.A. en-cours de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == 'MF-ENF') {return '% total = (C.A. total de la ligne / C.A. total)'}
							  if (SELECT.QUELMONTANT == '3') {return '% total = (C.A. total de la ligne / C.A. total)'}
							">
					<CALC formula="ROW.M1 / TOTALROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="SEJAMO"
                    width="80"
                    type="Number"
                    visible="true"
                    headerText="Séjours@LF@@LF@AMO"
                    outputFormat="#"
                    textAlign="right"
                    fixed="false"
                    totalFunction="sum"
                    otherFunction="">
                    <description><![CDATA[
                        <B>Nombre de séjours facturés à l'AMO</B>
                        
                        Nombre de séjours avec au moins une ligne facturée à l'AMO
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="M2" width="90" type="Number" visibleCondition="VIEW.MT2 != '0'" 
						headerText="
									if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé' +'\n'+'AMO'}
									if (SELECT.QUELMONTANT == '2') {return 'C.A. comptabilisé AMO'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. facturé' +'\n'+'AMO'}
									if (SELECT.QUELMONTANT == 'MTI') {return 'C.A. facturé' +'\n'+'AMO'}
									if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. en-cours' +'\n'+'AMO'}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. Facturé';}
									if (SELECT.QUELMONTANT == '3') {return 'C.A. Total';}
									" 
						headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="" 
						description="=if (SELECT.QUELMONTANT == '1') {return 'Chiffre d\'affaire facturé AMO (assurance maladie obligatoire)'}
									if (SELECT.QUELMONTANT == '2') {return 'Chiffre d\'affaire comptabilisé AMO (assurance maladie obligatoire)'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'Chiffre d\'affaire facturé AMO (assurance maladie obligatoire)'}
									if (SELECT.QUELMONTANT == 'MTI') {return 'Chiffre d\'affaire facturé AMO (assurance maladie obligatoire)'}
									if (SELECT.QUELMONTANT == 'ENF') {return 'Chiffre d\'affaire en-cours AMO (assurance maladie obligatoire)'}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return 'Chiffre d\'affaire Facturé'}
									if (SELECT.QUELMONTANT == '3') {return 'Chiffre d\'affaire Total (Facturé + valorisé)'}
									">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="textAlign" value="center"/>
				</COLUMN>
				<COLUMN dataField="MFAMOP" type="Number" headerText="%@LF@@LF@AMO" width="45" visible="true" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true"
						description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé AMO = (C.A. facturé AMO / C.A. total facturé)'}
									  if (SELECT.QUELMONTANT == '2') {return '% C.A. comptabilisé AMO = (C.A. comptabilisé AMO / C.A. total comptabilisé)'}
									  if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. facturé AMO = (C.A. facturé AMO / C.A. total facturé)'}
									  if (SELECT.QUELMONTANT == 'MTI') {return '% C.A. facturé AMO = (C.A. facturé AMO / C.A. total facturé)'}
									  if (SELECT.QUELMONTANT == 'ENF') {return '% C.A. en-cours AMO = (C.A. en-cours AMO / C.A. total en-cours)'}
									  if (SELECT.QUELMONTANT == 'MF-ENF') {return '% C.A. Facturé '}
									  if (SELECT.QUELMONTANT == '3') {return '% C.A. Total '}
									">
					<CALC formula="ROW.M2 / ROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="SEJAMC"
                    width="80"
                    type="Number"
                    visible="true"
                    headerText="Séjours@LF@@LF@AMC"
                    outputFormat="#"
                    textAlign="right"
                    fixed="false"
                    totalFunction="sum"
                    otherFunction="">
                    <description><![CDATA[
                        <B>Nombre de séjours facturés à la mutuelle</B>
                        
                        Nombre de séjours avec au moins une ligne facturée à la mutuelle
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="M3" width="90" type="Number" visibleCondition="VIEW.MT3 != '0'" 
					headerText="
								if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé' +'\n'+'AMC'}
								if (SELECT.QUELMONTANT == '2') {return 'C.A. comptabilisé AMC'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. facturé' +'\n'+'AMC'}
								if (SELECT.QUELMONTANT == 'MTI') {return 'C.A. facturé' +'\n'+'AMC'}
								if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. en-cours' +'\n'+'AMC'}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. Facturé'}
								if (SELECT.QUELMONTANT == '3') {return 'C.A. Total'}
								"  
						headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="sum" 
						description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé AMC (assurance maladie complémentaire)'}
									if (SELECT.QUELMONTANT == '2') {return 'Chiffre d\'affaire comptabilisé AMC (assurance maladie complémentaire)'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'Chiffre d\'affaire facturé AMC (assurance maladie complémentaire)'}
									if (SELECT.QUELMONTANT == 'MTI') {return 'Chiffre d\'affaire facturé AMC (assurance maladie complémentaire)'}
									if (SELECT.QUELMONTANT == 'ENF') {return 'Chiffre d\'affaire en-cours AMC (assurance maladie complémentaire)'}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return 'Chiffre d\'affaire Facturé'}
									if (SELECT.QUELMONTANT == '3') {return 'Chiffre d\'affaire Total'}
									">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
                <COLUMN dataField="SEJPAT"
                    width="80"
                    type="Number"
                    visible="true"
                    headerText="Séjours@LF@@LF@Patient"
                    outputFormat="#"
                    textAlign="right"
                    fixed="false"
                    totalFunction="sum"
                    otherFunction="">
                    <description><![CDATA[
                        <B>Nombre de séjours facturés au patient</B>
                        
                        Nombre de séjours avec au moins une ligne facturée au patient
                    ]]></description>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="M4" width="90" type="Number" visibleCondition="VIEW.MT4 != '0'" 
					headerText="
								if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé' +'\n'+'Patient'}
								if (SELECT.QUELMONTANT == '2') {return 'C.A. comptabilisé Patient'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. facturé' +'\n'+'Patient'}
								if (SELECT.QUELMONTANT == 'MTI') {return 'C.A. facturé' +'\n'+'Patient'}
								if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. en-cours' +'\n'+'Patient'}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. Facturé'}
								if (SELECT.QUELMONTANT == '3') {return 'C.A. Total'}
								" 
					headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="sum" 
					description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. facturé Patient'}
								if (SELECT.QUELMONTANT == '2') {return 'C.A. comptabilisé Patient'}
								if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. facturé Patient'}
								if (SELECT.QUELMONTANT == 'MTI') {return 'C.A. facturé Patient'}
								if (SELECT.QUELMONTANT == 'ENF') {return 'C.A. en-cours Patient'}
								if (SELECT.QUELMONTANT == 'MF-ENF') {return 'C.A. Facturé '}
								if (SELECT.QUELMONTANT == '3') {return 'C.A. Total Patient'}
					">
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MFAPAT" type="Number" headerText="%@LF@@LF@PAT" width="45" visible="true" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true"
						description="=if (SELECT.QUELMONTANT == '1') {return '% C.A. facturé Patient = (C.A. facturé Patient / C.A. total facturé)'}
									if (SELECT.QUELMONTANT == '2') {return '% C.A. comptabilisé Patient = (C.A. comptabilisé Patient / C.A. total comptabilisé)'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. facturé Patient = (C.A. facturé Patient / C.A. total facturé)'}
									if (SELECT.QUELMONTANT == 'MTI') {return '% C.A. facturé Patient = (C.A. facturé Patient / C.A. total facturé)'}
									if (SELECT.QUELMONTANT == 'ENF') {return '% C.A. en-cours Patient = (C.A. en-cours Patient / C.A. total en-cours)'}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return '% C.A. Facturé '}
									if (SELECT.QUELMONTANT == '3') {return '% C.A. Total '}
									">
					<CALC formula="ROW.M4 / ROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="SEJD" width="90" type="Number" outputFormat="#" headerText="Nb@LF@dépassements" textAlign="right" totalFunction="text" otherFunction="text" otherComplement="" description="Nombre d'interventions avec dépassements">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>				
				</COLUMN>
				<COLUMN dataField="M5" width="90" type="Number" visibleCondition="VIEW.MT5 != '0'" 
						headerText="
									if (SELECT.QUELMONTANT == '1') {return 'C.A.' +'\n'+'dépassements'}
									if (SELECT.QUELMONTANT == '2') {return 'C.A.'+'\n'+'dépassements'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A.'+'\n'+'dépassements'}
									if (SELECT.QUELMONTANT == 'MTI') {return ''}
									if (SELECT.QUELMONTANT == 'ENF') {return ''}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
									if (SELECT.QUELMONTANT == '3') {return 'C.A.' +'\n'+'dépassements'}
									" 
						headerTextCalc="true" outputFormat="#E" textAlign="right" totalFunction="sum" otherFunction="sum" 
						description="=if (SELECT.QUELMONTANT == '1') {return 'C.A. dépassements inclus dans le C.A. total facturé'}
									if (SELECT.QUELMONTANT == '2') {return 'C.A. dépassements inclus dans le C.A. total comptabilisé'}
									if (SELECT.QUELMONTANT == 'MTFACI') {return 'C.A. dépassements inclus dans le C.A. total facturé'}
									if (SELECT.QUELMONTANT == 'MTI') {return ''}
									if (SELECT.QUELMONTANT == 'ENF') {return ''}
									if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
                                    if (SELECT.QUELMONTANT == '3') {return 'C.A. dépassements inclus dans le C.A. total'}
									">
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
				<COLUMN dataField="MFDEPP" type="Number" headerText="%@LF@@LF@DEP" width="45" visible="true" outputFormat="0%" textAlign="center" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true" 
				description="=if (SELECT.QUELMONTANT == '1') {return '% C.A. dépassements = (C.A. dépassements / C.A. facturé)'}
							if (SELECT.QUELMONTANT == '2') {return '% C.A. dépassements = (C.A. dépassements / C.A. comptabilisé)'}
							if (SELECT.QUELMONTANT == 'MTFACI') {return '% C.A. dépassements = (C.A. dépassements / C.A. facturé)'}
							if (SELECT.QUELMONTANT == 'MTI') {return ''}
							if (SELECT.QUELMONTANT == 'ENF') {return ''}
							if (SELECT.QUELMONTANT == 'MF-ENF') {return ''}
                            if (SELECT.QUELMONTANT == '3') {return '% C.A. dépassements = (C.A. dépassements / C.A. Total)'}
							">
					<CALC formula="ROW.M5 / ROW.M1 * 100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="EFEFEF"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
