Subversion Repository Public Repository

Aurocare_27_07_2018

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
/*
 * 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.ButtonType;
import com.bestray.healthcarecommonutil.util.GlossyButton;
import com.bestray.healthcarecommonutil.util.SimpleGradientPanel;
import com.bestray.healthcarecommonutil.util.Theme;
import com.bestray.healthcarecommonutil.vo.TPatient;
import com.bestray.healthcarecommonutil.util.TimeRange;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcarecommonutil.vo.TInpatentAdmission;
import com.bestray.healthcareinpatient.controller.InPatientCodeValuesController;
import com.bestray.healthcareinpatient.controller.InPatientPatientController;
import com.bestray.healthcareinpatient.util.CollectionUtill;
import com.bestray.healthcareinpatient.util.MessageProperties;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Vector;
import javax.swing.JOptionPane;
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;

// TODO: Auto-generated Javadoc
/**
 * The Class PatienRecordUpdateDialog.
 *
 * @author User1
 */
public class PatienInformationDialog extends javax.swing.JDialog {
    TInpatentAdmission pat_admission;
    String  ipd_number; 
    String pat_desease;
    String pat_note;
   
    /**
     * Instantiates a new patien record update dialog.
     *
     * @param parent the parent
     * @param modal the modal
     * @param ID the id
     */
    public PatienInformationDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        populateData();
        initComponents();
        save_button.setText("Save");
        patientType_label.setVisible(false);
        op_radiotb.setVisible(false);
        ip_radiotb.setVisible(false);
    }
    
    
    public PatienInformationDialog(java.awt.Frame parent, boolean modal, TPatient patient) {
        super(parent, modal);
        populateData();
        initComponents();
        displayPatientRecord(patient);
        patientType_label.setVisible(false);
        op_radiotb.setVisible(false);
        ip_radiotb.setVisible(false);
    }
    
        public PatienInformationDialog(java.awt.Frame parent, boolean modal, TInpatentAdmission admission) {
        super(parent, modal);
        populateData();
        initComponents();
        displayAdmissionInformation(admission);
        patientType_label.setVisible(false);
        op_radiotb.setVisible(false);
        ip_radiotb.setVisible(false);
    }
        
        public PatienInformationDialog(java.awt.Frame parent, boolean modal, TPatient patient, TInpatentAdmission admission) {
        super(parent, modal);
        this.pat_admission = admission;
        this.ipd_number= admission.getIpdNo();
        this.pat_desease= admission.getPatientDisease();
        this.pat_note = admission.getPatientNote();
        
        populateData();
        initComponents();
        displayPatientRecord(patient);
        patientType_label.setVisible(false);
        op_radiotb.setVisible(false);
        ip_radiotb.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() {

        opip_buttonGroup = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        patient_tabbedPane = new javax.swing.JTabbedPane();
        demogrphic_panel = new SimpleGradientPanel();
        patient_details_title = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        firstName_textbox = new javax.swing.JTextField();
        patientId_textbox = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        middleName_textbox = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        lastName_textbox = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        gender_combobox = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        age_textbox = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        contact_details_title = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        homePhone_textbox = new javax.swing.JTextField();
        mobilePhone_textbox = new javax.swing.JTextField();
        emergencyNumber_textbox = new javax.swing.JTextField();
        emilId_textbox = new javax.swing.JTextField();
        social_information_title = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        religion_combobox = new javax.swing.JComboBox();
        marital_combobx = new javax.swing.JComboBox();
        language_combobox = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        comments_textarea = new javax.swing.JTextArea();
        jLabel25 = new javax.swing.JLabel();
        birthDT_datepicker = new com.toedter.calendar.JDateChooser();
        joinedDT_datepicker = new com.toedter.calendar.JDateChooser();
        patient_details_title1 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        adhar_card_textbox = new javax.swing.JTextField();
        jLabel41 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        passport_details_textbox = new javax.swing.JTextField();
        voter_card_textbox = new javax.swing.JTextField();
        pan_card_textbox = new javax.swing.JTextField();
        driving_license_textbox = new javax.swing.JTextField();
        agemm_textbox = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        patientType_label = new javax.swing.JLabel();
        ip_radiotb = new javax.swing.JRadioButton();
        op_radiotb = new javax.swing.JRadioButton();
        jLabel3 = new javax.swing.JLabel();
        ipdNo_textbox = new javax.swing.JTextField();
        jLabel58 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        indication_textarea = new javax.swing.JTextArea();
        jLabel59 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        treatmentnote_textarea = new javax.swing.JTextArea();
        address_panel = new SimpleGradientPanel();
        present_address_title = new javax.swing.JLabel();
        permanent_address_title = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        presentAddress_textbox = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        presentVillage_textbox = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        presentCity_textbox = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        presentDistrict_textbox = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        presentZipCode_textbox = new javax.swing.JTextField();
        Address_lable = new javax.swing.JLabel();
        permanentAddress_textbox = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        permanentVillage_textbox = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        permanentCity_textbox = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        permanentDistrict_textbox = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        permanentZipCode_textbox = new javax.swing.JTextField();
        permanentAddress_checkbox = new javax.swing.JCheckBox();
        presentState_combobox = new javax.swing.JComboBox();
        presentCountry_combobox = new javax.swing.JComboBox();
        permanentState_combobox = new javax.swing.JComboBox();
        PermanentCountry_combobox = new javax.swing.JComboBox();
        insurance_panel = new SimpleGradientPanel();
        jLabel32 = new javax.swing.JLabel();
        insurance_id_textbox = new javax.swing.JTextField();
        patient_insurance_title = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        insurance_name_textbox = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        subcriber_name_textbox = new javax.swing.JTextField();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        patient_relation_textbox = new javax.swing.JTextField();
        insurance_checkbox = new javax.swing.JCheckBox();
        from_date_datepicker = new com.toedter.calendar.JDateChooser();
        to_date_datepicker = new com.toedter.calendar.JDateChooser();
        employeement_panel = new SimpleGradientPanel();
        patient_employment_title = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        patient_occupation_textbox = new javax.swing.JTextField();
        jLabel48 = new javax.swing.JLabel();
        company_name_textbox = new javax.swing.JTextField();
        jLabel49 = new javax.swing.JLabel();
        company_address1_textbox = new javax.swing.JTextField();
        company_address2_textbox = new javax.swing.JTextField();
        jLabel50 = new javax.swing.JLabel();
        company_number_textbox = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        colleague_name_textbox = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        colleague_number_textbox = new javax.swing.JTextField();
        employment_checkbox = new javax.swing.JCheckBox();
        jPanel4 = new javax.swing.JPanel();
        patient_registration_lable = new javax.swing.JLabel();
        patient_lable = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        save_button = new GlossyButton("Update",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED_RECTANGLUR);
        reset_button = new GlossyButton("Done",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED_RECTANGLUR);
        cancel_button = new GlossyButton("Cancel",Theme.GLOSSY_GREEN_THEME,ButtonType.BUTTON_ROUNDED_RECTANGLUR);
        jPanel6 = new javax.swing.JPanel();
        jLabel55 = new javax.swing.JLabel();
        patientIdBox_label = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        patientNameBox_label = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        dobBox_label = new javax.swing.JLabel();

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

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

        patient_tabbedPane.setBackground(new java.awt.Color(253, 251, 251));
        patient_tabbedPane.setForeground(new java.awt.Color(68, 62, 173));
        patient_tabbedPane.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        patient_tabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                patient_tabbedPaneStateChanged(evt);
            }
        });

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

        patient_details_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        patient_details_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/User-Files-icon 16X16.png"))); // NOI18N
        patient_details_title.setText("Patient Details");

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

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

        firstName_textbox.setBackground(new java.awt.Color(255, 243, 251));
        firstName_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        firstName_textbox.setNextFocusableComponent(lastName_textbox);

        //patientId_textbox.setText(patientId+"P");
        patientId_textbox.setEditable(false);
        //patientId_textbox.setText("");
        patientId_textbox.setBackground(new java.awt.Color(253, 251, 251));
        patientId_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        patientId_textbox.setForeground(new java.awt.Color(255, 0, 0));
        patientId_textbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        patientId_textbox.setNextFocusableComponent(firstName_textbox);
        patientId_textbox.setOpaque(false);
        patientId_textbox.setFont(new java.awt.Font("SansSerif", 1, 11)); // NOI18N

        patientId_textbox.setForeground(new java.awt.Color(255, 0, 0));

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

        middleName_textbox.setBackground(new java.awt.Color(255, 243, 251));
        middleName_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        lastName_textbox.setBackground(new java.awt.Color(255, 243, 251));
        lastName_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lastName_textbox.setNextFocusableComponent(gender_combobox);

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

        gender_combobox.setBackground(new java.awt.Color(253, 251, 251));
        gender_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        gender_combobox.setModel(new javax.swing.DefaultComboBoxModel(genderList));
        gender_combobox.setNextFocusableComponent(birthDT_datepicker);
        gender_combobox.setSelectedIndex(-1);

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

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

        age_textbox.setEditable(true);
        age_textbox.setBackground(new java.awt.Color(255, 243, 251));
        age_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        age_textbox.setNextFocusableComponent(agemm_textbox);
        age_textbox.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                age_textboxFocusLost(evt);
            }
        });
        age_textbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                age_textboxKeyTyped(evt);
            }
        });

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

        contact_details_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        contact_details_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Phone-icon 16X16.png"))); // NOI18N
        contact_details_title.setText("Contact Details");

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

        jLabel14.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel14.setText("Home Phone Number :");

        jLabel15.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel15.setText("Emergency Contact Number :");

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

        homePhone_textbox.setBackground(new java.awt.Color(255, 243, 251));
        homePhone_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        homePhone_textbox.setNextFocusableComponent(mobilePhone_textbox);

        mobilePhone_textbox.setBackground(new java.awt.Color(255, 243, 251));
        mobilePhone_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        mobilePhone_textbox.setNextFocusableComponent(emergencyNumber_textbox);

        emergencyNumber_textbox.setBackground(new java.awt.Color(255, 243, 251));
        emergencyNumber_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        emergencyNumber_textbox.setNextFocusableComponent(emilId_textbox);

        emilId_textbox.setBackground(new java.awt.Color(255, 243, 251));
        emilId_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        emilId_textbox.setNextFocusableComponent(religion_combobox);

        social_information_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        social_information_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/social-information-icon 16X16.png"))); // NOI18N
        social_information_title.setText("Social Informations");

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

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

        jLabel20.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel20.setText("Language Known :");

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

        religion_combobox.setBackground(new java.awt.Color(253, 251, 251));
        religion_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        religion_combobox.setModel(new javax.swing.DefaultComboBoxModel(religionList));
        religion_combobox.setNextFocusableComponent(marital_combobx);
        religion_combobox.setSelectedIndex(-1);

        marital_combobx.setBackground(new java.awt.Color(253, 251, 251));
        marital_combobx.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        marital_combobx.setModel(new javax.swing.DefaultComboBoxModel(maritalStatusList));
        marital_combobx.setNextFocusableComponent(language_combobox);
        marital_combobx.setSelectedIndex(-1);

        language_combobox.setBackground(new java.awt.Color(253, 251, 251));
        language_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        language_combobox.setModel(new javax.swing.DefaultComboBoxModel(languageList));
        language_combobox.setName(""); // NOI18N
        language_combobox.setNextFocusableComponent(comments_textarea);
        language_combobox.setSelectedIndex(-1);

        comments_textarea.setBackground(new java.awt.Color(255, 243, 251));
        comments_textarea.setColumns(20);
        comments_textarea.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        comments_textarea.setRows(5);
        comments_textarea.setNextFocusableComponent(driving_license_textbox);
        comments_textarea.setLineWrap(true);
        comments_textarea.setWrapStyleWord(true);
        jScrollPane1.setViewportView(comments_textarea);

        jLabel25.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel25.setText("Patient Joined :");

        birthDT_datepicker.setDateFormatString("dd/MM/yyyy");
        birthDT_datepicker.setBackground(new java.awt.Color(253, 251, 251));
        birthDT_datepicker.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthDT_datepicker.setNextFocusableComponent(age_textbox);
        birthDT_datepicker.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                birthDT_datepickerPropertyChange(evt);
            }
        });

        joinedDT_datepicker.setDateFormatString("dd/MM/yyyy");
        joinedDT_datepicker.setBackground(new java.awt.Color(253, 251, 251));
        joinedDT_datepicker.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        joinedDT_datepicker.setNextFocusableComponent(homePhone_textbox);
        joinedDT_datepicker.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                joinedDT_datepickerPropertyChange(evt);
            }
        });

        patient_details_title1.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        patient_details_title1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Identity-number-icon 16X16.png"))); // NOI18N
        patient_details_title1.setText("Identification Details");

        jLabel22.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel22.setText("Driving License Details:");

        jLabel23.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel23.setText("Adhar Card Details:");

        adhar_card_textbox.setBackground(new java.awt.Color(255, 243, 251));
        adhar_card_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        adhar_card_textbox.setNextFocusableComponent(passport_details_textbox);

        jLabel41.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel41.setText("Passport Details:");

        jLabel45.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel45.setText("Voter Card Details:");

        jLabel46.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel46.setText("Pan Card Details:");

        passport_details_textbox.setBackground(new java.awt.Color(255, 243, 251));
        passport_details_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        passport_details_textbox.setNextFocusableComponent(voter_card_textbox);

        voter_card_textbox.setBackground(new java.awt.Color(255, 243, 251));
        voter_card_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        voter_card_textbox.setNextFocusableComponent(pan_card_textbox);

        pan_card_textbox.setBackground(new java.awt.Color(255, 243, 251));
        pan_card_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        pan_card_textbox.setNextFocusableComponent(save_button);

        driving_license_textbox.setBackground(new java.awt.Color(255, 243, 251));
        driving_license_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        driving_license_textbox.setNextFocusableComponent(adhar_card_textbox);

        agemm_textbox.setBackground(new java.awt.Color(255, 243, 251));
        agemm_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        agemm_textbox.setNextFocusableComponent(joinedDT_datepicker);
        agemm_textbox.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                agemm_textboxFocusLost(evt);
            }
        });
        agemm_textbox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                agemm_textboxKeyTyped(evt);
            }
        });

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

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

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

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

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

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

        patientType_label.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        patientType_label.setText("Patient Type :");

        ip_radiotb.setText("In Patient");
        ip_radiotb.setOpaque(false);
        ip_radiotb.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ip_radiotbMouseClicked(evt);
            }
        });

        op_radiotb.setText("Out Patient");
        op_radiotb.setOpaque(false);
        op_radiotb.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                op_radiotbMouseClicked(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel3.setText("IPD . No.");

        ipdNo_textbox.setBackground(new java.awt.Color(255, 243, 251));
        ipdNo_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        ipdNo_textbox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ipdNo_textboxActionPerformed(evt);
            }
        });

        jLabel58.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel58.setText("Indication/Diseases :");

        indication_textarea.setBackground(new java.awt.Color(255, 243, 251));
        indication_textarea.setColumns(20);
        indication_textarea.setRows(5);
        jScrollPane2.setViewportView(indication_textarea);

        jLabel59.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel59.setText("Treatment Plan/O.T Note :");

        treatmentnote_textarea.setBackground(new java.awt.Color(255, 243, 251));
        treatmentnote_textarea.setColumns(20);
        treatmentnote_textarea.setRows(5);
        jScrollPane3.setViewportView(treatmentnote_textarea);

        javax.swing.GroupLayout demogrphic_panelLayout = new javax.swing.GroupLayout(demogrphic_panel);
        demogrphic_panel.setLayout(demogrphic_panelLayout);
        demogrphic_panelLayout.setHorizontalGroup(
            demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel16)
                            .addComponent(jLabel15)
                            .addComponent(jLabel14)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(emergencyNumber_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(mobilePhone_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(homePhone_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(emilId_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(contact_details_title))
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel1)
                                .addComponent(jLabel2))
                            .addComponent(jLabel8)
                            .addComponent(jLabel53)
                            .addComponent(jLabel57))
                        .addGap(2, 2, 2)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel11))
                                .addGap(22, 22, 22)
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(patientId_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                                .addComponent(firstName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(31, 31, 31)
                                                .addComponent(jLabel6))
                                            .addComponent(gender_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                                .addComponent(age_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel12)
                                                .addGap(18, 18, 18)
                                                .addComponent(agemm_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel17)))
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(middleName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, demogrphic_panelLayout.createSequentialGroup()
                                                .addComponent(jLabel3)
                                                .addGap(18, 18, 18)
                                                .addComponent(ipdNo_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, demogrphic_panelLayout.createSequentialGroup()
                                        .addComponent(jLabel59)
                                        .addGap(18, 18, 18)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, demogrphic_panelLayout.createSequentialGroup()
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                                .addComponent(jLabel58)
                                                .addGap(18, 18, 18))
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, demogrphic_panelLayout.createSequentialGroup()
                                                .addComponent(birthDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(lastName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel25)
                                    .addComponent(patientType_label))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                        .addComponent(op_radiotb)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(ip_radiotb))
                                    .addComponent(joinedDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(patient_details_title)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20)
                            .addComponent(jLabel21))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(religion_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(marital_combobx, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(language_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(social_information_title)
                    .addComponent(patient_details_title1)
                    .addComponent(jLabel41)
                    .addComponent(jLabel45)
                    .addComponent(jLabel46)
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel22)
                            .addComponent(jLabel23))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(pan_card_textbox)
                            .addComponent(voter_card_textbox)
                            .addComponent(passport_details_textbox)
                            .addComponent(adhar_card_textbox)
                            .addComponent(driving_license_textbox, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE))))
                .addGap(11, 11, 11))
        );
        demogrphic_panelLayout.setVerticalGroup(
            demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_details_title)
                    .addComponent(social_information_title))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(patientId_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(religion_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(firstName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(marital_combobx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(middleName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel20)
                            .addComponent(language_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(patient_details_title1))
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(13, 13, 13)
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, demogrphic_panelLayout.createSequentialGroup()
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel22)
                                            .addComponent(driving_license_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(4, 4, 4)
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel23)
                                            .addComponent(adhar_card_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel41)
                                            .addComponent(passport_details_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel59)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel45)
                                    .addComponent(voter_card_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel46)
                                    .addComponent(pan_card_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(demogrphic_panelLayout.createSequentialGroup()
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(lastName_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel9)
                                .addComponent(jLabel8)
                                .addComponent(jLabel3)
                                .addComponent(ipdNo_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(gender_combobox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel10)
                                .addComponent(jLabel53))
                            .addComponent(birthDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(age_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12)
                            .addComponent(agemm_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel17)
                            .addComponent(jLabel57)
                            .addComponent(jLabel58))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(op_radiotb)
                                .addComponent(ip_radiotb))
                            .addComponent(patientType_label))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel25)
                            .addComponent(joinedDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addComponent(contact_details_title)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(homePhone_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(mobilePhone_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(emergencyNumber_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(demogrphic_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16)
                            .addComponent(emilId_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(47, Short.MAX_VALUE))
        );

        patient_tabbedPane.addTab("Demographics", new javax.swing.ImageIcon(getClass().getResource("/images/demographic 24X24.png")), demogrphic_panel); // NOI18N

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

        present_address_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        present_address_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Address-icon16X16.png"))); // NOI18N
        present_address_title.setText("Present Address");

        permanent_address_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        permanent_address_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Address-icon16X16.png"))); // NOI18N
        permanent_address_title.setText("Permanent Address");

        jLabel24.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel24.setText("C/O :");

        presentAddress_textbox.setBackground(new java.awt.Color(255, 243, 251));
        presentAddress_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel26.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel26.setText("AT/POST :");

        presentVillage_textbox.setBackground(new java.awt.Color(255, 243, 251));
        presentVillage_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        presentCity_textbox.setBackground(new java.awt.Color(255, 243, 251));
        presentCity_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        presentDistrict_textbox.setBackground(new java.awt.Color(255, 243, 251));
        presentDistrict_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

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

        jLabel31.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel31.setText("Zip Code :");

        presentZipCode_textbox.setBackground(new java.awt.Color(255, 243, 251));
        presentZipCode_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        Address_lable.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        Address_lable.setText("C/O :");

        permanentAddress_textbox.setBackground(new java.awt.Color(255, 243, 251));
        permanentAddress_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel33.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel33.setText("AT/POST :");

        permanentVillage_textbox.setBackground(new java.awt.Color(255, 243, 251));
        permanentVillage_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        permanentCity_textbox.setBackground(new java.awt.Color(255, 243, 251));
        permanentCity_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        permanentDistrict_textbox.setBackground(new java.awt.Color(255, 243, 251));
        permanentDistrict_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

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

        jLabel38.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel38.setText("Zip Code :");

        permanentZipCode_textbox.setBackground(new java.awt.Color(255, 243, 251));
        permanentZipCode_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        permanentAddress_checkbox.setBackground(new java.awt.Color(253, 251, 251));
        permanentAddress_checkbox.setFont(new java.awt.Font("SansSerif", 0, 11)); // NOI18N
        permanentAddress_checkbox.setOpaque(false);
        permanentAddress_checkbox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                permanentAddress_checkboxItemStateChanged(evt);
            }
        });

        presentState_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        presentState_combobox.setModel(new javax.swing.DefaultComboBoxModel(stateList));
        presentState_combobox.setSelectedIndex(-1);

        presentCountry_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        presentCountry_combobox.setModel(new javax.swing.DefaultComboBoxModel(countryList));
        presentCountry_combobox.setSelectedIndex(-1);

        permanentState_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        permanentState_combobox.setModel(new javax.swing.DefaultComboBoxModel(stateList));
        permanentState_combobox.setSelectedIndex(-1);

        PermanentCountry_combobox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        PermanentCountry_combobox.setModel(new javax.swing.DefaultComboBoxModel(countryList));
        PermanentCountry_combobox.setSelectedIndex(-1);

        javax.swing.GroupLayout address_panelLayout = new javax.swing.GroupLayout(address_panel);
        address_panel.setLayout(address_panelLayout);
        address_panelLayout.setHorizontalGroup(
            address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, address_panelLayout.createSequentialGroup()
                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(address_panelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(present_address_title))
                    .addGroup(address_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel24)
                            .addComponent(jLabel26)
                            .addComponent(jLabel27)
                            .addComponent(jLabel28)
                            .addComponent(jLabel29)
                            .addComponent(jLabel30)
                            .addComponent(jLabel31))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(presentVillage_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(presentState_combobox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(presentCountry_combobox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(presentZipCode_textbox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                                    .addComponent(presentDistrict_textbox, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(presentCity_textbox, javax.swing.GroupLayout.Alignment.LEADING)))
                            .addComponent(presentAddress_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(188, 188, 188)
                .addComponent(permanentAddress_checkbox)
                .addGap(6, 6, 6)
                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(address_panelLayout.createSequentialGroup()
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(Address_lable)
                            .addComponent(jLabel33)
                            .addComponent(jLabel34)
                            .addComponent(jLabel35)
                            .addComponent(jLabel36)
                            .addComponent(jLabel37)
                            .addComponent(jLabel38))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(permanentAddress_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(permanentVillage_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(permanentZipCode_textbox, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(permanentDistrict_textbox, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(permanentCity_textbox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(permanentState_combobox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(PermanentCountry_combobox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(permanent_address_title))
                .addContainerGap(377, Short.MAX_VALUE))
        );
        address_panelLayout.setVerticalGroup(
            address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(address_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(permanent_address_title)
                    .addComponent(present_address_title))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(address_panelLayout.createSequentialGroup()
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24)
                            .addComponent(presentVillage_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel26)
                            .addComponent(presentAddress_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel27)
                            .addComponent(presentCity_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel28)
                            .addComponent(presentDistrict_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(presentState_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel29))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel30)
                            .addComponent(presentCountry_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel31)
                            .addComponent(presentZipCode_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(address_panelLayout.createSequentialGroup()
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(Address_lable)
                                .addComponent(permanentVillage_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(permanentAddress_checkbox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel33)
                            .addComponent(permanentAddress_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel34)
                            .addComponent(permanentCity_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel35)
                            .addComponent(permanentDistrict_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel36)
                            .addComponent(permanentState_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel37)
                            .addComponent(PermanentCountry_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6)
                        .addGroup(address_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel38)
                            .addComponent(permanentZipCode_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(232, Short.MAX_VALUE))
        );

        patient_tabbedPane.addTab("Address Informations", new javax.swing.ImageIcon(getClass().getResource("/images/Adress-icon 24X24.png")), address_panel); // NOI18N

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

        jLabel32.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel32.setText("URN No.");

        insurance_id_textbox.setBackground(new java.awt.Color(255, 243, 251));
        insurance_id_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        patient_insurance_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        patient_insurance_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/insurance-details-icon.png"))); // NOI18N
        patient_insurance_title.setText("Isurance Details");

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

        insurance_name_textbox.setBackground(new java.awt.Color(255, 243, 251));
        insurance_name_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        subcriber_name_textbox.setBackground(new java.awt.Color(255, 243, 251));
        subcriber_name_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel42.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel42.setText("Effective Date From :");
        jLabel42.setVisible(false);

        jLabel43.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel43.setText("To :");
        jLabel43.setVisible(false);

        jLabel44.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel44.setText("Relation with Patient :");

        patient_relation_textbox.setBackground(new java.awt.Color(255, 243, 251));
        patient_relation_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        insurance_checkbox.setBackground(new java.awt.Color(253, 251, 251));
        insurance_checkbox.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        insurance_checkbox.setText("No Insurance ");
        insurance_checkbox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                insurance_checkboxItemStateChanged(evt);
            }
        });

        from_date_datepicker.setDateFormatString("dd/MM/yyyy");
        from_date_datepicker.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        from_date_datepicker.setVisible(false);

        to_date_datepicker.setDateFormatString("dd/MM/yyyy");
        to_date_datepicker.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        to_date_datepicker.setVisible(false);

        javax.swing.GroupLayout insurance_panelLayout = new javax.swing.GroupLayout(insurance_panel);
        insurance_panel.setLayout(insurance_panelLayout);
        insurance_panelLayout.setHorizontalGroup(
            insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(insurance_panelLayout.createSequentialGroup()
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(insurance_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel39)
                            .addComponent(jLabel40)
                            .addComponent(jLabel42)
                            .addComponent(jLabel44))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(insurance_id_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(insurance_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(subcriber_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(insurance_panelLayout.createSequentialGroup()
                                .addComponent(from_date_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel43)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(to_date_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(patient_relation_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(insurance_panelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(patient_insurance_title)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(insurance_checkbox)))
                .addContainerGap(695, Short.MAX_VALUE))
        );
        insurance_panelLayout.setVerticalGroup(
            insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(insurance_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_insurance_title)
                    .addComponent(insurance_checkbox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(insurance_id_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel39)
                    .addComponent(insurance_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel40)
                    .addComponent(subcriber_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel42)
                        .addComponent(jLabel43))
                    .addComponent(from_date_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(to_date_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(insurance_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel44)
                    .addComponent(patient_relation_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(275, Short.MAX_VALUE))
        );

        patient_tabbedPane.addTab("Card Informations", new javax.swing.ImageIcon(getClass().getResource("/images/insurance-icon 24X24.png")), insurance_panel); // NOI18N

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

        patient_employment_title.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        patient_employment_title.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/employee detail 16X16.png"))); // NOI18N
        patient_employment_title.setText("Employment Details");

        jLabel47.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel47.setText("Patient Occupation :");

        patient_occupation_textbox.setBackground(new java.awt.Color(255, 243, 251));
        patient_occupation_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

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

        company_name_textbox.setBackground(new java.awt.Color(255, 243, 251));
        company_name_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel49.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel49.setText("Company Address :");

        company_address1_textbox.setBackground(new java.awt.Color(255, 243, 251));
        company_address1_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        company_address2_textbox.setBackground(new java.awt.Color(255, 243, 251));
        company_address2_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel50.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel50.setText("Company Number :");

        company_number_textbox.setBackground(new java.awt.Color(255, 243, 251));
        company_number_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel51.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel51.setText("Any Reference Colleague :");

        colleague_name_textbox.setBackground(new java.awt.Color(255, 243, 251));
        colleague_name_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel52.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N
        jLabel52.setText("Ref. Colleague Number :");

        colleague_number_textbox.setBackground(new java.awt.Color(255, 243, 251));
        colleague_number_textbox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        employment_checkbox.setBackground(new java.awt.Color(253, 251, 251));
        employment_checkbox.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        employment_checkbox.setText("Unemployed");
        employment_checkbox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                employment_checkboxItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout employeement_panelLayout = new javax.swing.GroupLayout(employeement_panel);
        employeement_panel.setLayout(employeement_panelLayout);
        employeement_panelLayout.setHorizontalGroup(
            employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(employeement_panelLayout.createSequentialGroup()
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(employeement_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel47)
                            .addComponent(jLabel48)
                            .addComponent(jLabel49)
                            .addComponent(jLabel50)
                            .addComponent(jLabel51)
                            .addComponent(jLabel52))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(patient_occupation_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(company_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(company_address1_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(company_address2_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(company_number_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(colleague_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(colleague_number_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(employeement_panelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(patient_employment_title)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(employment_checkbox)))
                .addContainerGap(772, Short.MAX_VALUE))
        );
        employeement_panelLayout.setVerticalGroup(
            employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(employeement_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_employment_title)
                    .addComponent(employment_checkbox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel47)
                    .addComponent(patient_occupation_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel48)
                    .addComponent(company_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel49)
                    .addComponent(company_address1_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(2, 2, 2)
                .addComponent(company_address2_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel50)
                    .addComponent(company_number_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel51)
                    .addComponent(colleague_name_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(employeement_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel52)
                    .addComponent(colleague_number_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(227, Short.MAX_VALUE))
        );

        patient_tabbedPane.addTab("Employment Informations", new javax.swing.ImageIcon(getClass().getResource("/images/employment-icon.png")), employeement_panel); // NOI18N

        jPanel4.setBackground(new java.awt.Color(68, 62, 173));
        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        patient_registration_lable.setBackground(new java.awt.Color(253, 251, 251));
        patient_registration_lable.setFont(new java.awt.Font("SansSerif", 1, 13)); // NOI18N
        patient_registration_lable.setForeground(new java.awt.Color(255, 255, 255));
        patient_registration_lable.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/patient-registraion.png"))); // NOI18N
        patient_registration_lable.setText("Patient Registration");

        patient_lable.setBackground(new java.awt.Color(253, 251, 251));
        patient_lable.setFont(new java.awt.Font("SansSerif", 1, 12));
        patient_lable.setForeground(new java.awt.Color(255, 255, 255));
        patient_lable.setText(" ");
        patient_lable.setVisible(false);

        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(1, 1, 1)
                .addComponent(patient_registration_lable)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(patient_lable, javax.swing.GroupLayout.PREFERRED_SIZE, 950, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(patient_registration_lable)
                    .addComponent(patient_lable, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0))
        );

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

        save_button.setBackground(new java.awt.Color(253, 251, 251));
        save_button.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        save_button.setForeground(new java.awt.Color(68, 62, 173));
        save_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Save-icon 24X24.png"))); // NOI18N
        save_button.setText("Update");
        save_button.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        save_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                save_buttonActionPerformed(evt);
            }
        });

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

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

        jPanel6.setBackground(new java.awt.Color(153, 255, 102));
        jPanel6.setVisible(false);

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

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

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

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

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

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

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel55)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(patientIdBox_label, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel54)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(patientNameBox_label, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel56)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(dobBox_label, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel55)
                    .addComponent(patientIdBox_label)
                    .addComponent(jLabel54)
                    .addComponent(patientNameBox_label)
                    .addComponent(jLabel56)
                    .addComponent(dobBox_label))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(1, 1, 1)
                .addComponent(save_button)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(reset_button, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cancel_button, 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(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(save_button)
                        .addComponent(reset_button, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(cancel_button, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        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(patient_tabbedPane)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(patient_tabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 492, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

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

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

    private void age_textboxFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_age_textboxFocusLost
        if(age_textbox.getText().trim().length()==0){
            age_textbox.setText("0");
        }
        if(age_textbox.getText().trim().length()!=0&&agemm_textbox.getText().trim().length()!=0){
            if(age_textbox.getText().matches("^[0-9]+$")&&agemm_textbox.getText().matches("^[0-9]+$")){
                int age = Integer.parseInt(age_textbox.getText());
                int agemm = Integer.parseInt(agemm_textbox.getText());
                if(agemm<12){
                    if(birthDT_datepicker.getDate()==null){
                        birthDT_datepicker.setDate(TimeRange.calculateBirthDate(age,agemm));
                    }
                }else{
                    JOptionPane.showMessageDialog(null,"Month should be less than 12.");
                }
            }else{
                JOptionPane.showMessageDialog(null,"Enter age in numbers");
            }
        }
    }//GEN-LAST:event_age_textboxFocusLost

    private void age_textboxKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_age_textboxKeyTyped
        birthDT_datepicker.setDate(null);
    }//GEN-LAST:event_age_textboxKeyTyped

    private void birthDT_datepickerPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_birthDT_datepickerPropertyChange
        if(birthDT_datepicker.getDate()!= null){
            if(TimeRange.checkBrithDate(birthDT_datepicker.getDate())){
                List<String> totalAge = TimeRange.calculateAge(birthDT_datepicker.getDate());
                age_textbox.setText(totalAge.get(0));
                agemm_textbox.setText(totalAge.get(1));
            }else{
                JOptionPane.showMessageDialog(null, "Wrong Birth Date. DOB cant be a future date");
                birthDT_datepicker.setDate(null);
            }
        }
    }//GEN-LAST:event_birthDT_datepickerPropertyChange

    private void joinedDT_datepickerPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_joinedDT_datepickerPropertyChange
        // TODO add your handling code here:
        if(joinedDT_datepicker.getDate()!= null){
            if(TimeRange.checkBrithDate(joinedDT_datepicker.getDate())){

            }else{
                JOptionPane.showMessageDialog(null, "Wrong Joined Date.Joined Date cant be a future date");
                joinedDT_datepicker.setDate(null);
            }
        }
    }//GEN-LAST:event_joinedDT_datepickerPropertyChange

    private void agemm_textboxFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_agemm_textboxFocusLost
        if(agemm_textbox.getText().trim().length()==0){
            agemm_textbox.setText("0");
        }
        if(age_textbox.getText().trim().length()!=0&&agemm_textbox.getText().trim().length()!=0){
            if(age_textbox.getText().matches("^[0-9]+$")&&agemm_textbox.getText().matches("^[0-9]+$")){
                int age = Integer.parseInt(age_textbox.getText());
                int agemm = Integer.parseInt(agemm_textbox.getText());
                if(agemm<12){
                    if(birthDT_datepicker.getDate()==null){
                        birthDT_datepicker.setDate(TimeRange.calculateBirthDate(age,agemm));
                    }
                }else{
                    JOptionPane.showMessageDialog(null,"Month should be less than 12.");
                }
            }else{
                JOptionPane.showMessageDialog(null,"Enter age in numbers");
            }
        }
    }//GEN-LAST:event_agemm_textboxFocusLost

    private void agemm_textboxKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_agemm_textboxKeyTyped
        birthDT_datepicker.setDate(null);
    }//GEN-LAST:event_agemm_textboxKeyTyped

    private void ip_radiotbMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ip_radiotbMouseClicked
        op_radiotb.setSelected(false);
        ip_radiotb.setSelected(true);
    }//GEN-LAST:event_ip_radiotbMouseClicked

    private void op_radiotbMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_op_radiotbMouseClicked
        op_radiotb.setSelected(true);
        ip_radiotb.setSelected(false);
    }//GEN-LAST:event_op_radiotbMouseClicked

    private void permanentAddress_checkboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_permanentAddress_checkboxItemStateChanged

        if(permanentAddress_checkbox.isSelected()){
            permanentAddress_textbox.setText(presentAddress_textbox.getText());
            permanentVillage_textbox.setText(presentVillage_textbox.getText());
            permanentCity_textbox.setText(presentCity_textbox.getText());
            permanentDistrict_textbox.setText(presentDistrict_textbox.getText());
            permanentState_combobox.setSelectedIndex(presentState_combobox.getSelectedIndex());
            PermanentCountry_combobox.setSelectedIndex(presentCountry_combobox.getSelectedIndex());
            permanentZipCode_textbox.setText(presentZipCode_textbox.getText());
        }
        else
        {
            permanentAddress_textbox.setText("");
            permanentVillage_textbox.setText("");
            permanentCity_textbox.setText("");
            permanentDistrict_textbox.setText("");
            permanentState_combobox.setSelectedIndex(-1);
            PermanentCountry_combobox.setSelectedIndex(-1);
            permanentZipCode_textbox.setText("");
        }
    }//GEN-LAST:event_permanentAddress_checkboxItemStateChanged

    private void insurance_checkboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_insurance_checkboxItemStateChanged
        if(insurance_checkbox.isSelected()){
            insurance_id_textbox.setText("");
            insurance_name_textbox.setText("");
            subcriber_name_textbox.setText("");
            from_date_datepicker.setDate(null);
            to_date_datepicker.setDate(null);
            patient_relation_textbox.setText("");
            insurance_id_textbox.setEditable(false);
            insurance_name_textbox.setEditable(false);
            subcriber_name_textbox.setEditable(false);
            from_date_datepicker.setEnabled(false);
            to_date_datepicker.setEnabled(false);
            patient_relation_textbox.setEditable(false);
        }else if(!insurance_checkbox.isSelected()){
            insurance_id_textbox.setEditable(true);
            insurance_name_textbox.setEditable(true);
            subcriber_name_textbox.setEditable(true);
            from_date_datepicker.setEnabled(true);
            to_date_datepicker.setEnabled(true);
            patient_relation_textbox.setEditable(true);
            from_date_datepicker.setDate(new Date());
            to_date_datepicker.setDate(new Date());
        }
    }//GEN-LAST:event_insurance_checkboxItemStateChanged

    private void employment_checkboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_employment_checkboxItemStateChanged
        if(employment_checkbox.isSelected()){
            patient_occupation_textbox.setText("");
            company_name_textbox.setText("");
            company_address1_textbox.setText("");
            company_address2_textbox.setText("");
            company_number_textbox.setText("");
            colleague_name_textbox.setText("");
            colleague_number_textbox.setText("");
            patient_occupation_textbox.setEditable(false);
            company_name_textbox.setEditable(false);
            company_address1_textbox.setEditable(false);
            company_address2_textbox.setEditable(false);
            company_number_textbox.setEditable(false);
            colleague_name_textbox.setEditable(false);
            colleague_number_textbox.setEditable(false);
        }else if(!employment_checkbox.isSelected()){
            patient_occupation_textbox.setEditable(true);
            company_name_textbox.setEditable(true);
            company_address1_textbox.setEditable(true);
            company_address2_textbox.setEditable(true);
            company_number_textbox.setEditable(true);
            colleague_name_textbox.setEditable(true);
            colleague_number_textbox.setEditable(true);
        }
    }//GEN-LAST:event_employment_checkboxItemStateChanged

    private void patient_tabbedPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_patient_tabbedPaneStateChanged
        jPanel6.setVisible(true);
        if(patient_tabbedPane.getSelectedIndex()!=0){

            if(patient!=null){
                patientIdBox_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();
                }
                if (patient.getPatientFName()!=null&&patient.getPatientLName()!=null){
                    patientNameBox_label.setText(patientFullName);
                }else{
                    patientNameBox_label.setText("");
                }
                if (patient.getBirthDate()!=null) {
                    dobBox_label.setText(sdf.format(patient.getBirthDate()));
                }else{
                    dobBox_label.setText("");
                }

            }
        }
    }//GEN-LAST:event_patient_tabbedPaneStateChanged

    private void save_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save_buttonActionPerformed
        try {
            if(ValidatePatient()){
                if(patient.getPatientId()==null){
                    patientId = inPatientPatientController.getPatientId();
                }
                if(patientId_textbox.getText().length()==0){
                    if(patient.getPatientId()==null){
                        patientId = inPatientPatientController.getPatientId();
                    }
                    patient.setPatientId(patientId);
                }else{
                    patient.setPatientId(patientId_textbox.getText());
                }
                patient.setPatientFName(firstName_textbox.getText().toUpperCase());
                patient.setPatientMName(middleName_textbox.getText().toUpperCase());
                patient.setPatientLName(lastName_textbox.getText().toUpperCase());
                patient.setPatientGender(String.valueOf(gender_combobox.getSelectedItem()));
                patient.setBirthDate(birthDT_datepicker.getDate());
                //patient.setPatientAge(Integer.parseInt(age_textbox.getText()));
                patient.setJoinedDate(joinedDT_datepicker.getDate());
                if(homePhone_textbox.getText().trim().length() != 0){
                    patient.setPatientHtNumber(Long.parseLong(homePhone_textbox.getText()));
                }else{
                    patient.setPatientHtNumber(null);
                }
                if(mobilePhone_textbox.getText().trim().length() != 0){
                    patient.setPatientMNumber(Long.parseLong(mobilePhone_textbox.getText()));
                }else{
                    patient.setPatientMNumber(null);
                }
                if(emergencyNumber_textbox.getText().trim().length() != 0){
                    patient.setPatientENumber(Long.parseLong(emergencyNumber_textbox.getText()));
                }else{
                    patient.setPatientENumber(null);
                }
                patient.setPatientEAddress(emilId_textbox.getText());
                if(op_radiotb.isSelected()){
                    patient.setOpIpStatus("Out Patient");
                }else if(ip_radiotb.isSelected()){
                    patient.setOpIpStatus("In patient");
                }else{
                    patient.setOpIpStatus("Out patient");
                }
                
                String new_ipd = "", new_pat_des = "", new_pat_note = "";
                new_ipd = (ipdNo_textbox.getText() == null)?"":ipdNo_textbox.getText().toString();
                new_pat_des = (indication_textarea.getText() == null)?"":indication_textarea.getText().toUpperCase();
                new_pat_note = (treatmentnote_textarea.getText() == null)?"":treatmentnote_textarea.getText().toUpperCase();
                System.out.println("@@@@@@@@@@ new_ipd: "+new_ipd+"    new_pat_des: "+new_pat_des+"    new_pat_note: "+new_pat_note);
                
                pat_admission.setIpdNo(new_ipd);
                pat_admission.setPatientDisease(new_pat_des);                
                pat_admission.setPatientNote(new_pat_note);
                
                patient.setPresentAddress1(presentAddress_textbox.getText().toUpperCase());
                patient.setPresentAddress2(presentVillage_textbox.getText().toUpperCase());
                patient.setPresentPatientCity(presentCity_textbox.getText().toUpperCase());
                patient.setPresentPatientDistrict(presentDistrict_textbox.getText().toUpperCase());
                patient.setPresentPatientState(String.valueOf(presentState_combobox.getSelectedItem()));
                patient.setPresentPatientCountry(String.valueOf(presentCountry_combobox.getSelectedItem()));
                if(presentZipCode_textbox.getText().trim().length() != 0){
                    patient.setPresentPatientPincode(Long.parseLong(presentZipCode_textbox.getText()));
                }else{
                    patient.setPresentPatientPincode(null);
                }
                patient.setPermanentAddress1(permanentAddress_textbox.getText().toUpperCase());
                patient.setPermanentAddress2(permanentVillage_textbox.getText().toUpperCase());
                patient.setPermanentPatientCity(permanentCity_textbox.getText().toUpperCase());
                patient.setPermanentPatientDistrict(permanentDistrict_textbox.getText().toUpperCase());
                patient.setPermanentPatientState(String.valueOf(permanentState_combobox.getSelectedItem()));
                patient.setPermanentPatientCountry(String.valueOf(PermanentCountry_combobox.getSelectedItem()));
                if(permanentZipCode_textbox.getText().trim().length() != 0){
                    patient.setPermanentPatientPincode(Long.parseLong(permanentZipCode_textbox.getText()));
                }else{
                    patient.setPermanentPatientPincode(null);
                }
                patient.setPatientReligion(String.valueOf(religion_combobox.getSelectedItem()));
                patient.setPatientMaritalStatus(String.valueOf(marital_combobx.getSelectedItem()));
                patient.setPatientLanguage(String.valueOf(language_combobox.getSelectedItem()));
                patient.setPatientComments(comments_textarea.getText().toUpperCase());
                patient.setPatientDrivingLicenseDetails(driving_license_textbox.getText());
                patient.setPatientPassportDetails(passport_details_textbox.getText());
                patient.setPatientAdharCardDetails(adhar_card_textbox.getText());
                patient.setPatientVoterCardDetails(voter_card_textbox.getText());
                patient.setPatientPanCardDetails(pan_card_textbox.getText());
                patient.setInsuranceId(insurance_id_textbox.getText());
                patient.setInsuranceName(insurance_name_textbox.getText());
                patient.setSubscriberName(subcriber_name_textbox.getText());
                patient.setEffectiveFrom(from_date_datepicker.getDate());
                patient.setEffectiveTo(to_date_datepicker.getDate());
                patient.setRelationName(patient_relation_textbox.getText());
                patient.setPatientOccupation(patient_occupation_textbox.getText());
                patient.setCompanyName(company_name_textbox.getText());
                patient.setCompanyAddress1(company_address1_textbox.getText());
                patient.setCompanyAddress2(company_address2_textbox.getText());
                if(company_number_textbox.getText().trim().length() != 0){
                    patient.setCompanyNumber(Long.parseLong(company_number_textbox.getText()));
                }else{
                    patient.setCompanyNumber(null);
                }
                patient.setColleagueReference(colleague_name_textbox.getText());
                if(colleague_number_textbox.getText().trim().length() != 0){
                    patient.setColleagueNumber(Long.parseLong(colleague_number_textbox.getText()));
                }else{
                    patient.setColleagueNumber(null);
                }
                            inPatientPatientController.savePatientAdmission(pat_admission);
                            if(inPatientPatientController.savePatientAdmission(pat_admission));
                    else JOptionPane.showMessageDialog(null, "Admission Data not Saved !!!");
                if(patient.getId()==null){
                    if(inPatientPatientController.isDuplicatePatient(patient)){
                        if(JOptionPane.showConfirmDialog(null, "Patient is already available with same details.\nDo you want to register again ?","", JOptionPane.OK_CANCEL_OPTION)==0){
                           
                            inPatientPatientController.savePatientRegistration(patient);
                            patientId_textbox.setText(patient.getPatientId());
                            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("success.save",new Object[]{"Patient"}));
                        }
                    } else{
                        inPatientPatientController.savePatientRegistration(patient);
                        patientId_textbox.setText(patient.getPatientId());
                        JOptionPane.showMessageDialog(null, MessageProperties.getMessage("success.save",new Object[]{"Patient"}));
                    }
                }else{
                    inPatientPatientController.savePatientRegistration(patient);
                    patientId_textbox.setText(patient.getPatientId());
                    JOptionPane.showMessageDialog(null, MessageProperties.getMessage("success.save",new Object[]{"Patient"}));
                }
                //clearFieldValues();
                //dispose();
              
            }
            
        }catch(HibernateOptimisticLockingFailureException e){
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.update",new Object[]{"Patient"}));
        }catch(ConstraintViolationException e){
            try{
                patientId = inPatientPatientController.getPatientId();
                patient.setPatientId(patientId);
                //inPatientPatientController.savePatientAdmission(pat_admission);
                if(inPatientPatientController.savePatientRegistration(patient)){
                    //if(inPatientPatientController.savePatientAdmission(pat_admission)) JOptionPane.showMessageDialog(null, "Data Saved Successfully !!!");
                    //else JOptionPane.showMessageDialog(null, "Admission Data not Saved !!!");
                }else{
                    JOptionPane.showMessageDialog(null, "Data not Saved !!!");
                }
            }catch(Exception e1){e1.printStackTrace();}
        }catch(ProcessingException e){
            e.printStackTrace();
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"Patient"}));
            throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }catch(Exception e){
            e.printStackTrace();
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("error.save",new Object[]{"Patient"}));
        }
       // displayPatientRecord(patient);
        
       
    }//GEN-LAST:event_save_buttonActionPerformed

    private void reset_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reset_buttonActionPerformed
        clearFieldValues();
        dispose();
        //displayAdmissionInformation(admission);
       
    }//GEN-LAST:event_reset_buttonActionPerformed

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

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

   
    /* @param args the command line arguments
     
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PatienRecordUpdateDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PatienRecordUpdateDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PatienRecordUpdateDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PatienRecordUpdateDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog 
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                PatienRecordUpdateDialog dialog = new PatienRecordUpdateDialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
*/
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Address_lable;
    private javax.swing.JComboBox PermanentCountry_combobox;
    private javax.swing.JPanel address_panel;
    private javax.swing.JTextField adhar_card_textbox;
    private javax.swing.JTextField age_textbox;
    private javax.swing.JTextField agemm_textbox;
    private com.toedter.calendar.JDateChooser birthDT_datepicker;
    private javax.swing.JButton cancel_button;
    private javax.swing.JTextField colleague_name_textbox;
    private javax.swing.JTextField colleague_number_textbox;
    private javax.swing.JTextArea comments_textarea;
    private javax.swing.JTextField company_address1_textbox;
    private javax.swing.JTextField company_address2_textbox;
    private javax.swing.JTextField company_name_textbox;
    private javax.swing.JTextField company_number_textbox;
    private javax.swing.JLabel contact_details_title;
    private javax.swing.JPanel demogrphic_panel;
    private javax.swing.JLabel dobBox_label;
    private javax.swing.JTextField driving_license_textbox;
    private javax.swing.JTextField emergencyNumber_textbox;
    private javax.swing.JTextField emilId_textbox;
    private javax.swing.JPanel employeement_panel;
    private javax.swing.JCheckBox employment_checkbox;
    private javax.swing.JTextField firstName_textbox;
    private com.toedter.calendar.JDateChooser from_date_datepicker;
    private javax.swing.JComboBox gender_combobox;
    private javax.swing.JTextField homePhone_textbox;
    private javax.swing.JTextArea indication_textarea;
    private javax.swing.JCheckBox insurance_checkbox;
    private javax.swing.JTextField insurance_id_textbox;
    private javax.swing.JTextField insurance_name_textbox;
    private javax.swing.JPanel insurance_panel;
    private javax.swing.JRadioButton ip_radiotb;
    private javax.swing.JTextField ipdNo_textbox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    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 jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private com.toedter.calendar.JDateChooser joinedDT_datepicker;
    private javax.swing.JComboBox language_combobox;
    private javax.swing.JTextField lastName_textbox;
    private javax.swing.JComboBox marital_combobx;
    private javax.swing.JTextField middleName_textbox;
    private javax.swing.JTextField mobilePhone_textbox;
    private javax.swing.JRadioButton op_radiotb;
    private javax.swing.ButtonGroup opip_buttonGroup;
    private javax.swing.JTextField pan_card_textbox;
    private javax.swing.JTextField passport_details_textbox;
    private javax.swing.JLabel patientIdBox_label;
    private javax.swing.JTextField patientId_textbox;
    private javax.swing.JLabel patientNameBox_label;
    private javax.swing.JLabel patientType_label;
    private javax.swing.JLabel patient_details_title;
    private javax.swing.JLabel patient_details_title1;
    private javax.swing.JLabel patient_employment_title;
    private javax.swing.JLabel patient_insurance_title;
    private javax.swing.JLabel patient_lable;
    private javax.swing.JTextField patient_occupation_textbox;
    private javax.swing.JLabel patient_registration_lable;
    private javax.swing.JTextField patient_relation_textbox;
    private javax.swing.JTabbedPane patient_tabbedPane;
    private javax.swing.JCheckBox permanentAddress_checkbox;
    private javax.swing.JTextField permanentAddress_textbox;
    private javax.swing.JTextField permanentCity_textbox;
    private javax.swing.JTextField permanentDistrict_textbox;
    private javax.swing.JComboBox permanentState_combobox;
    private javax.swing.JTextField permanentVillage_textbox;
    private javax.swing.JTextField permanentZipCode_textbox;
    private javax.swing.JLabel permanent_address_title;
    private javax.swing.JTextField presentAddress_textbox;
    private javax.swing.JTextField presentCity_textbox;
    private javax.swing.JComboBox presentCountry_combobox;
    private javax.swing.JTextField presentDistrict_textbox;
    private javax.swing.JComboBox presentState_combobox;
    private javax.swing.JTextField presentVillage_textbox;
    private javax.swing.JTextField presentZipCode_textbox;
    private javax.swing.JLabel present_address_title;
    private javax.swing.JComboBox religion_combobox;
    private javax.swing.JButton reset_button;
    private javax.swing.JButton save_button;
    private javax.swing.JLabel social_information_title;
    private javax.swing.JTextField subcriber_name_textbox;
    private com.toedter.calendar.JDateChooser to_date_datepicker;
    private javax.swing.JTextArea treatmentnote_textarea;
    private javax.swing.JTextField voter_card_textbox;
    // End of variables declaration//GEN-END:variables
    /** The patient id. */
    private String patientId;
    private String ipdNo;
    private String patientDisease;
    private String patientNote;
    
    /** The patient unique id. */
    private Long patientUniqueId;
    
    /** The patient. */
    private TPatient patient;
    private TInpatentAdmission admission;
    
    /** The patient controller. */
    private InPatientPatientController inPatientPatientController;
    
    /** The code values controller. */
    private InPatientCodeValuesController inPatientCodeValuesController;
    
    /** The gender list. */
    private Vector<TCCodeValues> genderList = new Vector<TCCodeValues>();
    
    /** The religion list. */
    private Vector<TCCodeValues> religionList = new Vector<TCCodeValues>();
    
    /** The marital status list. */
    private Vector<TCCodeValues> maritalStatusList = new Vector<TCCodeValues>();
    
    /** The language list. */
    private Vector<TCCodeValues> languageList = new Vector<TCCodeValues>();
    
    /** The state list. */
    private Vector<TCCodeValues> stateList = new Vector<TCCodeValues>();
    
    /** The country list. */
    private Vector<TCCodeValues> countryList = new Vector<TCCodeValues>();
    
    /** The sdf. */
    private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    
    /** The Main app. */
    private javax.swing.JFrame MainAPP;
    
    /**
     * Populate data.
     */
    private void populateData(){
        
        inPatientPatientController = (InPatientPatientController)HealthCareInpatientHome.context.getBean("inPatientPatientController");
        inPatientCodeValuesController = (InPatientCodeValuesController)HealthCareInpatientHome.context.getBean("inPatientCodeValuesController");
        try{
                genderList = inPatientCodeValuesController.getCodeValues("gender");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"gender"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }try{
                religionList = inPatientCodeValuesController.getCodeValues("religion");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"religion"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }try{
                maritalStatusList = inPatientCodeValuesController.getCodeValues("marital status");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"marital status"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }try{
                languageList = inPatientCodeValuesController.getCodeValues("language");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"language"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }
        try{
                stateList = inPatientCodeValuesController.getCodeValues("state");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"state"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }try{
                countryList = inPatientCodeValuesController.getCodeValues("country");
        }catch(ProcessingException e){
             JOptionPane.showMessageDialog(null,MessageProperties.getMessage("error.fetch",new Object[]{"country"}));
             throw new HealthCareException(MessageProperties.getMessage("error.dao"));
        }
    }
    
    /**
     * Display patient record.
     *
     * @param ID the id
     */
    private void displayPatientRecord(TPatient patient) {
        if(patient!=null){     
            ipdNo_textbox.setText(ipd_number);
            indication_textarea.setText(pat_desease);
            treatmentnote_textarea.setText(pat_note);
            
            this.patient = patient;
            patientIdBox_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();
                }
            if (patient.getPatientFName()!=null&&patient.getPatientLName()!=null){
            patientNameBox_label.setText(patientFullName);
            }
            if (patient.getBirthDate()!=null) {
                dobBox_label.setText(sdf.format(patient.getBirthDate()));
                }
            patient_registration_lable.setText("");
            patient_lable.setVisible(true);
            patient_lable.setText(String.valueOf(patient.getPatientId()+" "+":"+" "+patientFullName));
            patientId_textbox.setText(String.valueOf(patient.getPatientId()));
            if(patient.getOpIpStatus().equalsIgnoreCase("Out Patient")){
                op_radiotb.setSelected(true);
                ip_radiotb.setSelected(false);
            }else if(patient.getOpIpStatus().equalsIgnoreCase("In Patient")){
                op_radiotb.setSelected(false);
                ip_radiotb.setSelected(true);
            }
            firstName_textbox.setText(patient.getPatientFName());
            middleName_textbox.setText(patient.getPatientMName());
            lastName_textbox.setText(patient.getPatientLName());
            gender_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(genderList,patient.getPatientGender()));
            birthDT_datepicker.setDate(patient.getBirthDate());
            //age_textbox.setText(String.valueOf(patient.getPatientAge()));
            joinedDT_datepicker.setDate(patient.getJoinedDate());
            if(patient.getPatientHtNumber()!=null){
            homePhone_textbox.setText(String.valueOf(patient.getPatientHtNumber()));
            }else{
            homePhone_textbox.setText("");
            }
            if(patient.getPatientMNumber()!=null){
            mobilePhone_textbox.setText(String.valueOf(patient.getPatientMNumber()));
            }else{
            mobilePhone_textbox.setText("");
            }
            if(patient.getPatientENumber()!=null){
            emergencyNumber_textbox.setText(String.valueOf(patient.getPatientENumber()));
            }else{
            emergencyNumber_textbox.setText("");
            }
            emilId_textbox.setText(patient.getPatientEAddress());
            religion_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(religionList,patient.getPatientReligion()));
            marital_combobx.setSelectedIndex(CollectionUtill.getCodeValueIndex(maritalStatusList,patient.getPatientMaritalStatus()));
            language_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(languageList,patient.getPatientLanguage()));
            comments_textarea.setText(patient.getPatientComments());
            driving_license_textbox.setText(patient.getPatientDrivingLicenseDetails());
            passport_details_textbox.setText(patient.getPatientPassportDetails());
            pan_card_textbox.setText(patient.getPatientPanCardDetails());
            voter_card_textbox.setText(patient.getPatientVoterCardDetails());
            adhar_card_textbox.setText(patient.getPatientAdharCardDetails());
            presentAddress_textbox.setText(patient.getPresentAddress1());
            presentVillage_textbox.setText(patient.getPresentAddress2());
            presentCity_textbox.setText(patient.getPresentPatientCity());
            presentDistrict_textbox.setText(patient.getPresentPatientDistrict());
            presentState_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(stateList,patient.getPresentPatientState()));
            presentCountry_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(countryList,patient.getPresentPatientCountry()));
            if(patient.getPresentPatientPincode()!=null){
            presentZipCode_textbox.setText(String.valueOf(patient.getPresentPatientPincode()));
            }else{
            presentZipCode_textbox.setText("");
            }
            permanentAddress_textbox.setText(patient.getPermanentAddress1());
            permanentVillage_textbox.setText(patient.getPermanentAddress2());
            permanentCity_textbox.setText(patient.getPermanentPatientCity());
            permanentDistrict_textbox.setText(patient.getPermanentPatientDistrict());
            permanentState_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(stateList,patient.getPermanentPatientState()));
            PermanentCountry_combobox.setSelectedIndex(CollectionUtill.getCodeValueIndex(countryList,patient.getPermanentPatientCountry()));
            if(patient.getPermanentPatientPincode()!=null){
            permanentZipCode_textbox.setText(String.valueOf(patient.getPermanentPatientPincode()));
            }else{
            permanentZipCode_textbox.setText("");
            }
            insurance_id_textbox.setText(patient.getInsuranceId());
            insurance_name_textbox.setText(patient.getInsuranceName());
            subcriber_name_textbox.setText(patient.getSubscriberName());
            from_date_datepicker.setDate(patient.getEffectiveFrom());
            to_date_datepicker.setDate(patient.getEffectiveTo());
            patient_relation_textbox.setText(patient.getRelationName());
            patient_occupation_textbox.setText(patient.getPatientOccupation());
            company_name_textbox.setText(patient.getCompanyName());
            company_address1_textbox.setText(patient.getCompanyAddress1());
            company_address2_textbox.setText(patient.getCompanyAddress2());
            if(patient.getCompanyNumber()!=null){
            company_number_textbox.setText(String.valueOf(patient.getCompanyNumber()));
            }else{
            company_number_textbox.setText("");
            }
            colleague_name_textbox.setText(patient.getColleagueReference());
            if(patient.getColleagueNumber()!=null){
            colleague_number_textbox.setText(String.valueOf(patient.getColleagueNumber()));
            }else{
            colleague_number_textbox.setText("");
            }
        }else{
                JOptionPane.showMessageDialog(null, MessageProperties.getMessage("notfound"));
            }
    }
    private void displayAdmissionInformation(TInpatentAdmission admission){
        ipdNo_textbox.setText(admission.getIpdNo());
        indication_textarea.setText(admission.getPatientDisease());
        treatmentnote_textarea.setText(admission.getPatientNote());
    }
    private boolean ValidatePatient() {
        boolean valid = true;
        if (this.firstName_textbox.getText().trim().length() == 0) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("firstname.mandatory"));
            firstName_textbox.requestFocus();
            firstName_textbox.selectAll();
            valid = false;
        }else if (this.firstName_textbox.getText().trim().length() != 0 && !this.firstName_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("firstname.pattern"));
            firstName_textbox.requestFocus();
            firstName_textbox.selectAll();
            valid = false;
        }
        else if (this.middleName_textbox.getText().trim().length() != 0 && !this.middleName_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("middile.pattern"));
            middleName_textbox.requestFocus();
            middleName_textbox.selectAll();
            valid = false;
        }
        else if (this.lastName_textbox.getText().trim().length() == 0) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("lastname.mandatory"));
            lastName_textbox.requestFocus();
            lastName_textbox.selectAll();
            valid = false;
        }
        else if (this.lastName_textbox.getText().trim().length() != 0 && !this.lastName_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("lastname.pattern"));
            lastName_textbox.requestFocus();
            lastName_textbox.selectAll();
            valid = false;
        }
        else if (this.gender_combobox.getSelectedItem()==null) {

            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("gender"));
            gender_combobox.requestFocus();
            valid = false;
       }
       else if (this.birthDT_datepicker.getDate() == null) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("dob"));
            birthDT_datepicker.requestFocus();
            valid = false;
       }
        else if (!this.homePhone_textbox.getText().equals("") && !(this.homePhone_textbox.getText().matches("^\\d{10}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("homenumber") );
           homePhone_textbox.requestFocus();
           homePhone_textbox.selectAll();
            valid = false;
        }
        else if (!this.mobilePhone_textbox.getText().equals("") && !(this.mobilePhone_textbox.getText().matches("^\\d{10}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("mobilenumber") );
           mobilePhone_textbox.requestFocus();
           mobilePhone_textbox.selectAll();
            valid = false;
        }
        else if (!this.emergencyNumber_textbox.getText().equals("") && !(this.emergencyNumber_textbox.getText().matches("^\\d{10}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("emergencynumber") );
           emergencyNumber_textbox.requestFocus();
           emergencyNumber_textbox.selectAll();
            valid = false;
        }
        else if (this.presentCity_textbox.getText().trim().length() != 0 && !this.presentCity_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("city"));
            presentCity_textbox.requestFocus();
            presentCity_textbox.selectAll();
            valid = false;
        }
        else if (this.presentDistrict_textbox.getText().trim().length() != 0 && !this.presentDistrict_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("dist"));
            presentDistrict_textbox.requestFocus();
            presentDistrict_textbox.selectAll();
            valid = false;
        }
        else if (!this.presentZipCode_textbox.getText().equals("") && !(this.presentZipCode_textbox.getText().matches("^\\d{6}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("zipcode") );
           presentZipCode_textbox.requestFocus();
           presentZipCode_textbox.selectAll();
            valid = false;
        } 
        else if (this.permanentCity_textbox.getText().trim().length() != 0 && !this.permanentCity_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("city"));
            permanentCity_textbox.requestFocus();
            permanentCity_textbox.selectAll();
            valid = false;
        }
        else if (this.permanentDistrict_textbox.getText().trim().length() != 0 && !this.permanentDistrict_textbox.getText().matches("^[A-Za-z]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("dist"));
            permanentDistrict_textbox.requestFocus();
            permanentDistrict_textbox.selectAll();
            valid = false;
        }
        else if (!this.permanentZipCode_textbox.getText().equals("") && !(this.permanentZipCode_textbox.getText().matches("^\\d{6}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("zipcode") );
           permanentZipCode_textbox.requestFocus();
           permanentZipCode_textbox.selectAll();
            valid = false;
        }
        else if (!this.emilId_textbox.getText().equals("") && !(this.emilId_textbox.getText().matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"))) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("email") );
           emilId_textbox.requestFocus();
           emilId_textbox.selectAll();
            valid = false;
        } 
        else if (this.insurance_name_textbox.getText().trim().length() != 0 && !this.insurance_name_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("insurancename"));
            insurance_name_textbox.requestFocus();
            insurance_name_textbox.selectAll();
            valid = false;
        }
         else if (this.subcriber_name_textbox.getText().trim().length() != 0 && !this.subcriber_name_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("subscribername"));
            subcriber_name_textbox.requestFocus();
            subcriber_name_textbox.selectAll();
            valid = false;
        }
         else if (this.patient_relation_textbox.getText().trim().length() != 0 && !this.patient_relation_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("relnwithpatient"));
            patient_relation_textbox.requestFocus();
            patient_relation_textbox.selectAll();
            valid = false;
        }
        else if (this.patient_occupation_textbox.getText().trim().length() != 0 && !this.patient_occupation_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("patientoccupation"));
            patient_occupation_textbox.requestFocus();
            patient_occupation_textbox.selectAll();
            valid = false;
        }
        else if (this.company_name_textbox.getText().trim().length() != 0 && !this.company_name_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("companyname"));
            company_name_textbox.requestFocus();
            company_name_textbox.selectAll();
            valid = false;
        }
        else if (!this.company_number_textbox.getText().equals("") && !(this.company_number_textbox.getText().matches("^\\d{10}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("companynumber") );
           company_number_textbox.requestFocus();
           company_number_textbox.selectAll();
            valid = false;
        }
        else if (this.colleague_name_textbox.getText().trim().length() != 0 && !this.colleague_name_textbox.getText().matches("^[A-Za-z ]*$")) {
            JOptionPane.showMessageDialog(null, MessageProperties.getMessage("referencecolleague"));
            colleague_name_textbox.requestFocus();
            colleague_name_textbox.selectAll();
            valid = false;
        }
        else if (!this.colleague_number_textbox.getText().equals("") && !(this.colleague_number_textbox.getText().matches("^\\d{10}$") )) {
           JOptionPane.showMessageDialog(null, MessageProperties.getMessage("referencecolleaguenum") );
           colleague_number_textbox.requestFocus();
           colleague_number_textbox.selectAll();
            valid = false;
        }
        
        return valid;
    }
    
    private void clearFieldValues() {
        patient = new TPatient();
        patientId_textbox.setText("");
        firstName_textbox.setText("");
        middleName_textbox.setText("");
        lastName_textbox.setText("");
        gender_combobox.setSelectedIndex(-1);
        birthDT_datepicker.setDate(null);
        age_textbox.setText("");
        agemm_textbox.setText("");
        joinedDT_datepicker.setDate(null);
        homePhone_textbox.setText("");
        mobilePhone_textbox.setText("");
        emergencyNumber_textbox.setText("");
        emilId_textbox.setText("");
        religion_combobox.setSelectedIndex(-1);
        //religion_textbox.setText("");
        marital_combobx.setSelectedIndex(-1);
        language_combobox.setSelectedIndex(-1);
        //language_textbox.setText("");
        comments_textarea.setText("");
        driving_license_textbox.setText("");
        pan_card_textbox.setText("");
        passport_details_textbox.setText("");
        adhar_card_textbox.setText("");
        voter_card_textbox.setText("");
        presentAddress_textbox.setText("");
        presentCity_textbox.setText("");
        presentVillage_textbox.setText("");
        presentDistrict_textbox.setText("");
        presentState_combobox.setSelectedIndex(-1);
        presentCountry_combobox.setSelectedIndex(-1);
        presentZipCode_textbox.setText("");
        permanentAddress_checkbox.setSelected(false);
        permanentAddress_textbox.setText("");
        permanentVillage_textbox.setText("");
        permanentCity_textbox.setText("");
        permanentDistrict_textbox.setText("");
        permanentState_combobox.setSelectedIndex(-1);
        PermanentCountry_combobox.setSelectedIndex(-1);
        permanentZipCode_textbox.setText("");
        insurance_checkbox.setSelected(false);
        insurance_id_textbox.setText("");
        insurance_name_textbox.setText("");
        subcriber_name_textbox.setText("");
        from_date_datepicker.setDate(null);
        to_date_datepicker.setDate(null);
        patient_relation_textbox.setText("");
        employment_checkbox.setSelected(false);
        patient_occupation_textbox.setText("");
        company_name_textbox.setText("");
        company_address1_textbox.setText("");
        company_address2_textbox.setText("");
        company_number_textbox.setText("");
        colleague_name_textbox.setText("");
        colleague_number_textbox.setText("");
        opip_buttonGroup.clearSelection();
    }
    
}

Commits for Aurocare_27_07_2018/AuroCareHealthCareInPatient/src/main/java/com/bestray/healthcareinpatient/view/PatienInformationDialog.java

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