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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.labinformationsystem.views;

import com.bestray.healthcarecommonutil.exception.HealthCareException;
import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.util.ButtonType;
import com.bestray.healthcarecommonutil.util.CurvedGradientPanel;
import com.bestray.healthcarecommonutil.util.GlossyButton;
import com.bestray.healthcarecommonutil.util.Theme;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcarecommonutil.vo.TPatEncOrderResults;
import com.bestray.labinformationsystem.controller.LabCodeValueController;
import com.bestray.labinformationsystem.controller.OrderResultController;
import com.bestray.labinformationsystem.util.CollectionUtill;
import com.bestray.labinformationsystem.util.MessageProperties;
import java.util.Vector;
import javax.swing.JOptionPane;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;

/**
 *
 * @author User1
 */
public class ComponentResultEntryScreen extends javax.swing.JDialog {

    /**
     * Creates new form ComponentResultEntryScreen
     */
    public ComponentResultEntryScreen(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        populateData();
        initComponents();
    }

    public ComponentResultEntryScreen(java.awt.Frame parent, boolean modal, TPatEncOrderResults componetResults) {
        super(parent, modal);
        populateData();
        initComponents();
        displayComponentVaules(componetResults);
    }

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

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new CurvedGradientPanel();
        jLabel1 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        done_button = new GlossyButton("Cancel",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED);
        cancel_button = new GlossyButton("Cancel",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED);
        jLabel7 = new javax.swing.JLabel();
        componentId_TextField = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        componentName_TextField = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        normalRanges_TextField = new javax.swing.JTextField();
        units_ComboBox = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        Notes_TextArea = new javax.swing.JTextArea();
        jScrollPane2 = new javax.swing.JScrollPane();
        componentResult_textArea = new javax.swing.JTextArea();
        jToolBar1 = new javax.swing.JToolBar();
        normal_togButton = new javax.swing.JToggleButton();
        Abnormal_togButton = new javax.swing.JToggleButton();
        compoStatus_textField = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Component Results");

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

        jLabel1.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(102, 153, 255));
        jLabel1.setText("Component Results");

        jSeparator1.setBackground(new java.awt.Color(102, 153, 255));
        jSeparator1.setForeground(new java.awt.Color(102, 153, 255));

        done_button.setBackground(new java.awt.Color(253, 251, 251));
        done_button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        done_button.setForeground(new java.awt.Color(68, 62, 173));
        done_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Done 16X16.png"))); // NOI18N
        done_button.setText("Done");
        done_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        done_button.setMaximumSize(new java.awt.Dimension(85, 25));
        done_button.setMinimumSize(new java.awt.Dimension(85, 25));
        done_button.setPreferredSize(new java.awt.Dimension(85, 25));
        done_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                done_buttonActionPerformed(evt);
            }
        });

        cancel_button.setBackground(new java.awt.Color(253, 251, 251));
        cancel_button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        cancel_button.setForeground(new java.awt.Color(68, 62, 173));
        cancel_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cancel16X16.png"))); // NOI18N
        cancel_button.setText("Cancel");
        cancel_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        cancel_button.setMaximumSize(new java.awt.Dimension(85, 25));
        cancel_button.setMinimumSize(new java.awt.Dimension(85, 25));
        cancel_button.setPreferredSize(new java.awt.Dimension(85, 25));
        cancel_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancel_buttonActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel7.setText("Component ID :");

        componentId_TextField.setEditable(false);
        componentId_TextField.setBackground(new java.awt.Color(255, 255, 255));
        componentId_TextField.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        componentId_TextField.setForeground(new java.awt.Color(204, 0, 0));
        componentId_TextField.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        componentId_TextField.setOpaque(false);

        jLabel8.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel8.setText("Name :");

        jLabel9.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel9.setText("Result :");

        jLabel10.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel10.setText("Unit :");

        componentName_TextField.setEditable(false);
        componentName_TextField.setBackground(new java.awt.Color(255, 255, 255));
        componentName_TextField.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        componentName_TextField.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        componentName_TextField.setOpaque(false);

        jLabel11.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel11.setText("Normal Range :");

        normalRanges_TextField.setEditable(false);
        normalRanges_TextField.setBackground(new java.awt.Color(255, 255, 255));
        normalRanges_TextField.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        normalRanges_TextField.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        normalRanges_TextField.setOpaque(false);

        units_ComboBox.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        units_ComboBox.setModel(new javax.swing.DefaultComboBoxModel(componentsUnitList));

        jLabel12.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel12.setText("Component Status :");

        jLabel13.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel13.setText("Notes :");

        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        Notes_TextArea.setColumns(20);
        Notes_TextArea.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        Notes_TextArea.setLineWrap(true);
        Notes_TextArea.setRows(5);
        jScrollPane1.setViewportView(Notes_TextArea);

        jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        componentResult_textArea.setColumns(20);
        componentResult_textArea.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        componentResult_textArea.setLineWrap(true);
        componentResult_textArea.setRows(5);
        componentResult_textArea.setWrapStyleWord(true);
        jScrollPane2.setViewportView(componentResult_textArea);

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

        normal_togButton.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(normal_togButton);
        normal_togButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        normal_togButton.setText("NORMAL");
        normal_togButton.setToolTipText("Press Button");
        normal_togButton.setFocusable(false);
        normal_togButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        normal_togButton.setMargin(new java.awt.Insets(2, 20, 2, 20));
        normal_togButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                normal_togButtonActionPerformed(evt);
            }
        });
        jToolBar1.add(normal_togButton);

        Abnormal_togButton.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(Abnormal_togButton);
        Abnormal_togButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        Abnormal_togButton.setText("ABNORMAL");
        Abnormal_togButton.setToolTipText("Press Button");
        Abnormal_togButton.setFocusable(false);
        Abnormal_togButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        Abnormal_togButton.setMargin(new java.awt.Insets(2, 20, 2, 20));
        Abnormal_togButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Abnormal_togButtonActionPerformed(evt);
            }
        });
        jToolBar1.add(Abnormal_togButton);

        compoStatus_textField.setEditable(false);
        compoStatus_textField.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        compoStatus_textField.setForeground(new java.awt.Color(255, 0, 0));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(done_button, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cancel_button, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jSeparator1)))
                .addGap(10, 10, 10))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel11)
                    .addComponent(jLabel7)
                    .addComponent(jLabel13)
                    .addComponent(jLabel8)
                    .addComponent(jLabel10)
                    .addComponent(jLabel9)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(componentId_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(normalRanges_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(componentName_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(units_ComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(compoStatus_textField)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel1)
                .addContainerGap(390, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jScrollPane1, jScrollPane2});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(componentId_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(componentName_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(normalRanges_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(units_ComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel12)
                        .addComponent(compoStatus_textField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cancel_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(done_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jScrollPane1, jScrollPane2});

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {componentName_TextField, normalRanges_TextField});

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel10, jLabel11, jLabel12, jLabel13, jLabel7, jLabel8, jLabel9, jToolBar1});

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {compoStatus_textField, units_ComboBox});

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

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

    private void done_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_done_buttonActionPerformed
        componetResults.setComponentResults(componentResult_textArea.getText());
        componetResults.setComponentNotes(Notes_TextArea.getText());
        if(normal_togButton.isSelected()){
        componetResults.setComponentStatus("NORMAL");
        }else if(Abnormal_togButton.isSelected()){
        componetResults.setComponentStatus("ABNORMAL");
        }else{
        componetResults.setComponentStatus("");
        }
        try {
            orderResultController.updateOrderResults(componetResults);
        }catch(HibernateOptimisticLockingFailureException e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.update",new Object[]{"procedure"}));
          }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"procedure"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
           }catch(Exception e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"procedure"}));
           }
        dispose();
    }//GEN-LAST:event_done_buttonActionPerformed

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

    private void normal_togButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_normal_togButtonActionPerformed
        compoStatus_textField.setText("NORMAL");
    }//GEN-LAST:event_normal_togButtonActionPerformed

    private void Abnormal_togButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Abnormal_togButtonActionPerformed
        compoStatus_textField.setText("ABNORMAL");
    }//GEN-LAST:event_Abnormal_togButtonActionPerformed

    /**
     * @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(ComponentResultEntryScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ComponentResultEntryScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ComponentResultEntryScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ComponentResultEntryScreen.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() {
                ComponentResultEntryScreen dialog = new ComponentResultEntryScreen(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.JToggleButton Abnormal_togButton;
    private javax.swing.JTextArea Notes_TextArea;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton cancel_button;
    private javax.swing.JTextField compoStatus_textField;
    private javax.swing.JTextField componentId_TextField;
    private javax.swing.JTextField componentName_TextField;
    private javax.swing.JTextArea componentResult_textArea;
    private javax.swing.JButton done_button;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JTextField normalRanges_TextField;
    private javax.swing.JToggleButton normal_togButton;
    private javax.swing.JComboBox units_ComboBox;
    // End of variables declaration//GEN-END:variables
    private Vector<TCCodeValues> componentsUnitList = new Vector<TCCodeValues>();
    private Vector<TCCodeValues> componentStatusList = new Vector<TCCodeValues>();
    private LabCodeValueController labCodeValueController;
    private TPatEncOrderResults componetResults;
    private OrderResultController orderResultController;
    

    private void populateData() {
        componetResults = new TPatEncOrderResults();
        labCodeValueController = (LabCodeValueController)LabInformationSystemHome.context.getBean("labCodeValueController");
        orderResultController =(OrderResultController)LabInformationSystemHome.context.getBean("orderResultController");
        try{
                componentsUnitList = labCodeValueController.getCodeValues("UNIT");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"UNIT"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
         }
        try{
                componentStatusList = labCodeValueController.getCodeValues("COMPONENT STATUS");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"COMPONENT STATUS"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
         }
    }

    public TPatEncOrderResults getComponentModification() {
        return componetResults;
    }

    private void displayComponentVaules(TPatEncOrderResults componetResults) {
        this.componetResults = componetResults;
        componentId_TextField.setText(String.valueOf(componetResults.getId()));
        componentName_TextField.setText(componetResults.getComponentId().getComponentName());
        componentResult_textArea.setText(componetResults.getComponentResults());
        if(componetResults.getComponentId().getComponentNormalRange()!=null){
            normalRanges_TextField.setText(componetResults.getComponentId().getComponentNormalRange());
        }else{
        normalRanges_TextField.setText("");
        }
        if(componetResults.getComponentNotes()!=null){
        Notes_TextArea.setText(componetResults.getComponentNotes());
        }else{
        Notes_TextArea.setText("");
        }
        units_ComboBox.setSelectedIndex(CollectionUtill.getCodeValueIndex(componentsUnitList,componetResults.getComponentId().getUnit()));
        if(componetResults.getComponentStatus()!=null){
            if(componetResults.getComponentStatus().equalsIgnoreCase("NORMAL")){
                normal_togButton.setSelected(true);
                compoStatus_textField.setText("NORMAL");
            }else if(componetResults.getComponentStatus().equalsIgnoreCase("ABNORMAL")){
                Abnormal_togButton.setSelected(true);
                compoStatus_textField.setText("ABNORMAL");
            }
        }else{
        normal_togButton.setSelected(false);
        Abnormal_togButton.setSelected(false);
        }
    }
    
}

Commits for Satyam/AuroCareLabInformationSystem/src/main/java/com/bestray/labinformationsystem/views/ComponentResultEntryScreen.java

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