<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000006" label="PMSI. Détail RSS" title="= 'Détail RSS n°' + VIEW.NO_RSS + ' (Séjour n°' + VIEW.NO_SEJOUR + ') '" database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" helpDokuWIkiDir="pmsi" helpDokuWIkiFile="pmsi000006"  helpFile="iCTI_PMSI_PMSI000006.HTML">
	<CACHE cachable="false" />
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="RSS à détailler">
		<GROUP>
			<FIELD name="OID" label="Oid" UI="number" default="0" enabled="false"/>
		</GROUP>
	</SELECTIONS>
	<QUERIES>
		<QUERY label="Fiche RSS">
			<SQL>
				<select><![CDATA[
				
					DROP TABLE IF EXISTS w_tmp; CREATE TEMP TABLE w_tmp AS
					SELECT rss_id, base.cti_group_concat(cancero_code || ' (' || cancero_texte_court || ')') as code_cancero
					FROM pmsi.v_rss_cancero_1
					WHERE v_rss_cancero_1.rss_id = [OID] AND v_rss_cancero_1.cdc = '2011'
					GROUP BY rss_id;
					
					DROP TABLE IF EXISTS w_gm_acte; CREATE TEMP TABLE w_gm_acte AS 
					SELECT
						v_rss_actes_1.rss_id AS rss_id,
						' (Acte : ' || v_rss_actes_1.acte_code || ' - ' || CASE WHEN char_length(v_rss_actes_1.acte_texte) < 60 THEN v_rss_actes_1.acte_texte ELSE substr(v_rss_actes_1.acte_texte, 1, 57) || '...' END || ')' AS gm_acte,
						v_rss_actes_1.icr_activite_1 AS icr
					FROM
						pmsi.v_rss_actes_1
						JOIN pmsi.t_actes ON t_actes.code = v_rss_actes_1.acte_code
						JOIN pmsi.t_classes_sections_elements ON t_actes.oid = t_classes_sections_elements.to_id
						JOIN pmsi.t_classes_sections ON t_classes_sections.oid = t_classes_sections_elements.section_id
						JOIN pmsi.t_classes ON t_classes.oid = t_classes_sections.classe_id
						JOIN pmsi.v_rss_gm_1 USING (rss_id)
					WHERE
						v_rss_actes_1.rss_id = [OID]
						AND t_classes_sections.code = v_rss_gm_1.gm_code
						AND t_classes.sequence = 12
					GROUP BY 1, 2, 3
					ORDER BY v_rss_actes_1.icr_activite_1 DESC
					LIMIT 1
					;
					
					DROP TABLE IF EXISTS w_leg; CREATE TEMP TABLE w_leg AS
					SELECT rss_id, base.cti_group_concat(code_retour_groupeur_code || ' - ' || code_retour_groupeur_texte || ' (x' || nombre_erreur_groupeur || ')') as codes_erreur
					FROM pmsi.v_rss_leg_1
					WHERE rss_id = [OID]
					GROUP BY 1
					
				]]></select>
			</SQL>
					
			<SQL optimizer="V_RSS_X">
				<select><![CDATA[
					
					
					SELECT v_rss_1.no_rss, 
						CASE WHEN patient_no_patient > 0 THEN patient_no_patient ELSE 0 END,
						v_rss_1.finess_texte || ' (' || v_rss_1.finess || ')' ,
						identite_nom || ' ' || identite_prenom, 
						v_rss_1.no_sejour_administratif,
						sexe_texte,
						age::text||' an(s) ' || CASE WHEN v_rsa_1.age_jours > 0 THEN v_rsa_1.age_jours::text || ' jour(s) ' ELSE ''::text END || '('||to_char(v_rss_1.date_naissance, 'DD/MM/YYYY')||')',
						code_postal||(SELECT CASE WHEN texte <> '' THEN ' ('||texte||')' ELSE 'Non renseigné' END FROM base.t_codes_postaux WHERE code = code_postal),
						ghm_code || ' - ' || ghm_texte,
						ipa_code || ' - ' || ipa_texte,
						gm_code || ' - ' || gm_texte || w_gm_acte.gm_acte,
						pole_oap_code || ' - ' || pole_oap_texte,
						ligne_oap_code || ' - ' || ligne_oap_texte,
						mco || ' - ' || mco_texte,
						cas_code || ' - ' || cas_texte,
						ghm_section_code[7] || ' - ' || ghm_section_texte[7],
						ghm_section_code[8] || ' - ' || ghm_section_texte[8],
						ghm_section_code[9] || ' - ' || ghm_section_texte[9],
						ghs_code || ' - ' || ghs_texte || CASE WHEN ghs_borne_haute > 0 THEN ' (Bornes : ' || ghs_borne_basse || '-' || ghs_borne_haute || ', dms nationale du ghs : ' || round(dms_nationale_ghs, 1) || ' jour(s) )' ELSE '' END,
						medecin_reference_rss_nom || ' (' || medecin_reference_rss_code || ')', 
						comite_medical_code || ' - ' || comite_medical_texte,
						diagnostic_principal_code || ' - ' || diagnostic_principal_texte || COALESCE(' (' || parametre_personnalise_1_code || ' ' || parametre_personnalise_1_texte || ')',''), 
						diagnostic_relie_code || ' - ' || diagnostic_relie_texte, 
						acte_principal_code || ' - ' || acte_principal_texte, 
						w_tmp.code_cancero as code_cancero,
						date_entree,
						date_sortie,
						duree_sejour::text || ' jour(s)' || CASE WHEN nb_seances > 0 THEN ', ' || nb_seances::text || ' séance(s)' ELSE '' END,
						nb_rum,
						v_rss_1.base_remboursement, v_rss_1.t2a_facture,
						v_rss_1.phc_facture, v_rss_1.dmi_facture, v_rss_1.nb_exh, v_rss_1.ca_exh, v_rss_1.ca_exb,
						v_rss_1.ca_ghs, v_rss_1.forfait_facture, 
						v_rss_1.t2a_facture - v_rss_1.ca_ghs - v_rss_1.ca_exh - v_rss_1.forfait_facture,
						honoraires_factures,
						CASE WHEN poids_bebe > 0 THEN poids_bebe::text||' g' ELSE '' END,
						CASE WHEN age_gestationnel > 0 
							THEN age_gestationnel::text||' sem'||CASE WHEN date_dernieres_regles != '2099-12-31' THEN ' ('||to_char(date_dernieres_regles, 'DD/MM/YYYY')||')' ELSE '' END
							ELSE ''
						END,
						CASE 
							WHEN v_rss_1.ghm_id = 0 AND v_rsf_total_1.valorise_fides_code = '1' THEN 'Valorisé FIDES ACE'::text
                            WHEN v_rss_1.en_cours <> '0' AND v_rss_1.en_cours_etat = 'S' THEN 'Sorti non groupé non transmis à ePMSI'
                            WHEN v_rss_1.en_cours <> '0' AND v_rss_1.en_cours_etat = 'G' THEN 'Groupé non validé non transmis à ePMSI'
							WHEN v_rss_1.en_cours <> '0' AND v_rss_1.en_cours_etat = 'V' THEN 'Validé non facturé non transmis à ePMSI'
							WHEN v_rss_1.en_cours <> '0' AND v_rss_1.en_cours_etat = 'F' THEN 'Facturé non transmis à ePMSI'
							WHEN v_rss_1.en_cours <> '0' THEN 'Non transmis non transmis à ePMSI'
							WHEN v_rss_1.traitement_epmsi = '11' THEN 'Non traité par ePmsi. CMD 90 hors 90H02Z et 90H03Z'
							WHEN v_rss_1.traitement_epmsi = '12' THEN 'Non traité par ePmsi. Prestation inter_établissement'
							WHEN v_rss_1.traitement_epmsi = '13' THEN 'Non traité par ePmsi. GHS 9999'
							WHEN v_rss_1.traitement_epmsi = '15' THEN 'Non traité par ePmsi. Cohérence RSF'
							WHEN v_rss_1.traitement_epmsi = '21' THEN 'Traité non valorisé par ePmsi. Pb chainage'
							WHEN v_rss_1.traitement_epmsi = '22' THEN 'Traité non valorisé par ePmsi. Pb variable bloquante'
							WHEN v_rss_1.traitement_epmsi = '23' THEN 'Traité non valorisé par ePmsi. Attente décision droits'
							WHEN v_rss_1.traitement_epmsi = '24' THEN 'Traité non valorisé par ePmsi. Non facturables AM'
							WHEN v_rss_1.traitement_epmsi = '25' THEN 'Traité non valorisé par ePmsi. Prélèvement organes patient décédé'
							WHEN v_rss_1.traitement_epmsi = '26' THEN 'Traité non valorisé par ePmsi. Erreur inconnue (Valosej)'
							WHEN v_rss_1.traitement_epmsi = '30' THEN 'Valorisé par ePmsi'
							WHEN v_rss_1.traitement_epmsi = '31' THEN 'Valorisé par ePmsi (AME)'
							WHEN v_rss_1.traitement_epmsi = '32' THEN 'Valorisé par ePmsi (IVG)'
							WHEN v_rss_1.traitement_epmsi = '33' THEN 'Valorisé par ePmsi (SU)'
							ELSE v_rss_1.traitement_epmsi  END ||
							CASE WHEN date_groupage <> '20991231' THEN ' (groupé le ' || to_char(date_groupage,'DD/MM/YYYY') || ')' ELSE '' END,
						w_leg.codes_erreur,
						v_rsf_total_1.exoneration_tm_code || ' - ' || v_rsf_total_1.exoneration_tm_texte as justificatif_exo,
						v_rsf_total_1.code_pec_code || ' - ' || v_rsf_total_1.code_pec_texte || CASE WHEN v_rsf_total_1.code_pec_code = '0' THEN ' (' || v_rsf_total_1.motif_non_facturation_texte || ')' ELSE '' END as code_pec,
						v_rsf_total_1.taux_remboursement as taux_remboursement,
						v_rsf_total_1.regime_code || ' - ' || v_rsf_total_1.regime_texte as regime,
						v_rsf_total_1.nature_pec_code || ' - ' || v_rsf_total_1.nature_pec_texte as nature_pec,
						v_rsf_total_1.type_contrat_oc_code || ' - ' || v_rsf_total_1.type_contrat_oc_texte as type_contrat_oc,
						v_rsf_total_1.facturation_18euros_code || ' - ' || v_rsf_total_1.facturation_18euros_texte as fac_18euros,
						v_rsf_total_1.code_pec_fj_code || ' - ' || v_rsf_total_1.code_pec_fj_texte as code_pec_fj,
						v_rsf_total_1.pat_benef_cmu_code || ' - ' || v_rsf_total_1.pat_benef_cmu_texte as pat_benef_cmu,
                        CASE WHEN v_rss_1.type_sejour_ovalide = '1' THEN '1 - GHM de niveau J ou T0 ou Durée de séjour &lt; 2j'
                             WHEN v_rss_1.type_sejour_ovalide = '2' THEN '2 - CM28'
                             WHEN v_rss_1.type_sejour_ovalide = '3' THEN '3 - Autres GHM'
                        ELSE '0'::text END,
                        etat_sejour_code || ' - ' || etat_sejour_texte,
                        v_rss_1.severite_cti_code || ' - ' || v_rss_1.severite_cti_texte,
						mode_entree  || provenance || ' - ' ||  mode_entree_texte ||' '|| provenance_texte ,
						etablissement_provenance_code || ' : ' || etablissement_provenance_texte,
						mode_sortie || destination || ' - ' || mode_sortie_texte ||' '|| destination_texte ,
						passage_urgences_code || ' : ' || passage_urgences_texte ,
						etablissement_destination_code || ' : ' || etablissement_destination_texte,
                        case when activite_urgence = '1' then '1 : Prestation ATU facturée' else 'Non' end,
                        conversion_hp_hc_id::text || ' : ' || conversion_hp_hc_texte ,
                        raac_id::text || ' : ' ||raac_texte,
                        rescrit_tarif_id::text || ' : ' ||rescrit_tarif_texte,
                        adm_prod_reshospi_id::text || ' : ' ||adm_prod_reshospi_texte,
                        contexte_pat_id::text || ' : ' ||contexte_pat_texte,
                        nb_intervention_id::text || ' : ' ||nb_intervention_texte,
						np_code || ' : ' || np_texte
				
					FROM
						#V_RSS_X#
						LEFT JOIN w_tmp ON w_tmp.rss_id = v_rss_1.rss_id
						LEFT JOIN w_gm_acte ON w_gm_acte.rss_id = v_rss_1.rss_id
						LEFT JOIN w_leg ON w_leg.rss_id = v_rss_1.rss_id
						LEFT JOIN pmsi.p_rss_etat ON v_rss_1.rss_id = p_rss_etat.rss_id
					WHERE 
						v_rss_1.rss_id = [OID]  
						
						
				]]></select>
				<FIELDS>
					<FIELD name="RSS"/>
					<FIELD name="PAT"/>
					<FIELD name="FIN"/>
					<FIELD name="NOM" ifHideNames="Non autorisé"/>
					<FIELD name="NOADM"/>
					<FIELD name="SEXE"/>
					<FIELD name="AGE"/>
					<FIELD name="CP"/>
					<FIELD name="GHM"/>
					<FIELD name="IPA"/>
					<FIELD name="GM"/>
					<FIELD name="POAP"/>
					<FIELD name="LOAP"/>
					<FIELD name="ASO"/>
					<FIELD name="CAS"/>
					<FIELD name="GATIH"/>
					<FIELD name="GPATIH"/>
					<FIELD name="DATIH"/>
					<FIELD name="GHS"/>
					<FIELD name="MEDECIN"/>
					<FIELD name="COMITE"/>
					<FIELD name="DIAGP"/>
					<FIELD name="DIAGR"/>
					<FIELD name="ACTEP"/>
					<FIELD name="CANCERO"/>
					<FIELD name="DATE_ENT"/>
					<FIELD name="DATE_SOR"/>
					<FIELD name="NBJ"/>
					<FIELD name="NB_RUM"/>
					<FIELD name="CA"/>
					<FIELD name="CA_T2A"/>
					<FIELD name="CA_PHC"/>
					<FIELD name="CA_DMI"/>
					<FIELD name="NB_EXH"/>
					<FIELD name="CA_EXH"/>
					<FIELD name="CA_EXB"/>
					<FIELD name="CA_GHS"/>
					<FIELD name="CA_FOR"/>
					<FIELD name="CA_AUT"/>
					<FIELD name="CA_HON"/>
					<FIELD name="PBB"/>
					<FIELD name="AGEST"/>
					<FIELD name="EPMSI"/>
					<FIELD name="CODES_ERREUR"/>
					<FIELD name="JUSTIFICATIF_EXO"/>
					<FIELD name="CODE_PEC"/>
					<FIELD name="TAUX_REMBOURSEMENT"/>
					<FIELD name="REGIME"/>
					<FIELD name="NATURE_PEC"/>
					<FIELD name="TYPE_CONTRAT_OC"/>
					<FIELD name="FAC_18EUROS"/>
					<FIELD name="CODE_PEC_FJ"/>
					<FIELD name="PAT_BENEF_CMU"/>
					<FIELD name="T_SEJ_OVA"/>
					<FIELD name="ETAT_SEJ"/>
					<FIELD name="CTISEV"/>
					<FIELD name="MDENTRPROV"/>
					<FIELD name="ETABPROV"/>
					<FIELD name="MDSORTDEST"/>
					<FIELD name="PASSAGE_URGENCES"/>      <!-- Passage Urgence -->
					<FIELD name="ETABDEST"/>
					<FIELD name="ACT_URG"/>
                    <FIELD name="COHPHC"/>
					<FIELD name="RAAC"/>
					<FIELD name="RESC_TARIF"/>
					<FIELD name="ADM_PROD_RH"/>
					<FIELD name="CONTEX_PAT"/>
					<FIELD name="NB_INTERV"/>
					<FIELD name="NP"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Codage">
			<SQL>
				<select><![CDATA[
					SELECT '1' AS TRI, unite_medicale_code, 'CIM10', no_rum, type_diagnostic AS TYPE, 
						diagnostic_code || ' - ' || diagnostic_texte AS CODE, '', null,'', 
						CASE 
						WHEN p_rss.date_sortie < '20100301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg11_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg11_code ELSE '' END
						WHEN p_rss.date_sortie < '20110301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg12_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg12_code ELSE '' END
						WHEN p_rss.date_sortie < '20120301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg13_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg13_code ELSE '' END
						WHEN p_rss.date_sortie < '20130301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg1311d_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg1311d_code ELSE '' END
						WHEN p_rss.date_sortie < '20140301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg1311e_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg1311e_code ELSE '' END
						WHEN p_rss.date_sortie < '20150301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg1311f_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg1311f_code ELSE '' END
						WHEN p_rss.date_sortie < '20160301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg1311g_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg1311g_code ELSE '' END
						WHEN p_rss.date_sortie < '20170301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2016_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2016_code ELSE '' END
						WHEN p_rss.date_sortie < '20180301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2017_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2017_code ELSE '' END
						WHEN p_rss.date_sortie < '20190301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2018_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2018_code ELSE '' END
						WHEN p_rss.date_sortie < '20200301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2019_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2019_code ELSE '' END
						WHEN p_rss.date_sortie < '20210301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2020_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2020_code ELSE '' END
						WHEN p_rss.date_sortie < '20220301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2021_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2021_code ELSE '' END
						WHEN p_rss.date_sortie < '20230301' THEN
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2022_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2022_code ELSE '' END
						ELSE
							CASE WHEN type_diagnostic_rss IN ('DA', 'DS') AND diagnostic_severite_fg2023_code IN ('2', '3', '4') THEN 'Sévérité = ' || diagnostic_severite_fg2023_code ELSE '' END
						END,
						null AS DATE_MVT, 0 as icr, 0 as ACTE_P, ''::text as EXTDOC,''::text as MCC, '' AS uf, '' AS assoc_non_prevue, ''::text as int,
                        
                        CASE 
                            WHEN v_rss_diagnostics_1.diagnostic_code = ANY (ARRAY['F00002'::text, 'F00012'::text, 'F00022'::text, 'F00032'::text, 'F00042'::text, 'F00102'::text, 'F00112'::text, 'F00122'::text, 'F00132'::text, 'F00142'::text, 'F00202'::text, 'F00212'::text, 'F00222'::text, 'F00232'::text, 'F00242'::text, 'F00902'::text, 'F00912'::text, 'F00922'::text, 
                                                                                    'F00932'::text, 'F00942'::text, 'F01002'::text, 'F01012'::text, 'F01022'::text, 'F01032'::text, 'F01042'::text, 'F01102'::text, 'F01112'::text, 'F01122'::text, 'F01132'::text, 'F01142'::text, 'F01202'::text, 'F01212'::text, 'F01222'::text,
                                                                                    'F01232'::text, 'F01242'::text, 'F01302'::text, 'F01312'::text, 'F01322'::text, 'F01332'::text, 'F01342'::text, 'F01802'::text, 'F01812'::text, 'F01822'::text, 'F01832'::text, 'F01842'::text, 'F02002'::text, 'F02012 '::text, 'F02022'::text, 'F02032'::text, 'F02042'::text, 'F02102'::text,
                                                                                    'F02112'::text, 'F02122'::text, 'F02132'::text, 'F02142'::text, 'F02202'::text, 'F02212'::text, 'F02222'::text, 'F02232'::text, 'F02242'::text, 'F02302'::text, 'F02312'::text, 'F02322'::text, 'F02332'::text, 'F02342'::text, 'F02402'::text, 'F02412'::text, 'F02422'::text, 'F02432'::text,
                                                                                    'F02442'::text, 'F02802'::text, 'F02812'::text, 'F02822'::text, 'F02832'::text, 'F02842'::text, 'F03+02'::text, 'F03+12'::text, 'F03+22'::text, 'F03+32'::text, 'F03+42'::text, 'F721'::text, 'F730'::text, 'F731'::text, 'F738'::text, 'F739'::text]) 
                            THEN '1' 
                            WHEN v_rss_diagnostics_1.diagnostic_code = ANY (ARRAY['G10'::text, 'G110'::text, 'G111'::text, 'G112'::text, 'G113'::text, 'G114'::text, 'G118'::text, 'G119'::text, 'G120'::text, 'G121'::text, 'G122'::text, 'G128'::text, 'G129'::text, 'G14'::text, 'G20'::text, 'G210'::text, 'G211'::text, 'G212'::text, 'G213'::text, 'G214'::text, 'G218'::text, 'G219'::text, 'G22'::text, 'G230'::text, 'G231'::text, 'G232'::text, 'G238'::text, 'G239'::text, 'G242'::text, 'G253'::text, 'G255'::text, 'G26'::text, 'G318'::text, 'G320'::text, 'G328'::text, 'G37'::text, 'G371'::text, 'G372'::text, 'G373'::text, 'G374'::text, 'G375'::text, 'G378'::text, 'G379'::text, 'G600'::text, 'G601'::text, 'G602'::text, 'G603'::text, 'G608'::text, 'G609'::text, 'G710'::text, 'G711'::text, 'G712'::text, 'G713'::text, 'G718'::text, 'G719'::text, 'G800'::text, 'G801'::text, 'G802'::text, 'G803'::text, 'G804'::text, 'G808'::text, 'G809'::text, 'G8108'::text, 'G811'::text, 'G819'::text, 'G820'::text, 'G821'::text, 'G822'::text, 'G823'::text, 'G824'::text, 'G825'::text, 'G838+0'::text, 'Q743'::text, 'R270'::text]) 
                            THEN '2'
                            WHEN v_rss_diagnostics_1.diagnostic_code = ANY (ARRAY['R2630'::text, 'R2638'::text, 'Z740'::text]) 
                            THEN '3'
                            WHEN v_rss_diagnostics_1.diagnostic_code = ANY (ARRAY['U900'::text, 'Z515'::text, 'Z741'::text, 'Z742'::text, 'Z743'::text, 'Z748'::text, 'Z749'::text, 'Z930'::text, 'Z931'::text, 'Z932'::text, 'Z933'::text, 'Z934'::text, 'Z935'::text, 'Z936'::text, 'Z938'::text, 'Z939'::text, 'Z990'::text, 'Z991'::text, 'Z991+0'::text, 'Z991+1'::text, 'Z991+8'::text, 'Z993'::text, 'Z998'::text, 'Z999'::text]) 
                            THEN '4'
                            ELSE NULL END AS nb_diag_polyhand_liste,
                        CASE 
                            WHEN v_rss_diagnostics_1.diagnostic_code = ANY (ARRAY['Z5500'::text,'Z5508'::text,'Z551'::text,'Z590'::text,'Z5910'::text,'Z5911'::text,'Z5912'::text,'Z5913'::text,'Z5918'::text,'Z5950'::text,'Z5958'::text,'Z5960'::text,'Z5961'::text,'Z5962'::text,'Z5968'::text,'Z5970'::text,'Z5978'::text,'Z6020'::text,'Z6028'::text,'Z6030'::text,'Z6038'::text]) 
                            THEN '1' ELSE NULL END
						FROM pmsi.v_rss_diagnostics_1 JOIN pmsi.p_rss ON v_rss_diagnostics_1.rss_id = p_rss.oid
						WHERE rss_id = [OID] 
						
						UNION ALL
						
						SELECT '2' AS TRI, 
							unite_medicale_code, 
							acte_nomenclature, 
							no_rum, 
							acte_classant AS TYPE, 
							COALESCE(acte_ccam_descriptif_code,acte_code) || CASE WHEN phase_ccam NOT IN ('', '0') THEN ' (' || phase_ccam || ')' ELSE '' END || ' - ' || COALESCE(acte_ccam_descriptif_texte,acte_texte) AS CODE, 
							CASE WHEN acte_section_id[12] > 0 THEN acte_section_code[12] ELSE ''::TEXT END AS GM, 
							nombre, 
							activite_ccam, 
							medecin_nom || ' (' || medecin_code || ')', 
							date_acte AS DATE_MVT, 
							CASE WHEN type_etablissement IN ('2','3') THEN icr_public_atih ELSE icr_prive_atih END, 
							CASE WHEN v_rss_1.acte_principal_code = v_rss_actes_1.acte_code THEN 1 ELSE 0 END AS ACTE_P,
							trim(pmsi.v_rss_actes_1.modificateur_ccam_1::text || ' '::text || pmsi.v_rss_actes_1.modificateur_ccam_2::text || ' '::text || pmsi.v_rss_actes_1.modificateur_ccam_3::text 
						    || ' '::text || pmsi.v_rss_actes_1.modificateur_ccam_4::text ),
							v_rss_actes_1.extension_ccam AS EXTDOC,
							v_rss_actes_1.unite_fonctionnelle_code as uf,
							v_rss_actes_1.association_nonprevue_ccam AS assoc_non_prevue,
							array_to_string(base.cti_array_sort_unique(v_rss_actes_1.interventions), ', ') as int,
                            ''::text,''::text
						FROM pmsi.v_rss_actes_1 
						LEFT JOIN pmsi.v_acte_ccam_descriptif_link ON v_rss_actes_1.acte_ccam_descriptif_id = link_acte_ccam_descriptif_id
							JOIN pmsi.v_rss_1 ON v_rss_1.rss_id = v_rss_actes_1.rss_id
							LEFT JOIN base.t_finess ON v_rss_1.finess = t_finess.code
						WHERE v_rss_actes_1.rss_id = [OID] 
						
						ORDER BY 1, 4, DATE_MVT, TYPE, CODE
						
						
				]]></select>
				<FIELDS>
					<FIELD name="TRI"/>
					<FIELD name="UM"/>
					<FIELD name="NOM"/>
					<FIELD name="RUM"/>
					<FIELD name="TYP"/>
					<FIELD name="COD"/>
					<FIELD name="GM"/>
					<FIELD name="NBR"/>
					<FIELD name="ACT"/>
					<FIELD name="MED"/>
					<FIELD name="DAT"/>
					<FIELD name="ICR"/>
					<FIELD name="ACTE_P"/>
					<FIELD name="MCC" />
					<FIELD name="EXTDOC"/>
					<FIELD name="UF"/>
					<FIELD name="ASSOC_NON_PREVUE" />
					<FIELD name="INT" />
					<FIELD name="PHL" />
					<FIELD name="DIAGPREC" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Facture">
			<SQL>
				<select><![CDATA[
					(SELECT 
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							row_number() OVER (PARTITION BY rss_id ORDER BY prestation_code) AS oid1,
							'' AS cod1,
							'-9999999' AS oid2,
							'-9999999' AS cod2,
							'-9999999' AS oid3,
							'-9999999' AS cod3,
							'' AS oid,
							'' AS cod,
							'' AS txt,
							1 AS level,
							0 as no_rum, mt || dmt, date_debut, date_fin, prestation_code || ' ' || prestation_texte ||
							CASE WHEN operation_lamda IN ('1','2','3') THEN ' (' || to_char(date_part('year',date_comptable),'FM0000') || ')' ELSE ''::text END AS prestation_code,
						operation_lamda, nombre, coefficient, prix_unitaire, base_remboursement, taux_remboursement, sejour_remboursable,
						t2a_facture, coefficient_mco, ghs_code, base_remboursement_sauf_transition_sauf_ame
						FROM pmsi.v_rsf_detail_1
						WHERE rss_id = [OID])
						UNION ALL
						(SELECT
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							1000000 AS oid1,
							'' AS cod1,
							'-9999999' AS oid2,
							'-9999999' AS cod2,
							'-9999999' AS oid3,
							'-9999999' AS cod3,
							'' AS oid,
							'' AS cod,
							'' AS txt,
							1 AS level,
							0, '',  null, null, '', '', 0, 0, 0, 0, 0,  0, 0, 0,'',0
						FROM pmsi.p_rss WHERE oid = [OID] AND nb_rum > 1 AND base_remboursement > 0)
						UNION ALL
						(SELECT
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							2000000 AS oid1,
							'' AS cod1,
							'-9999999' AS oid2,
							'-9999999' AS cod2,
							'-9999999' AS oid3,
							'-9999999' AS cod3,
							'' AS oid,
							'' AS cod,
							'' AS txt,
							1 AS level,
							0, '', null, null, 'Répartition par RUM', '', 0, 0, 0, 0, 0,  0, 0, 0,'',0
						FROM pmsi.p_rss WHERE oid = [OID] AND nb_rum > 1)
						UNION ALL
						(SELECT 
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							2000000 AS oid1,
							'' AS cod1,
							no_rum::text AS oid2,
							'' AS cod2,
							'-9999999' AS oid3,
							'-9999999' AS cod3,
							'' AS oid,
							'' AS cod,
							'' AS txt,
							 2 AS level,
							no_rum, '', null, null, no_rum::text || ' : '::text || unite_medicale_code || ' '::text || unite_medicale_texte,  '',     0, 0, 0, 0, 0,  0, 0, 0,'',0      
						FROM pmsi.v_rsf_detail_rum_1, pmsi.p_rss     
						WHERE v_rsf_detail_rum_1.rss_id = p_rss.oid AND rss_id = [OID] AND nb_rum > 1 AND base_remboursement > 0
						GROUP BY no_rum, unite_medicale_code, unite_medicale_texte)    
						UNION ALL
						(SELECT 
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							2000000 AS oid1,
							'' AS cod1,
							no_rum::text AS oid2,
							'' AS cod2,
							no_rum::text || row_number() OVER (PARTITION BY no_rum ORDER BY prestation_code, date_fin),
							'' AS cod3,
							'' AS oid,
							'' AS cod,
							'' AS txt,
							3 AS level,
							no_rum, mt || dmt, date_debut, date_fin, prestation_code || ' ' || prestation_texte ||
							CASE WHEN operation_lamda IN ('1','2','3') THEN ' (' || to_char(date_part('year',date_comptable),'FM0000') || ')' ELSE ''::text END,
							operation_lamda, nombre, coefficient, prix_unitaire, 
							v_rsf_detail_rum_1.base_remboursement_rum, v_rsf_detail_rum_1.taux_remboursement, v_rsf_detail_rum_1.sejour_remboursable_rum, v_rsf_detail_rum_1.t2a_facture, coefficient_mco, v_rsf_detail_rum_1.ghs_code, 
							v_rsf_detail_rum_1.base_remboursement_rum_sauf_transition_sauf_ame
						FROM pmsi.v_rsf_detail_rum_1, pmsi.p_rss     
						WHERE v_rsf_detail_rum_1.rss_id = p_rss.oid AND rss_id = [OID] AND nb_rum > 1 AND base_remboursement > 0)
						UNION ALL
						(	SELECT 
							'-9999999' AS oidt,
							'-9999999' AS codt,
							'-9999999' AS txtt,
							'-9999999' AS oid1,
							'-9999999' AS cod1,
							'-9999999' AS oid2,
							'-9999999' AS cod2,
							'-9999999' AS oid3,
							'-9999999' AS cod3,
							'-9999999' AS oid,
							'-9999999' AS cod,
							'-9999999' AS txt,
							'9' AS LEVEL,
							0 AS no_rum, '', NULL as date_debut, NULL as date_fin, 'TOTAL' as prestation, '', 0 as nombre, 0 as coefficient, 0 as prix_unitaire, 
								SUM(subquery.base_remboursement) as base_remb_rum, MAX(subquery.taux_remboursement) as tx_remb, SUM(subquery.sejour_remboursable) as sejour_remb, SUM(subquery.t2a_facture) as t2_facture,
								MAX(subquery.coefficient_mco) as coef_mco, '' as ghs, 
								SUM(subquery.base_remboursement_sauf_transition_sauf_ame) as base_remboursement_rum_sauf_transition_sauf_ame
							FROM (		SELECT base_remboursement, taux_remboursement, sejour_remboursable, t2a_facture, coefficient_mco, base_remboursement_sauf_transition_sauf_ame
										FROM pmsi.v_rsf_detail_1 WHERE rss_id = [OID]
								) subquery
						)

						ORDER BY no_rum, level, date_debut, prestation_code, operation_lamda
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="RUM"/>
					<FIELD name="MTDMT"/>
					<FIELD name="DATD"/>
					<FIELD name="DATF"/>
					<FIELD name="ACTE"/>
					<FIELD name="LAMDA"/>
					<FIELD name="NBR"/>
					<FIELD name="COEF"/>
					<FIELD name="PU"/>
					<FIELD name="CA"/>
					<FIELD name="TAUX"/>
					<FIELD name="REMB"/>
					<FIELD name="QT2A"/>
					<FIELD name="CMCO"/>
					<FIELD name="GHS"/>
					<FIELD name="BR_HT_HAME"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Rums">
			<SQL>
				<select><![CDATA[
					SELECT no_rum, unite_medicale_code, date_entree_rum, date_sortie_rum, mode_entree_rum || ' ' || mode_entree_rum_texte_court,
						provenance_rum || ' ' || provenance_rum_texte_court,
						mode_sortie_rum || ' ' || mode_sortie_rum_texte_court, 
						destination_rum || ' ' || destination_rum_texte_court, 
						passage_urgences_code || ' ' || passage_urgences_texte,
						duree_sejour_rum, 
						diagnostic_principal_rum_code || ' ' || diagnostic_principal_rum_texte,
						diagnostic_relie_rum_code || ' ' || diagnostic_relie_rum_texte,
						igs2_rum,
						type_autorisation,
						mode_hospitalisation_code,
						discipline_sae_code,
						medecin_rum_nom
					FROM pmsi.v_rss_rum_2
						WHERE rss_id = [OID] 
						ORDER BY 1
						
				]]></select>
				<FIELDS>
					<FIELD name="RUM"/>
					<FIELD name="UM"/>
					<FIELD name="DATE"/>
					<FIELD name="DATS"/>
					<FIELD name="ME"/>
					<FIELD name="PRO"/>
					<FIELD name="MS"/>
					<FIELD name="DES"/>
					<FIELD name="PASSAGE_URGENCES_RUM"/>
					<FIELD name="NBJ"/>
					<FIELD name="DIAGP"/>
					<FIELD name="DIAGR"/>
					<FIELD name="IGS"/>
					<FIELD name="AUT"/>
					<FIELD name="HOS"/>
					<FIELD name="DIS"/>
					<FIELD name="MEDRUM"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="LPPUCD">
			<SQL>
				<select><![CDATA[
					(SELECT 'LPP', lpp_code, lpp_texte, date_lpp, nombre, 0, prix_unitaire, montant_facture, montant_tr, montant_t2a_accorde, montant_ecart_indemnisable, ''::text, ''::text as indication_code
						FROM pmsi.v_rss_lpp_1
						WHERE rss_id = [OID]) 
						UNION ALL
						(SELECT 'UCD', ucd_code, ucd_texte, date_ucd, nombre, coefficient_fractionnement, prix_unitaire, montant_facture, montant_tr, montant_t2a_accorde, montant_ecart_indemnisable, type_ucd_code, v_rss_ucd_1.indication_code
						FROM pmsi.v_rss_ucd_1
						WHERE rss_id = [OID]) 
						ORDER BY 1, 4, 2
						
				]]></select>
				<FIELDS>
					<FIELD name="TYP"/>
					<FIELD name="COD"/>
					<FIELD name="TXT"/>
					<FIELD name="DAT"/>
					<FIELD name="NB"/>
					<FIELD name="COE"/>
					<FIELD name="PU"/>
					<FIELD name="MF"/>
					<FIELD name="MTR"/>
					<FIELD name="MT2A"/>
					<FIELD name="MEMI"/>
					<FIELD name="INFO"/>
					<FIELD name="INDICATION"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Historique séjours">
			<SQL optimizer="V_RSS_X">
				<select><![CDATA[
					SELECT v_rss_1.rss_id, v_rss_1.no_rss, 
						v_rss_1.finess_texte || ' (' || v_rss_1.finess || ')' ,
						no_sejour_administratif,
						ghm_code || ' - ' || ghm_texte, 
						medecin_reference_rss_nom || ' (' || medecin_reference_rss_code || ')', 
						diagnostic_principal_code || ' - ' || diagnostic_principal_texte, 
						acte_principal_code || ' - ' || acte_principal_texte, 
						date_entree,
						date_sortie,
						prestation_principale_code
					FROM #V_RSS_X#
					WHERE 
						patient_id =
						(SELECT patient_id FROM pmsi.p_rss WHERE				
								p_rss.oid =  [OID])  
					ORDER BY date_entree DESC
						
				]]></select>
				<FIELDS>
					<FIELD name="OID"/>
					<FIELD name="RSS"/>
					<FIELD name="FIN"/>
					<FIELD name="NOADM"/>
					<FIELD name="GHM"/>
					<FIELD name="MEDR"/>
					<FIELD name="DIAGP"/>
					<FIELD name="ACTEP"/>
					<FIELD name="DATENT"/>
					<FIELD name="DATSOR"/>
					<FIELD name="PRESP"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Controles expert">
			<SQL>
				<select><![CDATA[
					SELECT 
						v_expert_rss_controle_1.date_signalement,
						CASE WHEN etat IN ('I','T') THEN v_expert_rss_controle_1.date_correction ELSE NULL END,
						v_expert_rss_controle_1.etat_texte,
						v_expert_rss_controle_1.expert_controle_code,
						v_expert_rss_controle_1.expert_controle_texte,
						v_expert_rss_controle_1.expert_controle_gravite_texte,
						v_expert_rss_controle_1.code_justificatif
					FROM pmsi.v_expert_rss_controle_1 
					WHERE rss_id = [OID] AND
						 etat <> 'H'
					ORDER BY 1 DESC
						
				]]></select>
				<FIELDS>
					<FIELD name="CXDS"/>
					<FIELD name="CXDC"/>
					<FIELD name="CXE"/>
					<FIELD name="CXC"/>
					<FIELD name="CXT"/>
					<FIELD name="CXG"/>
					<FIELD name="CXJ"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="Mère/Bébé">
			<SQL optimizer="V_RSS_X">
				<select><![CDATA[
					SELECT 
						v_rss_1.rss_id, 
						v_rss_1.no_rss, 
						v_rss_1.finess_texte || ' (' || v_rss_1.finess || ')' ,
						no_sejour_administratif,
						CASE WHEN patient_no_patient > 0 THEN patient_no_patient ELSE 0 END,
						identite_nom || ' ' || identite_prenom,
						v_rss_1.date_naissance,
						ghm_code || ' - ' || ghm_texte, 
						medecin_reference_rss_nom || ' (' || medecin_reference_rss_code || ')', 
						diagnostic_principal_code || ' - ' || diagnostic_principal_texte, 
						acte_principal_code || ' - ' || acte_principal_texte, 
						date_entree,
						date_sortie,
						prestation_principale_code
					FROM #V_RSS_X#
					WHERE 
						rss_mere_id = [OID] OR
						v_rss_1.rss_id IN (SELECT rss_mere_id FROM pmsi.p_rss WHERE oid = [OID])
						
					ORDER BY date_entree DESC
						
				]]></select>
				<FIELDS>
					<FIELD name="OID"/>
					<FIELD name="RSS"/>
					<FIELD name="FIN"/>
					<FIELD name="NOADM"/>
					<FIELD name="PAT" />
					<FIELD name="NOM"  ifHideNames="Non autorisé"/>
					<FIELD name="DATN"  ifHideNames="Non autorisé"/>
					<FIELD name="GHM"/>
					<FIELD name="MEDR"/>
					<FIELD name="DIAGP"/>
					<FIELD name="ACTEP"/>
					<FIELD name="DATENT"/>
					<FIELD name="DATSOR"/>
					<FIELD name="PRESP"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
                <select><![CDATA[ 
                    SELECT 'NO_RSS', no_rss::text FROM pmsi.p_rss WHERE oid = [OID]
                    UNION
                    SELECT 'NO_SEJOUR', trim(no_sejour_administratif::text) FROM pmsi.p_rss WHERE oid = [OID]
				]]></select>
                <FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL>
				<select><![CDATA[
					SELECT 
						'QEXPERT',
						count(*)
					FROM pmsi.v_expert_rss_controle_1 
					WHERE rss_id = [OID]
					UNION
					SELECT 
						'QMEREBEBE',
						count(*)
					FROM pmsi.p_rss
					WHERE rss_mere_id = [OID] OR
						p_rss.oid IN (SELECT rss_mere_id FROM pmsi.p_rss WHERE oid = [OID])
					UNION
					SELECT 
						'QUF', 
						count(*) 
					FROM pmsi.v_rss_actes_1 
					WHERE 
						rss_id = [OID] 
						AND unite_fonctionnelle_id IS DISTINCT FROM 0
					
				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL>
				<select><![CDATA[
					
					SELECT
						'QINTERV', 
						valeur 
					FROM pmsi.t_divers WHERE code = 'OPTPMSI_CPT_INTERV'
					
				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Détail RSS" shortLabel="Détail RSS" view="PMSI000006.XML" visible="= TAB == 5 &amp;&amp; VIEW.QEXPERT == '0' || TAB == 6 || TAB == 7" enabled="= Number(ROW.OID) != Number(SELECT.OID)">
				<ARG name="OID" value="ROW.OID"/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET label="RSS">
			<DATAGRID title="" total="false" showHeaders="false" rowHeight="20" multiLine="true" headerHeight="18">
				<ROWSTYLE name="fontSize" value="13"/>
				<ROWSTYLE name="backgroundColor" value="0xb3b3b3" condition="ROW.KEY == 'CHA'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.KEY == 'CHA'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.KEY == '12'"/>
				<COLUMN dataField="KEY" visible="false" textAlign="left"/>
				<COLUMN dataField="LABEL" visible="true" width="270" textAlign="left">
					<CELLSTYLE name="paddingLeft" value="30" condition="ROW.KEY == 'PAD'"/>
					<CELLSTYLE name="paddingLeft" value="40" condition="ROW.KEY == 'PAD2'"/>
				</COLUMN>
				<COLUMN dataField="VAL" visible="true" minWidth="400" textAlign="left">
					<!--<CELLSTYLE name="fontWeight" value="bold" condition="ROW.KEY == '1'"/>-->
					<CELLSTYLE name="fontWeight" value="bold" condition="ROW.KEY == '2'"/>
					<CELLSTYLE name="paddingLeft" value="10" condition="ROW.KEY == 'PAD2'"/>
				</COLUMN>
				<LINE label="Séjour" key="CHA" />
				<LINE label="FINESS" key="1">
					<COLUMN dataField="FIN" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="N° Séjour" key="1">
					<COLUMN dataField="NOADM" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="N° RSS" key="12">
					<COLUMN dataField="RSS" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Date entrée" key="1">
					<COLUMN dataField="DATE_ENT" type="Date" toDataField="VAL" inputFormat="AAAA-MM-JJ" outputFormat="DD MMMM YYYY" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Mode entrée | Provenance" key="1">
					<COLUMN dataField="MDENTRPROV" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>					
				<LINE label="Etablissement de provenance" key="1">
					<COLUMN dataField="ETABPROV" type="Char" toDataField="VAL" visible="true" visibleCondition="char(ROW.ETABPROV) != null" textAlign="left" />
				</LINE>		
				<LINE label="Passage Urgences" key="1">
					<COLUMN dataField="PASSAGE_URGENCES" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>		
				<LINE label="Date sortie" key="1">
					<COLUMN dataField="DATE_SOR" type="Date" toDataField="VAL" inputFormat="AAAA-MM-JJ" outputFormat="DD MMMM YYYY" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Mode sortie | Destination" key="1">
					<COLUMN dataField="MDSORTDEST" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>						
				<LINE label="Etablissement de destination" key="1">
					<COLUMN dataField="ETABDEST" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Durée de séjour" key="1">
					<COLUMN dataField="NBJ" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>				
				<LINE label="Médecin RSS" key="1">
					<COLUMN dataField="MEDECIN" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Comité" key="1">
					<COLUMN dataField="COMITE" type="Char" toDataField="VAL" visibleCondition="ENV.OPTPMSI_COMITE == '1'" textAlign="left" />
				</LINE>
				<LINE label="Nombre de RUM(s)" key="1">
					<COLUMN dataField="NB_RUM" type="Number" outputFormat="0" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Patient" key="CHA" />
				<LINE label="N° Patient" key="4">
					<COLUMN dataField="PAT" type="Char" outputFormat="#" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Nom" key="1">
					<COLUMN dataField="NOM" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Sexe" key="3">
					<COLUMN dataField="SEXE" type="Char" toDataField="VAL" visible="true" textAlign="left" >
						<CELLSTYLE name="cellIndicator" value="femme, 12,left middle , 0xEB76B1" condition="ROW.SEXE == 'Féminin'" /> 
						<CELLSTYLE name="cellIndicator" value="homme, 12,left middle , 0x75a0eb " condition="ROW.SEXE == 'Masculin'" /> 
						<CELLSTYLE name="cellIndicator" value="rectangle, 10,left middle , #FF5001 " condition="ROW.SEXE == 'Indeterminé'" /> 
						<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0x666666" condition="ROW.SEXE != 'Féminin' &amp;&amp; ROW.SEXE != 'Masculin' &amp;&amp; ROW.SEXE != 'Indeterminé'" /> 
						<CELLSTYLE name="paddingLeft" value="15"/>
					</COLUMN>
				</LINE>
				<LINE label="Age" key="4">
					<COLUMN dataField="AGE" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Code postal" key="4">
					<COLUMN dataField="CP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Indicateurs" key="CHA" />
				<LINE label="GHM" key="1">
					<COLUMN dataField="GHM" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="GHS" key="1">
					<COLUMN dataField="GHS" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="C.A.S. (Catégorie d'Activité de Soins)" key="1">
					<COLUMN dataField="CAS" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Domaine d'activité ATIH" key="1">
					<COLUMN dataField="DATIH" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Groupe d'activité ATIH" key="1">
					<COLUMN dataField="GATIH" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Groupe de planification ATIH" key="1">
					<COLUMN dataField="GPATIH" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="I.P.A. (Indicateur de Pilotage de l'Activité)" key="1">
					<COLUMN dataField="IPA" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
                <LINE label="Type séjour OVALIDE" key="1">
					<COLUMN dataField="T_SEJ_OVA" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Activité urgence" key="1">
					<COLUMN dataField="ACT_URG" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>                
                <LINE label="Sévérité CTI" key="1">
					<COLUMN dataField="CTISEV" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Variables" key="CHA" />              
                <LINE label="Conversion (HC,HP)" key="1">
					<COLUMN dataField="COHPHC" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>                
                <LINE label="RAAC" key="1">
					<COLUMN dataField="RAAC" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Rescrit tarifaire" key="1">
					<COLUMN dataField="RESC_TARIF" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Adm. de produits de la réserve hospitalière" key="1">
					<COLUMN dataField="ADM_PROD_RH" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Contexte du patient" key="1">
					<COLUMN dataField="CONTEX_PAT" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Nombre d'interventions" key="1">
					<COLUMN dataField="NB_INTERV" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Prise en charge non programmée" key="1">
					<COLUMN dataField="NP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>	
				<LINE label="Codage" key="CHA" />
				<LINE label="Diagnostic principal" key="1">
					<COLUMN dataField="DIAGP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Diagnostic relie" key="1">
					<COLUMN dataField="DIAGR" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Cancérologie" key="1">
					<COLUMN dataField="CANCERO" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Acte principal" key="1">
					<COLUMN dataField="ACTEP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Geste marqueur principal MSAP 2015" key="1">
					<COLUMN dataField="GM" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>				
				<LINE label="Poids du bébé" key="1">
					<COLUMN dataField="PBB" type="Char" outputFormat="#" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Age gestationnel (dern. règles)" key="4">
					<COLUMN dataField="AGEST" type="Char" outputFormat="#" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Facturation : Chiffre d'affaires" key="CHA">
				</LINE>
				<LINE label="Etat ePMSI" key="1">
					<COLUMN dataField="EPMSI" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>				
				<LINE label="Erreurs de groupage" key="1">
					<COLUMN dataField="CODES_ERREUR" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
                <LINE label="Etat de séjour (Module activité)" key="1">
					<COLUMN dataField="ETAT_SEJ" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Etablissement" key="1">
					<COLUMN dataField="CA" type="Number" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="T2A" key="1">
					<COLUMN dataField="CA_T2A" type="Number" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="dont GHS" key="PAD">
					<COLUMN dataField="CA_GHS" type="Number" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="dont EXH" key="PAD">
					<COLUMN dataField="CA_EXH" type="Number" visibleCondition="Number(ROW.CA_EXH) != 0" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="dont forfaits" key="PAD">
					<COLUMN dataField="CA_FOR" type="Number" visibleCondition="Number(ROW.CA_FOR) != 0" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINEx label="dont autres" key="PAD">
					<COLUMN dataField="CA_AUT" type="Number" outputFormat="#,00 E" visibleCondition="Number(ROW.CA_AUT) != 0" toDataField="VAL" visible="true" textAlign="left" />
				</LINEx>
				<LINE label="DMI" key="1">
					<COLUMN dataField="CA_DMI" type="Number" outputFormat="#,00 E" toDataField="VAL" visibleCondition="Number(ROW.CA_DMI) != 0" visible="true" textAlign="left" />
				</LINE>
				<LINE label="PHC" key="1">
					<COLUMN dataField="CA_PHC" type="Number" outputFormat="#,00 E" visibleCondition="Number(ROW.CA_PHC) != 0" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Honoraires" key="1">
					<COLUMN dataField="CA_HON" type="Number" outputFormat="#,00 E" visibleCondition="Number(ROW.CA_HON) != 0" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Facturation : Séjours extrêmes" key="CHA">
				</LINE>
				<LINE label="Nombre EXH" key="1">
					<COLUMN dataField="NB_EXH" type="Number" outputFormat="0" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="C.A. EXH" key="1">
					<COLUMN dataField="CA_EXH" type="Number" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="C.A. EXB" key="1">
					<COLUMN dataField="CA_EXB" type="Number" outputFormat="#,00 E" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Facturation : Prise en charge" key="CHA" />
				<LINE label="Exonération Ticket modérateur" key="1">
					<COLUMN dataField="JUSTIFICATIF_EXO" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Nature assurance" key="1">
					<COLUMN dataField="NATURE_PEC" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Séjour facturable à l'assurance maladie" key="1">
					<COLUMN dataField="CODE_PEC" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Taux remboursement" key="1">
					<COLUMN dataField="TAUX_REMBOURSEMENT" type="Number" outputFormat="# %" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Grand régime" key="1">
					<COLUMN dataField="REGIME" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Type de contrat organisme Comp." key="1">
					<COLUMN dataField="TYPE_CONTRAT_OC" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Facturation 18 euros" key="1">
					<COLUMN dataField="FAC_18EUROS" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Prise en charge forfait journalier" key="1">
					<COLUMN dataField="CODE_PEC_FJ" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Bénéficiaire CMU" key="1">
					<COLUMN dataField="PAT_BENEF_CMU" type="Char" toDataField="VAL" textAlign="left" />
				</LINE>
				<LINE label="Indicateurs : Ancienne classification" key="CHA" />
				<LINE label="Pôle OAP" key="1">
					<COLUMN dataField="POAP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="Ligne OAP" key="1">
					<COLUMN dataField="LOAP" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
				<LINE label="ASO (M/C/O)" key="1">
					<COLUMN dataField="ASO" type="Char" toDataField="VAL" visible="true" textAlign="left" />
				</LINE>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="RUMs" queryNumber="3" newPage="false">
			<DATAGRID title="" total="false" headerHeight="36" rowHeight="36">
				<ROWSTYLE name="fontSize" value="12"/>
				<COLUMN dataField="RUM" type="Number" outputFormat="#" visible="true" headerText="RUM" width="35" textAlign="center"/>
				<COLUMN dataField="UM" type="Char" visible="true" headerText="Unité médicale" width="60" textAlign="left"/>
				<COLUMN dataField="AUT" type="Char" visible="true" headerText="Autorisation" width="75" textAlign="left"/>
				<COLUMN dataField="HOS" type="Char" visible="true" headerText="Mode hospit." width="90" textAlign="left"/>
				<COLUMN dataField="MEDRUM" type="Char" visible="true" headerText="Médecin RUM" minWidth="40" textAlign="left"/>
				<COLUMN dataField="DIS" type="Char" visible="true" headerText="Discipline SAE" width="90" textAlign="left"/>
				<COLUMN dataField="DATE" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date entrée" width="80" textAlign="left"/>
				<COLUMN dataField="PASSAGE_URGENCES_RUM" type="Char" visible="true" headerText="Passage urgences" minWidth="40" textAlign="left"/>
				<COLUMN dataField="ME" type="Char" visible="true" headerText="Mode entrée" minWidth="40" textAlign="left"/>
				<COLUMN dataField="PRO" type="Char" visible="true" headerText="Provenance" minWidth="40" textAlign="left"/>
				<COLUMN dataField="DATS" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date sortie" width="80" textAlign="left"/>
				<COLUMN dataField="MS" type="Char" visible="true" headerText="Mode sortie" minWidth="40" textAlign="left"/>
				<COLUMN dataField="DES" type="Char" visible="true" headerText="Destination" minWidth="40" textAlign="left"/>
				<COLUMN dataField="NBJ" type="Number" outputFormat="#" visible="true" headerText="Durée" width="50" textAlign="left"/>
				<COLUMN dataField="IGS" type="Number" outputFormat="#" visible="true" headerText="IGS2" width="50" textAlign="left"/>
				<COLUMN dataField="DIAGP" type="Char" visible="true" headerText="Diagnostic principal RUM" minWidth="60" textAlign="left"/>
				<COLUMN dataField="DIAGR" type="Char" visible="true" headerText="Diagnostic relié RUM" minWidth="60" textAlign="left"/>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="Codage" queryNumber="1" newPage="false">
			<DATAGRID title="" total="false" headerHeight="36">
				<ROWSTYLE name="fontSize" value="12"/>
				<ROWSTYLE name="color" value="0x037ac9" condition="ROW.TRI == '1'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.TRI == '1' &amp;&amp; ROW.TYP == 'DP' "/>
				<ROWSTYLE name="color" value="0Xfb8404" condition="ROW.TRI == '2' &amp;&amp; ROW.TYP == 'Y'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.TRI == '2' &amp;&amp; ROW.ACTE_P == '1' "/>
				<ROWSTYLE name="color" value="0XB9121B" condition="ROW.PHL == '1' || ROW.PHL == '2' || ROW.PHL == '3' || ROW.PHL == '4'"/>
				<COLUMN dataField="TRI" type="Char" visible="false"/>
				<COLUMN dataField="RUM" type="Number" outputFormat="#" visible="true" headerText="RUM" width="40" textAlign="center"/>
				<COLUMN dataField="UM" type="Char" visible="true" headerText="Unité médicale" width="70" textAlign="left"/>
				<COLUMN dataField="NOM" type="Char" visible="true" headerText="Nomenclature" width="90" textAlign="left"/>
				<COLUMN dataField="TYP" type="Char" visible="true" headerText="Type" width="40" textAlign="left"/>
				<COLUMN dataField="COD" type="Char" visible="true" headerText="Code" minWidth="200" textAlign="left"/>
				<COLUMN dataField="GM" type="Char" visible="true" headerText="MSAP 2015" width="60" textAlign="left"/>
				<COLUMN dataField="DAT" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD MMM YY" visible="true" headerText="Date" width="75" textAlign="left"/>
				<COLUMN dataField="NBR" type="Number" outputFormat="#" visible="true" headerText="Nb" width="30" textAlign="left"/>
				<COLUMN dataField="ICR" type="Number" visible="true" outputFormat="#" headerText="ICR" width="50" textAlign="left"/>
				<COLUMN dataField="ACT" type="Char"  visible="true" headerText="Act.&#xD;CCAM" width="45" textAlign="left"/>
				<COLUMN dataField="ASSOC_NON_PREVUE" type="Char" visible="true" headerText="Ass Nn.&#xD;prévue" width="50" textAlign="left"/>
				<COLUMN dataField="MCC" type="Char" visible="true" headerText="Modif.&#xD;CCAM" width="45" textAlign="left"/>
				<COLUMN dataField="PHL" type="Char" visible="true" headerText="PHL" width="45" textAlign="left" description="Listes des codes de la CIM-10 pour l'identification du polyhandicap lourd.&#xD;Liste 1 : Déficiences mentales ou psychiatriques sévères.&#xD;Liste 2 : Troubles moteurs.&#xD;Liste 3 : Critères de mobilité réduite.&#xD;Liste 4 : Restrictions extrêmes de l'autonomie"/>
				<COLUMN dataField="DIAGPREC" type="Char" visible="true" headerText="Diag.&#xD;PREC" width="45" textAlign="left" description="Diagnostic de précarité"/>
				<COLUMN dataField="EXTDOC" type="Char" visible="true" headerText="Ext.&#xD;Doc" width="40" textAlign="left"/>
				<COLUMN dataField="UF" type="Char" visibleCondition="VIEW.QUF != '0'" headerText="UF Exec" width="50" textAlign="left"/>
				<COLUMN dataField="INT" type="Char" visibleCondition="VIEW.QINTERV == 'PRO'" headerText="N° Intervention" width="150" textAlign="left"/>
				<COLUMN dataField="MED" type="Char" visible="true" headerText="Exécutant" minWidth="50" textAlign="left"/>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="LPP-UCD" queryNumber="4" newPage="false">
			<DATAGRID title="" total="true" headerHeight="36" rowHeight="18" printRatio="0.8">
				<ROWSTYLE name="fontSize" value="12"/>
				<COLUMN dataField="TYP" type="Char" visible="true" headerText="Type" width="40" textAlign="left"/>
				<COLUMN dataField="COD" type="Char" visible="true" headerText="Code" width="80" textAlign="left"/>
				<COLUMN dataField="TXT" type="Char" visible="true" headerText="Texte" minWidth="100" textAlign="left"/>
				<COLUMN dataField="INDICATION" type="Char" headerText="Indication UCD" width="100" textAlign="left"/>
				<COLUMN dataField="INFO" type="Char" headerText="Info" width="50" textAlign="left"/>
				<COLUMN dataField="DAT" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date" width="80" textAlign="left"/>
				<COLUMN dataField="NB" type="Number" visible="true" outputFormat="#" headerText="Nombre" width="60" textAlign="left" totalFunction="sum"/>
				<COLUMN dataField="COE" type="Number" visible="true" outputFormat="#,0000" headerText="Coeff." width="80" textAlign="left"/>
				<COLUMN dataField="PU" type="Number" visible="true" outputFormat="#,00E" headerText="Prix unitaire" width="80" textAlign="right"/>
				<COLUMN dataField="MF" type="Number" visible="true" outputFormat="#,00E" headerText="Montant facturé" width="80" textAlign="right" totalFunction="sum"/>
				<COLUMN dataField="MTR" type="Number" visible="true" outputFormat="#,00E" headerText="Montant tarif resp." width="80" textAlign="right" totalFunction="sum"/>
				<COLUMN dataField="MT2A" type="Number" visible="true" outputFormat="#,00E" headerText="Montant T2A accordé" width="80" textAlign="right" totalFunction="sum"/>
				<COLUMN dataField="MEMI" type="Number" visible="true" outputFormat="#,00E" headerText="Ecart T2A facturé" width="80" textAlign="right" totalFunction="sum"/>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="Facture" queryNumber="2" newPage="false">
			<DATAGRID title="" total="true" headerHeight="36" totalRowInRows="= ROW.LVL == '9'">
				<ROWSTYLE name="fontSize" value="14"/>
				<ROWSTYLE name="color" value="0Xb3b3b3" condition="ROW.QT2A == '1'"/>
				<ROWSTYLE name="backgroundColor" value="0xcccccc" condition="ROW.LVL == '4'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.QT2A == '1' "/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '4' "/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '5' "/>
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="LVL" type="Char" visible="false"/>
				<COLUMN dataField="MTDMT" type="Char" visible="false" headerText="DMT" width="50" textAlign="left" totalFunction="text"/>
				<COLUMN dataField="ACTE" type="Char" visible="true" headerText="Acte" minWidth="40" textAlign="left" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="paddingLeft" value="10" condition="ROW.LVL == '5'"/>
					<CELLSTYLE name="paddingLeft" value="30" condition="ROW.LVL == '6'"/>
				</COLUMN>
				<COLUMN dataField="DATD" type="Date" visible="true" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" headerText="Date début" width="70" textAlign="left" totalFunction="text"/>
				<COLUMN dataField="DATF" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date fin" width="70" textAlign="left" totalFunction="text"/>
				<COLUMN dataField="NBR" type="Number" outputFormat="#" visible="true" headerText="Qté" width="40" textAlign="right" totalFunction="text" totalComplement=""/>
				<COLUMN dataField="COEF" type="Number" outputFormat="#,00" visible="true" headerText="Coeff." width="50" textAlign="right" totalFunction="text" totalComplement=""/>
				<COLUMN dataField="CMCO" type="Number" outputFormat="#,0000" visible="true" headerText="Coeff. MCO" width="50" textAlign="right" totalFunction="text" totalComplement=""/>
				<COLUMN dataField="PU" type="Number" outputFormat="#,00E" visible="true" headerText="PU" width="70" textAlign="right" totalFunction="text" totalComplement=""/>
				<COLUMN dataField="CA" type="Number" outputFormat="#,00E" visible="true" headerText="Total" width="80" textAlign="right" totalFunction="sum"/>
                <COLUMN dataField="BR_HT_HAME" type="Number" outputFormat="#,00E" visible="true" headerText="BR 100%" width="80" textAlign="right" totalFunction="sum" visibleCondition="ENV.TYPEETS != '1'" />
				<COLUMN dataField="TAUX" type="Number" outputFormat="#%" visible="true" headerText="Taux" width="50" textAlign="right" totalFunction="sum"/>
				<COLUMN dataField="REMB" type="Number" outputFormat="#,00E" visible="true" headerText="Remb" width="80" textAlign="right" totalFunction="sum"/>
				<COLUMN dataField="GHS" type="Char" outputFormat="#" visible="true" headerText="GHS" width="50" textAlign="left" totalFunction="text"/>
				<COLUMN dataField="QT2A" type="Char" visible="false" headerText="T2A ?" width="40" textAlign="center" totalFunction="text"/>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="Expert" queryNumber="6" newPage="false" visibleCondition="VIEW.QEXPERT != '0'">
			<DATAGRID title="" total="false" headerHeight="36" rowHeight="36">
				<ROWSTYLE name="fontSize" value="12"/>
				<COLUMN dataField="CXDS"
					width="60"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					visible="true"
					fixed="false"
					headerText="Date signalement" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="CXE"
					width="100"
					type="Char"
					visible="true"
					outputFormat="#"
					headerText="Etat" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXDC"
					width="60"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					visible="true"
					fixed="false"
					headerText="Date correction" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="CXG"
					width="60"
					type="Char"
					visible="true"
					headerText="Gravité" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXC"
					width="100"
					type="Char"
					visible="true"
					outputFormat="#"
					headerText="Code Controle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXT"
					minWidth="200"
					type="Char"
					visible="true"
					headerText="Texte Controle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXJ"
					minWidth="100"
					type="Char"
					visible="true"
					headerText="Justificatif Controle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="Mère / Bébé" queryNumber="7" newPage="false" visibleCondition="VIEW.QMEREBEBE != '0'">
			<DATAGRID title="" total="false" headerHeight="36" rowHeight="36">
				<ROWSTYLE name="fontSize" value="12"/>
				<ROWSTYLE name="backgroundColor" value="0xffd393" condition="Number(ROW.RSS) == Number(VIEW.NO_RSS)"/>
				<COLUMN dataField="OID" type="Char" visible="false">
				</COLUMN>
				<COLUMN dataField="FIN" type="Char" visible="true" 
				visibleCondition="ENV.CONSOLIDATION == '1'"
				headerText="Etablissement" width="80" textAlign="left"/>
				<COLUMN dataField="RSS" type="Char" visible="true" headerText="N° RSS" width="70" textAlign="left"/>
				<COLUMN dataField="NOADM" type="Char" visible="true" headerText="N° admin" width="80" textAlign="left"/>
				<COLUMN dataField="NOM"
					minWidth="180"
					maxWidth="230"
					type="Char"
					visible="true"
					headerText="Nom" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="*ROW">
				</COLUMN>
				<COLUMN dataField="DATN"
					width="60"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					visible="true"
					fixed="false"
					headerText="Date naissance" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="DATENT" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date entrée" width="70" textAlign="left"/>
				<COLUMN dataField="DATSOR" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date sortie" width="70" textAlign="left"/>
				<COLUMN dataField="MEDR" type="Char" visible="true" headerText="Médecin" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="GHM" type="Char" visible="true" headerText="GHM" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="DIAGP" type="Char" visible="true" headerText="Diagnostic principal" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="ACTEP" type="Char" visible="true" headerText="Acte principal" minWidth="60" fixed="false" textAlign="left"/>
			</DATAGRID>
		</ONGLET>
		<ONGLET label="Hist. Patient" queryNumber="5" newPage="false">
			<DATAGRID title="" total="false" headerHeight="36" rowHeight="36">
				<ROWSTYLE name="fontSize" value="12"/>
				<ROWSTYLE name="backgroundColor" value="0xffd393" condition="Number(ROW.RSS) == Number(VIEW.NO_RSS)"/>
				<COLUMN dataField="OID" type="Char" visible="false">
				</COLUMN>
				<COLUMN dataField="FIN" type="Char" visible="true" 
				visibleCondition="ENV.CONSOLIDATION == '1'"
				headerText="Etablissement" width="80" textAlign="left"/>
				<COLUMN dataField="RSS" type="Char" visible="true" headerText="N° RSS" width="70" textAlign="left"/>
				<COLUMN dataField="NOADM" type="Char" visible="true" headerText="N° admin" width="80" textAlign="left"/>
				<COLUMN dataField="DATENT" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date entrée" width="70" textAlign="left"/>
				<COLUMN dataField="DATSOR" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" visible="true" headerText="Date sortie" width="70" textAlign="left"/>
				<COLUMN dataField="MEDR" type="Char" visible="true" headerText="Médecin" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="PRESP" type="Char" visible="true" headerText="Mode" width="50" fixed="false" textAlign="left"/>
				<COLUMN dataField="GHM" type="Char" visible="true" headerText="GHM" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="DIAGP" type="Char" visible="true" headerText="Diagnostic principal" minWidth="60" fixed="false" textAlign="left"/>
				<COLUMN dataField="ACTEP" type="Char" visible="true" headerText="Acte principal" minWidth="60" fixed="false" textAlign="left"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
