<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000084" 
	label="PMSI. Intégrité de la base de données" 
	title="Intégrité de la base de données" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_pmsi">
	<CACHE cachable="false" />
	<VIEWPROPERTIES>
		<PROPERTYx dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
	</VIEWPROPERTIES>
	
	<QUERIES>
	
		<QUERY label=""> 
		
			<SQL>
				<select><![CDATA[
						SELECT 1, 'RSS', 'Vue v_rss_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss WHERE etat <> 'S') subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'RSS', 'Identités', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss WHERE etat <> 'S') subviewp,
							(SELECT count(*) AS count FROM pmsi.p_rss JOIN pmsi.p_identites ON p_identites.rss_id = p_rss.oid AND etat <> 'S') subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Etats', 'Vue v_rss_etat_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_etat_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'RSA', 'Vue v_rsa_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rsa_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
            
			<SQL>
				<select><![CDATA[
						SELECT 1, 'RUM', 'Vue v_rss_rum_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_rum) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_rum_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Diagnostics', 'Vue v_rss_diagnostics_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_diagnostics) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_diagnostics_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Actes', 'Vue v_rss_actes_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_actes) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_actes_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'LPP', 'Vue v_rss_lpp_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_lpp) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_lpp_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'UCD', 'Vue v_rss_ucd_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_ucd JOIN pmsi.t_type_ucd ON t_type_ucd.oid = p_rss_ucd.type_ucd_id) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_ucd_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Prestations', 'Vue v_rsf_detail_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rsf_detail WHERE est_ligne_rss = '1') subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rsf_detail_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Prestations honoraires', 'Vue v_rsf_detail_6', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rsf_detail WHERE type = 'C' AND est_ligne_rss = '1') subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rsf_detail_6) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Prise en charge', 'Vue v_rsf_total_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rsf_total) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rsf_total_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Médecins', 'Table t_medecins_c', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.t_medecins) subviewp,
							(SELECT count(*) AS count FROM pmsi.t_medecins_c) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'GHM', 'Table t_ghm_c', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.t_ghm) subviewp,
							(SELECT count(*) AS count FROM pmsi.t_ghm_c) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Actes', 'Table t_actes_c', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.t_actes) subviewp,
							(SELECT count(*) AS count FROM pmsi.t_actes_c) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Codes erreur groupage', 'Vue v_rss_leg_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM pmsi.p_rss_leg) subviewp,
							(SELECT count(*) AS count FROM pmsi.v_rss_leg_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			
			
			
		</QUERY>
		
		
		
	</QUERIES>
	
	<PRESENTATION>
	
		
		<ONGLET>
				
			<DATAGRID title="" total="false" sortable="false" headerHeight="40" >
				<ROWSTYLE name="fontSize" value="12" />
				
				<COLUMN dataField="NUM"
					width="60"
					type="Number"
					outputFormat="#"
					visible="false"
					headerText="N°" 
					textAlign="left" >
				</COLUMN>
				<COLUMN dataField="TAB"
					minWidth="100"
					type="Char"
					visible="true"
					headerText="Table" 
					textAlign="left">
				</COLUMN>
				<COLUMN dataField="VIEW"
					minWidth="200"
					type="Char"
					visible="true"
					headerText="Vue" 
					textAlign="left">
				</COLUMN>
				
				
				<COLUMN dataField="NB_P"
					width="100"
					type="Number"
					visible="true"
					headerText="Taille table" 
					outputFormat="0"
					fixed="false"
					textAlign="right">
				</COLUMN>
				<COLUMN dataField="NB_V"
					width="100"
					type="Number"
					visible="true"
					headerText="Taille vue" 
					outputFormat="0"
					fixed="false"
					textAlign="right">
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.NB_V != ROW.NB_P" />
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0x00FF33" 
							condition="ROW.NB_V == ROW.NB_P" />
				</COLUMN>
				
				
			</DATAGRID>
		
		</ONGLET>
		
	</PRESENTATION>
	
</VUE>

			
