<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000151" label="PMSI. Evolution temporelle Prestations honoraires" 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" typeEts="23" componentsFile="PMSI_components.XML" helpDokuWIkiDir="" helpDokuWIkiFile=""  helpFile="">
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS"/>
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
		<PROPERTY name="MONTANT_FIELD" value="[EVAL 
						if ('[DATA]' == '2HT') {return 'base_remboursement_sauf_transition';}
						if ('[DATA]' == '3HT') {return 'base_remboursement_sauf_transition';}
						return 'base_remboursement'; 
			EVAL]"/>
		<PROPERTY name="DATA">
			<value><![CDATA[[EVAL 
				
				switch ('[DATA]') {
					case '1' :
						return 'v_rsf_detail_1.nombre_coefficient';
						break;
					case '2' :
						return 'v_rsf_detail_1.base_remboursement';
						break;
					case '2HT' :
						return 'v_rsf_detail_1.base_remboursement_sauf_transition';
						break;
					case '3' :
						return 'v_rsf_detail_1.base_remboursement';
						break;
					case '3HT' :
						return 'v_rsf_detail_1.base_remboursement_sauf_transition';
						break;
					default :
						return 'v_rsf_detail_1.nombre_coefficient';
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATAM">
			<value><![CDATA[[EVAL 
				
				switch ('[DATA]') {
					case '1' :
						return 'SUM(v_rsf_detail_1.nombre_coefficient)';
						break;
					case '2' :
						return 'SUM(v_rsf_detail_1.base_remboursement)';
						break;
					case '2HT' :
						return 'SUM(v_rsf_detail_1.base_remboursement_sauf_transition)';
						break;
					case '3' :
						return 'base.cti_division(SUM(v_rsf_detail_1.base_remboursement), SUM(v_rsf_detail_1.nombre_coefficient))';
						break;
					case '3HT' :
						return 'base.cti_division(SUM(v_rsf_detail_1.base_remboursement_sauf_transition), SUM(v_rsf_detail_1.nombre_coefficient))';
						break;
					default :
						return 'SUM(v_rsf_detail_1.nombre_coefficient)';
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATAI">
			<value><![CDATA[[EVAL 
				
				switch ('[DATA]') {
					case '1' :
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.nombre_coefficient ELSE NULL END)';
						break;
					case '2' :
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.base_remboursement ELSE NULL END)';
						break;
					case '2HT' :
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.base_remboursement_sauf_transition ELSE NULL END)';
						break;
					case '3' :
						return 'base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.base_remboursement ELSE NULL END), SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.nombre_coefficient ELSE NULL END))';
						break;
					case '3HT' :
						return 'base.cti_division(SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.base_remboursement_sauf_transition ELSE NULL END), SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.nombre_coefficient ELSE NULL END))';
						break;
					default :
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN v_rsf_detail_1.nombre_coefficient ELSE NULL END)';
				}
				
			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>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="= var display:String = '';
					if (SELECT.PRESTATION != '-1') {display = display + '#B#Analyse prestation#/B# : #B#' + SELECT.PRESTATION_LABEL + '#/B#'}
					return display;
					">
		<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"/>
		</GROUP>
		<GROUP label="Prestation">
			<FIELD name="PRESTATION" label="Prestation" UI="combo" tree="true" width="400" default="-1" globalListProvider="PRESTATION" showIfNotDefault="true"/>
		</GROUP>
		<GROUP>
			<FIELD name="DATA" label="Données" UI="combo" tree="true" default="1" default2="0" printable="false">
				<OPTION label="Options" data="" globalListProvider="DATA_PRESTATIONS"/>
			</FIELD>
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="" UI="combo" default="PRESTA" tree="true">
				<OPTION label="Options" data="" globalListProvider="PRESTATIONS_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="PRESTATIONS_GROUPBY_OPTIONS"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_PRESTATION_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]}
						SIGNIFDATA{[VIEW.SELECT_TABTREE_ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						COLUMNBY[PERIODICITE]{v_rss_1.date_sortie,, '[PERIODE]' ,, '[TOPERIODE]' ,, 12,, [VIEW.COLUMN_OPTION]}
						OPTIONS{NOTZERO=1}
						INDICATORS{[VIEW.DATAM],}	
						INDICATORS_COLUMNS{[VIEW.DATAI],}
						ORDERBY{[VIEW.DATA],, DESC}
					FROM 
						[VIEW.V_RSS_VIEW_OPTIMIZE], pmsi.v_rsf_detail_6 v_rsf_detail_1
					WHERE 
						v_rss_1.rss_id = v_rsf_detail_1.rss_id
						AND mois_sortie IN ([VIEW.PERIODE_MOIS_LIST]) 
						AND date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.FILTRE_RSS_SELECT]
						[VIEW.PRESTATION_SELECT]
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT" />
					<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"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Justificatif Prestations par RSS" shortLabel="Liste Prestations" view="PMSI000153.XML" componentName="RSS_BASE_VIEWLINK" component2Name="PRESTATION_VIEWLINK" component3Name="DATE_EVOL_2_VIEWLINK"/>
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000005.XML" componentName="RSS_BASE_VIEWLINK" component2Name="RSS_OTHERS_VIEWLINK" component3Name="DATE_EVOL_2_VIEWLINK"/>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="Evolution temporelle (5 premiers)" type="lineChart" maxItems="5" maxItemsSortOn="N" maxItemsSortSeq="D" serieIsCategory="true" sortField="N" sortSeq="D" condition="ROW.LVL == '1'">
				<CATEGORY field="CODTXT" 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"/>
			</CHART>
			<CHART title="Comparatif (10 premiers)" type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="A" condition="ROW.LVL == '1'">
				<CATEGORY field="CODTXT" type="Char"/>
				<SERIE field="N" displayName="SELECT.DATA_LABEL" displayNameCalc="true"/>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="36" variableRowHeight="true" sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (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"/>
				<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="N" width="90" visibleCondition="SELECT.PERIODICITE != 'YEAR'" type="Number" outputFormat="= SELECT.DATA2" headerText="SELECT.DATA3" headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="sum"/>
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" width="40" visibleCondition="SELECT.PERIODICITE != 'YEAR'" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N / TOTALROW.N * 100"/>
				</COLUMN>
				<!-- Pour calculer la colonne "M_P" ("Moy."), il faut forcer le calcul de chacun
					 des mois avant de pouvoir les utiliser dans la balise <CALC formula="..." />-->
				<COLUMN dataField="N0" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N1" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N2" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N3" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N4" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N5" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N6" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N7" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N8" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N9" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N10" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N11" visible="false" type="Number" outputFormat="#"/>
				<COLUMN dataField="N12" visible="false" type="Number" outputFormat="#"/>
				<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
				<COLUMN dataField="M_P" type="Number" headerText="Moy." width="75" visibleCondition="SELECT.PERIODICITE != 'YEAR'" outputFormat="#" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="(ROW.N0+ROW.N1+ROW.N2+ROW.N3+ROW.N4+ROW.N5+ROW.N6+ROW.N7+ROW.N8+ROW.N9+ROW.N10+ROW.N11+ROW.N12) / Number(VIEW.NB_MOIS)"/>
				</COLUMN>
				<COLUMN dataField="N0" width="75" visibleCondition="VIEW.COLH0 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="&lt;&lt;" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N1" width="75" visibleCondition="VIEW.COLH1 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH1" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N2" width="75" visibleCondition="VIEW.COLH2 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH2" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N3" width="75" visibleCondition="VIEW.COLH3 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH3" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N4" width="75" visibleCondition="VIEW.COLH4 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH4" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N5" width="75" visibleCondition="VIEW.COLH5 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH5" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N6" width="75" visibleCondition="VIEW.COLH6 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH6" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N7" width="75" visibleCondition="VIEW.COLH7 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH7" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N8" width="75" visibleCondition="VIEW.COLH8 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH8" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N9" width="75" visibleCondition="VIEW.COLH9 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH9" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N10" width="75" visibleCondition="VIEW.COLH10 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH10" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N11" width="75" visibleCondition="VIEW.COLH11 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH11" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N12" width="75" visibleCondition="VIEW.COLH12 != null" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="VIEW.COLH12" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
