<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="PMSI000235" label="PMSI. Expert. Contrôles" 
	title="= 'Contrôles Expert' +  ' par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_pmsi" 
	softOption="iCTI_expert"
	globals="PMSI_globals.XML" 
	componentsFile="PMSI_components.XML"	helpDokuWIkiDir="pmsi:qualite:expert" helpDokuWIkiFile="pmsi000235"  helpFile="iCTI_PMSI_PMSI000273.HTML">
	<CACHE cachable="false" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<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="" UI="combo" tree="true" width="200" default="2014-01-01" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2014-12-31" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="" UI="combo" default="EXC" tree="true">
				<OPTION label="Options" data="" globalListProvider="EXC_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" treeLevel="1" />
				<OPTION label="Options" data="" globalListProvider="EXC_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" treeLevel="1" />
				<OPTION label="Options" data="" globalListProvider="EXC_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>
		
	</SELECTIONS>
	
	<SELECTIONS componentName="FILTRES_EXPERT_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_RSS_SELECTIONS" />
	
	<QUERIES>
		<QUERY label="">
		
			<SQL optimizer="V_RSS_X">
				<select><![CDATA[	
														
					CTISELECT_TREE
						WORKTABLE{PMSI000235}
						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]}	
					INDICATORS{
						COUNT(DISTINCT v_rss_1.rss_id),
						COUNT(*),
						COUNT(DISTINCT CASE WHEN expert_controle_gravite_id = 0 THEN v_rss_1.rss_id ELSE NULL END),
						COUNT(DISTINCT CASE WHEN expert_controle_gravite_id BETWEEN 1 AND 5 THEN v_rss_1.rss_id ELSE NULL END),
						COUNT(DISTINCT CASE WHEN expert_controle_gravite_id BETWEEN 6 AND 9 THEN v_rss_1.rss_id ELSE NULL END),
						COUNT(DISTINCT CASE WHEN etat IN ('') THEN v_rss_1.rss_id ELSE NULL END),
						COUNT(DISTINCT CASE WHEN etat IN ('I') THEN v_rss_1.rss_id ELSE NULL END),
						COUNT(DISTINCT CASE WHEN etat IN ('T') THEN v_rss_1.rss_id ELSE NULL END),
						AVG(delai_correction),
					}
					FROM #V_RSS_X# 
					JOIN pmsi.v_expert_rss_controle_1  ON v_expert_rss_controle_1.rss_id = v_rss_1.rss_id 
					WHERE date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' 
						[VIEW.FILTRE_RSS_SELECT]
						[VIEW.EXPERT_CONTROLE_SELECT]
					
					
						
				
						
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="NB_RSS"/>
					<FIELD name="NB_ERR"/>
					<FIELD name="NB_RSS_I"/>
					<FIELD name="NB_RSS_A"/>
					<FIELD name="NB_RSS_E"/>
					<FIELD name="NB_RSS_E_"/>
					<FIELD name="NB_RSS_EI"/>
					<FIELD name="NB_RSS_ET"/>
					<FIELD name="DEL_COR"/>
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false" />
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Evolution temporelle" shortLabel="Evolution temporelle" view="PMSI000273.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
				<ARG name="DATA_EXC" data="NBRSS"/>
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="PMSI000272.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_EXC" value="'NBRSS'" />
				<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="Justificatif par RSS" shortLabel="Justificatif RSS" view="PMSI000236.XML" 
					visible="= SELECT.GROUPBY != 'RSS' || SELECT.GROUPBY_2 != 'RSS' || SELECT.GROUPBY_2 != '-1'"
					enabled="= (SELECT.GROUPBY != 'RSS' &amp;&amp; ROW.OID2 &lt; 0) || (SELECT.GROUPBY_2 != 'RSS' &amp;&amp; ROW.OID2 &gt;= 0)"
					componentName="RSS_BASE_VIEWLINK" component2Name="EXPERT_VIEWLINK" >
					<ARG name="EXPERT_CONTROLE_GRAVITE" 
						value="if (COLUMN.NAME == 'NB_RSS_I') {return 'DT0'}
							if (COLUMN.NAME == 'NB_RSS_A') {return 'DT5'}
							if (COLUMN.NAME == 'NB_RSS_E') {return 'DT9'}
							return SELECT.EXPERT_CONTROLE_GRAVITE"/>
					<ARG name="EXPERT_CONTROLE_OPT" 
						value="if (COLUMN.NAME == 'NB_RSS_EI') {return 'DTI'}
							if (COLUMN.NAME == 'NB_RSS_ET') {return 'DTT'}
							if (COLUMN.NAME == 'NB_RSS_E_') {return '-1'}
							return SELECT.EXPERT_CONTROLE_OPT"/>
			</VIEWLINK>
			<VIEWLINK label="Détail RSS" shortLabel="Détail RSS" view="PMSI000006.XML"
				visible="= SELECT.GROUPBY == 'RSS' || SELECT.GROUPBY_2 == 'RSS'"
				enabled="= (SELECT.GROUPBY == 'RSS' &amp;&amp; ROW.OID2 &lt; 0) || (SELECT.GROUPBY_2 == 'RSS' &amp;&amp; ROW.OID2 &gt;= 0)">
				<ARG name="OID" value="ROW.OID" />
			</VIEWLINK>
		<!--	<VIEWREF label="Guide_Datim_MCO_2012" shortLabel="Guide_Datim_MCO_2012" 
				url="http://www.ctisante.com/references/pmsi/Guide_Datim_MCO_2012.pdf" rowContext="false" /> -->
			<VIEWREF label="Description des controles" shortLabel="Description des controles" 
				url="modules/pmsi/references/iCTI_PMSI_ExpertControle.HTML" rowContext="false" />
			
		</VIEWLINKS>
		<ONGLET excelLabel="Controle" label="Controle" 
			multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			
			<DATAGRID title="" total="true" showOthers="true" headerHeight="48" 
				sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_3 == '-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>
				<COLUMN dataField="COD" width="120" type="Char" visible="true" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="50" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" totalComplement="TOTAL" otherFunction="text" otherComplement="Autres">
				</COLUMN>
				<COLUMN dataField="NB_RSS" type="Number" width="100" outputFormat="#"
					visibleCondition="SELECT.EXPERT_CONTROLE_GRAVITE == '-1'  || SELECT.EXPERT_CONTROLE_GRAVITE == 'LI59'" 
					headerText="Nb RSS@LF@Signalés" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="NB_RSS_I" type="Number" width="100" outputFormat="#" 
					selectable="true"
					visibleCondition="SELECT.EXPERT_CONTROLE_GRAVITE == '-1' || SELECT.EXPERT_CONTROLE_GRAVITE == 'DT0'" 
					headerText="Nb RSS@LF@avec@LF@INFORMATION" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="NB_RSS_A" type="Number" width="100" outputFormat="#"
					selectable="true"
					visibleCondition="(SELECT.EXPERT_CONTROLE_GRAVITE == '-1' || SELECT.EXPERT_CONTROLE_GRAVITE == 'DT5' || SELECT.EXPERT_CONTROLE_GRAVITE == 'LI59')" 
					headerText="Nb RSS@LF@avec@LF@AVERTISSEMENT" totalFunction="text" otherFunction="text" otherComplement="">
					<CELLSTYLE name="color" value="0xFF6F00" />
					<CELLSTYLE name="fontWeight" value="bold" />
					<CELLSTYLE name="fontSize" value="14" />
				</COLUMN>
				<COLUMN dataField="NB_RSS_E" type="Number" width="100" outputFormat="#"
					selectable="true"
					visibleCondition="(SELECT.EXPERT_CONTROLE_GRAVITE == '-1' || SELECT.EXPERT_CONTROLE_GRAVITE == 'DT9' || SELECT.EXPERT_CONTROLE_GRAVITE == 'LI59')" 
					headerText="Nb RSS@LF@avec@LF@ERREUR" totalFunction="text" otherFunction="text" otherComplement="">
					<CELLSTYLE name="color" value="0xE11605" />
					<CELLSTYLE name="fontWeight" value="bold" />
					<CELLSTYLE name="fontSize" value="14" />
				</COLUMN>
				<COLUMN dataField="NB_RSS_E_" type="Number" width="100" outputFormat="#"
					selectable="true"
					visibleCondition="SELECT.EXPERT_CONTROLE_OPT == 'LI_IT'"
					headerText="Dont Nb RSS@LF@non corrigés" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="NB_RSS_EI" type="Number" width="100" outputFormat="#"
					selectable="true"
					visibleCondition="SELECT.EXPERT_CONTROLE_OPT == 'LI_IT' || SELECT.EXPERT_CONTROLE_OPT == 'LIIT'"
					headerText="Dont Nb RSS@LF@signalés mais ignorés" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="NB_RSS_ET" type="Number" width="100" outputFormat="#"
					selectable="true"
					visibleCondition="SELECT.EXPERT_CONTROLE_OPT == 'LI_IT' || SELECT.EXPERT_CONTROLE_OPT == 'LIIT'"
					headerText="Dont Nb RSS@LF@corrigés" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMN dataField="NB_ERR" type="Number" width="100" outputFormat="#"
					visible="true" 
					headerText="Nb Atypies@LF@Signalées" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMN>
				<COLUMNx dataField="DEL_COR" type="Number" width="100" outputFormat="#,0j"
					visible="true" 
					headerText="Délai correction" totalFunction="text" otherFunction="text" otherComplement="">
				</COLUMNx>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
