Subversion Repository Public Repository

Satyam

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
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
990
991
992
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareinpatient.view;

import com.bestray.healthcarecommonutil.exception.HealthCareException;
import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.util.DisabledGlassPane;
import com.bestray.healthcarecommonutil.util.SimpleGradientPanel;
import com.bestray.healthcarecommonutil.util.StandardButton;
import com.bestray.healthcarecommonutil.vo.TBedMaster;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcarecommonutil.vo.TDepartmentMaster;
import com.bestray.healthcarecommonutil.vo.TDoctorInformation;
import com.bestray.healthcarecommonutil.vo.TInpatentAdmission;
import com.bestray.healthcarecommonutil.vo.TPatient;
import com.bestray.healthcarecommonutil.vo.TPatientEncounter;
import com.bestray.healthcarecommonutil.vo.TRoomMaster;
import com.bestray.healthcareinpatient.controller.InPatientAdmissionController;
import com.bestray.healthcareinpatient.controller.InPatientCodeValuesController;
import com.bestray.healthcareinpatient.controller.InPatientRoundingController;
import com.bestray.healthcareinpatient.controller.InPatientTransferController;
import com.bestray.healthcareinpatient.util.CollectionUtill;
import com.bestray.healthcareinpatient.util.MessageProperties;
import java.awt.Color;
import java.text.SimpleDateFormat;
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 org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;

/**
 *
 * @author User1
 */
public class InPatient_Transfer_Panel extends SimpleGradientPanel {

    /**
     * Creates new form InPatient_Transfer_Panel
     */
    public InPatient_Transfer_Panel() {
        populateData();
        initComponents();
    }
    
    public InPatient_Transfer_Panel(TInpatentAdmission inpatentAdmission) {
        populateData();
        initComponents();
        showPreviousAdmissionDetails(inpatentAdmission);
        showPatientInfo(inpatentAdmission.getPatientId());
        startAdmissionProcess();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new SimpleGradientPanel(Color.LIGHT_GRAY, Color.WHITE);
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        patid_label = new javax.swing.JLabel();
        patName_label = new javax.swing.JLabel();
        patDOB_label = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        patGender_label = new javax.swing.JLabel();
        jToolBar1 = new javax.swing.JToolBar();
        admission_patient_search_button = new javax.swing.JButton();
        patient_reset_button = new javax.swing.JButton();
        patient_detail_button = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        days_label = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        admittedUser_textbox = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        preInPatId_textbox = new javax.swing.JTextField();
        admissionDate_textBox = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        admittedDept_textbox = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        admittedDoctor_textBox = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        admittedRoomType_textbox = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        admittedRoom_textBox = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        admittedBed_textBox = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        transferingUser_textfield = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        transferingDepartment_combobox = new javax.swing.JComboBox();
        jLabel21 = new javax.swing.JLabel();
        transferingRoomType_combox = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        transferingRoom_combobox = new javax.swing.JComboBox();
        jLabel20 = new javax.swing.JLabel();
        transferingBed_textbox = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        toDoctor_combobox = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        transferReason_textArea = new javax.swing.JTextArea();
        bed_search_button = new javax.swing.JButton();
        reset_button = new StandardButton("Reset");
        save_button = new StandardButton("Save");
        transferType_combobox = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        transferd_DateChooser = new com.toedter.calendar.JDateChooser();

        setOpaque(false);

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jPanel2.setOpaque(false);

        jLabel2.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        jLabel2.setText("MRN #");

        jLabel3.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        jLabel3.setText("Patient Name :");

        jLabel5.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        jLabel5.setText("DOB :");

        patid_label.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        patid_label.setForeground(new java.awt.Color(255, 0, 0));

        patName_label.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N
        patName_label.setForeground(new java.awt.Color(0, 102, 255));

        patDOB_label.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        patDOB_label.setForeground(new java.awt.Color(0, 102, 255));

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(67, 45, 247));
        jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Patients-icon 24X24.png"))); // NOI18N
        jLabel8.setText("Patient Details");

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

        patGender_label.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        patGender_label.setForeground(new java.awt.Color(0, 102, 255));

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jToolBar1.setOpaque(false);

        admission_patient_search_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        admission_patient_search_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/search-icon16X16.png"))); // NOI18N
        admission_patient_search_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        admission_patient_search_button.setOpaque(false);
        admission_patient_search_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                admission_patient_search_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(admission_patient_search_button);

        patient_reset_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        patient_reset_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/refresh 16x16.png"))); // NOI18N
        patient_reset_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        patient_reset_button.setOpaque(false);
        patient_reset_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                patient_reset_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(patient_reset_button);

        patient_detail_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        patient_detail_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/patient Info 16.png"))); // NOI18N
        patient_detail_button.setMargin(new java.awt.Insets(2, 20, 2, 20));
        patient_detail_button.setOpaque(false);
        patient_detail_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                patient_detail_buttonActionPerformed(evt);
            }
        });
        jToolBar1.add(patient_detail_button);

        jLabel7.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        jLabel7.setText("Days :");

        days_label.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        days_label.setForeground(new java.awt.Color(0, 102, 255));

        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)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patid_label, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patName_label, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patDOB_label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel8))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patGender_label, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(days_label, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(patid_label, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(patName_label))
                        .addComponent(patDOB_label, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING))
                    .addComponent(patGender_label, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(days_label, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7))
                .addContainerGap())
        );

        jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel8, jToolBar1});

        jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {days_label, jLabel2, jLabel3, jLabel5, jLabel6, jLabel7, patDOB_label, patGender_label, patName_label, patid_label});

        jPanel1.setOpaque(false);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tranfering From", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 1, 11), java.awt.Color.blue)); // NOI18N
        jPanel3.setOpaque(false);

        jLabel13.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel13.setText("Admiting User :");

        admittedUser_textbox.setEditable(false);
        admittedUser_textbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedUser_textbox.setOpaque(false);

        jLabel25.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel25.setText("In Patient # ");

        jLabel26.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel26.setText("Admission Date :");

        preInPatId_textbox.setEditable(false);
        preInPatId_textbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        preInPatId_textbox.setOpaque(false);

        admissionDate_textBox.setEditable(false);
        admissionDate_textBox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admissionDate_textBox.setOpaque(false);

        jLabel27.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel27.setText("From Department :");

        admittedDept_textbox.setEditable(false);
        admittedDept_textbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedDept_textbox.setOpaque(false);

        jLabel28.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel28.setText("Doctor :");

        admittedDoctor_textBox.setEditable(false);
        admittedDoctor_textBox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedDoctor_textBox.setOpaque(false);

        jLabel29.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel29.setText("From Room Type :");

        admittedRoomType_textbox.setEditable(false);
        admittedRoomType_textbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedRoomType_textbox.setOpaque(false);

        jLabel15.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel15.setText("From Room :");

        admittedRoom_textBox.setEditable(false);
        admittedRoom_textBox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedRoom_textBox.setOpaque(false);

        jLabel16.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel16.setText("From Bed :");

        admittedBed_textBox.setEditable(false);
        admittedBed_textBox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        admittedBed_textBox.setOpaque(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26)
                    .addComponent(jLabel13)
                    .addComponent(jLabel25)
                    .addComponent(jLabel27)
                    .addComponent(jLabel28)
                    .addComponent(jLabel29)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(admissionDate_textBox, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)
                    .addComponent(admittedUser_textbox)
                    .addComponent(admittedDept_textbox)
                    .addComponent(admittedDoctor_textBox)
                    .addComponent(admittedRoomType_textbox)
                    .addComponent(admittedRoom_textBox)
                    .addComponent(admittedBed_textBox)
                    .addComponent(preInPatId_textbox))
                .addGap(25, 25, 25))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(preInPatId_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(admissionDate_textBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(admittedUser_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(admittedDept_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(admittedDoctor_textBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(admittedRoomType_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(admittedRoom_textBox, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(admittedBed_textBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5))
        );

        jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {admissionDate_textBox, admittedBed_textBox, admittedDept_textbox, admittedDoctor_textBox, admittedRoomType_textbox, admittedRoom_textBox, admittedUser_textbox, jLabel13, jLabel15, jLabel16, jLabel25, jLabel26, jLabel27, jLabel28, jLabel29, preInPatId_textbox});

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Transfering To", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 1, 11), java.awt.Color.blue)); // NOI18N
        jPanel4.setOpaque(false);

        jLabel17.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel17.setText("Transfering User :");

        transferingUser_textfield.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N

        jLabel18.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel18.setText("To Department :");

        transferingDepartment_combobox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        transferingDepartment_combobox.setModel(new javax.swing.DefaultComboBoxModel(departmentList));
        transferingDepartment_combobox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                transferingDepartment_comboboxItemStateChanged(evt);
            }
        });
        transferingDepartment_combobox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                transferingDepartment_comboboxActionPerformed(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel21.setText("Room Type :");

        transferingRoomType_combox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        transferingRoomType_combox.setModel(new javax.swing.DefaultComboBoxModel(admissionRoomTypeList));
        transferingRoomType_combox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                transferingRoomType_comboxItemStateChanged(evt);
            }
        });
        transferingRoomType_combox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                transferingRoomType_comboxActionPerformed(evt);
            }
        });

        jLabel19.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel19.setText("To Room :");

        transferingRoom_combobox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        transferingRoom_combobox.setModel(new javax.swing.DefaultComboBoxModel(admissionRoomList));

        jLabel20.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel20.setText("To Bed :");

        transferingBed_textbox.setEditable(false);
        transferingBed_textbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N

        jLabel10.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel10.setText("Transfer Date :");

        jLabel23.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel23.setText("Doctor :");

        toDoctor_combobox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        toDoctor_combobox.setModel(new javax.swing.DefaultComboBoxModel(doctorList));

        jLabel24.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel24.setText("Transfer Reason :");

        transferReason_textArea.setColumns(20);
        transferReason_textArea.setRows(5);
        jScrollPane1.setViewportView(transferReason_textArea);

        bed_search_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/search-icon16X16.png"))); // NOI18N
        bed_search_button.setContentAreaFilled(false);
        bed_search_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bed_search_buttonActionPerformed(evt);
            }
        });

        reset_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        reset_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/refresh 16x16.png"))); // NOI18N
        reset_button.setText("Reset");
        reset_button.setOpaque(false);

        save_button.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N
        save_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Save-icon 16X16.png"))); // NOI18N
        save_button.setText("Save");
        save_button.setOpaque(false);
        save_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                save_buttonActionPerformed(evt);
            }
        });

        transferType_combobox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        transferType_combobox.setModel(new javax.swing.DefaultComboBoxModel(admissionTypeList));

        jLabel22.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jLabel22.setText("Transfer Type :");

        transferd_DateChooser.setDateFormatString("dd/MM/yyyy");
        transferd_DateChooser.setDate(new Date());

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addComponent(reset_button)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(save_button)
                        .addContainerGap())
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel21)
                                    .addComponent(jLabel23)
                                    .addComponent(jLabel18)
                                    .addComponent(jLabel17)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel22))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(transferingUser_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(transferingDepartment_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(toDoctor_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(transferingRoomType_combox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(transferingRoom_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(transferingBed_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(0, 0, 0)
                                        .addComponent(bed_search_button, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(transferType_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(transferd_DateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(25, 25, 25))))
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {transferType_combobox, transferingDepartment_combobox});

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel18, jLabel22});

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {transferd_DateChooser, transferingUser_textfield});

        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(transferd_DateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(transferingUser_textfield, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(transferType_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addGap(5, 5, 5)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(transferingDepartment_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(toDoctor_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(transferingRoomType_combox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(transferingRoom_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel20)
                        .addComponent(transferingBed_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(bed_search_button))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel24)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(save_button)
                            .addComponent(reset_button))))
                .addContainerGap())
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel10, jLabel17, jLabel18, jLabel19, jLabel20, jLabel21, jLabel22, jLabel23, toDoctor_combobox, transferType_combobox, transferd_DateChooser, transferingBed_textbox, transferingDepartment_combobox, transferingRoomType_combox, transferingRoom_combobox, transferingUser_textfield});

        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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(70, 70, 70)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void admission_patient_search_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_admission_patient_search_buttonActionPerformed
        DisabledGlassPane glassPane = new DisabledGlassPane();
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        rootPane.setGlassPane(glassPane);
        PatientLookUpDialog lookUpDialoge = new PatientLookUpDialog(MainAPP, true);
        lookUpDialoge.setResizable(false);
        lookUpDialoge.setLocationRelativeTo(null);
        glassPane.activate("");
        lookUpDialoge.setVisible(true);
        lookUpDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        glassPane.deactivate();
        if(PatientRecordDialog.patient!=null){
                patient = PatientRecordDialog.patient;
                PatientRecordDialog.patient = null;
                showPatientInfo(patient);
            }else if(PatientLookUpDialog.patient!=null){
                patient = PatientLookUpDialog.patient;
                PatientLookUpDialog.patient = null;
                showPatientInfo(patient);
            }
    }//GEN-LAST:event_admission_patient_search_buttonActionPerformed

    private void patient_reset_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_patient_reset_buttonActionPerformed

    }//GEN-LAST:event_patient_reset_buttonActionPerformed

    private void patient_detail_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_patient_detail_buttonActionPerformed
        DisabledGlassPane glassPane = new DisabledGlassPane();
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        rootPane.setGlassPane(glassPane);
        PatienInformationDialog patInfoDialoge = new PatienInformationDialog(MainAPP, true, patient);
        patInfoDialoge.setResizable(false);
        patInfoDialoge.setLocationRelativeTo(null);
        glassPane.activate("");
        patInfoDialoge.setVisible(true);
        patInfoDialoge.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        glassPane.deactivate();
    }//GEN-LAST:event_patient_detail_buttonActionPerformed

    private void bed_search_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bed_search_buttonActionPerformed
        if(transferingRoom_combobox.getSelectedItem()!=null){
            TRoomMaster room = (TRoomMaster)transferingRoom_combobox.getSelectedItem();
            try{
                room = inPatientAdmissionController.getRoomValues(room.getId());
            }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"department"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
            }
            DisabledGlassPane glassPane = new DisabledGlassPane();
            JRootPane rootPane = SwingUtilities.getRootPane(this);
            rootPane.setGlassPane(glassPane);
            BedAllocationDialog bedAllocationDialog = new BedAllocationDialog(MainAPP, true, room);
            bedAllocationDialog.setResizable(false);
            bedAllocationDialog.setLocationRelativeTo(null);
            glassPane.activate("");
            bedAllocationDialog.setVisible(true);
            bedAllocationDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            glassPane.deactivate();
            if(bedAllocationDialog.bed!=null){
                showBedInformation(bedAllocationDialog.bed);
            }
        }
    }//GEN-LAST:event_bed_search_buttonActionPerformed

    private void save_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save_buttonActionPerformed
     if(validateTransferSave()){        
        try {
            inPatientId = previousAdmission.getInpatientId();
            transferAdmission.setInpatientId(inPatientId);
            transferAdmission.setPatientId(previousAdmission.getPatientId());
            TDoctorInformation doctor = (TDoctorInformation)toDoctor_combobox.getSelectedItem();
            transferAdmission.setDoctorId(inPatientAdmissionController.findDoctorDetailsById(doctor.getId()));
            transferAdmission.setBedId(transferBed);
            transferAdmission.setAdmittedBy(transferingUser_textfield.getText());
            transferAdmission.setAdmissionType(String.valueOf(transferType_combobox.getSelectedItem()));
            transferAdmission.setInpatientStatus("ADMITTED");
            transferAdmission.setPatientNote(transferReason_textArea.getText());
            transferAdmission.setAdmissionDate(transferd_DateChooser.getDate());
            previousAdmission.setReleaseDate(transferd_DateChooser.getDate());
            previousAdmission.setInpatientStatus("TRANSFERD");
            transferAdmission.setEncounter(previousAdmission.getEncounter());
            inPatientTransferController.saveInpatientTransferDetails(previousAdmission,transferAdmission);
            //getOrCreateIPEncounter(transferAdmission);
            JOptionPane.showMessageDialog(null, "Patient transfer information has been saved.");
            InPatientHomePanel.scheduleToggleButton.doClick();
        }catch(HibernateOptimisticLockingFailureException e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.update",new Object[]{"In-Patient Admission"}));
        }catch(ProcessingException e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"In-Patient Admission"}));
        }catch(Exception e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"In-Patient Admission"}));
        }
      }
    }//GEN-LAST:event_save_buttonActionPerformed

    private void transferingDepartment_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_transferingDepartment_comboboxItemStateChanged
        if(transferingDepartment_combobox.getSelectedItem()!=null){
            TDepartmentMaster dept = (TDepartmentMaster)transferingDepartment_combobox.getSelectedItem();
            try{
                department = inPatientAdmissionController.getDepartmentbyID(dept.getId());
                //admissionRoomTypeList = inPatientAdmissionController.getRoomTypesByDept(department);
                doctorList = inPatientAdmissionController.getDoctorsByDepartment(department);
                toDoctor_combobox.setModel(new javax.swing.DefaultComboBoxModel(doctorList));
                toDoctor_combobox.setSelectedIndex(-1);
                
            }catch(ProcessingException e){
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"department"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
            }
        }
    }//GEN-LAST:event_transferingDepartment_comboboxItemStateChanged

    private void transferingRoomType_comboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_transferingRoomType_comboxItemStateChanged
        if(transferingRoomType_combox.getSelectedItem()!=null){
            try{
                String dept_str = transferingDepartment_combobox.getSelectedItem().toString();
                System.out.println("@@@dept: "+dept_str);
                admissionRoomList = inPatientAdmissionController.getRoomsByDeptRoomType(String.valueOf(transferingRoomType_combox.getSelectedItem()), inPatientAdmissionController.getDepartmentByName(dept_str));
            }catch(ProcessingException e){
                e.printStackTrace();
                JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"department"}));
                throw new HealthCareException(MessageProperties.getMessage("error.dao"));
            }
            transferingRoom_combobox.setModel(new javax.swing.DefaultComboBoxModel(admissionRoomList));
            transferingRoom_combobox.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_transferingRoomType_comboxItemStateChanged

    private void transferingRoomType_comboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transferingRoomType_comboxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_transferingRoomType_comboxActionPerformed

    private void transferingDepartment_comboboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transferingDepartment_comboboxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_transferingDepartment_comboboxActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField admissionDate_textBox;
    public static javax.swing.JButton admission_patient_search_button;
    private javax.swing.JTextField admittedBed_textBox;
    private javax.swing.JTextField admittedDept_textbox;
    private javax.swing.JTextField admittedDoctor_textBox;
    private javax.swing.JTextField admittedRoomType_textbox;
    private javax.swing.JTextField admittedRoom_textBox;
    private javax.swing.JTextField admittedUser_textbox;
    private javax.swing.JButton bed_search_button;
    private javax.swing.JLabel days_label;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JLabel patDOB_label;
    private javax.swing.JLabel patGender_label;
    private javax.swing.JLabel patName_label;
    private javax.swing.JLabel patid_label;
    private javax.swing.JButton patient_detail_button;
    private javax.swing.JButton patient_reset_button;
    private javax.swing.JTextField preInPatId_textbox;
    private javax.swing.JButton reset_button;
    private javax.swing.JButton save_button;
    private javax.swing.JComboBox toDoctor_combobox;
    private javax.swing.JTextArea transferReason_textArea;
    private javax.swing.JComboBox transferType_combobox;
    private com.toedter.calendar.JDateChooser transferd_DateChooser;
    private javax.swing.JTextField transferingBed_textbox;
    private javax.swing.JComboBox transferingDepartment_combobox;
    private javax.swing.JComboBox transferingRoomType_combox;
    private javax.swing.JComboBox transferingRoom_combobox;
    private javax.swing.JTextField transferingUser_textfield;
    // End of variables declaration//GEN-END:variables
    private javax.swing.JFrame MainAPP;
    
    private TPatient patient;
    /** The In-patient id. */
    String inPatientId;
    
    private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    /** The department list. */
    private Vector<TDepartmentMaster> departmentList = new Vector<TDepartmentMaster>();
    /** The Code Value list. */
    private Vector<TCCodeValues> admissionTypeList = new Vector<TCCodeValues>();
    /** The Doctor list. */
    private Vector<TDoctorInformation> doctorList = new Vector<TDoctorInformation>();
    /** The Admission Room Type list. */
    private Vector<String> admissionRoomTypeList = new Vector<String>();
    /** The Admission Room Type list. */
    private Vector<TRoomMaster> admissionRoomList = new Vector<TRoomMaster>();
    
    private InPatientTransferController inPatientTransferController;
    
    /** The In-Patient Code Value controller. */
    private InPatientCodeValuesController inPatientCodeValuesController;
    
    private TDepartmentMaster department;
    
    private TBedMaster transferBed;
    
    private TInpatentAdmission previousAdmission;
    
    private TInpatentAdmission transferAdmission;
    
    private InPatientAdmissionController inPatientAdmissionController;
    
    private InPatientRoundingController inPatientRoundingController;
    
    private void populateData() {
        transferBed = new TBedMaster();
        patient = new TPatient();
        department = new TDepartmentMaster();
        transferAdmission = new TInpatentAdmission();
        previousAdmission = new TInpatentAdmission();
        inPatientTransferController = (InPatientTransferController)HealthCareInpatientHome.context.getBean("inPatientTransferController");
        inPatientAdmissionController = (InPatientAdmissionController)HealthCareInpatientHome.context.getBean("inPatientAdmissionController");
        inPatientCodeValuesController = (InPatientCodeValuesController)HealthCareInpatientHome.context.getBean("inPatientCodeValuesController");
        inPatientRoundingController = (InPatientRoundingController)HealthCareInpatientHome.context.getBean("inPatientRoundingController");
     }
    
    private void showPatientInfo(TPatient patient) {
        if(patient!=null){
        patid_label.setText(patient.getPatientId());
        String patientFullName = null;
            if(patient.getPatientMName()!=null){
                    patientFullName = patient.getPatientFName()+" "+patient.getPatientMName()+" "+patient.getPatientLName();
                }else if(patient.getPatientMName()==null){
                    patientFullName = patient.getPatientFName()+" "+patient.getPatientLName();
                }
            patName_label.setText(patientFullName);
            patGender_label.setText(patient.getPatientGender());
            patDOB_label.setText(String.valueOf(sdf.format(patient.getBirthDate())));
            admission_patient_search_button.setVisible(false);
            patient_reset_button.setVisible(false);
            patient_detail_button.setVisible(false);
        }
    }
    
    private void startAdmissionProcess(){
        transferingUser_textfield.setText(CollectionUtill.showCurrentUser());
        try{
            admissionTypeList = inPatientCodeValuesController.getCodeValues("ADMISSION TYPE");
            transferType_combobox.setModel(new javax.swing.DefaultComboBoxModel(admissionTypeList));
            departmentList = inPatientTransferController.getDepartmentList();
            transferingDepartment_combobox.setModel(new javax.swing.DefaultComboBoxModel(departmentList));
            transferingDepartment_combobox.setSelectedIndex(-1);
            //According to KNH business rule :
            String dept_name = "";
            //dept_name = "KNH";
            dept_name = previousAdmission.getDoctorId().getDoctor_department_id().getDepartmentName();
            admissionRoomTypeList = inPatientAdmissionController.getRoomTypesByDept(inPatientAdmissionController.getDepartmentByName(dept_name));
            transferingRoomType_combox.setModel(new javax.swing.DefaultComboBoxModel(admissionRoomTypeList));
            transferingRoomType_combox.setSelectedIndex(-1);
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"information"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
         }
    }

    private void showPreviousAdmissionDetails(TInpatentAdmission inpatentAdmission) {
        this.previousAdmission = inpatentAdmission;
        preInPatId_textbox.setText(previousAdmission.getInpatientId());
        admissionDate_textBox.setText(sdf.format(previousAdmission.getAdmissionDate()));
        admittedUser_textbox.setText(previousAdmission.getAdmittedBy());
        admittedBed_textBox.setText(previousAdmission.getBedId().getBedNumber());
        admittedDept_textbox.setText(previousAdmission.getDoctorId().getDoctor_department_id().getDepartmentName());
        admittedRoomType_textbox.setText(previousAdmission.getBedId().getRoom().getRoomType());
        admittedRoom_textBox.setText(previousAdmission.getBedId().getRoom().getRoomNumber());
        admittedDoctor_textBox.setText(previousAdmission.getDoctorId().getDoctor_name());
    }
    
    private void showBedInformation(TBedMaster bed) {
        this.transferBed = bed;
        transferingBed_textbox.setText(bed.getBedNumber());
    }

    private boolean validateTransferSave() {
        boolean flag = true;
        if(patid_label.getText().length()==0){
            flag = false;
            JOptionPane.showMessageDialog(null,"Select a patient to transfer.");
        }else if(transferd_DateChooser.getDate()==null){
            flag = false;
            transferd_DateChooser.requestFocus();
            JOptionPane.showMessageDialog(null,"Transfer date should be selected.");
        }else if(transferingUser_textfield.getText().length()==0){
            flag = false;
            transferingUser_textfield.requestFocus();
            JOptionPane.showMessageDialog(null,"Enter an transfer user.");
        }else if(transferType_combobox.getSelectedItem()==null){
            flag = false;
            transferType_combobox.requestFocus();
            JOptionPane.showMessageDialog(null,"Transfer Type should be selected.");
        }else if(transferingDepartment_combobox.getSelectedItem()==null){
            flag = false;
            transferingDepartment_combobox.requestFocus();
            JOptionPane.showMessageDialog(null,"Select an department name.");
        }else if(toDoctor_combobox.getSelectedItem()==null){
            flag = false;
            toDoctor_combobox.requestFocus();
            JOptionPane.showMessageDialog(null,"Select an doctor name.");
        }else if(transferingRoomType_combox.getSelectedItem()==null){
            flag = false;
            transferingRoomType_combox.requestFocus();
            JOptionPane.showMessageDialog(null,"Select an room type.");
        }else if(transferingRoom_combobox.getSelectedItem()==null){
            flag = false;
            transferingRoom_combobox.requestFocus();
            JOptionPane.showMessageDialog(null,"Select an room name.");
        }else if(transferingBed_textbox.getText().length()==0){
            flag = false;
            transferingBed_textbox.requestFocus();
            JOptionPane.showMessageDialog(null,"Select an bed.");
        }
        return flag;
    }
    
    /*private void getOrCreateIPEncounter(TInpatentAdmission inpatadmission) {
        try{
            TPatientEncounter inpatenc = inPatientRoundingController.getIPEncounterByPatient(inpatadmission.getPatientId());
            if(inpatenc!=null){
                inpatenc.setDoctor(inpatadmission.getDoctorId());
                inpatenc = inPatientRoundingController.saveIPEncounter(true,inpatenc);
            }else{
                inpatenc = new TPatientEncounter();
                inpatenc.setPatient(inpatadmission.getPatientId());
                inpatenc.setDoctor(inpatadmission.getDoctorId());
                inpatenc = inPatientRoundingController.saveIPEncounter(false,inpatenc);
            }
        }catch(Exception ex){
            Logger.getLogger(RoundingPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }*/

}

Commits for Satyam/AuroCareHealthCareInPatient/src/main/java/com/bestray/healthcareinpatient/view/InPatient_Transfer_Panel.java

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