Subversion Repository Public Repository

Pharmacy_09_03_18

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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareemr.Views;

import com.bestray.healthcarecommonutil.exception.HealthCareException;
import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.util.JTextFieldHint;
import com.bestray.healthcarecommonutil.vo.TGroupMaster;
import com.bestray.healthcarecommonutil.vo.TProcedureMaster;
import com.bestray.healthcareemr.Controller.GroupMasterController;
import com.bestray.healthcareemr.Controller.ProcedureMasterController;
import com.bestray.healthcareemr.Util.MessageProperties;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.RowFilter;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;

/**
 *
 * @author DELL
 */
public class GroupPanel extends javax.swing.JPanel {

    /**
     * Creates new form GroupPanel
     */
    public GroupPanel() {
        
        popalateData();
        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() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        group_name_Label = new javax.swing.JLabel();
        status_Label = new javax.swing.JLabel();
        group_name_TextField = new javax.swing.JTextField();
        synonyms_Label = new javax.swing.JLabel();
        group_synonyms_TextField = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        search_Label = new javax.swing.JLabel();
        search_TextField = new javax.swing.JTextField();
        search_Button = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        pageSize_combo = new javax.swing.JComboBox();
        first_bt = new javax.swing.JButton();
        prev_bt = new javax.swing.JButton();
        next_bt = new javax.swing.JButton();
        last_bt = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        save_Button = new javax.swing.JButton();
        edit_Button = new javax.swing.JButton();
        reset_Button = new javax.swing.JButton();
        delete_Button = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        page_heading_Label = new javax.swing.JLabel();
        search_panel = new javax.swing.JPanel();
        group_ScrollPane = new javax.swing.JScrollPane();
        group_table = 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;
            }
        };
        jLabel2 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        add_procedure_panel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        procedureSource_list = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        procedureSelected_list = new javax.swing.JList();
        add_procedure_button = new javax.swing.JButton();
        remove_procedure_button = new javax.swing.JButton();
        procedure_search_textfield = new JTextFieldHint(new JTextField(), "/images/search-icon16X16.png", "Search Procedure");
        activeradbutton = new javax.swing.JRadioButton();
        inactiveradbutton = new javax.swing.JRadioButton();
        comments_Label1 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        group_comment_text = new javax.swing.JTextArea();

        setOpaque(false);
        setLayout(new java.awt.BorderLayout());

        jPanel1.setBackground(new java.awt.Color(253, 251, 251));
        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setOpaque(false);

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

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

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

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setOpaque(false);
        jPanel3.setPreferredSize(new java.awt.Dimension(840, 26));

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

        search_Button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        search_Button.setText("Search");
        search_Button.setMaximumSize(new java.awt.Dimension(85, 25));
        search_Button.setMinimumSize(new java.awt.Dimension(85, 25));
        search_Button.setOpaque(false);
        search_Button.setPreferredSize(new java.awt.Dimension(85, 25));
        search_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                search_ButtonActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel1.setText("Display");

        pageSize_combo.setBackground(new java.awt.Color(253, 251, 251));
        pageSize_combo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10", "15", "20" }));

        first_bt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/fastbackward.png"))); // NOI18N
        first_bt.setText("First");
        first_bt.setContentAreaFilled(false);
        first_bt.setVisible(false);
        first_bt.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        prev_bt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forward.png"))); // NOI18N
        prev_bt.setText("Prev");
        prev_bt.setContentAreaFilled(false);
        prev_bt.setVisible(false);
        prev_bt.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        next_bt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/back.png"))); // NOI18N
        next_bt.setText("Next");
        next_bt.setContentAreaFilled(false);
        next_bt.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        next_bt.setVisible(false);
        next_bt.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);

        last_bt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/fastforward.png"))); // NOI18N
        last_bt.setText("Last");
        last_bt.setContentAreaFilled(false);
        last_bt.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        last_bt.setVisible(false);
        last_bt.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(search_Label)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(search_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(search_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pageSize_combo, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, Short.MAX_VALUE)
                .addComponent(first_bt)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(prev_bt)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(next_bt)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(last_bt)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(search_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(search_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(search_Label)
                .addComponent(jLabel1)
                .addComponent(pageSize_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(first_bt, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(prev_bt, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(next_bt, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(last_bt, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel2.setBackground(new java.awt.Color(253, 251, 251));
        jPanel2.setOpaque(false);

        save_Button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        save_Button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Save-icon 16X16.png"))); // NOI18N
        save_Button.setText("Save");
        save_Button.setMaximumSize(new java.awt.Dimension(85, 25));
        save_Button.setMinimumSize(new java.awt.Dimension(85, 25));
        save_Button.setOpaque(false);
        save_Button.setPreferredSize(new java.awt.Dimension(85, 25));
        save_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                save_ButtonActionPerformed(evt);
            }
        });

        edit_Button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        edit_Button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Edit-icon 16X16.png"))); // NOI18N
        edit_Button.setText("Edit");
        edit_Button.setMaximumSize(new java.awt.Dimension(85, 25));
        edit_Button.setMinimumSize(new java.awt.Dimension(85, 25));
        edit_Button.setOpaque(false);
        edit_Button.setPreferredSize(new java.awt.Dimension(85, 25));
        edit_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edit_ButtonActionPerformed(evt);
            }
        });

        reset_Button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        reset_Button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/refresh 16x16.png"))); // NOI18N
        reset_Button.setText("Reset");
        reset_Button.setMaximumSize(new java.awt.Dimension(85, 25));
        reset_Button.setMinimumSize(new java.awt.Dimension(85, 25));
        reset_Button.setOpaque(false);
        reset_Button.setPreferredSize(new java.awt.Dimension(85, 25));
        reset_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reset_ButtonActionPerformed(evt);
            }
        });

        delete_Button.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        delete_Button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/delete 16x16.png"))); // NOI18N
        delete_Button.setText("Delete");
        delete_Button.setMaximumSize(new java.awt.Dimension(85, 25));
        delete_Button.setMinimumSize(new java.awt.Dimension(85, 25));
        delete_Button.setOpaque(false);
        delete_Button.setPreferredSize(new java.awt.Dimension(85, 25));
        delete_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                delete_ButtonActionPerformed(evt);
            }
        });

        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(save_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(edit_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(reset_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(delete_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(save_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(edit_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(reset_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(delete_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel4.setBackground(new java.awt.Color(0, 153, 255));

        page_heading_Label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
        page_heading_Label.setForeground(new java.awt.Color(255, 255, 255));
        page_heading_Label.setText("Group Master");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(page_heading_Label)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(page_heading_Label)
                .addGap(0, 0, 0))
        );

        search_panel.setOpaque(false);
        search_panel.setLayout(new java.awt.BorderLayout());

        group_ScrollPane.setVisible(false);

        group_table.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        group_table.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 11));
        updateTable();
        group_table.setModel(new javax.swing.table.DefaultTableModel(groupData,Header));
        group_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        group_table.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        group_table.getColumnModel().getColumn(0).setPreferredWidth(0);
        group_table.getColumnModel().getColumn(0).setMinWidth(0);
        group_table.getColumnModel().getColumn(0).setMaxWidth(0);

        group_table.getColumnModel().getColumn(1).setPreferredWidth(95);
        group_table.getColumnModel().getColumn(1).setMaxWidth(105);

        group_table.getColumnModel().getColumn(2).setPreferredWidth(250);
        group_table.getColumnModel().getColumn(2).setMaxWidth(350);

        group_table.getColumnModel().getColumn(3).setPreferredWidth(200);
        group_table.getColumnModel().getColumn(3).setMaxWidth(330);

        group_table.getColumnModel().getColumn(4).setPreferredWidth(70);
        group_table.getColumnModel().getColumn(4).setMaxWidth(70);
        group_ScrollPane.setViewportView(group_table);

        search_panel.add(group_ScrollPane, java.awt.BorderLayout.CENTER);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 0, 0));
        jLabel2.setText("*");

        jPanel5.setBackground(new java.awt.Color(253, 251, 251));
        jPanel5.setOpaque(false);

        add_procedure_panel.setBackground(new java.awt.Color(255, 255, 255));
        add_procedure_panel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Add Procedure", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 10))); // NOI18N
        add_procedure_panel.setOpaque(false);
        //add_procedure_panel.setVisible(true);

        jScrollPane1.setViewportView(procedureSource_list);

        procedureSelected_list.setModel(procedureselectedmodel);
        jScrollPane2.setViewportView(procedureSelected_list);

        add_procedure_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Add-icon16x16.png"))); // NOI18N
        add_procedure_button.setOpaque(false);
        add_procedure_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                add_procedure_buttonActionPerformed(evt);
            }
        });

        remove_procedure_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/minus-icon.png"))); // NOI18N
        remove_procedure_button.setOpaque(false);
        remove_procedure_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                remove_procedure_buttonActionPerformed(evt);
            }
        });

        procedure_search_textfield.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        procedure_search_textfield.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                procedure_search_textfieldKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout add_procedure_panelLayout = new javax.swing.GroupLayout(add_procedure_panel);
        add_procedure_panel.setLayout(add_procedure_panelLayout);
        add_procedure_panelLayout.setHorizontalGroup(
            add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(add_procedure_panelLayout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addGroup(add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(add_procedure_panelLayout.createSequentialGroup()
                        .addComponent(procedure_search_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(add_procedure_panelLayout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(add_procedure_button)
                            .addComponent(remove_procedure_button))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addGap(4, 4, 4))))
        );
        add_procedure_panelLayout.setVerticalGroup(
            add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(add_procedure_panelLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(procedure_search_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(add_procedure_panelLayout.createSequentialGroup()
                        .addGap(7, 7, 7)
                        .addGroup(add_procedure_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                        .addGap(5, 5, 5))
                    .addGroup(add_procedure_panelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(add_procedure_button)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(remove_procedure_button)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(add_procedure_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(add_procedure_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        buttonGroup1.add(activeradbutton);
        activeradbutton.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        activeradbutton.setText("Active");
        activeradbutton.setOpaque(false);

        buttonGroup1.add(inactiveradbutton);
        inactiveradbutton.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        inactiveradbutton.setText("Inactive");
        inactiveradbutton.setOpaque(false);

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

        group_comment_text.setColumns(20);
        group_comment_text.setLineWrap(true);
        group_comment_text.setRows(5);
        group_comment_text.setWrapStyleWord(true);
        jScrollPane3.setViewportView(group_comment_text);

        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)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(group_name_Label)
                                        .addComponent(status_Label))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(group_name_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(activeradbutton)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(inactiveradbutton))))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(synonyms_Label)
                                    .addGap(18, 18, 18)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(group_synonyms_TextField, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
                                        .addComponent(jScrollPane3))))
                            .addComponent(comments_Label1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10))
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(search_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(58, 58, 58))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(group_name_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(group_name_Label)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(status_Label)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(synonyms_Label)
                                            .addComponent(group_synonyms_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(inactiveradbutton)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(activeradbutton)
                                            .addGap(5, 5, 5))))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(11, 11, 11)
                                        .addComponent(comments_Label1))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(search_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        add(jPanel1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void save_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save_ButtonActionPerformed
        
        if(validateProcedure()){
            try{
                groupMaster.setGroupName(group_name_TextField.getText().toUpperCase());
                groupMaster.setGroupSynonims((group_synonyms_TextField.getText().toUpperCase()));
                if(activeradbutton.isSelected()){
                   groupMaster.setGroupStatus("ACTIVE"); 
                }else if(inactiveradbutton.isSelected()){
                    groupMaster.setGroupStatus("INACTIVE");
                }else{
                    groupMaster.setGroupStatus("ACTIVE");
                }
                groupMasterController.saveGroupMaster(groupMaster, procedureSelectedList);
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("success.save",new Object[]{"Group"}));
                groupMaster=new TGroupMaster();
                
            }catch(HibernateOptimisticLockingFailureException e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.update",new Object[]{"Group"}));
              }catch(ProcessingException e){
                    JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"Group"}));
                    throw new HealthCareException(MessageProperties.getMessage("error.dao"));
               }catch(Exception e){
                    JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"Group"}));
               }
             reset();
             updateTable();
             clearProcedureSelection();
             groupMaster = new TGroupMaster();
        }
    }//GEN-LAST:event_save_ButtonActionPerformed

    private void add_procedure_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add_procedure_buttonActionPerformed
        if(!procedureSource_list.isSelectionEmpty()){
            List<TProcedureMaster> selecteditems = procedureSource_list.getSelectedValuesList();
            for(TProcedureMaster s:selecteditems){
                procedureSelectedList.add(s);
                procedureselectedmodel.addElement(s);
                proceduresourcemodel.removeElement(s);
            }
            procedureSelected_list.getSelectionModel().clearSelection();
        }
    }//GEN-LAST:event_add_procedure_buttonActionPerformed

    private void procedure_search_textfieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_procedure_search_textfieldKeyPressed
        String expr = procedure_search_textfield.getText().toUpperCase();
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            displayProcedures(expr);
        }
    }//GEN-LAST:event_procedure_search_textfieldKeyPressed

    private void remove_procedure_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_remove_procedure_buttonActionPerformed
        if(!procedureSelected_list.isSelectionEmpty()){
            List<TProcedureMaster> selecteditems = procedureSelected_list.getSelectedValuesList();
            for(TProcedureMaster s:selecteditems){
                procedureSelectedList.remove(s);
                proceduresourcemodel.addElement(s);
                procedureselectedmodel.removeElement(s);
            }
            procedureSelected_list.getSelectionModel().clearSelection();
        }
    }//GEN-LAST:event_remove_procedure_buttonActionPerformed

    private void search_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_search_ButtonActionPerformed
       searchMethod();      
    }//GEN-LAST:event_search_ButtonActionPerformed

    private void reset_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reset_ButtonActionPerformed
        reset();
        updateTable();
        clearProcedureSelection();
        groupMaster = new TGroupMaster();
    }//GEN-LAST:event_reset_ButtonActionPerformed

    private void edit_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edit_ButtonActionPerformed
        try{
            int row = group_table.getSelectedRow();
            Object o = group_table.getValueAt(row, 0);
            displayRowValues(Long.parseLong(o.toString()));
             displayProcedures("");
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("notselected.edit"));
        }
    }//GEN-LAST:event_edit_ButtonActionPerformed

    private void delete_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_ButtonActionPerformed
       
         int row = group_table.getSelectedRow();
        if(row>=0)
        {
            Object o = group_table.getValueAt(row, 0);
            try{
                if(JOptionPane.showConfirmDialog(null, MessageProperties.getMessage("confirm.delete"),"", JOptionPane.OK_CANCEL_OPTION)==0)
                {
                    groupMasterController.deleteGroup(Long.parseLong(o.toString()));
                    //System.out.println("GROUP MASTER");
                    JOptionPane.showMessageDialog(null, MessageProperties.getMessage("success.delete",new Object[]{"Group"}));
                    updateTable();
                }else{
                    updateTable();
                }
            }catch(IllegalArgumentException e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.aleardydeleted",new Object[]{"Group"}));
            }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.delete",new Object[]{"Group"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
            }catch(Exception e){
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.delete",new Object[]{"Group"}));
            }
            reset();
        }else{
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("notselected.delete"));
        }
        
    }//GEN-LAST:event_delete_ButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton activeradbutton;
    private javax.swing.JButton add_procedure_button;
    private javax.swing.JPanel add_procedure_panel;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel comments_Label1;
    private javax.swing.JButton delete_Button;
    private javax.swing.JButton edit_Button;
    private javax.swing.JButton first_bt;
    private javax.swing.JScrollPane group_ScrollPane;
    private javax.swing.JTextArea group_comment_text;
    private javax.swing.JLabel group_name_Label;
    private javax.swing.JTextField group_name_TextField;
    private javax.swing.JTextField group_synonyms_TextField;
    private javax.swing.JTable group_table;
    private javax.swing.JRadioButton inactiveradbutton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JButton last_bt;
    private javax.swing.JButton next_bt;
    private javax.swing.JComboBox pageSize_combo;
    private javax.swing.JLabel page_heading_Label;
    private javax.swing.JButton prev_bt;
    private javax.swing.JList procedureSelected_list;
    private javax.swing.JList procedureSource_list;
    private javax.swing.JTextField procedure_search_textfield;
    private javax.swing.JButton remove_procedure_button;
    private javax.swing.JButton reset_Button;
    private javax.swing.JButton save_Button;
    private javax.swing.JButton search_Button;
    private javax.swing.JLabel search_Label;
    private javax.swing.JTextField search_TextField;
    private javax.swing.JPanel search_panel;
    private javax.swing.JLabel status_Label;
    private javax.swing.JLabel synonyms_Label;
    // End of variables declaration//GEN-END:variables
    private TGroupMaster groupMaster;
    private GroupMasterController groupMasterController;
    private ProcedureMasterController procedureMasterController;
    
    private Vector<TProcedureMaster> procedureList = new Vector<TProcedureMaster>();
    
    /** The procedureSelectedList. */
    private List<TProcedureMaster> procedureSelectedList = new ArrayList<TProcedureMaster>();
    
    /** The procedure selected model. */
     DefaultListModel procedureselectedmodel = new DefaultListModel();
     
     /** The procedure source model. */
     DefaultListModel proceduresourcemodel = new DefaultListModel();
     
     private Vector<Vector<String>> groupData;
     
     private int pagesize;
     
     private int searchRecords;
     
     private int index;
     
     /** The sorter. */
     TableRowSorter<TableModel> sorter;
     
     /** The Header. */
     private Vector<String> Header;
     
    private void popalateData() {
        groupMaster = new TGroupMaster();
        procedureMasterController =(ProcedureMasterController)HealthcareLogin.context.getBean("procedureMasterController");
        groupMasterController =(GroupMasterController)HealthcareLogin.context.getBean("groupMasterController");
        Header = new Vector<String>();
        Header.add("Id");
        Header.add("Sl.No");
        Header.add("Name");
        Header.add("Synonyms");
        Header.add("Status");
    }
    
     private void searchMethod(){
        String expr = search_TextField.getText().toUpperCase();
        groupData=null;
        pagesize=Integer.parseInt(pageSize_combo.getSelectedItem().toString());
        
        try{
                searchRecords = groupMasterController.getNoOfGroupsRecord(expr);
                if(searchRecords>pagesize){
                    
                    prev_bt.setVisible(true);
                    next_bt.setVisible(true);
                    first_bt.setVisible(true);
                    last_bt.setVisible(true);
                    next_bt.setEnabled(true);
                    last_bt.setEnabled(true);
                }else{
                    next_bt.setVisible(false);
                    last_bt.setVisible(false);
                    first_bt.setVisible(false);
                    prev_bt.setVisible(false);
                }
                index=0;

                groupData = groupMasterController.getAllGroupDetails(expr,index,(index+pagesize));
                first_bt.setEnabled(false);
                prev_bt.setEnabled(false);
                
            if(groupData.isEmpty()){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("notfound"));
            }else{
                updateTable();
                sorter = new TableRowSorter<TableModel>();
                sorter = new TableRowSorter<TableModel>(group_table.getModel());
                group_table.setRowSorter(sorter);
                sorter.setRowFilter(RowFilter.regexFilter(expr));
                sorter.setSortKeys(null);
                group_ScrollPane.setVisible(true);
            }
            
        }catch(ProcessingException e){
            JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"procedure"}));
            throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }catch(Exception e){
            JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"procedure"}));
        }
    }
    
    private boolean validateProcedure() {
      boolean valid = true;
         if(group_name_TextField.getText()==null || group_name_TextField.getText().trim().length()==0){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("procedure.mandatory"));
            group_name_TextField.requestFocus();
            valid = false;
        }
        return valid;
    }

    private void updateTable() {
        group_table.setModel(new javax.swing.table.DefaultTableModel(groupData, Header));
        group_table.getColumnModel().getColumn(0).setPreferredWidth(0);
        group_table.getColumnModel().getColumn(0).setMinWidth(0);
        group_table.getColumnModel().getColumn(0).setMaxWidth(0);
        group_table.getColumnModel().getColumn(1).setPreferredWidth(95);
        group_table.getColumnModel().getColumn(1).setMaxWidth(105);
        sorter = new TableRowSorter<TableModel>();
        sorter = new TableRowSorter<TableModel>(group_table.getModel());
        group_table.setRowSorter(sorter);
    }
    
    private void reset() {
       
        procedure_search_textfield.setText("");
        group_name_TextField.setText(null);
        group_synonyms_TextField.setText(null);   
        search_TextField.setText(null);
        groupMaster=new TGroupMaster();
        group_ScrollPane.setVisible(false);
        first_bt.setVisible(false);
        next_bt.setVisible(false);
        prev_bt.setVisible(false);
        last_bt.setVisible(false);
        search_TextField.setText("");
        buttonGroup1.clearSelection();
    }
    
    private void clearProcedureSelection() {
        procedureSelectedList.clear();
        procedureList.clear();
        proceduresourcemodel = new DefaultListModel();
        procedureselectedmodel = new DefaultListModel();
        try{
              procedureList = procedureMasterController.getAllProcedure();
           }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"components"}));
           }
        
        for(TProcedureMaster procedure:procedureList){
            proceduresourcemodel.addElement(procedure);
        }
        procedureList.clear();
        proceduresourcemodel = new DefaultListModel();
        procedureSource_list.setModel(proceduresourcemodel);
        procedureSelected_list.setModel(procedureselectedmodel);
    }

    private void displayRowValues(long parseLong) {
        
        try{
           
            groupMaster = groupMasterController.getGroupValues(parseLong);
            procedureSelectedList.clear();
            procedureSelectedList = groupMasterController.getSelectedProcedureByGroup(groupMaster);
            if(groupMaster!=null){
            group_name_TextField.setText(groupMaster.getGroupName());
            group_synonyms_TextField.setText(groupMaster.getGroupSynonims());
                if(groupMaster.getGroupStatus().equalsIgnoreCase("ACTIVE")){
                    activeradbutton.setSelected(true);
                }else if(groupMaster.getGroupStatus().equalsIgnoreCase("INACTIVE")){
                    inactiveradbutton.setSelected(true);
                }
                procedureselectedmodel = new DefaultListModel();
                for(TProcedureMaster procedure:procedureSelectedList){
                procedureselectedmodel.addElement(procedure);
                }
                procedureSelected_list.setModel(procedureselectedmodel);
            }else{
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("notfound"));
            }
         }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"procedure"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
         }catch(Exception e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"procedure"}));
         }
    }
    
    private void displayProcedures(String expr){
       try{
                procedureList = procedureMasterController.getProcedureListBySearch(expr);
            }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"components"}));
            }
            proceduresourcemodel = new DefaultListModel();
            for(TProcedureMaster procedure:procedureList){
                proceduresourcemodel.addElement(procedure);
            }
            procedureSource_list.setModel(proceduresourcemodel);
    }
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaEMR/src/main/java/com/bestray/healthcareemr/Views/GroupPanel.java

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