<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000019" label="PMSI. Comparaison LPP" title="= 'Comparaison LPP par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.QUELLEDATE_LABEL + ' : ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ' vs ' + SELECT.PERIODE_D_LABEL + ' à ' + SELECT.TOPERIODE_D_LABEL + ') - ' + SELECT.VERSION_GROUPAGE_LABEL" database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" globals="PMSI_globals.XML" componentsFile="PMSI_components.XML" helpDokuWIkiDir="pmsi:sejour_analyse_detaillee:lpp" helpDokuWIkiFile="pmsi000016"  helpFile="iCTI_PMSI_PMSI000019.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_LPP" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="QUELLEDATE" label="" width="200" UI="combo" default="1" printable="false">
				<OPTION label="Date sortie" data="1" data2="date_sortie" />
				<OPTION label="Date lpp" data="2" data2="date_lpp" />
			</FIELD>
			<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="Période précédente">
			<FIELD name="FILLER" label="" width="200" UI="text" default="" printable="false" visible="false" />
			<FIELD name="PERIODE_D" label="Période précédente" UI="combo" tree="true" width="150" default="2014-01-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2014-06-30" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="200" label="" UI="combo" default="LPP" tree="true">
				<OPTION label="Options" data="" globalListProvider="LPP_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="200" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="LPP_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>		
        <GROUP label="">
			<FIELD name="GROUPBY_3" width="200" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="LPP_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_LPP_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_LPP_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}
						INDICATORS{
						
                                sum(CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN nombre ELSE 0 END),
                                sum(CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN montant_facture ELSE 0 END),
                                count(DISTINCT CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN v_rss_lpp_1.rss_id ELSE NULL END),
                                sum(CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE_D]' AND '[TOPERIODE_D]' THEN nombre ELSE 0 END),
                                sum(CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE_D]' AND '[TOPERIODE_D]' THEN montant_facture ELSE 0 END),
                                count(DISTINCT CASE WHEN [VIEW.QUELLEDATE] BETWEEN '[PERIODE_D]' AND '[TOPERIODE_D]' THEN v_rss_lpp_1.rss_id ELSE NULL END)
                        }
                        ORDERBY{indicateurs[2],, DESC}
					FROM #V_RSS_X#
						JOIN pmsi.v_rss_lpp_1 ON v_rss_1.rss_id = v_rss_lpp_1.rss_id 
					WHERE 
						 ([VIEW.QUELLEDATE] BETWEEN '[PERIODE_D]' AND '[TOPERIODE_D]' 
							OR [VIEW.QUELLEDATE] BETWEEN '[PERIODE]' AND '[TOPERIODE]')
						AND from_eco = 0
						[VIEW.LPP_SELECT]
						[VIEW.FILTRE_RSS_SELECT]
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<FIELD name="SORT" />
					<FIELD name="FNB" />
					<FIELD name="FMF" />
					<FIELD name="RSS" />
					<FIELD name="DNB" />
					<FIELD name="DMF" />
					<FIELD name="RSS2" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Justificatif LPP par RSS" shortLabel="Liste LPP" view="PMSI000017.XML" componentName="RSS_BASE_VIEWLINK" component2Name="LPP_VIEWLINK" component3Name="DATE_COMP_VIEWLINK" />
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000005.XML" componentName="RSS_BASE_VIEWLINK" component2Name="RSS_OTHERS_VIEWLINK" component3Name="DATE_COMP_VIEWLINK" />
		</VIEWLINKS>
		<ONGLET excelLabel="Comparaison" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="Nombre de LPP pour les 12 premiers" type="columnChart" maxItems="12" maxItemsSortOn="FNB" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="A" condition="ROW.LVL == '1'">
				<CATEGORY field="CODTXT" type="Char" />
				<SERIE field="DNB" displayName="'Nb ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="FNB" displayName="'Nb ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true" />
			</CHART>
			<CHART title="Montant facturé pour les 12 premiers" type="columnChart" maxItems="12" maxItemsSortOn="FMF" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="A" condition="ROW.LVL == '1'">
				<CATEGORY field="CODTXT" type="Char" />
				<SERIE field="DMF" displayName="'Montant ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="FMF" displayName="'Montant ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true" />
			</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_2 == '-1' || SELECT.GROUPBY_3 == '-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">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' &amp;&amp; SELECT.GROUPBY_TAB != 'TAB'" />
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" >
				</COLUMN>
                <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="FNB" outputFormat="#" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="DNB" outputFormat="#" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="FMF" outputFormat="#E" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="DMF" outputFormat="#E" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="RSS" outputFormat="#" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="RSS2" outputFormat="#" visible="false" type="Number" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="COL0D" width="80" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\nNb RSS'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Nombre de séjours différents">
					<CALC formula="ROW.RSS2" />
				</COLUMN>
				<COLUMN dataField="COL0F" width="80" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\nNb RSS'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Nombre de séjours différents">
					<CALC formula="ROW.RSS" />
				</COLUMN>
				<COLUMN dataField="COL0E" type="Number" headerText="Ecart" width="70" outputFormat="#" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL0F - ROW.COL0D" />
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.RSS &lt; ROW.RSS2" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="ROW.RSS &gt; ROW.RSS2" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.RSS != null &amp;&amp; ROW.RSS != null &amp;&amp; ROW.RSS2 == ROW.RSS" />
				</COLUMN>
				<COLUMN dataField="COL0P" type="Number" headerText="% évol." width="45" outputFormat="= if (ROW.COL0F !=0 || ROW.COL0D != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL0E / ROW.COL0D * 100" />
				</COLUMN>
                <COLUMN dataField="COL1D" width="80" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\nNb LPP'" headerTextCalc="true" textAlign="right" description="Nombre de LPP différents" totalFunction="calc" otherFunction="calc" calc="true">
					<CALC formula="ROW.DNB" />
				</COLUMN>
				<COLUMN dataField="COL1F" width="80" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" type="Number" outputFormat="#" fixed="false" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\nNb LPP'" headerTextCalc="true" textAlign="right" description="Nombre de LPP différents" totalFunction="calc" otherFunction="calc" calc="true">
					<CALC formula="ROW.FNB" />
				</COLUMN>
				<COLUMN dataField="COL1E" type="Number" headerText="Ecart" width="70" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" outputFormat="#" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL1F - ROW.COL1D" />
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.FNB &lt; ROW.DNB" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="ROW.FNB &gt; ROW.DNB" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.FNB != null &amp;&amp; ROW.DNB != null &amp;&amp; ROW.FNB == ROW.DNB" />
				</COLUMN>
				<COLUMN dataField="COL1P" type="Number" headerText="% évol." width="45" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" outputFormat="= if (ROW.COL1D !=0 || ROW.COL1F != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL1E / ROW.COL1D * 100" />
				</COLUMN>
				<COLUMN dataField="COL2D" width="80" type="Number" outputFormat="#E" fixed="false" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\nFacturé'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Somme des montants facturés">
					<CALC formula="ROW.DMF" />
				</COLUMN>
				<COLUMN dataField="COL2F" width="80" type="Number" outputFormat="#E" fixed="false" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\nFacturé'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Somme des montants facturés">
					<CALC formula="ROW.FMF" />
				</COLUMN>
				<COLUMN dataField="COL2E" type="Number" headerText="Ecart" width="70" outputFormat="#E" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL2F - ROW.COL2D" />
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.FMF &lt; ROW.DMF" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="ROW.FMF &gt; ROW.DMF" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.FMF != null &amp;&amp; ROW.DMF != null &amp;&amp; ROW.FMF == ROW.DMF" />
				</COLUMN>
				<COLUMN dataField="COL2P" type="Number" headerText="% évol." width="45" fixed="false" outputFormat="= if (ROW.COL2D !=0 || ROW.COL2F != 0) {return '0%'} else {return '#'}" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL2E / ROW.COL2D * 100" />
				</COLUMN>
				<COLUMN dataField="COL3D" width="80" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" type="Number" outputFormat="#E" fixed="false" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\nP.U. moyen'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Rapport entre les colonnes &lt;b&gt;Montant facturé&lt;/b&gt; et &lt;b&gt;LPP&lt;/b&gt;">
					<CALC formula="ROW.DMF / ROW.DNB" />
				</COLUMN>
				<COLUMN dataField="COL3F" width="80" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" type="Number" selectable="true" outputFormat="#E" fixed="false" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\nP.U. moyen'" headerTextCalc="true" textAlign="right" totalFunction="calc" otherFunction="calc" calc="true" description="Rapport entre les colonnes &lt;b&gt;Montant facturé&lt;/b&gt; et &lt;b&gt;LPP&lt;/b&gt;">
					<CALC formula="ROW.FMF / ROW.FNB" />
				</COLUMN>
				<COLUMN dataField="COL3E" type="Number" headerText="Ecart" width="70" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" outputFormat="#E" fixed="false" selectable="true" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL3F - ROW.COL3D" />
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.COL3F &lt; ROW.COL3D" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="ROW.COL3F &gt; ROW.COL3D" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.COL3F != null &amp;&amp; ROW.COL3D != null &amp;&amp; ROW.COL3F == ROW.COL3D" />
				</COLUMN>
				<COLUMN dataField="COL3P" type="Number" headerText="% évol." width="45" visibleCondition="SELECT.GROUPBY == 'LPP' || SELECT.LPP != '-1'" outputFormat="= if (ROW.COL3D !=0 || ROW.COL3F != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.COL3E / ROW.COL3D * 100" />
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
