<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000335" label="PMSI. Analyse Paramétrable" title="= 'Analyse Paramétrable par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ') - ' + SELECT.VERSION_GROUPAGE_LABEL" database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" globals="PMSI_globals.XML" componentsFile="PMSI_components.XML" helpDokuWIkiDir="pmsi:sejours_analyse_globale:rss:sejours_rss:" helpDokuWIkiFile="pmsi000008"  helpFile="iCTI_PMSI_PMSI000335.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_RSS" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<VIEWPROPERTIES>
		<PROPERTY name="DATAFUNC">
			<value><![CDATA[[EVAL 
				// <?php
				function PMSI000335_dmsNat($tmp0, $sumCaseWhen, $ctiDivision) {
					$tmp1 = sprintf($sumCaseWhen, $tmp0, 'dms_nationale_ghs');
					$tmp2 = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
					return sprintf($ctiDivision, $tmp1, $tmp2);
				}
				
				function PMSI000335_dmsEts($tmp0, $sumCaseWhen, $ctiDivision) {
					$tmp1 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
					$tmp2 = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
					return sprintf($ctiDivision, $tmp1, $tmp2);
				}
				
				function PMSI000335_calcSQL($data) {
					
					// Pas de donnée sélectionnée, on renvoie des valeurs à zéro
					if ($data == '0') {
						return '0, 0';
					}
					$ctiDivision = "base.cti_division(%s, %s)";
					$countDistinctCaseWhen = "count(DISTINCT CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE null END)";
					$sumCaseWhen = "sum(CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ %s THEN %s ELSE 0 END)";
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$tmp0 = '';
					
					switch ($data) {
						case '1.1':	// Nombre de séjours
							$tmp = sprintf($countDistinctCaseWhen,'rss_id');
							break;
						case '1.2':	// Nombre de séjours 0 nuit
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_0n');
							break;
						case '1.3':	// Nombre de séjours 1 nuit
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_1n');
							break;
						case '1.4':	// Nombre de séjours > 1 nuit
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_2n + nb_rsa_xn');
							break;
						case '1.5':	// Nombre de séjours 2 nuits
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_2n');
							break;
						case '1.6':	// Nombre de séjours &gt; 2 nuits
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_xn');
							break;
						case '1.7':	// Nombre de séances
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_seances');
							break;
						case '1.8':	// Nombre de patients
							$tmp = sprintf($countDistinctCaseWhen, 'patient_id');
							break;
						case '1.9': // Nombre de journées hospitalisé
							$tmp = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							break;
						case '1.11': // Nombre de journées d'hospitalisation
							$tmp = sprintf($sumCaseWhen, $tmp0, 'duree_sejour + nb_rsa_0n + nb_seances');
							break;
						case '1.12':	// Nombre EXH
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_exh');
							break;
						case '1.13':	// Nombre EXB
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_exb');
							break;
						case '1.14':	// Nombre de séjours hospitalisé
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa_1n + nb_rsa_2n + nb_rsa_xn');
							break;
                        case '1.15':	// Age des patients
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 'age');
							$tmp2 = sprintf($countDistinctCaseWhen, 'rss_id');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
                        case '1.16': // Séjours dont séances
                            $tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
                            break;
						case '3.1':	// DMS
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							$tmp2 = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
						case '2.1':	// CA T2A
							$tmp = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							break;
						case '5.1':	// CA T2A 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							break;
						case '6.1':	// CA T2A 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							break;
						case '7.1':	// CA T2A hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							break;
						case '2.2':	// CA établissement
							$tmp = sprintf($sumCaseWhen, $tmp0, 'base_remboursement');
							break;
						case '5.2':	// CA établissement 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'base_remboursement');
							break;
						case '6.2':	// CA établissement 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'base_remboursement');
							break;
						case '7.2':	// CA établissement hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'base_remboursement');
							break;
						case '2.3':	// CA moyen établissement
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'base_remboursement') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '5.3':	// CA établissement moyen 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = 'base.cti_division(' .sprintf($sumCaseWhen, $tmp0, 'base_remboursement') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa'). ')';
							break;
						case '6.3':	// CA établissement moyen 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = 'base.cti_division(' .sprintf($sumCaseWhen, $tmp0, 'base_remboursement') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa'). ')';
							break;
						case '7.3':	// CA établissement moyen hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = 'base.cti_division(' .sprintf($sumCaseWhen, $tmp0, 'base_remboursement') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa'). ')';
							break;
						case '2.4':	// CA moyen T2A
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 't2a_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '5.4':	// CA moyen T2A 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 't2a_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '6.4':	// CA moyen T2A 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 't2a_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '7.4':	// CA moyen T2A hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 't2a_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '2.5':	// CA T2A journalier
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							$tmp2 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour + nb_rsa_0n + nb_seances');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
						case '5.5':	// CA T2A journalier 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							$tmp2 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour + nb_rsa_0n + nb_seances');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
						case '6.5':	// CA T2A journalier 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							$tmp2 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour + nb_rsa_0n + nb_seances');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
						case '7.5':	// CA T2A journalier hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp1 = sprintf($sumCaseWhen, $tmp0, 't2a_facture');
							$tmp2 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour + nb_rsa_0n + nb_seances');
							$tmp = sprintf($ctiDivision, $tmp1, $tmp2);
							break;
						case '2.6':	// CA GHS facturé
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs');
							break;
						case '5.6':	// CA GHS facturé 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs');
							break;
						case '6.6':	// CA GHS facturé 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs');
							break;
						case '7.6':	// CA GHS facturé hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs');
							break;
						case '2.7': // CA GHS Théorique
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs_theorique');
							break;
						case '5.7': // CA GHS Théorique 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs_theorique');
							break;
						case '6.7': // CA GHS Théorique 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs_theorique');
							break;
						case '7.7': // CA GHS Théorique hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_ghs_theorique');
							break;
						case '2.8':	// CA moyen GHS
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'ca_ghs') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '5.8':	// CA moyen GHS 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'ca_ghs') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '6.8':	// CA moyen GHS 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'ca_ghs') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '7.8':	// CA moyen GHS hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'ca_ghs') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '2.9':	// CA DMI
							$tmp = sprintf($sumCaseWhen, $tmp0, 'dmi_facture');
							break;
						case '5.9':	// CA DMI 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'dmi_facture');
							break;
						case '6.9':	// CA DMI 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'dmi_facture');
							break;
						case '7.9':	// CA DMI hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'dmi_facture');
							break;
						case '2.17':	// CA moyen DMI
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'dmi_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '5.17':	// CA moyen DMI 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'dmi_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '6.17':	// CA moyen DMI 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'dmi_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '7.17':	// CA moyen DMI hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'dmi_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '2.11':	// CA PHC
							$tmp = sprintf($sumCaseWhen, $tmp0,'phc_facture');
							break;
						case '5.11':	// CA PHC 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0,'phc_facture');
							break;
						case '6.11':	// CA PHC 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0,'phc_facture');
							break;
						case '7.11':	// CA PHC hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0,'phc_facture');
							break;
						case '2.12':	// CA moyen PHC
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'phc_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '5.12':	// CA moyen PHC 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'phc_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '6.12':	// CA moyen PHC 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'phc_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '7.12':	// CA moyen PHC hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = 'base.cti_division(' . sprintf($sumCaseWhen, $tmp0, 'phc_facture') . ',' . sprintf($sumCaseWhen, $tmp0, 'nb_rsa') . ')' ;
							break;
						case '2.13':	// CA EXH
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_exh');
							break;
						case '7.13':   // CA EXH hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_exh');
							break;
						case '2.14':	// CA EXB
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_exb');
							break;
						case '7.14':   // CA EXB hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_exb');
							break;
						case '2.15': // CA manque à gagner EXB
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_perte_exb');
							break;
						case '7.15':   // CA manque à gagner EXB hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ca_perte_exb');
							break;
						case '2.16':	// CA honoraires
							$tmp = sprintf($sumCaseWhen, $tmp0, 'honoraires_factures');
							break;
						case '5.16':	// CA honoraires 0 nuit
							$tmp0 = ' AND nb_seances > \'0\' OR nb_rsa_0n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'honoraires_factures');
							break;
						case '6.16':	// CA honoraires 1 nuit
							$tmp0 = ' AND nb_rsa_1n > \'0\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'honoraires_factures');
							break;
						case '7.16':	// CA honoraires hospitalisé
							$tmp0 = ' AND nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\'';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'honoraires_factures');
							break;
						case '3.2':	// Ecart DMS
							$tmp0 = ' AND cmd_code <> \'28\' ';
							// DMS NAT
							$tmpA = PMSI000335_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							//DMS ETS
							$tmpB = PMSI000335_dmsEts($tmp0, $sumCaseWhen, $ctiDivision);
							$tmp = '(' . $tmpB . ' - ' . $tmpA . ')';
							break;
						case '3.3':		// Performance ATIH
							// Nombre de dossiers
							$tmpA = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							// DMS NAT
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmpB = PMSI000335_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							$tmpC = '(' . $tmpB . ' * ' . $tmpA . ')';
							// Nombre de journées
							$tmpD = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							$tmp = sprintf($ctiDivision, $tmpC, $tmpD);
							break;
						case '3.4':		// Performance ANAP
							// Nombre de dossiers
							$tmpA = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							// DMS NAT
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmpB = PMSI000335_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							$tmpC = '(' . $tmpB . ' * ' . $tmpA . ')';
							// Nombre de journées
							$tmpD = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							$tmp = sprintf($ctiDivision, $tmpD, $tmpC);
							break;
						case '3.5':		// Jours bénéficiaires
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, '0 - ecart_[VIEW.DMS_FIELD]');
							break;
						case '3.6':		// Jours indus
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ecart_[VIEW.DMS_FIELD]');
							break;
						case '3.7':		// Ratio Indus / Bénéficiaires
							// Jours bénéficiaires
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmpA = sprintf($sumCaseWhen, $tmp0, '0 - ecart_[VIEW.DMS_FIELD]');
							// Jours indus
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 0 ';
							$tmpB = sprintf($sumCaseWhen, $tmp0, 'ecart_[VIEW.DMS_FIELD]');
							$tmp = sprintf($ctiDivision, $tmpB, $tmpA);
							break;
						case '3.8':	// Séjours < DMS Ref
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case '3.9':		// Séjours = DMS Ref
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case '3.11':		// Séjours = DMS Ref + 1
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 1 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case '3.12':		// Séjours = DMS Ref + 2
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 2 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case '3.13':		// Séjours = DMS Ref + 3
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 3 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case '3.14':	// Séjours > DMS Ref + 3
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 3 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						default :	// Nombre de séjours par défaut
							$tmp = sprintf($countDistinctCaseWhen, 'rss_id');
					}
					
					$toReplace = array(
						'@date_debut@',
						'@date_fin@'
					);
					
					$curPeriod = array(
						$periodeDebut,
						$periodeFin
					);
					
					
					
					return str_replace($toReplace, $curPeriod, $tmp);
				}
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATASQL">
			<value><![CDATA[[EVAL 
				// <?php
				
				return 
					PMSI000335_calcSQL('1.1') .','. PHP_EOL .
					PMSI000335_calcSQL('[DATA01]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA02]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA03]') .','. PHP_EOL .
					PMSI000335_calcSQL('[DATA04]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA05]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA06]') .','. PHP_EOL .
					PMSI000335_calcSQL('[DATA07]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA08]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA09]') .','. PHP_EOL .
					PMSI000335_calcSQL('[DATA10]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA11]') .','. PHP_EOL . 
					PMSI000335_calcSQL('[DATA12]');
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<SELECTIONS label="">
		<GROUP label="Période">
			<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="150" default="2014-07-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2014-12-31" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Données (12 Max)">
			<FIELD name="DATA01" label="" UI="combo" width="210" default="0" default2="" tree="true" printable="false" showIfNotDefault="true">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
			</FIELD>
			<FIELD name="DATA02" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false" selectable="false" showIfNotDefault="true" visible="= (SELECT.DATA01 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
			</FIELD>
			<FIELD name="DATA03" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false" showIfNotDefault="true" visible="= (SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA02 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
		</GROUP >
		<GROUP>
			<FIELD name="DATA04" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA05" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA04 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA06" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; ( SELECT.DATA05 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA07" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA08" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA07 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA09" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA07 != '0') &amp;&amp; ( SELECT.DATA08 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA10" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA09 != '0') &amp;&amp; ( SELECT.DATA08 != '0') &amp;&amp; ( SELECT.DATA07 != '0') &amp;&amp; (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA11" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA09 != '0') &amp;&amp; ( SELECT.DATA08 != '0') &amp;&amp; ( SELECT.DATA07 != '0')  &amp;&amp; (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA10 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
			<FIELD name="DATA12" label="" UI="combo" width="210" default="0" default2="0" tree="true" printable="false"  showIfNotDefault="true" visible="= (SELECT.DATA09 != '0') &amp;&amp; ( SELECT.DATA08 != '0') &amp;&amp; ( SELECT.DATA07 != '0') &amp;&amp; (SELECT.DATA05 != '0') &amp;&amp; ( SELECT.DATA06 != '0') &amp;&amp; ( SELECT.DATA04 != '0') &amp;&amp; (SELECT.DATA03 != '0') &amp;&amp; ( SELECT.DATA02 != '0') &amp;&amp; ( SELECT.DATA01 != '0') &amp;&amp; ( SELECT.DATA10 != '0') &amp;&amp; ( SELECT.DATA11 != '0')">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_CA" />
				<OPTION label="Options" data="" globalListProvider="DATA_RATIO" />
			</FIELD>
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="210" label="" UI="combo" default="4" tree="true">
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" 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 label="">
			<FIELD name="GROUPBY_2" width="210" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
             <FIELD name="GROUPBY_3" width="210" label="" UI="combo" default="-1"  tree="true"> 
				<OPTION label="Pas de troisième niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_RSS_SOUSSELECTIONS" />
	<SELECTIONS componentName="FILTRES_RSS_SELECTIONS" />
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_RSS_X" cacheEnabled="true">
				<select><![CDATA[ 
					
					CTISELECT_TREE
						GROUPBY1{[VIEW.SELECT_TABTREE_OID_FIELD],, [VIEW.SELECT_TABTREE_COD_FIELD],, [VIEW.SELECT_TABTREE_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.SELECT_TABTREE_2_OID_FIELD],, [VIEW.SELECT_TABTREE_2_COD_FIELD],, [VIEW.SELECT_TABTREE_2_TXT_FIELD]}
						GROUPBY3{[VIEW.SELECT_TABTREE_3_OID_FIELD],, [VIEW.SELECT_TABTREE_3_COD_FIELD],, [VIEW.SELECT_TABTREE_3_TXT_FIELD]}
						SIGNIFDATA{[VIEW.SELECT_TABTREE_ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						OPTIONS{NOTZERO=1}
						ORDERBY{[VIEW.DATA01],, DESC}
						INDICATORS{
							[VIEW.DATASQL]
						}
					FROM 
						[VIEW.V_RSS_VIEW_OPTIMIZE]
					WHERE 1=1
						AND (
							mois_sortie IN ([VIEW.PERIODE_MOIS_LIST]) AND date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						)
						[VIEW.FILTRE_RSS_SELECT]
						
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<FIELD name="SORT" />
					<FIELD name="SEJ" />
					<FIELD name="D1" />
					<FIELD name="D2" />
					<FIELD name="D3" />
					<FIELD name="D4" />
					<FIELD name="D5" />
					<FIELD name="D6" />
					<FIELD name="D7" />
					<FIELD name="D8" />
					<FIELD name="D9" />
					<FIELD name="D10" />
					<FIELD name="D11" />
					<FIELD name="D12" />
				</FIELDS>
			</SQL>
			</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
				<SQL>
					<select><![CDATA[
							SELECT 'X_PERIODE_D', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '1 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(date_debut) FROM pmsi.p_imports))::text
						UNION ALL
							SELECT 'X_TOPERIODE_D', greatest(to_date(to_char('[TOPERIODE]'::date - INTERVAL  '1 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(date_debut) FROM pmsi.p_imports))::text
                        UNION ALL
							SELECT 'X_PERIODE', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '3 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(date_debut) FROM pmsi.p_imports))::text
					]]></select>
					<FIELDS>
						<FIELD name="name"/>
						<FIELD name="value"/>
					</FIELDS>
				</SQL>
			</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="PMSI000037.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
				<ARG name="DATA1" value="'1.1'" />
				<ARG name="DATA2" value="return SELECT.DATA01" />
				<ARG name="DATA3" value="return SELECT.DATA02" />
			</VIEWLINK>
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="PMSI000036.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
				<ARG name="DATA" value="return SELECT.DATA01" />
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="PMSI000213.XML" enabled="true" rowContext="false" buttonType="ANALYSE_CROISEE">
				<ARG name="ALIAS_PERIODE" value="'-1'" />
				<ARG name="PERIODE" value="return VIEW.X_PERIODE;" />
				<ARG name="DATA" value="return SELECT.DATA01" />
				<ARG name="COLUMNBY" value="'MSOR'" />
				<ARG name="GROUPBY" value="'ASOR'" />
				<ARG name="GROUPBY_2" value="if (SELECT.GROUPBY == 'ASOR') {return 'GHM';} else {return SELECT.GROUPBY;}" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
			</VIEWLINK>
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000005.XML" componentName="RSS_BASE_VIEWLINK" />
		</VIEWLINKS>
		<ONGLET excelLabel="Comparaison" label="Comparaison" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="" type="group" subType="h" percentHeight="100">
				<CHART title="Nombre de Séjours" type="pieChart" subType="" maxItems="10" maxItemsSortOn="SEJ" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="CODTXT" type="Char" />
					<SERIE field="SEJ" displayName="Nombre de Séjours" />
				</CHART>
				<CHART title="Répartition 1ère donnée" type="pieChart" subType="" maxItems="10" maxItemsSortOn="D1" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="CODTXT" type="Char" />
					<SERIE field="D1" displayName="SELECT.DATA01_LABEL " displayNameCalc="true"/>
				</CHART>
				<CHART title="Répartition 2ème donnée" type="pieChart" subType="" maxItems="10" maxItemsSortOn="D2" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="CODTXT" type="Char" />
					<SERIE field="D2" displayName="SELECT.DATA02_LABEL " displayNameCalc="true"/>
				</CHART>
			</CHART>
			
			<DATAGRID title="" total="true" showOthers="true" headerHeight="54" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_3 == '-1' ||  SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="LVL" width="50" type="Char" visible="false" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" />
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="70" 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="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" />
				<COLUMN dataField="CODTXT" type="Char" minWidth="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,10)" />
				</COLUMN>
				<COLUMN dataField="SEJ" type="Number" width="80" outputFormat="#" selectable="true" headerText="Nombre de Séjours" otherFunction="text" totalFunction="text" description="Nombre de séjours. Pour les séjours de la CMD 28, nombre de séances"/>
				<COLUMN dataField="P_RSA" type="Number" headerText="% Séjours" width="50" selectable="true" outputFormat="#,0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true"
					description="Poids du nombre de séjours du critère de regroupement dans le nombre de séjours Total">
					<CALC formula="ROW.SEJ / TOTALROW.SEJ * 100" />
				</COLUMN>
				<COLUMN dataField="D1" type="Number" width="90" fixed="false" outputFormat="= SELECT.DATA012" selectable="true" headerText="SELECT.DATA01_LABEL" headerTextCalc="true" description="= SELECT.DATA013 " visibleCondition="SELECT.DATA01 != '0'" />
				<COLUMN dataField="D2" type="Number" width="90" outputFormat="= SELECT.DATA022" selectable="true" headerText="SELECT.DATA02_LABEL" headerTextCalc="true" description="= SELECT.DATA023 " visibleCondition="SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" />
				<COLUMN dataField="D3" type="Number" width="90" outputFormat="= SELECT.DATA032" selectable="true" headerText="SELECT.DATA03_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D3_2" type="Number" width="90" outputFormat="= if(SELECT.DATA03=='4.3'){return SELECT.DATA012} else { return SELECT.DATA032}" selectable="true" headerText="SELECT.DATA03_LABEL" headerTextCalc="true" description="= SELECT.DATA033" visibleCondition="SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="
					switch(SELECT.DATA03) {
						case '4.2' :
							return ROW.D2 / TOTALROW.D2 * 100;
							break;
						case '4.3' :
							return ROW.D1 - ROW.D2;
							break;
						case '4.4' :
							return ((ROW.D1 - ROW.D2)/ ROW.D1 * 100);
							break;
						default :
							return ROW.D3;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D4" type="Number" width="90" outputFormat="= SELECT.DATA042" selectable="true" headerText="SELECT.DATA04_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D4_2" type="Number" width="90" outputFormat="=  if(SELECT.DATA04=='4.3'){return SELECT.DATA022} else { return SELECT.DATA042}" selectable="true" headerText="SELECT.DATA04_LABEL" headerTextCalc="true" description="= SELECT.DATA043 " visibleCondition="SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="
					switch(SELECT.DATA04) {
						case '4.2' :
							return ROW.D3 / TOTALROW.D3 * 100;
							break;
						case '4.3' :
							return ROW.D2 - ROW.D3;
							break;
						case '4.4' :
							return ((ROW.D2 - ROW.D3)/ ROW.D2 * 100);
							break;
						default :
							return ROW.D4;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D5" type="Number" width="90" outputFormat="= SELECT.DATA052" selectable="true" headerText="SELECT.DATA05_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D5_2" type="Number" width="90" outputFormat="= if(SELECT.DATA05=='4.3'){return SELECT.DATA032} else { return SELECT.DATA052}" selectable="true" headerText="SELECT.DATA05_LABEL" headerTextCalc="true" description="= SELECT.DATA053 " visibleCondition="SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA05) {
						case '4.2' :
							return ROW.D4 / TOTALROW.D4 * 100;
							break;
						case '4.3' :
							return ROW.D3 - ROW.D4;
							break;
						case '4.4' :
							return ((ROW.D3 - ROW.D4)/ ROW.D3 * 100);
							break;
						default :
							return ROW.D5;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D6" type="Number" width="90" outputFormat="= SELECT.DATA062" selectable="true" headerText="SELECT.DATA06_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D6_2" type="Number" width="90" outputFormat="= if(SELECT.DATA06=='4.3'){return SELECT.DATA042} else { return SELECT.DATA062}" selectable="true" headerText="SELECT.DATA06_LABEL" headerTextCalc="true" description="= SELECT.DATA063 " visibleCondition="SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA06) {
						case '4.2' :
							return ROW.D5 / TOTALROW.D5 * 100;
							break;
						case '4.3' :
							return ROW.D4 - ROW.D5;
							break;
						case '4.4' :
							return ((ROW.D4 - ROW.D5)/ ROW.D4 * 100);
							break;
						default :
							return ROW.D6;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D7" type="Number" width="90" outputFormat="= SELECT.DATA072" selectable="true" headerText="SELECT.DATA07_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D7_2" type="Number" width="90" outputFormat="= if(SELECT.DATA07=='4.3'){return SELECT.DATA052} else { return SELECT.DATA072}" selectable="true" headerText="SELECT.DATA07_LABEL" headerTextCalc="true" description="= SELECT.DATA073 " visibleCondition="SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA07) {
						case '4.2' :
							return ROW.D6 / TOTALROW.D6 * 100;
							break;
						case '4.3' :
							return ROW.D5 - ROW.D6;
							break;
						case '4.4' :
							return ((ROW.D5 - ROW.D6)/ ROW.D5 * 100);
							break;
						default :
							return ROW.D7;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D8" type="Number" width="90" outputFormat="= SELECT.DATA082" selectable="true" headerText="SELECT.DATA08_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D8_2" type="Number" width="90" outputFormat="= if(SELECT.DATA08=='4.3'){return SELECT.DATA062} else { return SELECT.DATA082}" selectable="true" headerText="SELECT.DATA08_LABEL" headerTextCalc="true" description="= SELECT.DATA083" visibleCondition="SELECT.DATA08 != '0' &amp;&amp; SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA08) {
						case '4.2' :
							return ROW.D7 / TOTALROW.D7 * 100;
							break;
						case '4.3' :
							return ROW.D6 - ROW.D7;
							break;
						case '4.4' :
							return ((ROW.D6 - ROW.D7)/ ROW.D6 * 100);
							break;
						default :
							return ROW.D8;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D9" type="Number" width="90" outputFormat="= SELECT.DATA092" selectable="true" headerText="SELECT.DATA09_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D9_2" type="Number" width="90" outputFormat="= if(SELECT.DATA09=='4.3'){return SELECT.DATA072} else { return SELECT.DATA092}" selectable="true" headerText="SELECT.DATA09_LABEL" headerTextCalc="true" description="= SELECT.DATA093 " visibleCondition="SELECT.DATA09 != '0' &amp;&amp; SELECT.DATA08 != '0' &amp;&amp; SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA09) {
						case '4.2' :
							return ROW.D8 / TOTALROW.D8 * 100;
							break;
						case '4.3' :
							return ROW.D7 - ROW.D8;
							break;
						case '4.4' :
							return ((ROW.D7 - ROW.D8)/ ROW.D7 * 100);
							break;
						default :
							return ROW.D9;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D10" type="Number" width="90" outputFormat="= SELECT.DATA102" selectable="true" headerText="SELECT.DATA10_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D10_2" type="Number" width="90" outputFormat="= if(SELECT.DATA10=='4.3'){return SELECT.DATA082} else { return SELECT.DATA102}" selectable="true" headerText=" SELECT.DATA10_LABEL" headerTextCalc="true" description="= SELECT.DATA103 " visibleCondition="SELECT.DATA10 != '0' &amp;&amp; SELECT.DATA09 != '0' &amp;&amp; SELECT.DATA08 != '0' &amp;&amp; SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA10) {
						case '4.2' :
							return ROW.D9 / TOTALROW.D9 * 100;
							break;
						case '4.3' :
							return ROW.D8 - ROW.D9;
							break;
						case '4.4' :
							return ((ROW.D8 - ROW.D9)/ ROW.D8 * 100);
							break;
						default :
							return ROW.D10;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D11" type="Number" width="90" outputFormat="= SELECT.DATA112" selectable="true" headerText="SELECT.DATA11_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D11_2" type="Number" width="90" outputFormat="= if(SELECT.DATA11=='4.3'){return SELECT.DATA092} else { return SELECT.DATA112}" selectable="true" headerText=" SELECT.DATA11_LABEL" headerTextCalc="true" description="= SELECT.DATA113" visibleCondition="SELECT.DATA11 != '0' &amp;&amp; SELECT.DATA10 != '0' &amp;&amp; SELECT.DATA09 != '0' &amp;&amp; SELECT.DATA08 != '0' &amp;&amp; SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA11) {
						case '4.2' :
							return ROW.D10 / TOTALROW.D10 * 100;
							break;
						case '4.3' :
							return ROW.D9 - ROW.D10;
							break;
						case '4.4' :
							return ((ROW.D9 - ROW.D10)/ ROW.D9 * 100);
							break;
						default :
							return ROW.D11;
							break;
					}" />
				</COLUMN>
				<COLUMN dataField="D12" type="Number" width="90" outputFormat="= SELECT.DATA122" selectable="true" headerText="SELECT.DATA12_LABEL" headerTextCalc="true" description=" " visible="false" />
				<COLUMN dataField="D12_2" type="Number" width="90" outputFormat="= if(SELECT.DATA12=='4.3'){return SELECT.DATA102} else { return SELECT.DATA122}" selectable="true" headerText=" SELECT.DATA12_LABEL" headerTextCalc="true" description="= SELECT.DATA123" visibleCondition="SELECT.DATA12 != '0' &amp;&amp; SELECT.DATA11 != '0' &amp;&amp; SELECT.DATA10 != '0' &amp;&amp; SELECT.DATA09 != '0' &amp;&amp; SELECT.DATA08 != '0' &amp;&amp; SELECT.DATA07 != '0' &amp;&amp; SELECT.DATA06 != '0' &amp;&amp; SELECT.DATA05 != '0' &amp;&amp; SELECT.DATA04 != '0' &amp;&amp; SELECT.DATA03 != '0' &amp;&amp; SELECT.DATA02 != '0' &amp;&amp; SELECT.DATA01 != '0'" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
				<CALC formula="
					switch(SELECT.DATA12) {
						case '4.2' :
							return ROW.D11 / TOTALROW.D11 * 100;
							break;
						case '4.3' :
							return ROW.D10 - ROW.D11;
							break;
						case '4.4' :
							return ((ROW.D10 - ROW.D11)/ ROW.D10 * 100);
							break;
						default :
							return ROW.D12;
							break;
					}" />
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
