<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000058" label="PMSI. Evolution temporelle Interventions" title="= SELECT.DATA_LABEL + ' par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.QUELLEDATE_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:sejour_analyse_detaillee:actes:interventions" helpDokuWIkiFile="pmsi000056"  helpFile="iCTI_PMSI_PMSI000056.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_INTERVENTIONS" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		<PROPERTY name="DATAM">
			<value><![CDATA[[EVAL 
			
				switch ('[DATA]') {
					case '2' :
						return "COUNT(distinct no_intervention)";
						break;
					case '4' :
						return "SUM([VIEW.ICR_FIELD])";
						break;
					case '5' :
						return "SUM([VIEW.ICR_FIELD]_activite_1)";
						break;
					case '6' :
						return "SUM([VIEW.ICR_FIELD]_activite_4)";
						break;
					default :
						return "SUM(nb_interventions)";
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATAI">
			<value><![CDATA[[EVAL 
			
				switch ('[DATA]') {
					case '2' :
						return "COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE THEN no_intervention ELSE NULL END)";
						break;
					case '4' :
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.ICR_FIELD] ELSE NULL END)";
						break;
					case '5' :
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.ICR_FIELD]_activite_1 ELSE NULL END)";
						break;
					case '6' :
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN [VIEW.ICR_FIELD]_activite_4 ELSE NULL END)";
						break;
					default :
						return "SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_interventions ELSE NULL END)";
				}
				
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="QUELLEDATE" label="" UI="combo" default="1" default2="date_fin" printable="false">
				<OPTION label="Date sortie" data="1" data2="date_sortie" />
				<OPTION label="Date acte" data="2" data2="date_acte" />
			</FIELD>
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="de" UI="combo" tree="true" width="200" default="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="Regroupements">
			<FIELD name="GROUPBY" width="200" label="" UI="combo" default="ACTE" tree="true">
				<OPTION label="Options" data="" globalListProvider="INTERV_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="INTERV_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>		
        <GROUP label="">
			<FIELD name="GROUPBY_3" width="200" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="INTERV_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA" UI="combo" default="1" tree="true" printable="false">
				<OPTION label="Options" data="" globalListProvider="DATA_INTERVENTIONS" />
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_INTERV_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_INTERV_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]{[VIEW.QUELLEDATE],, '[PERIODE]' ,, '[TOPERIODE]' ,, 12,, [VIEW.COLUMN_OPTION]}
						OPTIONS{NOTZERO=1}
						INDICATORS{[VIEW.DATAM],}	
						INDICATORS_COLUMNS{[VIEW.DATAI],}
					FROM 
						#V_RSS_X#, [VIEW.QINTERV]
					WHERE 
						v_rss_1.rss_id = v_rss_actes_4.rss_id
						AND [VIEW.QUELLEDATE] BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.FILTRE_RSS_SELECT]
						[VIEW.FILTRE_INTERV_SELECT]
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<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>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[
					
					SELECT
						'QINTERV', 
						CASE WHEN valeur = 'PRO' THEN 'pmsi.v_rss_actes_5 v_rss_actes_4' ELSE 'pmsi.v_rss_actes_4' END
					FROM pmsi.t_divers WHERE code = 'OPTPMSI_CPT_INTERV'
					
				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Justificatif Interventions par RSS" shortLabel="Liste Interventions" view="PMSI000057.XML" componentName="RSS_BASE_VIEWLINK" component2Name="INTERVENTION_VIEWLINK" component3Name="DATE_EVOL_2_VIEWLINK" visible="= VIEW.CPT_INTERV == 'CTI'" />
			<VIEWLINK label="Justificatif Interventions par RSS" shortLabel="Liste Interventions" view="PMSI000348.XML" componentName="RSS_BASE_VIEWLINK" component2Name="INTERVENTION_VIEWLINK" component3Name="DATE_EVOL_2_VIEWLINK" visible="= VIEW.CPT_INTERV == 'PRO'" />
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition temporelle" label="Répartition temporelle" 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" 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="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="80" visible="true" type="Number" outputFormat="#" headerText="SELECT.DATA2" headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="sum" />
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" 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="#" fixed="false" selectable="true" headerText="&lt;&lt;" textAlign="right" otherFunction="calc" totalFunction="calc" />
				<COLUMN dataField="N1" width="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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="70" 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>
