Subversion Repository Public Repository

Aurocare_27_07_2018

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
/*
 * 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.ButtonType;
import com.bestray.healthcarecommonutil.util.CWTabbedPaneUI;
import com.bestray.healthcarecommonutil.util.CurvedGradientPanel;
import com.bestray.healthcarecommonutil.util.DisabledGlassPane;
import com.bestray.healthcarecommonutil.util.GlossyButton;
import com.bestray.healthcarecommonutil.util.Theme;
import com.bestray.healthcarecommonutil.vo.TPatient;
import com.bestray.healthcareemr.Controller.CodeValuesController;
import com.bestray.healthcareemr.Controller.PatientController;
import com.bestray.healthcareemr.Util.MessageProperties;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcareemr.Controller.AppointmentController;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

// TODO: Auto-generated Javadoc
/**
 * The Class PatientLookUpDialog.
 *
 * @author sumitHome
 */
public class PatientLookUpDialog extends javax.swing.JDialog {
    
    /**
     * Creates new form PatientLookUpDialog.
     *
     * @param parent the parent
     * @param modal the modal
     */
    public PatientLookUpDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        populate();
        initComponents();
    }
   
    /**
     * Instantiates a new patient look up dialog.
     *
     * @param parent the parent
     * @param modal the modal
     * @param tabName the tab name
     */
    public PatientLookUpDialog(java.awt.Frame parent, boolean modal, String tabName) {
        super(parent, modal);
        this.tabName = tabName;
        populate();
        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() {

        pat_search_tabpane = new javax.swing.JTabbedPane();
        search_tab = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        header_panel = new javax.swing.JPanel();
        patient_lookup_lable = new javax.swing.JLabel();
        name_search_panel = new CurvedGradientPanel();
        patient_fname_lable = new javax.swing.JLabel();
        fisrt_name_searchbox = new javax.swing.JTextField();
        patient_lname_lable = new javax.swing.JLabel();
        last_name_searchbox = new javax.swing.JTextField();
        patient_id_lable = new javax.swing.JLabel();
        patient_ID_searchbox = new javax.swing.JTextField();
        patient_id_lable1 = new javax.swing.JLabel();
        patient_id_lable3 = new javax.swing.JLabel();
        contactNumber_searchbox = new javax.swing.JTextField();
        patient_id_lable4 = new javax.swing.JLabel();
        patient_id_lable5 = new javax.swing.JLabel();
        drivingLicense_searchbox = new javax.swing.JTextField();
        patient_id_lable6 = new javax.swing.JLabel();
        passport_searchbox = new javax.swing.JTextField();
        patient_id_lable7 = new javax.swing.JLabel();
        voterId_searchbox = new javax.swing.JTextField();
        patient_id_lable8 = new javax.swing.JLabel();
        adharCard_searchbox = new javax.swing.JTextField();
        patient_id_lable9 = new javax.swing.JLabel();
        panCard_searchbox = new javax.swing.JTextField();
        birthDT_datepicker = new com.toedter.calendar.JDateChooser();
        gender_combobox = new javax.swing.JComboBox();
        button_panel = new javax.swing.JPanel();
        cancel_button = new GlossyButton("Cancel",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED);
        patient_search_button = new GlossyButton("Search",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED);
        complete_reg_button = new javax.swing.JButton();
        quick_reg_button = new javax.swing.JButton();
        reset_button = new GlossyButton("Reset",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED);
        recentPatient_tab = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        recentPatient_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;
            }

        };

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Patient Look Up");

        pat_search_tabpane.setUI(new CWTabbedPaneUI());
        pat_search_tabpane.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        pat_search_tabpane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                pat_search_tabpaneStateChanged(evt);
            }
        });

        search_tab.setLayout(new java.awt.BorderLayout());

        jPanel2.setBackground(new java.awt.Color(253, 251, 251));
        jPanel2.setPreferredSize(new java.awt.Dimension(1031, 456));

        header_panel.setBackground(new java.awt.Color(153, 204, 255));
        header_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        patient_lookup_lable.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        patient_lookup_lable.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/search_patient-icon32X32.png"))); // NOI18N
        patient_lookup_lable.setText("Patient Search");

        javax.swing.GroupLayout header_panelLayout = new javax.swing.GroupLayout(header_panel);
        header_panel.setLayout(header_panelLayout);
        header_panelLayout.setHorizontalGroup(
            header_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(header_panelLayout.createSequentialGroup()
                .addGap(1, 1, 1)
                .addComponent(patient_lookup_lable)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        header_panelLayout.setVerticalGroup(
            header_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, header_panelLayout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(patient_lookup_lable)
                .addGap(0, 0, 0))
        );

        name_search_panel.setBackground(new java.awt.Color(253, 251, 251));

        patient_fname_lable.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_fname_lable.setText("First Name :");

        fisrt_name_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        fisrt_name_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        fisrt_name_searchbox.setNextFocusableComponent(last_name_searchbox);
        fisrt_name_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_lname_lable.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_lname_lable.setText("Last Name :");

        last_name_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        last_name_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        last_name_searchbox.setNextFocusableComponent(gender_combobox);
        last_name_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable.setText("Patient ID :");

        patient_ID_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        patient_ID_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        patient_ID_searchbox.setNextFocusableComponent(birthDT_datepicker);
        patient_ID_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable1.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable1.setText("Patient DOB :");

        patient_id_lable3.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable3.setText("Gender :");

        contactNumber_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        contactNumber_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        contactNumber_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable4.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable4.setText("Patient Contact Number :");

        patient_id_lable5.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable5.setText("Driving License # :");

        drivingLicense_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        drivingLicense_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        drivingLicense_searchbox.setNextFocusableComponent(passport_searchbox);
        drivingLicense_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable6.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable6.setText("Passport # :");

        passport_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        passport_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        passport_searchbox.setNextFocusableComponent(voterId_searchbox);
        passport_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable7.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable7.setText("Voter - ID # :");

        voterId_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        voterId_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        voterId_searchbox.setNextFocusableComponent(adharCard_searchbox);
        voterId_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable8.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable8.setText("Adhar Card # :");

        adharCard_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        adharCard_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        adharCard_searchbox.setNextFocusableComponent(panCard_searchbox);
        adharCard_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        patient_id_lable9.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        patient_id_lable9.setText("Pan Card # :");

        panCard_searchbox.setBackground(new java.awt.Color(255, 243, 251));
        panCard_searchbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        panCard_searchbox.setNextFocusableComponent(contactNumber_searchbox);
        panCard_searchbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        birthDT_datepicker.setDateFormatString("dd-MM-yyyy");
        birthDT_datepicker.setBackground(new java.awt.Color(253, 251, 251));
        birthDT_datepicker.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthDT_datepicker.setNextFocusableComponent(fisrt_name_searchbox);
        birthDT_datepicker.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

        gender_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        gender_combobox.setModel(new javax.swing.DefaultComboBoxModel(genderList));
        gender_combobox.setNextFocusableComponent(drivingLicense_searchbox);
        gender_combobox.setSelectedIndex(-1);
        gender_combobox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                patient_ID_searchboxKeyPressed(evt);
            }
        });

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

        cancel_button.setBackground(java.awt.Color.white);
        cancel_button.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        cancel_button.setForeground(new java.awt.Color(68, 62, 173));
        cancel_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cancel24X24.png"))); // NOI18N
        cancel_button.setText("Cancel");
        cancel_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        cancel_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancel_buttonActionPerformed(evt);
            }
        });

        patient_search_button.setBackground(java.awt.Color.white);
        patient_search_button.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        patient_search_button.setForeground(new java.awt.Color(68, 62, 173));
        patient_search_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/search-icon24X24.png"))); // NOI18N
        patient_search_button.setText("Search");
        patient_search_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        patient_search_button.setPreferredSize(new java.awt.Dimension(89, 33));
        patient_search_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                patient_search_buttonActionPerformed(evt);
            }
        });

        complete_reg_button.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        complete_reg_button.setForeground(new java.awt.Color(68, 62, 173));
        complete_reg_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/user-patient-icon16X16.png"))); // NOI18N
        complete_reg_button.setText("Complete Registration");
        complete_reg_button.setContentAreaFilled(false);
        complete_reg_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        complete_reg_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                complete_reg_buttonActionPerformed(evt);
            }
        });

        quick_reg_button.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        quick_reg_button.setForeground(new java.awt.Color(68, 62, 173));
        quick_reg_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/quick-patient-add-icon16X16.png"))); // NOI18N
        quick_reg_button.setText("Quick Registration       ");
        quick_reg_button.setContentAreaFilled(false);
        quick_reg_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        quick_reg_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                quick_reg_buttonActionPerformed(evt);
            }
        });

        reset_button.setBackground(java.awt.Color.white);
        reset_button.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        reset_button.setForeground(new java.awt.Color(68, 62, 173));
        reset_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/resetField24X24.png"))); // NOI18N
        reset_button.setText("Reset");
        reset_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        reset_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reset_buttonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout button_panelLayout = new javax.swing.GroupLayout(button_panel);
        button_panel.setLayout(button_panelLayout);
        button_panelLayout.setHorizontalGroup(
            button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, button_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(complete_reg_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(quick_reg_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(273, 273, 273)
                .addComponent(reset_button, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(patient_search_button, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cancel_button, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
                .addContainerGap())
        );
        button_panelLayout.setVerticalGroup(
            button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(button_panelLayout.createSequentialGroup()
                .addGroup(button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(button_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(complete_reg_button)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(quick_reg_button))
                    .addGroup(button_panelLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cancel_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(button_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(patient_search_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(reset_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(14, 14, 14)))
                .addContainerGap())
        );

        javax.swing.GroupLayout name_search_panelLayout = new javax.swing.GroupLayout(name_search_panel);
        name_search_panel.setLayout(name_search_panelLayout);
        name_search_panelLayout.setHorizontalGroup(
            name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(name_search_panelLayout.createSequentialGroup()
                .addGap(75, 75, 75)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(patient_id_lable)
                    .addComponent(patient_id_lable1)
                    .addComponent(patient_fname_lable)
                    .addComponent(patient_lname_lable)
                    .addComponent(patient_id_lable3, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(patient_ID_searchbox, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)
                    .addComponent(fisrt_name_searchbox, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)
                    .addComponent(last_name_searchbox, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)
                    .addComponent(birthDT_datepicker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(gender_combobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 197, Short.MAX_VALUE)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(patient_id_lable4)
                    .addComponent(patient_id_lable6)
                    .addComponent(patient_id_lable7)
                    .addComponent(patient_id_lable8)
                    .addComponent(patient_id_lable9)
                    .addComponent(patient_id_lable5, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(4, 4, 4)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(drivingLicense_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(passport_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(voterId_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(adharCard_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panCard_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(contactNumber_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(75, 75, 75))
            .addGroup(name_search_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(button_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        name_search_panelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {birthDT_datepicker, patient_ID_searchbox});

        name_search_panelLayout.setVerticalGroup(
            name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(name_search_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_id_lable)
                    .addComponent(patient_ID_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(patient_id_lable5)
                    .addComponent(drivingLicense_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_id_lable6)
                    .addComponent(passport_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(patient_fname_lable)
                    .addComponent(fisrt_name_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(name_search_panelLayout.createSequentialGroup()
                        .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(patient_id_lable7)
                            .addComponent(voterId_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(last_name_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(patient_lname_lable))
                        .addGap(18, 18, 18)
                        .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(patient_id_lable8)
                            .addComponent(adharCard_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(patient_id_lable1)))
                    .addComponent(birthDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(patient_id_lable9)
                        .addComponent(gender_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(patient_id_lable3))
                    .addGroup(name_search_panelLayout.createSequentialGroup()
                        .addComponent(panCard_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(name_search_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(patient_id_lable4)
                            .addComponent(contactNumber_searchbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addComponent(button_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21))
        );

        name_search_panelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {birthDT_datepicker, patient_ID_searchbox});

        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(header_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(name_search_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(header_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(name_search_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        search_tab.add(jPanel2, java.awt.BorderLayout.CENTER);

        pat_search_tabpane.addTab("    Patient Search", new javax.swing.ImageIcon(getClass().getResource("/images/pat_search_24X24.png")), search_tab); // NOI18N

        recentPatient_table.setModel(new javax.swing.table.DefaultTableModel(recentPatientData,recentPatientHeader));
        recentPatient_table.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                recentPatient_tableMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(recentPatient_table);

        javax.swing.GroupLayout recentPatient_tabLayout = new javax.swing.GroupLayout(recentPatient_tab);
        recentPatient_tab.setLayout(recentPatient_tabLayout);
        recentPatient_tabLayout.setHorizontalGroup(
            recentPatient_tabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, recentPatient_tabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 931, Short.MAX_VALUE)
                .addContainerGap())
        );
        recentPatient_tabLayout.setVerticalGroup(
            recentPatient_tabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, recentPatient_tabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
                .addContainerGap())
        );

        pat_search_tabpane.addTab("    Recent Patients", new javax.swing.ImageIcon(getClass().getResource("/images/recent_pat_24X24.png")), recentPatient_tab); // NOI18N

        getContentPane().add(pat_search_tabpane, java.awt.BorderLayout.CENTER);
        pat_search_tabpane.setSelectedIndex(0);

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

    /**
     * Patient_search_button action performed.
     *
     * @param evt the evt
     */
    private void patient_search_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_patient_search_buttonActionPerformed
         try{
            int numOfSearchCriteria=0;
            Map<String,Object> searchCriteria=new HashMap<String,Object>();
            String expr = null;
            if(!(patient_ID_searchbox.getText().trim().length() == 0)){
                expr = patient_ID_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_id",expr);
                numOfSearchCriteria++;
            }
            if(birthDT_datepicker.getDate()!= null){
                searchCriteria.put("birth_date",birthDT_datepicker.getDate());
                numOfSearchCriteria++;
            }
            if(!(fisrt_name_searchbox.getText().trim().length() == 0)){
                expr = fisrt_name_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_f_name",expr);
                numOfSearchCriteria++;
            }/*
            if(!(middle_name_searchbox.getText().trim().length() == 0)){
                expr = middle_name_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_m_name",expr);
                numOfSearchCriteria++;
            }*/
            if(!(last_name_searchbox.getText().trim().length() == 0)){
                expr = last_name_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_l_name",expr);
                numOfSearchCriteria++;
            }
            if(!(contactNumber_searchbox.getText().trim().length() == 0)){
                expr = contactNumber_searchbox.getText().toUpperCase();
                searchCriteria.put("patientContact",expr);
                numOfSearchCriteria++;
            }
            if(!(drivingLicense_searchbox.getText().trim().length() == 0)){
                expr = drivingLicense_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_drivinglicense_details",expr);
                numOfSearchCriteria++;
            }
            if(!(passport_searchbox.getText().trim().length() == 0)){
                expr = passport_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_passport_details",expr);
                numOfSearchCriteria++;
            }
            if(!(voterId_searchbox.getText().trim().length() == 0)){
                expr = voterId_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_votercard_details",expr);
                numOfSearchCriteria++;
            }
            if(!(adharCard_searchbox.getText().trim().length() == 0)){
                expr = adharCard_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_adharcard_details",expr);
                numOfSearchCriteria++;
            }
            if(!(panCard_searchbox.getText().trim().length() == 0)){
                expr = panCard_searchbox.getText().toUpperCase();
                searchCriteria.put("patient_pancard_details",expr);
                numOfSearchCriteria++;
            }
            if(gender_combobox.getSelectedItem()!=null){
                expr = String.valueOf(gender_combobox.getSelectedItem());
                searchCriteria.put("patient_gender",expr);
                numOfSearchCriteria++;
            }
            if(numOfSearchCriteria==0){
                patientData = patientController.getAllPatientrecords();
            }else{
                patientData = patientController.getPatientWise(searchCriteria);
            }

            if(patientData == null || patientData.isEmpty()){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("notfound"));
                //clearSearchFields();
            }else{
                DisabledGlassPane glassPane = new DisabledGlassPane();
                JRootPane rootPane = SwingUtilities.getRootPane(this);
                rootPane.setGlassPane(glassPane);
                PatientRecordDialog searchDialoge = new PatientRecordDialog(MainAPP, true, patientData, screenName, tabName);
                dispose();
                searchDialoge.setResizable(false);
                searchDialoge.setLocationRelativeTo(null);
                glassPane.activate("");
                searchDialoge.setVisible(true);
                searchDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                clearSearchFields();
                patientData.clear();
                glassPane.deactivate();
            }
        }catch(ProcessingException e){
            JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"patient"}));
            throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }catch(Exception e){
            JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"patient"}));
        }
    }//GEN-LAST:event_patient_search_buttonActionPerformed

    /**
     * Cancel_button action performed.
     *
     * @param evt the evt
     */
    private void cancel_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_buttonActionPerformed
        dispose();
    }//GEN-LAST:event_cancel_buttonActionPerformed

    /**
     * Complete_reg_button action performed.
     *
     * @param evt the evt
     */
    private void complete_reg_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_complete_reg_buttonActionPerformed
        DisabledGlassPane glassPane = new DisabledGlassPane();
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        rootPane.setGlassPane(glassPane);
        PatienRecordUpdateDialog fullRegistrationDialoge = new PatienRecordUpdateDialog(MainAPP, true);
        dispose();
        fullRegistrationDialoge.setResizable(false);
        fullRegistrationDialoge.setLocationRelativeTo(null);
        glassPane.activate("");
        fullRegistrationDialoge.setVisible(true);
        fullRegistrationDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        clearSearchFields();
        patientData.clear();
        glassPane.deactivate();
    }//GEN-LAST:event_complete_reg_buttonActionPerformed

    /**
     * Quick_reg_button action performed.
     *
     * @param evt the evt
     */
    private void quick_reg_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quick_reg_buttonActionPerformed
        DisabledGlassPane glassPane = new DisabledGlassPane();
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        rootPane.setGlassPane(glassPane);
        QuickPatientRegistrationDialog quickRegistrationDialoge = new QuickPatientRegistrationDialog(MainAPP, true);
        dispose();
        quickRegistrationDialoge.setResizable(false);
        quickRegistrationDialoge.setLocationRelativeTo(null);
        glassPane.activate("");
        quickRegistrationDialoge.setVisible(true);
        quickRegistrationDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        clearSearchFields();
        patientData.clear();
        glassPane.deactivate();
    }//GEN-LAST:event_quick_reg_buttonActionPerformed

    /**
     * Reset_button action performed.
     *
     * @param evt the evt
     */
    private void reset_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reset_buttonActionPerformed
        clearSearchFields();
    }//GEN-LAST:event_reset_buttonActionPerformed

    private void patient_ID_searchboxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_patient_ID_searchboxKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            patient_search_button.doClick();
        }
    }//GEN-LAST:event_patient_ID_searchboxKeyPressed

    private void pat_search_tabpaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pat_search_tabpaneStateChanged
        if(pat_search_tabpane.getSelectedIndex()==1){
            try{
                recentPatientData = patientController.getAllRecentPatientrecords();
                recentPatient_table.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 11));
                recentPatient_table.setBackground(new java.awt.Color(253, 251, 251));
                recentPatient_table.setFont(new java.awt.Font("Tahoma", 0, 12)); 
                recentPatient_table.setModel(new DefaultTableModel(recentPatientData,recentPatientHeader));
                recentPatient_table.getColumnModel().getColumn(0).setMinWidth(0);
                recentPatient_table.getColumnModel().getColumn(0).setPreferredWidth(0);
                recentPatient_table.getColumnModel().getColumn(0).setMaxWidth(0);
                recentPatient_table.setRowHeight(25);
                recentPatient_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                
            }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"recent patient"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
            }catch(Exception e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"recent patient"}));
            }
        }
    }//GEN-LAST:event_pat_search_tabpaneStateChanged

    private void recentPatient_tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_recentPatient_tableMouseClicked
        try{
        if (evt.getClickCount() == 2) {
            if(tabName.equalsIgnoreCase("Walk In")){
                int row = recentPatient_table.getSelectedRow();
                patient = patientController.getPatientByPatientId(String.valueOf(recentPatient_table.getValueAt(row, 1)));
                DisabledGlassPane glassPane = new DisabledGlassPane();
                JRootPane rootPane = SwingUtilities.getRootPane(this);
                rootPane.setGlassPane(glassPane);
                AppointmentDialog appointmentDialoge = new AppointmentDialog(MainAPP, true, patient);
                dispose();
                appointmentDialoge.setResizable(false);
                appointmentDialoge.setLocationRelativeTo(null);
                glassPane.activate("");
                appointmentDialoge.setVisible(true);
                appointmentDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                glassPane.deactivate();
            }else if(tabName.equalsIgnoreCase("Make Appointment")){
                int row = recentPatient_table.getSelectedRow();
                patient = patientController.getPatientByPatientId(String.valueOf(recentPatient_table.getValueAt(row, 1)));
                DisabledGlassPane glassPane = new DisabledGlassPane();
                JRootPane rootPane = SwingUtilities.getRootPane(this);
                rootPane.setGlassPane(glassPane);
                AppointmentDialog appointmentDialoge = new AppointmentDialog(MainAPP, true, patient);
                dispose();
                appointmentDialoge.setResizable(false);
                appointmentDialoge.setLocationRelativeTo(null);
                glassPane.activate("");
                appointmentDialoge.setVisible(true);
                appointmentDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                glassPane.deactivate();
            }else if(tabName.equalsIgnoreCase("Search Appointment")){
                int row = recentPatient_table.getSelectedRow();
                patient = patientController.getPatientByPatientId(String.valueOf(recentPatient_table.getValueAt(row, 1)));
                Vector<Vector<String>> appointmentData = new Vector<Vector<String>>();
                appointmentData = appointmentController.getAppointmentListByPatient(patient);
                if(appointmentData == null || appointmentData.isEmpty()){
                    JOptionPane.showMessageDialog(null,"No appoinments found for this patient.");
                   }else{
                DisabledGlassPane glassPane = new DisabledGlassPane();
                JRootPane rootPane = SwingUtilities.getRootPane(this);
                rootPane.setGlassPane(glassPane);
                AppointmentsearchDialoge appointmentSearchDialoge = new AppointmentsearchDialoge(MainAPP, true, patient, appointmentData, tabName);
                dispose();
                appointmentSearchDialoge.setResizable(false);
                appointmentSearchDialoge.setLocationRelativeTo(null);
                glassPane.activate("");
                appointmentSearchDialoge.setVisible(true);
                appointmentSearchDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                glassPane.deactivate();
             }
            }
         }
        }catch(ProcessingException e){
            JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"patient"}));
            throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, "select a patient record");
        }               
    }//GEN-LAST:event_recentPatient_tableMouseClicked

    /*
    public static void main(String args[]) {
         
        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(PatientLookUpDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PatientLookUpDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PatientLookUpDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PatientLookUpDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                PatientLookUpDialog dialog = new PatientLookUpDialog(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.JTextField adharCard_searchbox;
    private com.toedter.calendar.JDateChooser birthDT_datepicker;
    private javax.swing.JPanel button_panel;
    private javax.swing.JButton cancel_button;
    private javax.swing.JButton complete_reg_button;
    private javax.swing.JTextField contactNumber_searchbox;
    private javax.swing.JTextField drivingLicense_searchbox;
    private javax.swing.JTextField fisrt_name_searchbox;
    private javax.swing.JComboBox gender_combobox;
    private javax.swing.JPanel header_panel;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField last_name_searchbox;
    private javax.swing.JPanel name_search_panel;
    private javax.swing.JTextField panCard_searchbox;
    private javax.swing.JTextField passport_searchbox;
    private javax.swing.JTabbedPane pat_search_tabpane;
    private javax.swing.JTextField patient_ID_searchbox;
    private javax.swing.JLabel patient_fname_lable;
    private javax.swing.JLabel patient_id_lable;
    private javax.swing.JLabel patient_id_lable1;
    private javax.swing.JLabel patient_id_lable3;
    private javax.swing.JLabel patient_id_lable4;
    private javax.swing.JLabel patient_id_lable5;
    private javax.swing.JLabel patient_id_lable6;
    private javax.swing.JLabel patient_id_lable7;
    private javax.swing.JLabel patient_id_lable8;
    private javax.swing.JLabel patient_id_lable9;
    private javax.swing.JLabel patient_lname_lable;
    private javax.swing.JLabel patient_lookup_lable;
    private javax.swing.JButton patient_search_button;
    private javax.swing.JButton quick_reg_button;
    private javax.swing.JPanel recentPatient_tab;
    private javax.swing.JTable recentPatient_table;
    private javax.swing.JButton reset_button;
    private javax.swing.JPanel search_tab;
    private javax.swing.JTextField voterId_searchbox;
    // End of variables declaration//GEN-END:variables
    /** The patient data. */
    private Vector<Vector<String>> patientData = new Vector<Vector<String>>();
    
    /** The patient data. */
    private Vector<Vector<String>> recentPatientData = new Vector<Vector<String>>();
    
    /** The patient header. */
    private Vector<String> patientHeader;
    
    /** The recent patient header. */
    private Vector<String> recentPatientHeader;
    
    /** The patient. */
    private TPatient patient;
    
    /** The patient controller. */
    private PatientController patientController;
    
    /** The code values controller. */
    private CodeValuesController codeValuesController;
    
    /** The gender list. */
    private Vector<TCCodeValues> genderList = new Vector<TCCodeValues>();
    
    /** The sorter. */
    TableRowSorter<TableModel> sorter;
    
    /** The Main app. */
    private javax.swing.JFrame MainAPP;
    
    /** The screen name. */
    private String screenName = "Lookup Dialog";
    
    /** The tab name. */
    private String tabName;
    
    private AppointmentController appointmentController;
    
    
    /**
     * Populate.
     */
    private void populate(){
        patientController = (PatientController)HealthcareLogin.context.getBean("patientController");
        codeValuesController = (CodeValuesController)HealthcareLogin.context.getBean("codeValuesController");
        appointmentController = (AppointmentController)HealthcareLogin.context.getBean("appointmentController");
        patient = new TPatient();
        try{
                genderList = codeValuesController.getCodeValues("gender");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"gender"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }
        patientHeader = new Vector<String>();
        patientHeader.add("Id");
        patientHeader.add("Patient Id");
        patientHeader.add("Patient Name");
        patientHeader.add("Gender");
        patientHeader.add("Contact Number");
        patientHeader.add("Emergency Number");
        
        recentPatientHeader = new Vector<String>();
        recentPatientHeader.add("Id");
        recentPatientHeader.add("Patient Id");
        recentPatientHeader.add("Patient Name");
        recentPatientHeader.add("Gender");
        recentPatientHeader.add("Date of Birth");
        recentPatientHeader.add("OP/IP Status");
        recentPatientHeader.add("Home Number");
        recentPatientHeader.add("Mobile Number");
        recentPatientHeader.add("Emergency Number");
        recentPatientHeader.add("Present Address");
        
    }

    /**
     * Clear search fields.
     */
    private void clearSearchFields() {
        fisrt_name_searchbox.setText("");
        //middle_name_searchbox.setText("");
        last_name_searchbox.setText("");
        patient_ID_searchbox.setText("");
        birthDT_datepicker.setDate(null);
        contactNumber_searchbox.setText("");
        passport_searchbox.setText("");
        adharCard_searchbox.setText("");
        panCard_searchbox.setText("");
        drivingLicense_searchbox.setText("");
        gender_combobox.setSelectedIndex(-1);
        voterId_searchbox.setText("");
    }
    

}

Commits for Aurocare_27_07_2018/AuroCareEMR/src/main/java/com/bestray/healthcareemr/Views/PatientLookUpDialog.java

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