<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000118" 
	label="PMSI. RSS supprimés" 
	title="= 'Liste des RSS supprimés (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_pmsi"
	globals="PMSI_globals.XML"
	componentsFile="PMSI_components.XML">
	
	<VIEWPROPERTIES>

		<PROPERTYx dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
	</VIEWPROPERTIES>
	
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
	
		<GROUP label="Date sortie">
			<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" printable="false" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2014-12-31"  globalListProvider="DATE_FIN" printable="false">
			</FIELD>
		</GROUP>
		
	</SELECTIONS>

	<QUERIES>
	
		<QUERY label=""> 
			
			<SQL select="
				(SELECT 
					p_rss.oid, 
					p_rss.no_rss::text, 
					p_rss.no_sejour_administratif,
					p_rss.finess, 
					p_rss.date_entree, 
					p_rss.date_sortie,
					p_imports.texte
					
				FROM pmsi.p_rss
					join pmsi.p_imports on p_imports.oid = p_rss.import_id
				WHERE 
					p_rss.etat = 'S'
					AND p_rss.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
				)
				
				UNION ALL
				
				(SELECT 
					-9999999, 
					COUNT(*)::text || ' RSS supprimés' , 
					'', 
					'', 
					null,
					null,
					''
				FROM pmsi.p_rss
				WHERE 
					etat = 'S'
					AND p_rss.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
				)
					
				ORDER BY 2
				"
				 >
				<FIELDS>
					<FIELD name="OID" />
					<FIELD name="RSS" />
					<FIELD name="ADM" />
					<FIELD name="FIN" />
					<FIELD name="DATE" />
					<FIELD name="DATS" />
					<FIELD name="IMPORT" />
				</FIELDS>
			</SQL>
			
			
		</QUERY>
		
		
		
	</QUERIES>
	
	<PRESENTATION>
	
		<VIEWLINKS>
			
			

		</VIEWLINKS>
	
		<ONGLET excelLabel="Liste RSS supprimés" >
				
			<DATAGRID title="" total="true" key="RSS" headerHeight="36"  
				totalRowInRows="= ROW.OID == '-9999999'"
			>
				<ROWSTYLE name="fontSize" value="11" />
				<FOOTERROWSTYLE name="fontSize" value="11" />
				
				<COLUMN dataField="OID"
					type="Char"
					visible="false">
				</COLUMN>
				<COLUMN dataField="FIN"
					width="60"
					type="Char"
					visible="true"
					headerText="Etablissement" 
					textAlign="left" 
					visibleCondition="ENV.CONSOLIDATION == '1'"
					otherFunction="text"
					totalFunction="text" 
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="RSS"
					width="200"
					type="Char"
					visible="true"
					outputFormat="#"
					headerText="N° RSS" 
					textAlign="center" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="*ROW">
				</COLUMN>
				
				<COLUMN dataField="ADM"
					width="200"
					type="Char"
					visible="true"
					outputFormat="#"
					headerText="N° Séjour" 
					textAlign="center" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="*ROW">
				</COLUMN>
				
				<COLUMN dataField="DATE"
					width="80"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					visible="true"
					headerText="Date entrée" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="DATS"
					width="80"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					visible="true"
					headerText="Date sortie" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				
				<COLUMN dataField="IMPORT"
					width="200"
					type="Char"
					visible="true"
					outputFormat="#"
					headerText="Lot" 
					textAlign="center" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="*ROW">
				</COLUMN>
				
				
			</DATAGRID>
		
		</ONGLET>
		
	</PRESENTATION>
	
</VUE>

			
