<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="PMSI000033" label="PMSI. Evolution temporelle Séjours" title="= SELECT.DATA_LABEL + ' 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_PMSI000033.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_RSS" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />    
		<PROPERTY name="DATA">
			<value><![CDATA[[EVAL 
			
				switch ('[DATA]') {
					case '1' : 
						return 'v_rss_1.rss_id';
						break;
					case '2' :case '2.2' : 
						return 'nb_rsa_0n';
						break;
					case '3' : 
						return 'nb_rsa_1n';
						break;
					case '3.3' : 
						return 'nb_rsa_2n + nb_rsa_xn';
						break;
					case '4' : 
						return 'nb_rsa_2n';
						break;
					case '5' : 
						return 'nb_rsa_xn';
						break;
					case '6' : 
						return 'nb_seances';
						break;
					case '7' : 
						return 'duree_sejour';
						break;
					case '8' : 
						return "CASE WHEN cmd_code <> '28' THEN duree_sejour else 0 END";
						break;					
                    case '8.1' : 
						return "CASE WHEN cmd_code <> '28' THEN dms_nationale_ghs else 0 END";
						break;                    
                    case '1.17' : 
						return "v_rss_1.ghm_id";
						break;
					default :
						return 'nb_rsa';
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATAM">
			<value><![CDATA[[EVAL 
			
				switch ('[DATA]') {
					case '1' : 
						return 'COUNT(DISTINCT v_rss_1.rss_id)';
						break;
					case '1.16' : 
						return 'SUM(nb_rsa)';
						break;					
                    case '1.17' : 
						return 'COUNT(DISTINCT v_rss_1.ghm_id)';
						break;					
                    case '2' : 
						return 'SUM(nb_rsa_0n)';
						break;
					case '2.2' : 
						return 'base.cti_division(SUM(nb_rsa_0n),COUNT(DISTINCT v_rss_1.rss_id))*100';
						break;
					case '3' : 
						return 'SUM(nb_rsa_1n)';
						break;
					case '3.3' : 
						return 'SUM(nb_rsa_2n + nb_rsa_xn)';
						break;
					case '4' : 
						return 'SUM(nb_rsa_2n)';
						break;
					case '5' : 
						return 'SUM(nb_rsa_xn)';
						break;
					case '6' : 
						return 'SUM(nb_seances)';
						break;
					case '7' : 
						return 'SUM(duree_sejour)';
						break;
					case '8' : 
						return "base.cti_division(sum(CASE WHEN cmd_code <> '28' THEN duree_sejour else 0 END), sum(CASE WHEN cmd_code <> '28' THEN nb_rsa ELSE 0 END))";
						break;					
                    case '8.1' : 
						return "base.cti_division(sum(CASE WHEN cmd_code <> '28' THEN dms_nationale_ghs else 0 END), sum(CASE WHEN cmd_code <> '28' THEN nb_rsa ELSE 0 END))";
						break;                   
                    case '9' : 
						return "sum(CASE WHEN mode_sortie = '9' THEN nb_rsa else 0 END)";
						break;                    
                    case '10' : 
						return "sum(CASE WHEN duree_sejour = 0 AND cas_code = 'C' THEN nb_rsa else 0 END)";
						break;
                    case '1.13' : 
						return "base.cti_division(	
									sum(ghm_nat.age_public),
									sum(ghm_nat.nb_rsa_public))";
						break;                    
                    case '1.14' : 
						return "base.cti_division(	
									sum(ghm_nat.age_prive),
									sum(ghm_nat.nb_rsa_prive))";
						break;
                    case '1.15' : 
						return "base.cti_division(	
									sum(age),
									COUNT(DISTINCT  v_rss_1.rss_id ))";
						break;                    
					default :
						return 'nb_rsa';
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATAI">
			<value><![CDATA[[EVAL 
			
				switch ('[DATA]') {
					case '1' : 
						return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN v_rss_1.rss_id ELSE NULL END)";
						break;						
                    case '1.16' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa ELSE NULL END)";
						break;
                    case '1.17' : 
						return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN v_rss_1.ghm_id ELSE NULL END)";
						break;					
					case '2' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_0n ELSE NULL END)";
						break;
					case '2.2': 
						return 'base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_0n ELSE NULL END),COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN v_rss_1.rss_id ELSE NULL END))*100';
						break;
					case '3' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_1n ELSE NULL END)";
						break;
					case '3.3' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_2n + nb_rsa_xn ELSE NULL END)";
						break;
					case '4' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_2n ELSE NULL END)";
						break;
					case '5' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa_xn ELSE NULL END)";
						break;
					case '6' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_seances ELSE NULL END)";
						break;
                    case '7' : 
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN duree_sejour ELSE NULL END)";
						break;
					case '8' : 
						return "base.cti_division(	
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN cmd_code <> '28' THEN duree_sejour else 0 END ELSE NULL END),
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN cmd_code <> '28' THEN nb_rsa ELSE 0 END ELSE NULL END))";
						break;					
                    case '8.1' : 
						return "base.cti_division(	
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN cmd_code <> '28' THEN dms_nationale_ghs else 0 END ELSE NULL END),
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN cmd_code <> '28' THEN nb_rsa ELSE 0 END ELSE NULL END))";
						break;                    
                    case '1.13' : 
						return "base.cti_division(	
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN ghm_nat.age_public ELSE NULL END),
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN ghm_nat.nb_rsa_public ELSE NULL END))";
						break;
                    case '1.14' : 
						return "base.cti_division(	
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN ghm_nat.age_prive ELSE NULL END),
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN ghm_nat.nb_rsa_prive ELSE NULL END))";
						break;
                    case '1.15' : 
						return "base.cti_division(	
									sum(CASE WHEN COLUMNCHECKSEQUENCE THEN  age  ELSE NULL END),
									COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN v_rss_1.rss_id ELSE NULL END))";
						break;                         
                    case '9' : 
						return "sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN mode_sortie = '9' THEN nb_rsa else 0 END ELSE NULL END)";
						break;
                    case '10' : 
						return "sum(CASE WHEN COLUMNCHECKSEQUENCE THEN CASE WHEN duree_sejour = 0 AND cas_code = 'C' THEN nb_rsa else 0 END ELSE NULL END)";
						break;
					default :
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_rsa ELSE NULL END)";
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="COMBIEN_JOURS">
			<value><![CDATA[
						[EVAL 
							if ('[PERIODICITE]' == 'DAY') {
								if ('[NBJOURS]' != '-1') {
									return [NBJOURS];
								}
								else {
									return substr('[TOPERIODE]', -2);
								}
							}
							else {return "12";}
						EVAL]
					]]></value>
		</PROPERTY>
		
		<PROPERTY name="NB_MOIS">
			<value><![CDATA[[EVAL 
				
				// nombre de mois entre les deux dates de la pÃ©riode d'analyse
				$nb_mois = 	((intval(substr('[TOPERIODE]', 0, 4)) - 1) * 12 + intval(substr('[TOPERIODE]', 5, 2))) -
							((intval(substr('[PERIODE]', 0, 4)) - 1) * 12 + intval(substr('[PERIODE]', 5, 2))) + 1;
			
				switch ('[PERIODICITE]') {
					case 'MONTH':
						// return $nb_mois > 12 ? '12' : strval($nb_mois);
						return strval($nb_mois);
						break;
					case 'QUARTER' :
						// return ceil($nb_mois / 3) > 12 ? '12' : strval(ceil($nb_mois / 3));
						return strval(ceil($nb_mois / 3));
						break;
					case 'YEAR' :
						// return ceil($nb_mois / 12) > 12 ? '12' : strval(ceil($nb_mois / 12));
						return strval(ceil($nb_mois / 12));
						break;
					default :
						return strval($nb_mois);
				}
				
			EVAL]]]></value>
		</PROPERTY>

		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<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="de" UI="combo" tree="true" width="200" default="2014-01-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à " UI="combo" tree="true" width="200" default="2014-12-31" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Périodicité">
			<FIELD name="PERIODICITE" width="200" UI="combo" default="MONTH" globalListProvider="PERIODICITE" />
			<FIELD name="NBJOURS" label="Nombre de jours" UI="combo" width="200" default="12" visible="= SELECT.PERIODICITE == 'DAY' ">
				<OPTION data="-1" label="A partir du dÃ©but du mois"/>
				<OPTION data="1" label="1 jour"/>
				<OPTION data="2" label="2 jours"/>
				<OPTION data="3" label="3 jours"/>
				<OPTION data="4" label="4 jours"/>
				<OPTION data="5" label="5 jours"/>
				<OPTION data="6" label="6 jours"/>
				<OPTION data="7" label="7 jours"/>
				<OPTION data="8" label="8 jours"/>
				<OPTION data="9" label="9 jours"/>
				<OPTION data="10" label="10 jours"/>
				<OPTION data="11" label="11 jours"/>
				<OPTION data="12" label="12 jours"/>
				<OPTION data="13" label="13 jours"/>
				<OPTION data="14" label="14 jours"/>
				<OPTION data="15" label="15 jours"/>
				<OPTION data="16" label="16 jours"/>
				<OPTION data="17" label="17 jours"/>
				<OPTION data="18" label="18 jours"/>
				<OPTION data="19" label="19 jours"/>
				<OPTION data="20" label="20 jours"/>
 				<OPTION data="21" label="21 jours"/>
				<OPTION data="22" label="22 jours"/>
				<OPTION data="23" label="23 jours"/>
				<OPTION data="24" label="24 jours"/>
				<OPTION data="25" label="25 jours"/>
				<OPTION data="26" label="26 jours"/>
				<OPTION data="27" label="27 jours"/>
				<OPTION data="28" label="28 jours"/>
				<OPTION data="29" label="29 jours"/>
				<OPTION data="30" label="30 jours"/>
				<OPTION data="31" label="31 jours"/>			
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA" width="280" label="" UI="combo" default="1" tree="true" printable="false" >
				<OPTION label="Options" data="" globalListProvider="DATA_SEJOURS" />
			</FIELD>
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="" UI="combo" default="4" tree="true">
                <OPTION label="RSS" data="RSS" treeLevel="1"/>				
                <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="220" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>		
        <GROUP label="">
			<FIELD name="GROUPBY_3" width="220" 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>
		<GROUP label="">
			<FIELD name="SHOWDMSREF" label="" width="1" UI="text" default="1" printable="false" visible="false" />
		</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]}
						COLUMNBY[PERIODICITE]{date_sortie,, '[PERIODE]' ,, '[TOPERIODE]' ,, [VIEW.COMBIEN_JOURS],, [VIEW.COLUMN_OPTION]}
						OPTIONS{NOTZERO=1}
						INDICATORS{sum(nb_rsa), [VIEW.DATAM],}	
						INDICATORS_COLUMNS{[VIEW.DATAI],}
						ORDERBY{[VIEW.DATA],, DESC}
					FROM 
						#V_RSS_X#
					WHERE 
						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="NRSA" />
					<FIELD name="N" />
					<FIELD name="N0" />
					<FIELD name="N1" />
					<FIELD name="N2" />
					<FIELD name="N3" />
					<FIELD name="N4" />
					<FIELD name="N5" />
					<FIELD name="N6" />
					<FIELD name="N7" />
					<FIELD name="N8" />
					<FIELD name="N9" />
					<FIELD name="N10" />
					<FIELD name="N11" />
					<FIELD name="N12" />
					<FIELD name="N13" />
					<FIELD name="N14" />
					<FIELD name="N15" />
					<FIELD name="N16" />
					<FIELD name="N17" />
					<FIELD name="N18" />
					<FIELD name="N19" />
					<FIELD name="N20" />
					<FIELD name="N21" />
					<FIELD name="N22" />
					<FIELD name="N23" />
					<FIELD name="N24" />
					<FIELD name="N25" />
					<FIELD name="N26" />
					<FIELD name="N27" />
					<FIELD name="N28" />
					<FIELD name="N29" />
					<FIELD name="N30" />
					<FIELD name="N31" />
				</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
                        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
                        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
                    UNION
                        SELECT 'BASE_NAT_YEAR', extract('year' FROM max(date_reference))::text FROM pmsi.t_indicateurs_atih where periode_type <> 'NOW'
                ]]></select>
                <FIELDS>
                    <FIELD name="name" />
                    <FIELD name="value" />
                </FIELDS>
            </SQL>
        </QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="PMSI000035.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'" />
                <ARG name="DATA2" value="'7'" />
                <ARG name="DATA3" value="'2'" />
                <ARG name="DATA4" value="'3'" />
                <ARG name="DATA5" value="'3.3'" />
                <ARG name="DATA6" value="'0'" />
                <ARG name="DATA7" value="'0'" />
                <ARG name="DATA8" value="'0'" />
                <ARG name="DATA9" value="'0'" />
                <ARG name="DATA010" value="'0'" />
                <ARG name="DATA011" value="'0'" />
                <ARG name="DATA012" value="'0'" />
                <ARG name="DATA013" value="'0'" />
                <ARG name="DATA014" value="'0'" />
                <ARG name="DATA015" value="'0'" />
			</VIEWLINK>			
            <VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="PMSI000434.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'" />
                <ARG name="DATA2" value="'7'" />
                <ARG name="DATA3" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"  view="PMSI000435.XML"  rowContext="false" componentName=""  enabled="true" buttonType="VIEWLINK_EVO_COMP_1" >			
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="'MSOR'" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
                    <ARG name="DATA1" value="'1'" />
                    <ARG name="DATA2" value="'7'" />
                    <ARG name="DATA3" value="'2'" />
                    <ARG name="DATA4" value="'3'" />
                    <ARG name="DATA5" value="'3.3'" />
                    <ARG name="DATA6" value="'0'" />
                    <ARG name="DATA7" value="'0'" />
                    <ARG name="DATA8" value="'0'" />
                    <ARG name="DATA9" value="'0'" />
                    <ARG name="DATA010" value="'0'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'0'" />
					<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;"/>
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="PMSI000033.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
				<ARG name="DATA" value="'1'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="PMSI000214.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="'1'" />
				<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'" />
				<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;"/>
			</VIEWLINK>
			<VIEWLINK label="Analyse"  shortLabel="Analyse"  rowContext="false" buttonType="VIEWLINK_ANALYSE_MCO">			
                <VIEWITEM label="Analyse" shortLabel="Analyse" view="PMSI000008.XML" enabled="true" rowContext="false" buttonType="ANALYSE">
                    <ARG name="PERIODE" value="return VIEW.PERIODE;" />
                    <ARG name="TOPERIODE" value="return VIEW.TOPERIODE;" />
                    <ARG name="GROUPBY_TAB" value="'AUTO'" />
                </VIEWITEM>			
                <VIEWITEM label="CA" shortLabel="Analyse CA" view="PMSI000007.XML" enabled="true" rowContext="false" buttonType="ANALYSE">
                    <ARG name="PERIODE" value="return VIEW.PERIODE;" />
                    <ARG name="TOPERIODE" value="return VIEW.TOPERIODE;" />
                    <ARG name="GROUPBY_TAB" value="'AUTO'" />
                </VIEWITEM>                
                <VIEWITEM label="Analyse paramétrable" shortLabel="Analyse CA" view="PMSI000439.XML" enabled="true" rowContext="false" buttonType="ANALYSE">
                    <ARG name="PERIODE" value="return VIEW.PERIODE;" />
                    <ARG name="TOPERIODE" value="return VIEW.TOPERIODE;" />
                    <ARG name="GROUPBY_TAB" value="'AUTO'" />
                    <ARG name="LS_DATA" value="'-1'" />
                    <ARG name="DATA01" value="'7'" />
                    <ARG name="DATA02" value="'2'" />
                    <ARG name="DATA03" value="'3'" />
                    <ARG name="DATA04" value="'3.3'" />
                    <ARG name="DATA05" value="'0'" />
                    <ARG name="DATA06" value="'0'" />
                    <ARG name="DATA07" value="'0'" />
                    <ARG name="DATA08" value="'0'" />
                    <ARG name="DATA09" value="'0'" />
                    <ARG name="DATA010" value="'0'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'0'" />
                </VIEWITEM>
			</VIEWLINK>
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000034.XML" componentName="RSS_BASE_VIEWLINK" component2Name="DATE_EVOL_2_VIEWLINK">
				<ARG name="T_DUREE_SEJOUR" value="if (SELECT.DATA == '2') {return 'DU0'}
													if (SELECT.DATA == '3') {return 'DU1'}
													if (SELECT.DATA == '3.3') {return '3.3'}
													if (SELECT.DATA == '4') {return 'DU2'}
													if (SELECT.DATA == '5') {return 'X'}
													if (SELECT.DATA == '6') {return 'S'}" />
			</VIEWLINK>
		</VIEWLINKS>	
		<ONGLET excelLabel="Répartition temporelle" label="Répartition temporelle" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
            <CHART title="" type="group" subType="h" percentHeight="100" fromTotal="false">					
                <CHART title="Décomposition (10 premiers)" type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="N" sortSeq="D" condition="ROW.LVL == '1'">
                    <CATEGORY field="CODTXT" type="Char" />
                    <SERIE field="N" displayName="SELECT.DATA_LABEL" displayNameCalc="true" />
                </CHART>            
                <CHART title="Evolution temporelle (5 premiers)" type="lineChart" maxItems="5" maxItemsSortOn="N" maxItemsSortSeq="D" serieIsCategory="true" sortField="N" sortSeq="D"  visibleCondition="SELECT.PERIODICITE != 'DAY'" condition="ROW.LVL == '1'">
                    <CATEGORY field="COD" type="Char" />
                    <SERIE field="N1" displayName="VIEW.COLH1" displayNameCalc="true" visibleCondition="VIEW.COLH1 != null" />
                    <SERIE field="N2" displayName="VIEW.COLH2" displayNameCalc="true" visibleCondition="VIEW.COLH2 != null" />
                    <SERIE field="N3" displayName="VIEW.COLH3" displayNameCalc="true" visibleCondition="VIEW.COLH3 != null" />
                    <SERIE field="N4" displayName="VIEW.COLH4" displayNameCalc="true" visibleCondition="VIEW.COLH4 != null" />
                    <SERIE field="N5" displayName="VIEW.COLH5" displayNameCalc="true" visibleCondition="VIEW.COLH5 != null" />
                    <SERIE field="N6" displayName="VIEW.COLH6" displayNameCalc="true" visibleCondition="VIEW.COLH6 != null" />
                    <SERIE field="N7" displayName="VIEW.COLH7" displayNameCalc="true"   visibleCondition="VIEW.COLH7 != null" />
                    <SERIE field="N8" displayName="VIEW.COLH8" displayNameCalc="true"   visibleCondition="VIEW.COLH8 != null" />
                    <SERIE field="N9" displayName="VIEW.COLH9" displayNameCalc="true"   visibleCondition="VIEW.COLH9 != null" />
                    <SERIE field="N10" displayName="VIEW.COLH10" displayNameCalc="true" visibleCondition="VIEW.COLH10 != null" />
                    <SERIE field="N11" displayName="VIEW.COLH11" displayNameCalc="true" visibleCondition="VIEW.COLH11 != null" />
                    <SERIE field="N12" displayName="VIEW.COLH12" displayNameCalc="true" visibleCondition="VIEW.COLH12 != null" />
                    <SERIE field="N13" displayName="VIEW.COLH13" displayNameCalc="true" visibleCondition="VIEW.COLH13 != null" />
                    <SERIE field="N14" displayName="VIEW.COLH14" displayNameCalc="true" visibleCondition="VIEW.COLH14 != null" />
                    <SERIE field="N15" displayName="VIEW.COLH15" displayNameCalc="true" visibleCondition="VIEW.COLH15 != null" />
                    <SERIE field="N16" displayName="VIEW.COLH16" displayNameCalc="true" visibleCondition="VIEW.COLH16 != null" />
                    <SERIE field="N17" displayName="VIEW.COLH17" displayNameCalc="true" visibleCondition="VIEW.COLH17 != null" />
                    <SERIE field="N18" displayName="VIEW.COLH18" displayNameCalc="true" visibleCondition="VIEW.COLH18 != null" />
                    <SERIE field="N19" displayName="VIEW.COLH19" displayNameCalc="true" visibleCondition="VIEW.COLH19 != null" />
                    <SERIE field="N20" displayName="VIEW.COLH20" displayNameCalc="true" visibleCondition="VIEW.COLH20 != null" />
                    <SERIE field="N21" displayName="VIEW.COLH21" displayNameCalc="true" visibleCondition="VIEW.COLH21 != null" />
                    <SERIE field="N22" displayName="VIEW.COLH22" displayNameCalc="true" visibleCondition="VIEW.COLH22 != null" />
                    <SERIE field="N23" displayName="VIEW.COLH23" displayNameCalc="true" visibleCondition="VIEW.COLH23 != null" />
                    <SERIE field="N24" displayName="VIEW.COLH24" displayNameCalc="true" visibleCondition="VIEW.COLH24 != null" />
                    <SERIE field="N25" displayName="VIEW.COLH25" displayNameCalc="true" visibleCondition="VIEW.COLH25 != null" />
                    <SERIE field="N26" displayName="VIEW.COLH26" displayNameCalc="true" visibleCondition="VIEW.COLH26 != null" />
                    <SERIE field="N27" displayName="VIEW.COLH27" displayNameCalc="true" visibleCondition="VIEW.COLH27 != null" />
                    <SERIE field="N28" displayName="VIEW.COLH28" displayNameCalc="true" visibleCondition="VIEW.COLH28 != null" />
                    <SERIE field="N29" displayName="VIEW.COLH29" displayNameCalc="true" visibleCondition="VIEW.COLH29 != null" />
                    <SERIE field="N30" displayName="VIEW.COLH30" displayNameCalc="true" visibleCondition="VIEW.COLH30 != null" />
                    <SERIE field="N31" displayName="VIEW.COLH31" displayNameCalc="true" visibleCondition="VIEW.COLH31 != null" />
                </CHART>
            </CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="36" 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="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="*ROW" />
				<COLUMN dataField="CODTXT" type="Char" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.TXT" condition="ROW.COD == ROW.TXT"/>
					<CALC formula="ROW.COD + ' - ' + ROW.TXT" condition="ROW.COD != ROW.TXT"/>
				</COLUMN>
				<COLUMN dataField="NRSA" width="70" visibleCondition="SELECT.DATA != '1'" type="Number" outputFormat="#" headerText="Séjours" textAlign="right" totalFunction="sum" otherFunction="sum">
				</COLUMN>
				<COLUMN dataField="N" width="70" visibleCondition="SELECT.PERIODICITE != 'YEAR'" type="Number" outputFormat="=return SELECT.DATA2" headerText="SELECT.DATA3" headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="sum" calc="false" />
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" visibleCondition="SELECT.DATA != '8' &amp;&amp; SELECT.PERIODICITE != 'YEAR' &amp;&amp; SELECT.DATA != '2.2'" width="40" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N / TOTALROW.N * 100" />
				</COLUMN>
				<COLUMN dataField="N0"  width="70" visibleCondition="VIEW.COLH0 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="&lt;&lt;" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N1"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH1 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH1"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N2"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH2 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH2"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N3"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH3 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH3"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N4"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH4 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH4"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N5"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH5 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH5"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N6"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH6 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH6"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N7"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH7 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH7"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N8"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH8 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH8"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N9"  width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH9 != null"  type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH9"  headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N10" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH10 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH10" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N11" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH11 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH11" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N12" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH12 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH12" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N13" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH13 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH13" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N14" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH14 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH14" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N15" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH15 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH15" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N16" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH16 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH16" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N17" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH17 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH17" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N18" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH18 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH18" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N19" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH19 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH19" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N20" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH20 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH20" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N21" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH21 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH21" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N22" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH22 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH22" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N23" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH23 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH23" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N24" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH24 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH24" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N25" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH25 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH25" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N26" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH26 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH26" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N27" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH27 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH27" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N28" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH28 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH28" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N29" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH29 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH29" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N30" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH30 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH30" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N31" width="= if (SELECT.PERIODICITE == 'DAY') { return 35;} else { return  70;}" visibleCondition="VIEW.COLH31 != null" type="Number" outputFormat="=return SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH31" headerTextCalc="true" textAlign="right" otherFunction="calc" totalFunction="calc" />
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
