Subversion Repositories Integrator Subversion

Rev

Rev 182 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="relatorio_agenda" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c6447326-3eb7-45a9-af8e-852ae2ec5c1b">
        <property name="ireport.zoom" value="1.5"/>
        <property name="ireport.x" value="0"/>
        <property name="ireport.y" value="0"/>
        <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
                <defaultValueExpression><![CDATA["/Users/periclesalmeida/Documents/workspaceEclipse/CLINICA_SVN/clinica/src/main/resources/relatorios/"]]></defaultValueExpression>
        </parameter>
        <parameter name="pSequencialProfissional" class="java.lang.Long">
                <defaultValueExpression><![CDATA[]]></defaultValueExpression>
        </parameter>
        <parameter name="pDataAgenda" class="java.util.Date">
                <defaultValueExpression><![CDATA[]]></defaultValueExpression>
        </parameter>
        <queryString>
                <![CDATA[select  row_number() OVER (ORDER BY a.num_horario_inicial) AS num_registro,
        CASE a.tip_atendimento
        WHEN 'C' THEN 'CONSULTA'
        WHEN 'R' THEN 'RETORNO'
        WHEN 'P' THEN 'PROCEDIMENTO'
        END AS tip_atendimento,
       TO_CHAR(CAST(a.num_horario_inicial AS TIME), 'HH24:mi' ) AS num_horario_inicial,
       CASE a.tip_situacao
       WHEN 'M' THEN 'MARCADO'
       WHEN 'L' THEN 'LIVRE'
       WHEN 'N' THEN 'EM ATENDIMENTO'
       WHEN 'G' THEN 'AGUARDANDO'
       WHEN 'C' THEN 'CONFIRMADO'
       WHEN 'F' THEN 'FALTA'
       WHEN 'A' THEN 'ATENDIDO'
       END as tip_situacao,
       a.dat_agenda,
       TO_CHAR(a.dat_agenda, 'DD') AS num_dia,
       TO_CHAR(a.dat_agenda, 'YYYY') AS num_ano,
       CASE WHEN TO_CHAR(a.dat_agenda, 'D') = '1' THEN 'DOMINGO'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '2' THEN 'SEGUNDA'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '3' THEN 'TERCA'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '4' THEN 'QUARTA'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '5' THEN 'QUINTA'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '6' THEN 'SEXTA'
            WHEN TO_CHAR(a.dat_agenda, 'D') = '7' THEN 'SABADO'
       END as nom_dia_semana,

       CASE DATE_PART('MONTH', a.dat_agenda)
       WHEN 1 THEN 'JANEIRO'
       WHEN 2 THEN 'FEVEREIRO'
       WHEN 3 THEN 'MARÇO'
       WHEN 4 THEN 'ABRIL'
       WHEN 5 THEN 'MAIO'
       WHEN 6 THEN 'JUNHO'
       WHEN 7 THEN 'JULHO'
       WHEN 8 THEN 'AGOSTO'
       WHEN 9 THEN 'SETEMBRO'
       WHEN 10 THEN 'OUTUBRO'
       WHEN 11 THEN 'NOVEMBRO'
       WHEN 12 THEN 'DEZEMBRO'
       END as nom_mes,
       i.dsc_tratamento || s.nom_pessoa AS nom_profissional,
       CASE WHEN e.nom_pessoa IS NULL THEN a.dsc_pessoa_paciente ELSE e.nom_pessoa END as nom_paciente
  from sc_cln.cln_agenda a
left join sc_cln.cln_paciente p on (a.seq_pessoa_paciente = p.seq_pessoa_paciente)
left join sc_adm.adm_pessoa   e on (p.seq_pessoa_paciente = e.seq_pessoa)
join sc_cln.cln_profissional r on (a.seq_pessoa_profissional = r.seq_pessoa_profissional)
join sc_adm.adm_pessoa   s on (a.seq_pessoa_profissional = s.seq_pessoa)
join sc_adm.adm_pessoa_fisica   i on (s.seq_pessoa = i.seq_pessoa)
WHERE r.seq_pessoa_profissional =$P{pSequencialProfissional}
  AND a.dat_agenda =$P{pDataAgenda}
ORDER BY a.num_horario_inicial]]>
        </queryString>
        <field name="num_registro" class="java.lang.Long"/>
        <field name="tip_atendimento" class="java.lang.String"/>
        <field name="num_horario_inicial" class="java.lang.String"/>
        <field name="tip_situacao" class="java.lang.String">
                <fieldDescription><![CDATA[Valores possiveis: P - Pendente de Confirmacao, C - Confirmado, N - Canceado e R - Realizado.]]></fieldDescription>
        </field>
        <field name="dat_agenda" class="java.sql.Date"/>
        <field name="num_dia" class="java.lang.String"/>
        <field name="num_ano" class="java.lang.String"/>
        <field name="nom_dia_semana" class="java.lang.String"/>
        <field name="nom_mes" class="java.lang.String"/>
        <field name="nom_profissional" class="java.lang.String"/>
        <field name="nom_paciente" class="java.lang.String"/>
        <background>
                <band splitType="Stretch"/>
        </background>
        <title>
                <band height="75" splitType="Stretch">
                        <subreport>
                                <reportElement uuid="b6db748c-379b-4157-8672-20b46c75530e" x="0" y="0" width="555" height="45"/>
                                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "subrelatorio_cabecalho.jasper"]]></subreportExpression>
                        </subreport>
                        <staticText>
                                <reportElement uuid="ec887a4d-29f4-4d9c-85b3-39483a26ebb3" x="-1" y="45" width="555" height="30"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
                                </textElement>
                                <text><![CDATA[AGENDA]]></text>
                        </staticText>
                </band>
        </title>
        <pageHeader>
                <band height="62" splitType="Stretch">
                        <textField>
                                <reportElement uuid="2fd1a221-794b-4234-aac8-b730d81b2e7b" x="-1" y="30" width="320" height="20"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="Arial" size="12" isBold="true"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{nom_dia_semana} + ", " + $F{num_dia} + " DE " + $F{nom_mes} + " DE " + $F{num_ano}]]></textFieldExpression>
                        </textField>
                        <textField>
                                <reportElement uuid="2b4e8875-32c1-46b3-9d9d-75da5cf539d2" x="319" y="30" width="236" height="20"/>
                                <textElement textAlignment="Right">
                                        <font fontName="Arial" size="12" isBold="true"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{nom_profissional}]]></textFieldExpression>
                        </textField>
                </band>
        </pageHeader>
        <columnHeader>
                <band height="20" splitType="Stretch">
                        <rectangle>
                                <reportElement uuid="eabe0b10-cbe6-48c3-9f2c-8cb3e250585d" x="0" y="0" width="555" height="20" backcolor="#CCCCCC"/>
                        </rectangle>
                        <staticText>
                                <reportElement uuid="8cb4c6d2-d253-42d4-9839-59e04e746346" x="95" y="0" width="113" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <text><![CDATA[TIPO]]></text>
                        </staticText>
                        <staticText>
                                <reportElement uuid="6423b892-6a8f-4bac-9f06-2dc94d036b43" x="38" y="0" width="57" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <text><![CDATA[HORA]]></text>
                        </staticText>
                        <staticText>
                                <reportElement uuid="a2e0bb46-bcdc-4b8f-8829-de3e5b99b8c0" x="429" y="0" width="125" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <text><![CDATA[SITUAÇÃO]]></text>
                        </staticText>
                        <staticText>
                                <reportElement uuid="f802cf2d-9be6-4bd5-9e69-130733efb241" x="208" y="0" width="256" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <text><![CDATA[PACIENTE]]></text>
                        </staticText>
                        <staticText>
                                <reportElement uuid="8deb6a6f-ee64-4038-8c6a-4777917700d9" x="0" y="0" width="38" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <text><![CDATA[#]]></text>
                        </staticText>
                </band>
        </columnHeader>
        <detail>
                <band height="20" splitType="Stretch">
                        <rectangle>
                                <reportElement uuid="eabe0b10-cbe6-48c3-9f2c-8cb3e250585d" x="0" y="0" width="555" height="20"/>
                        </rectangle>
                        <textField isBlankWhenNull="true">
                                <reportElement uuid="5678060b-4854-40c5-a5c4-22f0900964c3" x="95" y="0" width="113" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{tip_atendimento}]]></textFieldExpression>
                        </textField>
                        <textField>
                                <reportElement uuid="b1f1a551-0388-48a6-8a71-c0fa04c67ec9" x="38" y="0" width="57" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{num_horario_inicial}]]></textFieldExpression>
                        </textField>
                        <textField>
                                <reportElement uuid="7d3bacb3-4009-40ef-9709-05e10c43ec3e" x="429" y="0" width="125" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{tip_situacao}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                                <reportElement uuid="ae4ed9f9-c578-4caf-9645-ca28ea392eeb" x="208" y="0" width="246" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{nom_paciente}]]></textFieldExpression>
                        </textField>
                        <textField>
                                <reportElement uuid="3c7afd66-2a84-42c9-9e07-7038b405835f" x="0" y="0" width="38" height="20"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle">
                                        <font fontName="Arial"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{num_registro}]]></textFieldExpression>
                        </textField>
                </band>
        </detail>
        <pageFooter>
                <band height="49" splitType="Stretch">
                        <subreport>
                                <reportElement uuid="ae8d065c-9cac-41c0-b26e-489b91e02902" x="0" y="0" width="555" height="35"/>
                                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "subrelatorio_rodape.jasper"]]></subreportExpression>
                        </subreport>
                </band>
        </pageFooter>
</jasperReport>