<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="PMSI000211" label="PMSI. Indicateurs I.P.A (arrêté 8 juin 2005)" title="= 'Indicateurs de Pilotage des Activités de soins Autorisés (IPA)  (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" globals="PMSI_globals.XML" componentsFile="PMSI_components.XML" helpFile="iCTI_PMSI_PMSI000211.HTML">
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
		<PROPERTY name="PERIODE_D" value="[EVAL 
											if ('[TYPE_COMPARAISON]' == 'S') {return '[PERIODE_D]';}
											if ('[TYPE_COMPARAISON]' == '2') {return '[VIEW.WPERIODE_D]';}
											return '[PERIODE]';
										EVAL]"/>
		<PROPERTY name="TOPERIODE_D" value="[EVAL 
											if ('[TYPE_COMPARAISON]' == 'S') {return '[TOPERIODE_D]';}
											if ('[TYPE_COMPARAISON]' == '2') {return '[VIEW.WTOPERIODE_D]';}
											return '[TOPERIODE]';
										EVAL]"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<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-07-01" printable="false" globalListProvider="DATE_DEBUT">
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2014-12-31" printable="false" globalListProvider="DATE_FIN">
			</FIELD>
		</GROUP>
		<GROUP label="Période précédente">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="S" printable="false">
				<OPTION label="Pas de comparaison" data="-1"/>
				<OPTION label="Même période sur année précédente" data="2"/>
				<OPTION label="Saisie période" data="S"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="PERIODE_D" label=" " UI="combo" tree="true" width="200" default="2014-01-01" printable="false" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="200" default="2014-06-30" printable="false" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_RSS_SELECTIONS"/>
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_RSS_X" cacheEnabled="false">
				<select><![CDATA[ 
				
				-- Exclusions de la base d'analyse
				
				DROP TABLE IF EXISTS w_exclu_o
				;
				CREATE TEMP TABLE w_exclu_o AS
				SELECT
					rss_id AS w_exclu_o_id
				FROM pmsi.v_rss_ipa_2
				WHERE
					categorie_ipa_code = '*'
					--AND ipa_est_maitre = '1'
				;
		
				CREATE INDEX w_exclu_o_i1 ON w_exclu_o
				USING btree
				(w_exclu_o_id);
				
				-- Séjours d'obstétrique/néonat
				
				DROP TABLE IF EXISTS w_exclu_a
				;
				CREATE TEMP TABLE w_exclu_a AS
				SELECT
					rss_id AS w_exclu_a_id
				FROM pmsi.v_rss_ipa_2
				WHERE
					categorie_ipa_code = 'A'
					AND ipa_est_maitre = '1'
				;
				CREATE INDEX w_exclu_a_i1 ON w_exclu_a
				USING btree
				(w_exclu_a_id);
				
				DROP TABLE IF EXISTS w_ipa;
				CREATE TEMP TABLE w_ipa AS
				(
					SELECT 	
						v_rss_ipa_2.ipa_id AS oid,
						v_rss_ipa_2.ipa_code AS code,
						v_rss_ipa_2.ipa_texte AS texte,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa ELSE null END), 0) as nb,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb ELSE null END), 0) as nx,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = '*' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = 'A' AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL)) THEN nb_rsa 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code IN ('B', 'C') AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL AND w_exclu_a_id IS NULL)) THEN nb_rsa 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = 'D' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa 
										  ELSE null END), 0) as nb2,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = '*' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = 'A' AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL)) THEN nb 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code IN ('B', 'C') AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL AND w_exclu_a_id IS NULL)) THEN nb 
										  WHEN date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_rss_ipa_2.categorie_ipa_code = 'D' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb 
										  ELSE null END), 0) as nx2,
						0 as nb3,
						0 as nx3,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa ELSE null END), 0) as nbp,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb ELSE null END), 0) as nxp,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = '*' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = 'A' AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL)) THEN nb_rsa 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code IN ('B', 'C') AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL AND w_exclu_a_id IS NULL)) THEN nb_rsa 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = 'D' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb_rsa 
								  ELSE null END), 0) as nbp2,
						coalesce(sum(CASE WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = '*' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = 'A' AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL)) THEN nb 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code IN ('B', 'C') AND (v_rss_ipa_2.ipa_est_maitre = '1' OR (v_rss_ipa_2.ipa_est_maitre = '0' AND w_exclu_o_id IS NULL AND w_exclu_a_id IS NULL)) THEN nb 
								  WHEN date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_rss_ipa_2.categorie_ipa_code = 'D' AND v_rss_ipa_2.ipa_est_maitre = '1' THEN nb 
								  ELSE null END), 0) as nxp2,
						0 as nbp3,
						0 as nxp3
					FROM #V_RSS_X#
					LEFT JOIN pmsi.v_rss_ipa_2 on v_rss_ipa_2.rss_id = v_rss_1.rss_id
					LEFT JOIN w_exclu_o ON w_exclu_o.w_exclu_o_id = v_rss_ipa_2.rss_id
					LEFT JOIN w_exclu_a ON w_exclu_a.w_exclu_a_id = v_rss_ipa_2.rss_id
					WHERE 	(date_sortie &gt;= '[PERIODE]' AND date_sortie &lt;= '[TOPERIODE]'
									OR
									date_sortie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
							[VIEW.FILTRE_RSS_SELECT]
					GROUP BY 1,2,3
					ORDER BY 2
				)
				;
				
				UPDATE w_ipa
					SET 
						nb3 = nb2 - nb,
						nbp3 = nbp2 - nbp
				;


				----------------------------------------------

				SELECT	0,
						'',
						'Base d''analyse', 
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp),
						3 as level,
						'A' as order
				FROM	w_ipa
				GROUP BY 1, 2, 3, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Total Exclusions',
						coalesce(sum(w_ipa.nb), 0)::text,
						coalesce(sum(w_ipa.nb2), 0)::text,
						coalesce(sum(w_ipa.nb3), 0),
						coalesce(sum(w_ipa.nbp), 0)::text,
						coalesce(sum(w_ipa.nbp2), 0)::text,
						coalesce(sum(w_ipa.nbp3), 0),
						0 as level,
						'B' as order
				FROM	w_ipa
				WHERE	w_ipa.code not like 'D%'
				GROUP BY 1, 2, 3, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Sous-total Séjours particuliers',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nbp3),
						1 as level,
						'C' as order
				FROM	w_ipa
				WHERE	w_ipa.code like '*%'
				GROUP BY 1, 2, 3, 10, 11
				HAVING	(sum(w_ipa.nb) > 0 OR sum(w_ipa.nbp) > 0)
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - ' || w_ipa.texte,
						w_ipa.nb::text,
						w_ipa.nb2::text,
						w_ipa.nb3,
						w_ipa.nbp::text,
						w_ipa.nbp2::text,
						w_ipa.nbp3,
						2 as level,
						'D' as order
				FROM	w_ipa
				WHERE	w_ipa.code like '*%'
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Sous-total Activités autorisées dans le champ obstétrique/néonatalogie',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nbp3),
						1 as level,
						'E' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'A%'
				GROUP BY 1, 2, 3, 10, 11
				HAVING	(sum(w_ipa.nb) > 0 OR sum(w_ipa.nbp) > 0)
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - ' || w_ipa.texte,
						w_ipa.nb::text,
						w_ipa.nb2::text,
						w_ipa.nb3,
						w_ipa.nbp::text,
						w_ipa.nbp2::text,
						w_ipa.nbp3,
						2 as level,
						'F' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'A%'
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Sous-total Activités autorisées SIOS',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nbp3),
						1 as level,
						'G' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'B%'
				GROUP BY 1, 2, 3, 10, 11
				HAVING	(sum(w_ipa.nb) > 0 OR sum(w_ipa.nbp) > 0)
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - ' || w_ipa.texte,
						w_ipa.nb::text,
						w_ipa.nb2::text,
						w_ipa.nb3,
						w_ipa.nbp::text,
						w_ipa.nbp2::text,
						w_ipa.nbp3,
						2 as level,
						'H' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'B%'
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Sous-total Activités autorisées de médecine et chirurgie spécialisée',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nbp3),
						1 as level,
						'I' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'C%'
				GROUP BY 1, 2, 3, 10, 11
				HAVING	(sum(w_ipa.nb) > 0 OR sum(w_ipa.nbp) > 0)
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - '::text || w_ipa.texte || CASE WHEN w_ipa.code = 'C07' THEN ' (nb prestations)'::text ELSE ''::text END,
						w_ipa.nb::text || CASE WHEN w_ipa.code = 'C07' THEN ' ('::text || w_ipa.nx::text || ')'::text ELSE ''::text END,
						w_ipa.nb2::text || CASE WHEN w_ipa.code = 'C07' THEN ' ('::text || w_ipa.nx2::text || ')'::text ELSE ''::text END,
						w_ipa.nb3,
						w_ipa.nbp::text || CASE WHEN w_ipa.code = 'C07' THEN ' ('::text || w_ipa.nxp::text || ')'::text ELSE ''::text END,
						w_ipa.nbp2::text || CASE WHEN w_ipa.code = 'C07' THEN ' ('::text || w_ipa.nxp2::text || ')'::text ELSE ''::text END,
						w_ipa.nbp3,
						2 as level,
						'J' as order
				FROM	w_ipa
				WHERE	w_ipa.code like 'C%'
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Total Médecine',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nb3),
						0 as level,
						'K' as order
				FROM	w_ipa
				WHERE	w_ipa.code IN ('D01', 'D01A', 'D02', 'D03', 'D04')
				GROUP BY 1, 2, 3, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - ' || w_ipa.texte,
						w_ipa.nb::text,
						w_ipa.nb2::text,
						w_ipa.nb3,
						w_ipa.nbp::text,
						w_ipa.nbp2::text,
						w_ipa.nbp3,
						2 as level,
						'L' as order
				FROM	w_ipa
				WHERE	w_ipa.code IN ('D01', 'D01A', 'D02', 'D03', 'D04')
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	0,
						'',
						'Total Chirurgie',
						sum(w_ipa.nb)::text,
						sum(w_ipa.nb2)::text,
						sum(w_ipa.nb3),
						sum(w_ipa.nbp)::text,
						sum(w_ipa.nbp2)::text,
						sum(w_ipa.nbp3),
						0 as level,
						'M' as order
				FROM	w_ipa
				WHERE	w_ipa.code IN ('D05', 'D06')
				GROUP BY 1, 2, 3, 10, 11
				-----------------------------------------------
				UNION ALL

				SELECT	w_ipa.oid,
						w_ipa.code,
						w_ipa.code || ' - ' || w_ipa.texte,
						w_ipa.nb::text,
						w_ipa.nb2::text,
						w_ipa.nb3,
						w_ipa.nbp::text,
						w_ipa.nbp2::text,
						w_ipa.nbp3,
						2 as level,
						'N' as order
				FROM	w_ipa
				WHERE	w_ipa.code IN ('D05', 'D06')
				GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
				ORDER BY 11, 1
				;
				]]>
				</select>
				<FIELDS>
					<FIELD name="OID"/>
					<FIELD name="COD"/>
					<FIELD name="TXT"/>
					<FIELD name="NB"/>
					<FIELD name="NB2"/>
					<FIELD name="NB3"/>
					<FIELD name="NBP"/>
					<FIELD name="NBP2"/>
					<FIELD name="NBP3"/>
					<FIELD name="LVL"/>
					<FIELD name="ORD"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL select="SELECT 'WPERIODE_D', (date '[PERIODE]' + interval '1 day' - interval '1 year' - interval '1 day')::date
						UNION ALL
							SELECT 'WTOPERIODE_D', (date '[TOPERIODE]' + interval '1 day' - interval '1 year' - interval '1 day')::date
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL select="SELECT 'PERIODE_D_LABEL', 
							CASE WHEN extract(day from p_calendrier.date) &gt; 1 THEN p_calendrier.texte_court ELSE p_calendrier_mois.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND (p_calendrier.date + interval '1 day' + interval '1 year' - interval '1 day')::date = '[PERIODE]'
						UNION ALL
							SELECT 'TOPERIODE_D_LABEL', 
							CASE WHEN dernier_jour = '1' THEN p_calendrier_mois.texte_court ELSE p_calendrier.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND (p_calendrier.date + interval '1 day' + interval '1 year' - interval '1 day')::date = '[TOPERIODE]'
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Justificatif IPA par RSS" shortLabel="Liste IPA" view="PMSI000212.XML">
				<ARG name="PERIODE" value="	if ((COLUMN.NAME == 'NBP' || COLUMN.NAME == 'NBP2' || COLUMN.NAME == 'NBP3') &amp;&amp; SELECT.TYPE_COMPARAISON == '2') {return VIEW.WPERIODE_D}
											if ((COLUMN.NAME == 'NBP' || COLUMN.NAME == 'NBP2' || COLUMN.NAME == 'NBP3') &amp;&amp; SELECT.TYPE_COMPARAISON == 'S') {return SELECT.PERIODE_D}
											return SELECT.PERIODE" />
				<ARG name="TOPERIODE" value="if ((COLUMN.NAME == 'NBP' || COLUMN.NAME == 'NBP2' || COLUMN.NAME == 'NBP3') &amp;&amp; SELECT.TYPE_COMPARAISON == '2') {return VIEW.WTOPERIODE_D}
											if ((COLUMN.NAME == 'NBP' || COLUMN.NAME == 'NBP2' || COLUMN.NAME == 'NBP3') &amp;&amp; SELECT.TYPE_COMPARAISON == 'S') {return SELECT.TOPERIODE_D}
											return SELECT.TOPERIODE" />
				<ARG name="DATA_IPA" value="if (ROW.ORD == 'K') {return '992'}
										else if (ROW.ORD == 'M') {return '991'}
										else if (ROW.ORD == 'B') {return '99'}
										else if (ROW.ORD == 'C') {return 'IC*'}
										else if (ROW.ORD == 'E') {return 'ICA'}
										else if (ROW.ORD == 'G') {return 'ICB'}
										else if (ROW.ORD == 'I') {return 'ICC'}
										else if (ROW.ORD == 'A') {return '00'}
										else if (ROW.ORD == 'D' || ROW.ORD == 'F' || ROW.ORD == 'H' || ROW.ORD == 'J' || ROW.ORD == 'L' || ROW.ORD == 'N') { return 'II' + ROW.OID}
										else {return '00'}" />
				<ARG name="IPA_MASTER" value="if (COLUMN.NAME == 'NB' || COLUMN.NAME == 'NBP') {return '0'}
										else if (COLUMN.NAME == 'NB3' || COLUMN.NAME == 'NBP3') {return '1'}
										else if (COLUMN.NAME == 'NB2' || COLUMN.NAME == 'NBP2') {return '2'}
										else {return '0'}" />

			</VIEWLINK>
			<VIEWREF label="DGOS : Guide méthodologique. Analyse des taux de recours. Pilotage de l'activité des établissements de santé _ Septembre 2011" shortLabel="Guide méthodo IPA" 
				url="http://www.ctisante.com/references/pmsi/Guide_pilotage_activite_decembre-2011_integration_annexe_ATIH_x.pdf" rowContext="false"/>
			<VIEWREF label="Identification des activités de soins dans le champ MCO pour l'activité 2015 (CCAM descriptive ATIH v1, GHM v11G)" shortLabel="Mise à jour 2015" 
				url="http://www.ctisante.com/references/pmsi/Annexe_IPA_V11G_juin2015.pdf" rowContext="false"/>
		</VIEWLINKS>
		<ONGLET excelLabel="I.P.A" label="I.P.A.">
			<DATAGRID title="" headerHeight="60" variableRowHeight="true" sortable="false">
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="backgroundColor" value="0xFFD393" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="backgroundColor" value="0xFFFFFF" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="borderSides" value="top bottom" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="borderStyle" value="solid" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="borderThickness" value="1" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="fontSize" value="12" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="fontSize" value="12" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="rowHeight" value="24" condition="ROW.LVL == '0'"/>
				<ROWSTYLE name="rowHeight" value="24" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '1'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="backgroundColor" value="0x86D1E4" condition="ROW.LVL == '1'"/>
				<ROWSTYLE name="borderSides" value="top bottom" condition="ROW.LVL == '1'"/>
				<ROWSTYLE name="borderStyle" value="solid" condition="ROW.LVL == '1'"/>
				<ROWSTYLE name="borderThickness" value="1" condition="ROW.LVL == '1'"/>
				<COLUMN dataField="OID" type="Number" visible="false">
				</COLUMN>
				<COLUMN dataField="COD" type="Char" visible="false">
				</COLUMN>
				<COLUMN dataField="ORD" type="Char" visible="false">
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" maxWidth="300" headerText="" textAlign="left">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' || ROW.LVL == '1'"/>
				</COLUMN>
				<COLUMN dataField="NB" width="150" type="Number" outputFormat="#" headerText="'Séjours ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL + ' (Indicateur principal)';" headerTextCalc="true" selectable="true" textAlign="right">
				</COLUMN>
				<COLUMN dataField="NB2" width="150" type="Number" outputFormat="#" headerText="'Séjours ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL + ' (Indicateur principal ou secondaire)';" headerTextCalc="true" selectable="true" textAlign="right">
				</COLUMN>
				<COLUMN dataField="NB3" width="150" type="Number" outputFormat="#" headerText="'Séjours ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL + ' (Indicateur secondaire)';" headerTextCalc="true" selectable="true" textAlign="right">
				</COLUMN>
				<COLUMN dataField="NBP" width="150" type="Number" outputFormat="#" headerText="if (SELECT.TYPE_COMPARAISON == '2') {
									return 'Séjours ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL + ' (Indicateur principal)';
								}
								else {
									return 'Séjours ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL + ' (Indicateur principal)';
								}
								" headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPE_COMPARAISON != '-1'" textAlign="right">
				</COLUMN>
				<COLUMN dataField="NBP2" width="150" type="Number" outputFormat="#" headerText="if (SELECT.TYPE_COMPARAISON == '2') {
									return 'Séjours ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL + ' (Indicateur principal ou secondaire)';
								}
								else {
									return 'Séjours ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL + ' (Indicateur principal ou secondaire)';
								}
								" headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPE_COMPARAISON != '-1'" textAlign="right">
				</COLUMN>
				<COLUMN dataField="NBP3" width="150" type="Number" outputFormat="#" headerText="if (SELECT.TYPE_COMPARAISON == '2') {
									return 'Séjours ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL + ' (Indicateur secondaire)';
								}
								else {
									return 'Séjours ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL + ' (Indicateur secondaire)';
								}
								" headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPE_COMPARAISON != '-1'" textAlign="right">
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
