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
/*
 * 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.DisabledGlassPane;
import com.bestray.healthcarecommonutil.vo.TDepartmentMaster;
import com.bestray.healthcareemr.Controller.AppointmentController;
import com.bestray.healthcareemr.Controller.DepartmentMasterController;
import com.bestray.healthcareemr.Controller.LabReceiptAmbulatoryController;
import com.bestray.healthcareemr.Util.MessageProperties;
import com.bestray.healthcareemr.reports.ConsultationFeeReport;
import com.bestray.healthcareemr.reports.DeptAppointmentReport;
import com.bestray.healthcareemr.reports.DrTripathyPatientReport;
import com.bestray.healthcareemr.reports.LabTestFeeReport;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author User1
 */
public class PatientSchedulingReportPanel extends javax.swing.JPanel {

    /**
     * Creates new form PatientSchedulingReportPanel
     */
    public PatientSchedulingReportPanel() {
        populate();
        initComponents();
        jToolBar2.setVisible(false);
        jScrollPane1.setVisible(false);
        jPanel1.setVisible(false);
        pdf_button.setVisible(false);
        viewbutton.setVisible(false);
    }

    /**
     * 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();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jToolBar1 = new javax.swing.JToolBar();
        consultationFee_button = new javax.swing.JToggleButton();
        DAR_button = new javax.swing.JToggleButton();
        labTestReport_toggelButton = new javax.swing.JToggleButton();
        back_button = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        detail_Datelb = new javax.swing.JLabel();
        datechooser = new com.toedter.calendar.JDateChooser();
        detail_monthlb = new javax.swing.JLabel();
        detail_monthchooser = new com.toedter.calendar.JMonthChooser();
        detail_month_year_chosser = new com.toedter.calendar.JYearChooser();
        detail_yearchooser = new com.toedter.calendar.JYearChooser();
        detail_yearlb = new javax.swing.JLabel();
        viewbutton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        dept_comboBox = new javax.swing.JComboBox();
        jToolBar2 = new javax.swing.JToolBar();
        jLabel1 = new javax.swing.JLabel();
        dailyReport_button = new javax.swing.JToggleButton();
        monthlyReport_button = new javax.swing.JToggleButton();
        yearlyReport_button = new javax.swing.JToggleButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        consultationFeeTable = 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;
            }

        };
        pdf_button = new javax.swing.JButton();
        total_consult_fee_label = new javax.swing.JLabel();
        total_consult_fee_tb = new javax.swing.JTextField();
        total_amount_label = new javax.swing.JLabel();
        total_amount_tb = new javax.swing.JTextField();
        total_paid_label = new javax.swing.JLabel();
        total_paid_tb = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));
        setOpaque(false);

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

        buttonGroup1.add(consultationFee_button);
        consultationFee_button.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        consultationFee_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/report24x24.png"))); // NOI18N
        consultationFee_button.setText("Consultation Fee Report");
        consultationFee_button.setFocusable(false);
        consultationFee_button.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        consultationFee_button.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        consultationFee_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        consultationFee_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultationFee_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(consultationFee_button);

        buttonGroup1.add(DAR_button);
        DAR_button.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        DAR_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/report24x24.png"))); // NOI18N
        DAR_button.setText("Department Appointment Report");
        DAR_button.setFocusable(false);
        DAR_button.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        DAR_button.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        DAR_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        DAR_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DAR_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(DAR_button);

        buttonGroup1.add(labTestReport_toggelButton);
        labTestReport_toggelButton.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        labTestReport_toggelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/report24x24.png"))); // NOI18N
        labTestReport_toggelButton.setText("Lab Test Report");
        labTestReport_toggelButton.setFocusable(false);
        labTestReport_toggelButton.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        labTestReport_toggelButton.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        labTestReport_toggelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                labTestReport_toggelButtonActionPerformed(evt);
            }
        });
        jToolBar1.add(labTestReport_toggelButton);

        back_button.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        back_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Button-Back-icon.png"))); // NOI18N
        back_button.setText("Back ");
        back_button.setFocusable(false);
        back_button.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        back_button.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        back_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        back_button.setOpaque(false);
        back_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                back_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(back_button);

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

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(102, 102, 102));
        jLabel4.setText("Parameters :");

        detail_Datelb.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        detail_Datelb.setText("Date :");
        detail_Datelb.setVisible(false);

        datechooser.setDate(new Date());
        datechooser.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        datechooser.setOpaque(false);
        datechooser.setVisible(false);

        detail_monthlb.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        detail_monthlb.setText("Month :");
        detail_monthlb.setVisible(false);

        detail_monthchooser.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        detail_monthchooser.setOpaque(false);
        detail_monthchooser.setVisible(false);

        detail_month_year_chosser.setVisible(false);
        detail_month_year_chosser.setOpaque(false);

        detail_yearchooser.setOpaque(false);
        detail_yearchooser.setVisible(false);

        detail_yearlb.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        detail_yearlb.setText("Year :");
        detail_yearlb.setVisible(false);

        viewbutton.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        viewbutton.setText("View");
        viewbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewbuttonActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel2.setText("Department :");

        dept_comboBox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        dept_comboBox.setModel(new javax.swing.DefaultComboBoxModel(departmentList));
        dept_comboBox.setSelectedIndex(-1);

        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(jLabel4)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(detail_Datelb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(datechooser, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(detail_monthlb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(detail_monthchooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(detail_month_year_chosser, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(detail_yearlb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(detail_yearchooser, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dept_comboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(viewbutton)))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(viewbutton)
                        .addComponent(jLabel2)
                        .addComponent(dept_comboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(datechooser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE)
                            .addComponent(detail_monthchooser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(detail_month_year_chosser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(detail_yearlb, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(detail_Datelb, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(detail_monthlb, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(detail_yearchooser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {datechooser, dept_comboBox, detail_month_year_chosser, detail_monthchooser, detail_yearchooser});

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

        jLabel1.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        jLabel1.setText("                             Report Name :   ");
        jToolBar2.add(jLabel1);

        dailyReport_button.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(dailyReport_button);
        dailyReport_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        dailyReport_button.setText("Daily Report");
        dailyReport_button.setFocusable(false);
        dailyReport_button.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        dailyReport_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        dailyReport_button.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        dailyReport_button.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                dailyReport_buttonItemStateChanged(evt);
            }
        });
        dailyReport_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dailyReport_buttonActionPerformed(evt);
            }
        });
        jToolBar2.add(dailyReport_button);

        monthlyReport_button.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(monthlyReport_button);
        monthlyReport_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        monthlyReport_button.setText("Monthly Report");
        monthlyReport_button.setFocusable(false);
        monthlyReport_button.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        monthlyReport_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        monthlyReport_button.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        monthlyReport_button.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                monthlyReport_buttonItemStateChanged(evt);
            }
        });
        monthlyReport_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                monthlyReport_buttonActionPerformed(evt);
            }
        });
        jToolBar2.add(monthlyReport_button);

        yearlyReport_button.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(yearlyReport_button);
        yearlyReport_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        yearlyReport_button.setText("Yearly Report");
        yearlyReport_button.setFocusable(false);
        yearlyReport_button.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        yearlyReport_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        yearlyReport_button.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        yearlyReport_button.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                yearlyReport_buttonItemStateChanged(evt);
            }
        });
        yearlyReport_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                yearlyReport_buttonActionPerformed(evt);
            }
        });
        jToolBar2.add(yearlyReport_button);

        jScrollPane1.setOpaque(false);

        consultationFeeTable.setModel(new javax.swing.table.DefaultTableModel(data,Header));
        consultationFeeTable.setOpaque(false);
        consultationFeeTable.setRowHeight(21);
        consultationFeeTable.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 11));
        consultationFeeTable.setBackground(new java.awt.Color(253, 251, 251));
        consultationFeeTable.setFont(new java.awt.Font("Tahoma", 0, 12));
        consultationFeeTable.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jScrollPane1.setViewportView(consultationFeeTable);

        pdf_button.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        pdf_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pdf-icon.png"))); // NOI18N
        pdf_button.setText("Save as PDF");
        pdf_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pdf_buttonActionPerformed(evt);
            }
        });

        total_consult_fee_label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
        total_consult_fee_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        total_consult_fee_label.setText("Total Consultation Fee (Rs.): ");
        total_consult_fee_label.setVisible(false);

        total_consult_fee_tb.setEditable(false);
        total_consult_fee_tb.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        total_consult_fee_tb.setOpaque(false);
        total_consult_fee_tb.setVisible(false);

        total_amount_label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
        total_amount_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        total_amount_label.setText("Total Amount (Rs.): ");
        total_amount_label.setVisible(false);

        total_amount_tb.setVisible(false);
        total_amount_tb.setEditable(false);
        total_amount_tb.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        total_amount_tb.setOpaque(false);

        total_paid_label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
        total_paid_label.setText("Total Paid Amount (Rs.): ");
        total_paid_label.setVisible(false);

        total_paid_tb.setVisible(false);
        total_paid_tb.setEditable(false);
        total_paid_tb.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        total_paid_tb.setOpaque(false);

        jButton1.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pdf-icon.png"))); // NOI18N
        jButton1.setText("Dr  P.L TRIPATHY");
        jButton1.setFocusable(false);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jButton1.setVisible(false);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(pdf_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(total_consult_fee_label, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(total_amount_label, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, 0)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(total_consult_fee_tb, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(total_amount_tb, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(total_paid_label)
                                .addGap(0, 0, 0)
                                .addComponent(total_paid_tb, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {total_amount_tb, total_consult_fee_tb, total_paid_tb});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pdf_button)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(total_amount_tb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(total_amount_label, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(total_paid_label)
                    .addComponent(total_paid_tb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(total_consult_fee_tb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(total_consult_fee_label, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18))
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {total_amount_label, total_amount_tb, total_consult_fee_label, total_consult_fee_tb, total_paid_label, total_paid_tb});

    }// </editor-fold>//GEN-END:initComponents

    private void dailyReport_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dailyReport_buttonActionPerformed
        /*if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }*/
        detail_Datelb.setVisible(true);
        datechooser.setVisible(true);
        detail_monthlb.setVisible(false);
        detail_monthchooser.setVisible(false);
        detail_yearlb.setVisible(false);
        detail_yearchooser.setVisible(false);
        detail_month_year_chosser.setVisible(false);
        jPanel1.setVisible(true);
        pdf_button.setVisible(true);
        
        if(datechooser.getDate()!=null){
            viewbutton.doClick();
        }
    }//GEN-LAST:event_dailyReport_buttonActionPerformed

    private void monthlyReport_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_monthlyReport_buttonActionPerformed
        
        /*if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }*/
        detail_monthlb.setVisible(true);
        detail_monthchooser.setVisible(true);
        detail_month_year_chosser.setVisible(true);
        detail_Datelb.setVisible(false);
        datechooser.setVisible(false);
        detail_yearlb.setVisible(false);
        detail_yearchooser.setVisible(false);
        jPanel1.setVisible(true);
        pdf_button.setVisible(true);
        
        if(detail_monthchooser.getMonth()!=0){
            viewbutton.doClick();
        }
    }//GEN-LAST:event_monthlyReport_buttonActionPerformed

    private void yearlyReport_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yearlyReport_buttonActionPerformed
        
        /*if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }*/
        detail_yearlb.setVisible(true);
        detail_yearchooser.setVisible(true);
        detail_Datelb.setVisible(false);
        datechooser.setVisible(false);
        detail_monthlb.setVisible(false);
        detail_monthchooser.setVisible(false);
        detail_month_year_chosser.setVisible(false);
        jPanel1.setVisible(true);
        pdf_button.setVisible(true);
        
        if(detail_yearchooser.getYear()!=0){
            viewbutton.doClick();
        }
    }//GEN-LAST:event_yearlyReport_buttonActionPerformed

    private void back_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_back_buttonActionPerformed
        PatientSchedulingPanel.display_panel.removeAll();
        PatientSchedulingPanel.display_panel.updateUI();
        PatientSchedulingPanel.display_panel.setBackground(Color.WHITE);
        PatientSchedulingPanel.display_panel.add(PatientSchedulingPanel.appointmentList_panel,java.awt.BorderLayout.CENTER);
        PatientSchedulingPanel.display_panel.setVisible(true);
    }//GEN-LAST:event_back_buttonActionPerformed

    private void DAR_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DAR_buttonActionPerformed
      
       jToolBar2.setVisible(true);
       jScrollPane1.setVisible(false);
       total_consult_fee_label.setVisible(true);
       total_consult_fee_tb.setVisible(true);
       viewbutton.setVisible(false);
       total_consult_fee_label.setVisible(false);
       total_consult_fee_tb.setVisible(false);
       total_paid_label.setVisible(false);
       total_paid_tb.setVisible(false);
       total_amount_tb.setVisible(false);
       total_amount_label.setVisible(false);
       jLabel2.setVisible(true);
       dept_comboBox.setVisible(true);
       
    }//GEN-LAST:event_DAR_buttonActionPerformed

    private String getMonthFullName(int monthNumber){
        String monthName="";
        if(monthNumber>=0 && monthNumber<12){
            try{
                Calendar calendar = Calendar.getInstance();
                calendar.set(Calendar.MONTH, monthNumber);

                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMMM");
                simpleDateFormat.setCalendar(calendar);
                monthName = simpleDateFormat.format(calendar.getTime());
            }catch (Exception e){}
        }
            return monthName;
    }
    
    private void pdf_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pdf_buttonActionPerformed
        String date = "null";
        String month = "null";
        String year = "null";
        String displayFormat = "";
        String departmentIds = "";
        if(dept_comboBox.getSelectedIndex()==-1){
            for(TDepartmentMaster dept:departmentList){
                departmentIds = departmentIds.concat(dept.getId().toString()+",");
            }
            departmentIds = departmentIds.substring(0,departmentIds.length()-1);
            
        }else{
            departmentIds = ((TDepartmentMaster)dept_comboBox.getSelectedItem()).getId().toString();
        }
        try{
            if(DAR_button.isSelected() || consultationFee_button.isSelected() || labTestReport_toggelButton.isSelected()){
                if(dailyReport_button.isSelected()){
                    if(datechooser.getDate()!=null){
                        date = sdf.format(datechooser.getDate());
                        displayFormat = "Date : "+sdf1.format(datechooser.getDate());
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Date");
                    }
                }else if(monthlyReport_button.isSelected()){
                    if(detail_monthchooser.getMonth()!=0){
                        //month = getMonthFullName(detail_monthchooser.getMonth());
                        int monthnum = detail_monthchooser.getMonth()+1;
                        int yearnum = detail_month_year_chosser.getYear();
                        if(monthnum < 10){
                            month = String.valueOf(yearnum)+"0"+monthnum;
                        }else{
                            month = String.valueOf(yearnum)+monthnum;
                        }
                        displayFormat = "Month : "+getMonthFullName(detail_monthchooser.getMonth())+" Of "+String.valueOf(yearnum);
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Month");
                    }
                }else if(yearlyReport_button.isSelected()){
                    if(detail_yearchooser.getYear()!=0){
                        year = String.valueOf(detail_yearchooser.getYear());
                        displayFormat = "Year : "+year;
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Year");
                    }
                }
                if(DAR_button.isSelected()){
                    DeptAppointmentReport darReport=new DeptAppointmentReport();
                    darReport.getPdfReport(date,month,year,displayFormat,departmentIds);
                    
                    int reply = JOptionPane.showConfirmDialog(null, "Do you want to open this file ?", " Department Appointment Report", JOptionPane.YES_NO_OPTION);
                    if (reply == JOptionPane.YES_OPTION){
                        darReport.openPdfReport();
                    }
                }else if(consultationFee_button.isSelected()){
                    ConsultationFeeReport feeReport=new ConsultationFeeReport();
                    feeReport.getPdfReport(date,month,year,displayFormat,departmentIds);
                    int reply = JOptionPane.showConfirmDialog(null, "Do you want to open this file ?", " Consultation Fee Report", JOptionPane.YES_NO_OPTION);
                    if (reply == JOptionPane.YES_OPTION){
                        feeReport.openPdfReport();
                    }
                }else if(labTestReport_toggelButton.isSelected()){
                    LabTestFeeReport labTestFeeReport=new LabTestFeeReport();
                    labTestFeeReport.getPdfReport(date,month,year,displayFormat);
                    System.out.println("Date :"+date);
                    System.out.println("Month :"+month);
                    System.out.println("Year :"+year);
                    System.out.println("Dipslay Format :"+displayFormat);
                    int reply = JOptionPane.showConfirmDialog(null, "Do you want to open this file ?", " Lab Test Fee Report", JOptionPane.YES_NO_OPTION);
                    if (reply == JOptionPane.YES_OPTION){
                        labTestFeeReport.openPdfReport();
                    }
                }
            }else{
                JOptionPane.showMessageDialog(null,"Choose The Report Type");
            }

        }//try
        catch(Exception e){
            String error=e.getMessage();
            JOptionPane.showMessageDialog(null, error+"\n So, Document can't be generated");
        }
    }//GEN-LAST:event_pdf_buttonActionPerformed

    private void consultationFee_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultationFee_buttonActionPerformed
        jToolBar2.setVisible(true);
        viewbutton.setVisible(true);
        jLabel2.setVisible(true);
        jButton1.setVisible(false);
        dept_comboBox.setVisible(true);
        if(dailyReport_button.isSelected() || monthlyReport_button.isSelected() || yearlyReport_button.isSelected() ){
            viewbutton.doClick();
        }
    }//GEN-LAST:event_consultationFee_buttonActionPerformed
    
    private void viewbuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewbuttonActionPerformed
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        rootPane.setGlassPane(glassPane);
        glassPane.activateLoadingImage();
        
        SwingWorker s = new SwingWorker() {

            @Override
            protected Object doInBackground() throws Exception {
                Double fee = 0d;
                try {
                    if(consultationFee_button.isSelected() || labTestReport_toggelButton.isSelected()){
                        Date date = null;
                        String month = "null";
                        int year = 0;
                        int monthyear = 0;
                        TDepartmentMaster dept = null;
                        if(dept_comboBox.getSelectedItem()!=null){
                            dept = departmentMasterController.getDepartmentValues(((TDepartmentMaster)dept_comboBox.getSelectedItem()).getId());
                        }
                        if(dailyReport_button.isSelected()){
                            if(datechooser.getDate()!=null){
                                date = datechooser.getDate();
                            }else{
                                JOptionPane.showMessageDialog(null,"Choose The Date");
                            }
                        }else if(monthlyReport_button.isSelected()){
                            if(detail_monthchooser.getMonth()>=0){
                                 month = getMonthFullName(detail_monthchooser.getMonth());
                                 monthyear = detail_month_year_chosser.getYear();
                            }else{
                                 JOptionPane.showMessageDialog(null,"Choose The Month");
                            }
                        }else if(yearlyReport_button.isSelected()){
                            if(detail_yearchooser.getYear()!=0){
                                 year = detail_yearchooser.getYear();
                            }else{
                                 JOptionPane.showMessageDialog(null,"Choose The Year");
                            }
                        }
                        jScrollPane1.setVisible(true);

                        if(consultationFee_button.isSelected()){
                            data = appointmentController.showAppointmentList(date, month,monthyear, year, dept);
                            consultationFeeTable.setModel(new javax.swing.table.DefaultTableModel(data,Header));
                            for(int row=0;row<consultationFeeTable.getRowCount();row++){
                                if(!consultationFeeTable.getValueAt(row, 5).toString().equalsIgnoreCase("")){
                                    fee+=Double.parseDouble(consultationFeeTable.getValueAt(row, 5).toString());
                                }
                            }
                            total_consult_fee_tb.setText(String.valueOf(fee));

                            total_paid_label.setVisible(false);
                            total_paid_tb.setVisible(false);
                            total_amount_tb.setVisible(false);
                            total_amount_label.setVisible(false);

                            total_consult_fee_label.setVisible(true);
                            total_consult_fee_tb.setVisible(true);
                            if(data.isEmpty()){
                                JOptionPane.showMessageDialog(null,"No Data Available");
                            }
                        }else if(labTestReport_toggelButton.isSelected()){
                            Date parsedDate = null;
                            if(date!=null){
                                parsedDate = sdf.parse(sdf.format(date));
                            }else{
                                parsedDate = null;
                            }
                            fee = 0d;
                            labReportdata = labReceiptController.showLabReceiptList(parsedDate, month,monthyear, year);
                            consultationFeeTable.setModel(new javax.swing.table.DefaultTableModel(labReportdata,labReportHeader));
                            for(int row=0;row<consultationFeeTable.getRowCount();row++){
                                if(!consultationFeeTable.getValueAt(row, 5).toString().equalsIgnoreCase("")){
                                    fee+=Double.parseDouble(consultationFeeTable.getValueAt(row, 4).toString());
                                }
                            }
                            total_amount_tb.setText(String.valueOf(fee));
                            fee=0d;
                            for(int row=0;row<consultationFeeTable.getRowCount();row++){
                                if(!consultationFeeTable.getValueAt(row, 6).toString().equalsIgnoreCase("")){
                                    fee+=Double.parseDouble(consultationFeeTable.getValueAt(row, 5).toString());
                                }
                            }
                            total_paid_tb.setText(String.valueOf(fee));

                            total_consult_fee_label.setVisible(false);
                            total_consult_fee_tb.setVisible(false);

                            total_paid_label.setVisible(true);
                            total_paid_tb.setVisible(true);
                            total_amount_tb.setVisible(true);
                            total_amount_label.setVisible(true);
                            if(labReportdata.isEmpty()){
                                JOptionPane.showMessageDialog(null,"No Data Available");
                            }
                        }
                    }

                }catch (ProcessingException ex) {
                    Logger.getLogger(PatientSchedulingReportPanel.class.getName()).log(Level.SEVERE, null, ex);
                }catch (Exception ex) {
                    Logger.getLogger(PatientSchedulingReportPanel.class.getName()).log(Level.SEVERE, null, ex);
                }
                return null;
            }

            @Override
            protected void done() {
                super.done();
                glassPane.deactivate();
            }
            
        };
        s.execute();
    }//GEN-LAST:event_viewbuttonActionPerformed

    private void labTestReport_toggelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_labTestReport_toggelButtonActionPerformed
        jToolBar2.setVisible(true);
        viewbutton.setVisible(true);
        jLabel2.setVisible(false);
        jButton1.setVisible(false);
        dept_comboBox.setVisible(false);
        if(dailyReport_button.isSelected() || monthlyReport_button.isSelected() || yearlyReport_button.isSelected() ){
            viewbutton.doClick();
        }
    }//GEN-LAST:event_labTestReport_toggelButtonActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        String date = "null";
        String month = "null";
        String year = "null";
        String displayFormat = "";
        String departmentIds = "";
        for(TDepartmentMaster dept:departmentList){
                departmentIds = departmentIds.concat(dept.getId().toString()+",");
            }
            departmentIds = departmentIds.substring(0,departmentIds.length()-1);
            
        
        try{
            if(DAR_button.isSelected()){
                if(dailyReport_button.isSelected()){
                    if(datechooser.getDate()!=null){
                        date = sdf.format(datechooser.getDate());
                        displayFormat = "Date : "+sdf1.format(datechooser.getDate());
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Date");
                    }
                }else if(monthlyReport_button.isSelected()){
                    if(detail_monthchooser.getMonth()!=0){
                        //month = getMonthFullName(detail_monthchooser.getMonth());
                        int monthnum = detail_monthchooser.getMonth()+1;
                        int yearnum = detail_month_year_chosser.getYear();
                        if(monthnum < 10){
                            month = String.valueOf(yearnum)+"0"+monthnum;
                        }else{
                            month = String.valueOf(yearnum)+monthnum;
                        }
                        displayFormat = "Month : "+getMonthFullName(detail_monthchooser.getMonth())+" Of "+String.valueOf(yearnum);
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Month");
                    }
                }else if(yearlyReport_button.isSelected()){
                    if(detail_yearchooser.getYear()!=0){
                        year = String.valueOf(detail_yearchooser.getYear());
                        displayFormat = "Year : "+year;
                    }else{
                        JOptionPane.showMessageDialog(null,"Choose The Year");
                    }
                }
                if(DAR_button.isSelected()){
                    DrTripathyPatientReport darReport=new DrTripathyPatientReport();
                    System.out.println(departmentIds);
                    System.out.println(date);
                    System.out.println(month);
                    System.out.println(year);
                    darReport.getPdfReport(date,month,year,displayFormat,departmentIds);
                    
                    int reply = JOptionPane.showConfirmDialog(null, "Do you want to open this file ?", " Department Appointment Report", JOptionPane.YES_NO_OPTION);
                    if (reply == JOptionPane.YES_OPTION){
                        darReport.openPdfReport();
                    }
                }
            }else{
                JOptionPane.showMessageDialog(null,"Choose The Report Type");
            }

        }//try
        catch(Exception e){
            String error=e.getMessage();
            JOptionPane.showMessageDialog(null, error+"\n So, Document can't be generated");
        }
         
    }//GEN-LAST:event_jButton1ActionPerformed

    private void dailyReport_buttonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_dailyReport_buttonItemStateChanged
        // TODO add your handling code here:
        if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }
    }//GEN-LAST:event_dailyReport_buttonItemStateChanged

    private void monthlyReport_buttonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_monthlyReport_buttonItemStateChanged
        // TODO add your handling code here:
        if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }
    }//GEN-LAST:event_monthlyReport_buttonItemStateChanged

    private void yearlyReport_buttonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_yearlyReport_buttonItemStateChanged
        // TODO add your handling code here:
        if(DAR_button.isSelected()){
            jButton1.setVisible(true);
        }
    }//GEN-LAST:event_yearlyReport_buttonItemStateChanged

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JToggleButton DAR_button;
    private javax.swing.JButton back_button;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JTable consultationFeeTable;
    private javax.swing.JToggleButton consultationFee_button;
    private javax.swing.JToggleButton dailyReport_button;
    private com.toedter.calendar.JDateChooser datechooser;
    private javax.swing.JComboBox dept_comboBox;
    private javax.swing.JLabel detail_Datelb;
    private com.toedter.calendar.JYearChooser detail_month_year_chosser;
    private com.toedter.calendar.JMonthChooser detail_monthchooser;
    private javax.swing.JLabel detail_monthlb;
    private com.toedter.calendar.JYearChooser detail_yearchooser;
    private javax.swing.JLabel detail_yearlb;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JToggleButton labTestReport_toggelButton;
    private javax.swing.JToggleButton monthlyReport_button;
    private javax.swing.JButton pdf_button;
    private javax.swing.JLabel total_amount_label;
    private javax.swing.JTextField total_amount_tb;
    private javax.swing.JLabel total_consult_fee_label;
    private javax.swing.JTextField total_consult_fee_tb;
    private javax.swing.JLabel total_paid_label;
    private javax.swing.JTextField total_paid_tb;
    private javax.swing.JButton viewbutton;
    private javax.swing.JToggleButton yearlyReport_button;
    // End of variables declaration//GEN-END:variables

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    private SimpleDateFormat sdf1 = new SimpleDateFormat("dd-MM-yyyy");
    private Vector<String> Header = new Vector<String>();
    private Vector<Vector<String>> data = new Vector<Vector<String>>();
    private Vector<String> labReportHeader = new Vector<String>();
    private Vector<Vector<String>> labReportdata = new Vector<Vector<String>>();
    private AppointmentController appointmentController;
    private LabReceiptAmbulatoryController labReceiptController;
    private DisabledGlassPane glassPane = new DisabledGlassPane();
    /** The department list. */
    private Vector<TDepartmentMaster> departmentList = new Vector<TDepartmentMaster>();
    /** The department master controller. */
    private DepartmentMasterController departmentMasterController;
    
    private void populate(){
        appointmentController = (AppointmentController)HealthcareLogin.context.getBean("appointmentController");
        labReceiptController=(LabReceiptAmbulatoryController)HealthcareLogin.context.getBean("labReceiptAmbulatoryController");
        departmentMasterController=(DepartmentMasterController)HealthcareLogin.context.getBean("departmentMasterController");
        Header.add("Date");
        Header.add("MRN");
        Header.add("Patient Name");
        Header.add("Doctor");
        Header.add("Patient Type");
        Header.add("Consultation Fee");
        labReportHeader.add("Date");
        labReportHeader.add("Receipt Number");
        labReportHeader.add("MRN");
        labReportHeader.add("Patient Name");
        labReportHeader.add("Total Amount");
        labReportHeader.add("Paid Amount");
        labReportHeader.add("Received By");
        try{
            departmentList = departmentMasterController.getDepartmentList();
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"department"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
         }
    }
}

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

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