Subversion Repository Public Repository

Satyam

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareinpatient.view;

import com.bestray.healthcarecommonutil.vo.TIPMaternityDetails;
import com.bestray.healthcarecommonutil.vo.TInpatentAdmission;
import com.bestray.healthcarecommonutil.vo.TPatientEncounter;
import com.bestray.healthcareinpatient.controller.InPatientDischargeController;
import com.bestray.healthcareinpatient.reports.IPDischargeReport;
import com.bestray.healthcareinpatient.reports.IPMaternityDischargeReport;
import com.bestray.healthcareinpatient.util.MessageProperties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author DELL
 */
public class PatientTypeJDialog extends javax.swing.JDialog {
private  TInpatentAdmission inPatientAdmission;
private TPatientEncounter encounter;
private TIPMaternityDetails ipMaternityDetails;       
private InPatientDischargeController inPatientDischargeController;
 

    public PatientTypeJDialog(java.awt.Frame parent, boolean modal,TInpatentAdmission inPatientAdmission,TPatientEncounter encounter) {
        super(parent, modal);
        this.inPatientAdmission = inPatientAdmission;
        this.encounter=encounter;
        populate();
        initComponents();
    }

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

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        date_of_delivery_jLabel = new javax.swing.JLabel();
        time_of_delivery_jLabel = new javax.swing.JLabel();
        sex_of_child_jLabel = new javax.swing.JLabel();
        weight_of_child_jLabel = new javax.swing.JLabel();
        time_of_delivery_TextField = new javax.swing.JTextField();
        weight_of_child_TextField = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        save_Button = new javax.swing.JButton();
        report_Button = new javax.swing.JButton();
        deliveryDT_datepicker = new com.toedter.calendar.JDateChooser();
        jLabel2 = new javax.swing.JLabel();
        sex_of_child_Combobox = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(51, 51, 255));
        jLabel1.setText("Enter The Followings.");

        date_of_delivery_jLabel.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        date_of_delivery_jLabel.setText("Date Of Delivery:");
        date_of_delivery_jLabel.setVisible(true);

        time_of_delivery_jLabel.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        time_of_delivery_jLabel.setText("Time Of Delivery:");
        time_of_delivery_jLabel.setVisible(true);

        sex_of_child_jLabel.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        sex_of_child_jLabel.setText("Sex Of Child :");
        sex_of_child_jLabel.setVisible(true);

        weight_of_child_jLabel.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        weight_of_child_jLabel.setText("Weight Of Child :");
        weight_of_child_jLabel.setVisible(true);

        time_of_delivery_TextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                time_of_delivery_TextFieldActionPerformed(evt);
            }
        });
        time_of_delivery_TextField.setVisible(true);

        weight_of_child_TextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                weight_of_child_TextFieldActionPerformed(evt);
            }
        });
        weight_of_child_TextField.setVisible(true);

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

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

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(save_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(report_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(save_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(report_Button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(52, 52, 52))
        );

        deliveryDT_datepicker.setVisible(true);

        jLabel2.setFont(new java.awt.Font("SansSerif", 3, 10)); // NOI18N
        jLabel2.setText("HH:MM:SS");

        sex_of_child_Combobox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "FEMALE", "MALE"}));
        sex_of_child_Combobox.setSelectedIndex(-1);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(time_of_delivery_jLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(date_of_delivery_jLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(sex_of_child_jLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(weight_of_child_jLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(weight_of_child_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(0, 162, Short.MAX_VALUE)
                                        .addComponent(jLabel2))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(deliveryDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(time_of_delivery_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(sex_of_child_Combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(0, 0, Short.MAX_VALUE)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(date_of_delivery_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(deliveryDT_datepicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(time_of_delivery_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(time_of_delivery_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(sex_of_child_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(sex_of_child_Combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(weight_of_child_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(weight_of_child_TextField)))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 20, Short.MAX_VALUE))
        );

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

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

    private void report_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_report_ButtonActionPerformed
try{
    inPatientDischargeController.dischargeInPatient(inPatientAdmission);
    Long encounterId = encounter.getEncId();
    String Name = inPatientAdmission.getPatientId().getPatientFName();
    IPMaternityDischargeReport iPDichargeReport = new IPMaternityDischargeReport();
                iPDichargeReport.getPdfReport(encounterId,Name);
                iPDichargeReport.openPdfReport();
}
catch(Exception ex){
    
}
   this.dispose();     
    }//GEN-LAST:event_report_ButtonActionPerformed

    private void save_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save_ButtonActionPerformed
       if(ValidateMaternityDetails()){
           saveMaternityDetails();
           clearMaternityDetails();
       // }
    }//GEN-LAST:event_save_ButtonActionPerformed
    }
    private void weight_of_child_TextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_weight_of_child_TextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_weight_of_child_TextFieldActionPerformed

    private void time_of_delivery_TextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_time_of_delivery_TextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_time_of_delivery_TextFieldActionPerformed
private boolean ValidateMaternityDetails() {
        boolean valid = true;
        if(deliveryDT_datepicker.getDate()==null){
                JOptionPane.showMessageDialog(null,"Choose The Delivery Date.");
            valid = false;
            }
        else if (this.time_of_delivery_TextField.getText().trim().length() == 0) {
            JOptionPane.showMessageDialog(null,"Time Of Delivery for Child is Mandatory");
             valid = false;
        }
        else if (this.weight_of_child_TextField.getText().trim().length() == 0) {
            JOptionPane.showMessageDialog(null, "Weight Of Child is Mandatory");
            valid = false;
        }
        
        else if(sex_of_child_Combobox.getSelectedItem()==null){
            JOptionPane.showMessageDialog(null, "Sex Of Child is Mandatory");
            valid = false;
        }
         
        return valid;
    
}
private void clearMaternityDetails(){
       ipMaternityDetails=new  TIPMaternityDetails();
       weight_of_child_TextField.setText(null);
       time_of_delivery_TextField.setText(null);
       deliveryDT_datepicker.setDate(null);
        sex_of_child_Combobox.setSelectedIndex(-1);    
    }
    
   
public void saveMaternityDetails() {
       try{
           ipMaternityDetails=new TIPMaternityDetails();
           System.out.println("Encounter:--------------"+encounter.getEncId().toString());        
           ipMaternityDetails.setInpatientMatEnc(encounter);
           ipMaternityDetails.setDate_Of_Delivery(deliveryDT_datepicker.getDate()); 
           ipMaternityDetails.setSex_Of_Child(sex_of_child_Combobox.getSelectedItem().toString());
           ipMaternityDetails.setWeight_Of_Child(Float.parseFloat(weight_of_child_TextField.getText()));
           ipMaternityDetails.setTime_Of_Delivery(time_of_delivery_TextField.getText());
          inPatientDischargeController.saveMaternityDetails(ipMaternityDetails);          
          JOptionPane.showMessageDialog(null, "MaternityDetails Saved Successfully.");
       }
       catch(Exception ex){
          ex.printStackTrace();
                Logger.getLogger(EncounterPanel.class.getName()).log(Level.SEVERE, null, ex); 
       }
        
    }
private void populate() {
        ipMaternityDetails=new TIPMaternityDetails();
        //inPatientAdmission = new TInpatentAdmission();
       // encounter = new TPatientEncounter();
        inPatientDischargeController = (InPatientDischargeController)HealthCareInpatientHome.context.getBean("inPatientDischargeController");
    }
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JLabel date_of_delivery_jLabel;
    private com.toedter.calendar.JDateChooser deliveryDT_datepicker;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JButton report_Button;
    private javax.swing.JButton save_Button;
    private javax.swing.JComboBox sex_of_child_Combobox;
    private javax.swing.JLabel sex_of_child_jLabel;
    private javax.swing.JTextField time_of_delivery_TextField;
    private javax.swing.JLabel time_of_delivery_jLabel;
    private javax.swing.JTextField weight_of_child_TextField;
    private javax.swing.JLabel weight_of_child_jLabel;
    // End of variables declaration//GEN-END:variables
}

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

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