Subversion Repository Public Repository

Aurocare_27_07_2018

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareinpatient.view;

import com.bestray.healthcarecommonutil.vo.TInpatentAdmission;
import com.bestray.healthcarecommonutil.vo.TPatientEncounter;
import com.bestray.healthcareinpatient.reports.AnesthesiaReport;
import com.bestray.healthcareinpatient.reports.IPTreatment;
import javax.swing.JOptionPane;

/**
 *
 * @author DELL
 */
public class ReportTypeDialog extends javax.swing.JDialog {

    /**
     * Creates new form ReportTypeDialog
     */
    public ReportTypeDialog(java.awt.Frame parent, boolean modal,TPatientEncounter encounter,TInpatentAdmission inpatadmission) {
        super(parent, modal);
        this.encounter=encounter;
        this.inpatadmission=inpatadmission;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        jLabel1 = new javax.swing.JLabel();
        ip_Treatment_Report = new javax.swing.JButton();
        anesthia_Report_Button = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(204, 255, 204));

        jToolBar1.setBackground(new java.awt.Color(204, 255, 204));
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        jLabel1.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 102, 255));
        jLabel1.setText("Select The Report Type");
        jToolBar1.add(jLabel1);

        ip_Treatment_Report.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/report 16X16.png"))); // NOI18N
        ip_Treatment_Report.setText("IPTreatment");
        ip_Treatment_Report.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ip_Treatment_ReportActionPerformed(evt);
            }
        });

        anesthia_Report_Button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/report 16X16.png"))); // NOI18N
        anesthia_Report_Button.setText("Anesthesia");
        anesthia_Report_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                anesthia_Report_ButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(ip_Treatment_Report)
                        .addGap(26, 26, 26)
                        .addComponent(anesthia_Report_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ip_Treatment_Report)
                    .addComponent(anesthia_Report_Button))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void anesthia_Report_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_anesthia_Report_ButtonActionPerformed
        try{
            
                Long id = Long.parseLong(encounter.getEncId().toString());
                String patientName = inpatadmission.getPatientId().getPatientFName()+" "+inpatadmission.getPatientId().getPatientMName()+" "+inpatadmission.getPatientId().getPatientLName();
                AnesthesiaReport anesthesiaReport=new AnesthesiaReport();
                anesthesiaReport.getPdfReport(id,patientName);
                anesthesiaReport.openPdfReport();
            
        }
        catch(Exception e){
            String error=e.getMessage();
            JOptionPane.showMessageDialog(null, error+"\n SORRY!!, Document can't be generated");
            
        }
    }//GEN-LAST:event_anesthia_Report_ButtonActionPerformed

    private void ip_Treatment_ReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ip_Treatment_ReportActionPerformed
        try{
            
                Long id = Long.parseLong(encounter.getEncId().toString());
                String patientName = inpatadmission.getPatientId().getPatientFName()+" "+inpatadmission.getPatientId().getPatientMName()+" "+inpatadmission.getPatientId().getPatientLName();
                IPTreatment ipTreatment=new IPTreatment();
                ipTreatment.getPdfReport(id,patientName);
                ipTreatment.openPdfReport();
            
        }
        catch(Exception e){
            String error=e.getMessage();
            JOptionPane.showMessageDialog(null, error+"\n SORRY!!, Document can't be generated");
            
        }
    }//GEN-LAST:event_ip_Treatment_ReportActionPerformed

    
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton anesthia_Report_Button;
    private javax.swing.JButton ip_Treatment_Report;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables
private TPatientEncounter encounter;
private TInpatentAdmission inpatadmission;


}

Commits for Aurocare_27_07_2018/AuroCareHealthCareInPatient/src/main/java/com/bestray/healthcareinpatient/view/ReportTypeDialog.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Fri 27 Jul, 2018 07:21:55 +0000