<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000002" 
	label="PMSI. Chiffrier CTI"
    title="= 'PMSI. Chiffrier CTI'" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_pmsi"
	componentFile="PMSI_components.XML">
	<CACHE cachable="false" />
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
	</VIEWPROPERTIES>
	
	<SELECTIONS>
		
	</SELECTIONS>
	
	<QUERIES>
		<QUERY> 
			
			<SQL select="SELECT  substr(mois, 1, 4) || '-' || substr(mois, 5, 2)  || '-01', 
							sum(nb_rsa), 
							sum(ca_sejour),
							sum(nb_rsa_champ_ghs), 
							sum(ca_sejour_champ_ghs),
							sum(nb_rsa_hors_champ_ghs), 
							sum(ca_sejour_hors_champ_ghs),
							sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs),  
							CASE WHEN sum(nb_rsa) > 0 AND sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs) &gt;= 10 THEN sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs) / sum(nb_rsa) * 100 ELSE 0 END,
							sum(ca_sejour_en_cours_valides_champ_ghs + ca_sejour_en_cours_groupes_champ_ghs + ca_sejour_en_cours_sortis_non_groupes_champ_ghs + ca_sejour_en_cours_presents_champ_ghs),  
							sum(nb_rsa_en_cours_sortis_non_groupes_champ_ghs + nb_rsa_en_cours_presents_champ_ghs), 
							SUM(CASE WHEN finess = '[VIEW.FI1]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI1]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI2]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI2]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI3]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI3]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI4]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI4]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI5]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI5]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI6]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI6]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI7]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI7]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI8]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI8]' THEN ca_sejour ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI9]' THEN nb_rsa ELSE 0 END),
							SUM(CASE WHEN finess = '[VIEW.FI9]' THEN ca_sejour ELSE 0 END)
							FROM pmsi.p_chiffrier WHERE substr(mois,0,5)::bigint >= (date_part('year', CURRENT_DATE) - 5)::bigint GROUP BY mois  ORDER BY mois DESC " >
				<FIELDS>
					<FIELD name="MOIS" />
					<FIELD name="RSA" />
					<FIELD name="CA" />
					<FIELD name="RSA_GHS" />
					<FIELD name="CA_GHS" />
					<FIELD name="RSA_NGHS" />
					<FIELD name="CA_NGHS" />
					<FIELD name="RSA_ECG" />
					<FIELD name="PRSA_ECG" />
					<FIELD name="CA_ECG" />
					<FIELD name="RSA_ECN" />
					<FIELD name="RSA1" />
					<FIELD name="CA1" />
					<FIELD name="RSA2" />
					<FIELD name="CA2" />
					<FIELD name="RSA3" />
					<FIELD name="CA3" />
					<FIELD name="RSA4" />
					<FIELD name="CA4" />
					<FIELD name="RSA5" />
					<FIELD name="CA5" />
					<FIELD name="RSA6" />
					<FIELD name="CA6" />
					<FIELD name="RSA7" />
					<FIELD name="CA7" />
					<FIELD name="RSA8" />
					<FIELD name="CA8" />
					<FIELD name="RSA9" />
					<FIELD name="CA9" />
				</FIELDS>
			</SQL>
			
		</QUERY>
		
		<QUERY> 
			
			<SQL select="SELECT  p_calendrier_mois.annee, 
						sum(nb_rsa), 
						sum(ca_sejour),
						sum(nb_rsa_champ_ghs), 
						sum(ca_sejour_champ_ghs),
						sum(nb_rsa_hors_champ_ghs), 
						sum(ca_sejour_hors_champ_ghs),
						sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs),  
						CASE WHEN sum(nb_rsa) > 0 AND sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs) &gt;= 10 THEN sum(nb_rsa_en_cours_valides_champ_ghs + nb_rsa_en_cours_groupes_champ_ghs) / sum(nb_rsa) * 100 ELSE 0 END,
						sum(ca_sejour_en_cours_valides_champ_ghs + ca_sejour_en_cours_groupes_champ_ghs + ca_sejour_en_cours_sortis_non_groupes_champ_ghs + ca_sejour_en_cours_presents_champ_ghs),  
						sum(nb_rsa_en_cours_sortis_non_groupes_champ_ghs + nb_rsa_en_cours_presents_champ_ghs) 
				FROM pmsi.p_chiffrier, base.p_calendrier_mois 
				WHERE p_chiffrier.mois = p_calendrier_mois.mois
				AND substr(p_chiffrier.mois,0,5)::bigint >= (date_part('year', CURRENT_DATE) - 5)::bigint
				GROUP BY annee
				ORDER BY annee DESC " >
				<FIELDS>
					<FIELD name="ANNEE" />
					<FIELD name="RSA" />
					<FIELD name="CA" />
					<FIELD name="RSA_GHS" />
					<FIELD name="CA_GHS" />
					<FIELD name="RSA_NGHS" />
					<FIELD name="CA_NGHS" />
					<FIELD name="RSA_ECG" />
					<FIELD name="PRSA_ECG" />
					<FIELD name="CA_ECG" />
					<FIELD name="RSA_ECN" />
				</FIELDS>
			</SQL>
			
		</QUERY>
		
		<QUERY> 
			
			<SQL select="(SELECT t_finess.code, t_finess.texte,
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -5, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -5, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -5, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -5, '12')::integer  THEN mois::text || '01' ELSE null END)::text,
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -4, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -4, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -4, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -4, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -3, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -3, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -3, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -3, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -2, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -2, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -2, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -2, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -1, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -1, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -1, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -1, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE), '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE), '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE), '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE), '12')::integer  THEN mois::text || '01' ELSE null END)
					FROM base.t_finess 
					JOIN pmsi.p_chiffrier ON (p_chiffrier.finess = t_finess.code AND nb_rsa_champ_ghs &lt;&gt; 0)
					WHERE t_finess.secondaire = '1'
					GROUP BY t_finess.code, t_finess.texte)

					UNION ALL

					(SELECT '000000000', COUNT(DISTINCT t_finess.code)::text || ' Etablissements',
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -5, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -5, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -5, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -5, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -4, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -4, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -4, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -4, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -3, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -3, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -3, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -3, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -2, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -2, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -2, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -2, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -1, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -1, '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -1, '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -1, '12')::integer  THEN mois::text || '01' ELSE null END),
					SUM(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) , '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE), '12')::integer  THEN nb_rsa ELSE null END),
					MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) , '01')::integer AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE), '12')::integer  THEN mois::text || '01' ELSE null END)
					FROM base.t_finess 
					JOIN pmsi.p_chiffrier ON (p_chiffrier.finess = t_finess.code AND nb_rsa_champ_ghs &lt;&gt; 0)
					WHERE t_finess.secondaire = '1')

					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="FIN" />
					<FIELD name="FINTXT" />
					<FIELD name="RSAA5" />
					<FIELD name="DATA5" />
					<FIELD name="RSAA4" />
					<FIELD name="DATA4" />
					<FIELD name="RSAA3" />
					<FIELD name="DATA3" />
					<FIELD name="RSAA2" />
					<FIELD name="DATA2" />
					<FIELD name="RSAA1" />
					<FIELD name="DATA1" />
					<FIELD name="RSAA0" />
					<FIELD name="DATA0" />
				</FIELDS>
			</SQL>
			
		</QUERY>
	
	
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forRows="false"> 
			
			<SQL select="
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE) - 5), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -5 , '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -5, '12')  THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						UNION ALL
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE) - 4), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -4, '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -4, '12')  THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						UNION ALL
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE) - 3), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -3, '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -3, '12')  THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						UNION ALL
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE) - 2), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -2, '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -2, '12')  THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						UNION ALL
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE) - 1), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) -1, '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) -1, '12')  THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						UNION ALL
						SELECT CONCAT('DAT', date_part('year', CURRENT_DATE)), MAX(CASE WHEN mois &gt;= CONCAT(date_part('year', CURRENT_DATE) , '01') AND mois &lt;= CONCAT(date_part('year', CURRENT_DATE) , '12') THEN mois::text || '01' ELSE null END) FROM pmsi.p_chiffrier WHERE nb_rsa_champ_ghs &lt;&gt; 0
						">
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>
		
			
		</QUERY>
	
	</QUERIES>
	
	<CALCFIELDS>
	</CALCFIELDS>
	
	<PRESENTATION>
	
		
		<ONGLET label="Chiffrier mensuel">			
			<CHART title="Séjours" type="columnChart" subType="stacked" 	
				sortField="MOIS" sortSeq="A" 
				maxItems="24"  maxItemsSortOn="MOIS" maxItemsSortSeq="D"  >
				<CATEGORY field="MOIS" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMM YY"
					/>
				<SERIE field="RSA_GHS" displayName="Nb séjours expédiés ePMSI GHM" />
				<SERIE field="RSA_ECG" displayName="Nb groupés non expédiés ePMSI GHM " />
				<SERIEx field="RSA_ECN" displayName="Nb non groupés ePMSI GHM" />
				<SERIE field="RSA_NGHS" displayName="Nb séjours ePMSI hors GHM" />
			</CHART>
			<CHART title="C.A. Séjour" type="columnChart" subType="stacked" categoryField="MOIS" sortField="MOIS" sortSeq="A" maxItems="24"  
				maxItemsSortOn="MOIS" maxItemsSortSeq="D"  >
				<CATEGORY field="MOIS" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMM YY"
					/>
				<SERIE field="CA_GHS" displayName="C.A. Séjour expédiés ePMSI GHM" />
				<SERIE field="CA_ECG" displayName="C.A. Séjour non expédiés ePMSI GHM" />
				<SERIE field="CA_NGHS" displayName="C.A. Séjour Hors ePMSI hors GHM" />
			</CHART>
					
			<DATAGRID title="Chiffrier" key="MOIS" headerHeight="48" keySeq="D" printRatio="1">
				<COLUMN dataField="MOIS"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMMM YYYY"
					width="100"
					headerText="Mois"
					textAlign="left" />
				<COLUMN dataField="RSA" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb&#xD;Total" 
					textAlign="right" />
				<COLUMN dataField="CA" 
					type="Number" 
					width="110"
					outputFormat="#E"
					headerText="C.A.&#xD;Total" 
					textAlign="right" 
					largeSeparator="true"/>
				<COLUMN dataField="RSA_GHS" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_GHS" 
					type="Number" 
					width="110"
					outputFormat="#E"
					currencyAlign="right"
					headerText="C.A. Séjour expédiés (GHM)" 
					textAlign="right" 
					largeSeparator="true" />
				<COLUMN dataField="RSA_NGHS" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb expédiés (ePMSI hors GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_NGHS" 
					type="Number" 
					width="110"
					outputFormat="#E"
					currencyAlign="right"
					headerText="C.A. expédiés (ePMSI hors GHM)" 
					textAlign="right"
					largeSeparator="true"/>
				<COLUMN dataField="RSA_ECG" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="PRSA_ECG" 
					type="Number"
					width="80"
					outputFormat="#%"
					headerText="% groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_ECG" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="C.A. groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="RSA_ECN" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb non groupés (GHM)" 
					textAlign="right" />
				
				
			</DATAGRID>
		
		</ONGLET>
		
		<ONGLET label="Chiffrier annuel" queryNumber="1">
		
			<CHART title="Séjours" type="columnChart" subType="stacked" categoryField="ANNEE" sortField="ANNEE" sortSeq="A" maxItems="72"  maxItemsSortOn="ANNEE" maxItemsSortSeq="D"  >
				<CATEGORY field="ANNEE" 
					type="Char"
					/>

				<SERIE field="RSA_GHS" displayName="Nb séjours expédiés ePMSI GHM" />
				<SERIE field="RSA_ECG" displayName="Nb groupés non expédiés ePMSI GHM " />
				<SERIEx field="RSA_ECN" displayName="Nb non groupés ePMSI GHM" />
				<SERIE field="RSA_NGHS" displayName="Nb séjours ePMSI hors GHM" />
			</CHART>
			<CHART title="C.A. Séjour" type="columnChart" subType="stacked" categoryField="ANNEE" sortField="ANNEE" sortSeq="A" maxItems="72"  maxItemsSortOn="ANNEE" maxItemsSortSeq="D"  >
				<CATEGORY field="ANNEE" 
					type="Char"
					/>
				<SERIE field="CA_GHS" displayName="C.A. Séjour expédiés ePMSI GHM" />
				<SERIE field="CA_ECG" displayName="C.A. Séjour non expédiés ePMSI GHM" />
				<SERIE field="CA_NGHS" displayName="C.A. Séjour Hors ePMSI hors GHM" />
			</CHART>
					
			<DATAGRID title="Chiffrier" key="ANNEE" keySeq="D" headerHeight="48" >
				<COLUMN dataField="ANNEE"
					type="Char"
					width="100"
					outputFormat="#"
					headerText="Année"
					textAlign="left" />
				<COLUMN dataField="RSA" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb Total" 
					textAlign="right" />
				<COLUMN dataField="CA" 
					type="Number" 
					width="110"
					outputFormat="#E"
					headerText="C.A. Total" 
					textAlign="right" 
					largeSeparator="true"/>
				<COLUMN dataField="RSA_GHS" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_GHS" 
					type="Number" 
					width="110"
					outputFormat="#E"
					currencyAlign="right"
					headerText="C.A. Séjour expédiés (GHM)" 
					textAlign="right" 
					largeSeparator="true" />
				<COLUMN dataField="RSA_NGHS" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb expédiés (ePMSI hors GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_NGHS" 
					type="Number" 
					width="110"
					outputFormat="#E"
					currencyAlign="right"
					headerText="C.A. expédiés (ePMSI hors GHM)" 
					textAlign="right"
					largeSeparator="true"/>
				<COLUMN dataField="RSA_ECG" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="PRSA_ECG" 
					type="Number"
					width="80"
					outputFormat="#%"
					headerText="% groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMN dataField="CA_ECG" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="C.A. groupés non expédiés (GHM)" 
					textAlign="right" />
				<COLUMNx dataField="RSA_ECN" 
					type="Number"
					width="110"
					outputFormat="#"
					headerText="Nb non groupés (GHM)" 
					textAlign="right" />
			</DATAGRID>
		
		</ONGLET>
		
		<ONGLET label="Séjours par établisements (consolidation)" queryNumber="2">
		
					
			<CHARTx title="séjours" type="columnChart" subType="stacked" categoryField="MOIS" sortField="MOIS" sortSeq="A" maxItems="24"  maxItemsSortOn="MOIS" maxItemsSortSeq="D"  >
				<CATEGORY field="MOIS" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMM YY"
					/>
				<SERIE field="RSAA0" displayName="VIEW.TX0" displayNameCalc="true"/>
				<SERIE field="RSAA1" displayName="VIEW.TX1" displayNameCalc="true"/>
				<SERIE field="RSAA2" displayName="VIEW.TX2" displayNameCalc="true"/>
				<SERIE field="RSAA3" displayName="VIEW.TX3" displayNameCalc="true"/>
				<SERIE field="RSAA4" displayName="VIEW.TX4" displayNameCalc="true"/>
				<SERIE field="RSAA5" displayName="VIEW.TX5" displayNameCalc="true"/>
			</CHARTx>
			
					
			<DATAGRID title="Séjours par établissement (consolidation)" total="true" key="FIN" headerHeight="48" keySeq="A"
				totalRowInRows="= ROW.FIN == '000000000'"
			>
				
				<COLUMN dataField="FIN" 
					type="Char"
					width="80"
					headerText="FINESS" 
					textAlign="center"
					totalFunction="text"
					totalComplement="TOTAL"/>
				<COLUMN dataField="FINTXT" 
					type="Char"
					minWidth="200"
					headerText="Etablissement" 
					textAlign="left" />

				<COLUMN dataField="RSAA0" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  annee;" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA0 != 'null'"
					/>
				<COLUMN dataField="DATA0" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + annee;" 
					headerTextCalc="true"
					textAlign="center"  
					fixed="false"
					visibleCondition="VIEW.DATA0 != 'null'"
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA0 == '' &#124; (ROW.DATA0 != VIEW.DATA0 &amp;&amp; ROW.DATA1 == VIEW.DATA1)" />
					</COLUMN>
				<COLUMN dataField="RSAA1" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  (annee - 1);" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA1 != 'null'"
					/>
				<COLUMN dataField="DATA1" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + (annee - 1);" 
					headerTextCalc="true"
					textAlign="center" 
					fixed="false"
					visibleCondition="VIEW.DATA1 != 'null'"
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA1 == '' &#124; (ROW.DATA1 != VIEW.DATA1 &amp;&amp; ROW.DATA2 == VIEW.DATA2)" />
					</COLUMN>
				<COLUMN dataField="RSAA2" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  (annee - 2);" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA2 != 'null'"
					/>
				<COLUMN dataField="DATA2" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + (annee - 2);" 
					headerTextCalc="true"
					textAlign="center" 
					fixed="false"
					visibleCondition="VIEW.DATA2 != 'null'"
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA2 == '' &#124; (ROW.DATA2 != VIEW.DATA2 &amp;&amp; ROW.DATA3 == VIEW.DATA3)" />
					</COLUMN>
				<COLUMN dataField="RSAA3" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  (annee - 3);" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA3 != 'null'"
					/>
				<COLUMN dataField="DATA3" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + (annee - 3);" 
					headerTextCalc="true"
					textAlign="center" 
					fixed="false"
					visibleCondition="VIEW.DATA3 != 'null'"
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA3 == '' &#124; (ROW.DATA3 != VIEW.DATA3 &amp;&amp; ROW.DATA4 == VIEW.DATA4)" />
				</COLUMN>
				<COLUMN dataField="RSAA4" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  (annee - 4);" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA4 != 'null'"
					/>
				<COLUMN dataField="DATA4" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + (annee - 4);" 
					headerTextCalc="true"
					textAlign="center" 
					fixed="false"
					visibleCondition="VIEW.DATA4 != 'null'"
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA4 == '' &#124; (ROW.DATA4 != VIEW.DATA4 &amp;&amp; ROW.DATA5 == VIEW.DATA5)" />
				</COLUMN>
				<COLUMN dataField="RSAA5" 
					type="Number"
					width="80"
					outputFormat="#"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Séjours ' +  (annee - 5);" 
					headerTextCalc="true"
					textAlign="right" 
					fixed="false"
					visibleCondition="VIEW.DATA5 != 'null'"
					/>
				<COLUMN dataField="DATA5" 
					type="Date"
					inputFormat="AAAAMMJJ"
					outputFormat="MMMM"
					width="100"
					headerText="var d:Date = new Date(); var annee:String = String(d.getFullYear()); return 'Dernier mois ' + (annee - 5);" 
					headerTextCalc="true"
					textAlign="center" 
					fixed="false"
					visibleCondition="VIEW.DATA5 != 'null'"		
					>
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.DATA5.substring(4,6) != '12'"/>
				</COLUMN>
			</DATAGRID>
		
		</ONGLET>
		
		
		
				
	</PRESENTATION>
	
</VUE>

