Subversion Repository Public Repository

Satyam

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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareemr.Views;

import com.bestray.healthcarecommonutil.util.ButtonType;
import com.bestray.healthcarecommonutil.util.DisabledGlassPane;
import com.bestray.healthcarecommonutil.util.SimpleGradientPanel;
import com.bestray.healthcarecommonutil.util.StandardButton;
import com.bestray.healthcarecommonutil.util.Theme;
import com.bestray.healthcarecommonutil.vo.TDoctorInformation;
import com.bestray.healthcarecommonutil.vo.TPatient;
import com.bestray.healthcarecommonutil.vo.TPatientEncounter;
import com.bestray.healthcareemr.Controller.OutPatientController;
import com.bestray.healthcarecommonutil.util.Initcap;
import com.bestray.healthcarecommonutil.util.TimeRange;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Vector;
import javax.swing.JRootPane;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author dell
 */
public class OpenEncounterDialog extends javax.swing.JDialog {

    /**
     * Creates new form OpenEncounterDialog
     */
    public OpenEncounterDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    public OpenEncounterDialog(java.awt.Frame parent, boolean modal,TPatient patientinfo) {
        super(parent, modal);
        this.patientinfo = patientinfo;
        initComponents();
        populate();
        String patientFullName = null;
        if(patientinfo.getPatientMName()!=null){
            patientFullName = Initcap.toInitCap(patientinfo.getPatientFName())+" "+Initcap.toInitCap(patientinfo.getPatientMName())+" "+Initcap.toInitCap(patientinfo.getPatientLName());
        }else if(patientinfo.getPatientMName()==null){
            patientFullName = Initcap.toInitCap(patientinfo.getPatientFName())+" "+Initcap.toInitCap(patientinfo.getPatientLName());
        }
        namelabel.setText(patientFullName);
        doblabel.setText(sdf.format(patientinfo.getBirthDate()));
        sexlabel.setText(patientinfo.getPatientGender());
        patientidlabel.setText(patientinfo.getPatientId());
        List<String> totalAge = TimeRange.calculateAge(patientinfo.getBirthDate());
        age.setText(totalAge.get(0)+" yr "+totalAge.get(1)+" months");
    }

    /**
     * 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() {

        jPanel2 = new SimpleGradientPanel(Color.WHITE,Color.LIGHT_GRAY);
        doblabel = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        age = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        sexlabel = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        namelabel = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        patientidlabel = new javax.swing.JLabel();
        closebutton = new StandardButton("Close",Theme.STANDARD_RED_THEME,ButtonType.BUTTON_RECTANGULAR);
        jScrollPane1 = new javax.swing.JScrollPane();
        openedenc = new javax.swing.JTable(){
            public boolean isCellEditable(int row, int column){
                return false;
            }
            public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
                Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
                if (rowIndex % 2 == 0 && !isCellSelected(rowIndex, vColIndex)) {
                    c.setForeground(Color.BLACK);
                    c.setBackground(new Color(200, 225, 250));
                }
                else if(rowIndex % 2 == 0 && isCellSelected(rowIndex, vColIndex)){
                    c.setForeground(Color.WHITE);
                    c.setBackground(Color.BLUE);
                }
                else if(rowIndex % 2 != 0 && isCellSelected(rowIndex, vColIndex)){
                    c.setForeground(Color.WHITE);
                    c.setBackground(Color.BLUE);
                }
                else {
                    c.setForeground(Color.BLACK);
                    c.setBackground(getBackground());
                }
                return c;
            }
        };

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);

        doblabel.setFont(new java.awt.Font("Bookman Old Style", 0, 13)); // NOI18N
        doblabel.setText("jLabel12");

        jLabel11.setFont(new java.awt.Font("Bookman Old Style", 1, 14)); // NOI18N
        jLabel11.setText("DOB :");

        age.setFont(new java.awt.Font("Bookman Old Style", 0, 13)); // NOI18N
        age.setText("jLabel8");

        jLabel7.setFont(new java.awt.Font("Bookman Old Style", 1, 14)); // NOI18N
        jLabel7.setText("Age :");

        sexlabel.setFont(new java.awt.Font("Bookman Old Style", 0, 13)); // NOI18N
        sexlabel.setText("jLabel10");

        jLabel9.setFont(new java.awt.Font("Bookman Old Style", 1, 14)); // NOI18N
        jLabel9.setText("Sex :");

        namelabel.setFont(new java.awt.Font("Bookman Old Style", 0, 13)); // NOI18N
        namelabel.setText("jLabel6");

        jLabel3.setFont(new java.awt.Font("Bookman Old Style", 1, 14)); // NOI18N
        jLabel3.setText("Name :");

        jLabel38.setFont(new java.awt.Font("Bookman Old Style", 1, 14)); // NOI18N
        jLabel38.setText("MRN :");

        patientidlabel.setFont(new java.awt.Font("Bookman Old Style", 0, 13)); // NOI18N
        patientidlabel.setText("patientId");

        closebutton.setText("Close");
        closebutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closebuttonActionPerformed(evt);
            }
        });

        openedenc.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 11));
        openedenc.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Encounter Date", "Doctor", "Status","Comments"
            }
        ));
        openedenc.setRowHeight(21);
        openedenc.getColumnModel().getColumn(0).setMinWidth(0);
        openedenc.getColumnModel().getColumn(0).setPreferredWidth(0);
        openedenc.getColumnModel().getColumn(0).setMaxWidth(0);
        openedenc.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                openedencMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(openedenc);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(namelabel)
                        .addGap(28, 28, 28)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sexlabel)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(age)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(doblabel)
                        .addGap(0, 305, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel38)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patientidlabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(closebutton)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel38)
                            .addComponent(patientidlabel)))
                    .addComponent(closebutton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(namelabel)
                    .addComponent(jLabel9)
                    .addComponent(sexlabel)
                    .addComponent(jLabel7)
                    .addComponent(age)
                    .addComponent(jLabel11)
                    .addComponent(doblabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

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

    private void closebuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closebuttonActionPerformed
        dispose();
    }//GEN-LAST:event_closebuttonActionPerformed

    private void openedencMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openedencMouseClicked
        int row = openedenc.getSelectedRow();
        if(evt.getClickCount()%2==0){
           TDoctorInformation doctor = (TDoctorInformation)openedenc.getValueAt(row, 2);
           Long rowidvalue = Long.valueOf(openedenc.getValueAt(row, 0).toString());
           /*DisabledGlassPane glassPane = new DisabledGlassPane();
           JRootPane rootPane = SwingUtilities.getRootPane(this);
           rootPane.setGlassPane(glassPane);    
           //OutPatientDialog p = new OutPatientDialog(MainAPP, true, patientinfo,doctor,null,"openencounter",rowidvalue);
           OutPatientDialog p = new OutPatientDialog(MainAPP, true, patientinfo,doctor,null,"openencounter",rowidvalue);
           dispose();
           p.setResizable(false);
           p.setBounds(40, 50, 1200, 650);
           p.setLocationRelativeTo(null);
           glassPane.activate("");
           p.setVisible(true);
           p.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
           glassPane.deactivate();*/
           HealthCareEmrAdvanceHome.outpatient_right_display_panel.removeAll();
           HealthCareEmrAdvanceHome.outpatient_right_display_panel.updateUI();
           HealthCareEmrAdvanceHome.outpatient_right_display_panel.setBackground(Color.WHITE);
           //HealthCareEmrAdvanceHome.outpatient_right_display_panel.add(new NewOutPatientPanel(patientinfo,doctor,null,"openencounter",rowidvalue),java.awt.BorderLayout.CENTER);
           HealthCareEmrAdvanceHome.outpatient_right_display_panel.add(new OutPatientEncounterPanel1(patientinfo,doctor,null,"openencounter",rowidvalue),java.awt.BorderLayout.CENTER);
           HealthCareEmrAdvanceHome.outpatient_right_display_panel.setVisible(true);
           dispose();
        }
    }//GEN-LAST:event_openedencMouseClicked

    /**
     * @param args the command line arguments
     
    public static void main(String args[]) {
        /* Set the Nimbus look and feel 
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(OpenEncounterDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(OpenEncounterDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(OpenEncounterDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(OpenEncounterDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog 
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                OpenEncounterDialog dialog = new OpenEncounterDialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }*/
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel age;
    private javax.swing.JButton closebutton;
    private javax.swing.JLabel doblabel;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel namelabel;
    private javax.swing.JTable openedenc;
    private javax.swing.JLabel patientidlabel;
    private javax.swing.JLabel sexlabel;
    // End of variables declaration//GEN-END:variables
    private TPatient patientinfo;
    private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-YYYY");
    private SimpleDateFormat sdftime = new SimpleDateFormat("dd-MM-YYYY  hh:mm:ss a");
    /** The out patient controller. */
    private OutPatientController outPatientController;
    /** The encounters. */
    List<TPatientEncounter> encounterList;
    //Vector<Vector<Object>> encounters = new Vector<Vector<Object>>();
    //Vector<Object> header = new Vector<Object>();
    Vector<Object> addObject ;
    private javax.swing.JFrame MainAPP;
    DefaultTableModel model;
    
    private void populate() {
        outPatientController=(OutPatientController)HealthcareLogin.context.getBean("outPatientController");
        try {
            encounterList = outPatientController.getEncounterDates(patientinfo);
            model = (DefaultTableModel) openedenc.getModel();
            openedenc.getColumnModel().getColumn(0).setMinWidth(0);
            openedenc.getColumnModel().getColumn(0).setPreferredWidth(0);
            openedenc.getColumnModel().getColumn(0).setMaxWidth(0);

            for(TPatientEncounter encounter:encounterList){
                if(encounter.getEncStatus().equalsIgnoreCase("Opened")){
                    addObject = new Vector<Object>();
                    addObject.add(encounter.getEncId());
                    addObject.add(sdftime.format(encounter.getEncDate()));
                    addObject.add(encounter.getDoctor());
                    addObject.add(encounter.getEncStatus());
                    if(encounter.getAppoitmentId()!=null){
                        addObject.add("Scheduled");
                    }else{
                        addObject.add("On The Fly");
                    }
                    model.addRow(addObject);
                }
                }
                     
        }catch(Exception e){
            e.printStackTrace();
        }

    }
    
   
}

Commits for Satyam/AuroCareEMR/src/main/java/com/bestray/healthcareemr/Views/OpenEncounterDialog.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Fri 20 Jul, 2018 05:59:17 +0000