Subversion Repository Public Repository

Pharmacy_09_03_18

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
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareemr.Views;

import com.bestray.healthcarecommonutil.exception.HealthCareException;
import com.bestray.healthcarecommonutil.util.CurvedGradientPanel;
import com.bestray.healthcarecommonutil.vo.TPermission;
import com.bestray.healthcarecommonutil.util.PreferenceUtil;
import static com.bestray.healthcareinpatient.view.InPatientHomePanel.home_display_panel;
import com.bestray.healthcarepharmacy.view.PatientBillingPanel;
import com.bestray.healthcarepharmacy.view.PharmacyPurchasePanel;
import com.bestray.healthcarepharmacy.view.PharmacyReportPanel;
import com.bestray.healthcarepharmacy.view.PharmacySetupPanel;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;

// TODO: Auto-generated Javadoc
/**
 * The Class PatientRegDisplayPanel.
 *
 * @author user3
 */
public class PatientRegDisplayPanel extends CurvedGradientPanel {

    /**
     * Creates new form PatientRegDisplayPanel.
     */
    List<TPermission> permissions = new ArrayList<TPermission>();
    private Preferences myPrefObj = Preferences.userRoot();
    public PatientRegDisplayPanel() {
        try{
            permissions=(List<TPermission>)PreferenceUtil.getObject(myPrefObj, "permissions");
        }catch(Exception e){
            throw new HealthCareException("Not Getting All Permissions For the loggedin User");
        }
        initComponents();
        if(permissions.contains("REPORTS")){
            reports_label.setVisible(true);
        }else{
            reports_label.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() {

        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        pharmacy_purchase = new javax.swing.JLabel();
        sales_billing = new javax.swing.JLabel();
        reports_label = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        pharmacy_setup = new javax.swing.JLabel();

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

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pharm_home.png"))); // NOI18N

        jPanel2.setOpaque(false);

        pharmacy_purchase.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        pharmacy_purchase.setForeground(new java.awt.Color(51, 102, 255));
        pharmacy_purchase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-add-shopping-cart-96.png"))); // NOI18N
        pharmacy_purchase.setText("Purchase");
        pharmacy_purchase.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        pharmacy_purchase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pharmacy_purchaseMouseClicked(evt);
            }
        });

        sales_billing.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        sales_billing.setForeground(new java.awt.Color(51, 102, 255));
        sales_billing.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-bill-962.png"))); // NOI18N
        sales_billing.setText("Sales Billing");
        sales_billing.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        sales_billing.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                sales_billingMouseClicked(evt);
            }
        });

        reports_label.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        reports_label.setForeground(new java.awt.Color(51, 102, 255));
        reports_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-report-card-961.png"))); // NOI18N
        reports_label.setText("Reports");
        reports_label.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        reports_label.setName("REPORTS"); // NOI18N
        reports_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                reports_labelMouseClicked(evt);
            }
        });

        jPanel1.setOpaque(false);
        jPanel1.setLayout(null);

        pharmacy_setup.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        pharmacy_setup.setForeground(new java.awt.Color(51, 102, 255));
        pharmacy_setup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-hospital-96.png"))); // NOI18N
        pharmacy_setup.setText("Pharmacy Setup");
        pharmacy_setup.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        pharmacy_setup.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pharmacy_setupMouseClicked(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()
                .addGap(39, 39, 39)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pharmacy_purchase)
                    .addComponent(pharmacy_setup, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(134, 134, 134)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(reports_label)
                        .addGap(366, 366, 366)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(sales_billing))
                .addContainerGap(1685, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(92, 92, 92))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(106, 106, 106)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pharmacy_purchase)
                    .addComponent(sales_billing))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 133, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(pharmacy_setup)
                    .addComponent(reports_label, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(109, 109, 109))
        );

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

    /**
     * Reports_label mouse clicked.
     *
     * @param evt the evt
     */
    private void reports_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reports_labelMouseClicked
        HealthCareEmrAdvanceHome.button_panel.setVisible(true);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.removeAll();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.updateUI();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setBackground(Color.WHITE);
        //HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new ReportPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PharmacyReportPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setVisible(true);
    }//GEN-LAST:event_reports_labelMouseClicked
//    private void logout_buttonActionPerformed(java.awt.event.ActionEvent evt) {                                              
//        Preferences myPrefObj = Preferences.userRoot();
//        try{
//            PreferenceUtil.putObject(myPrefObj, "user", null);
//            PreferenceUtil.putObject(myPrefObj, "permissions", null);
//            PreferenceUtil.putObject(myPrefObj, "udepartments", null);
//            PreferenceUtil.putObject(myPrefObj, "selecteddepartment", null);
//            PreferenceUtil.putObject(myPrefObj, "sections", null);
//        }catch(Exception e){}
//        
//        new HealthcareLogin().setVisible(true);
//    }
    /**
     * Search_label mouse clicked.
     *
     * @param evt the evt
     */
          
    private void sales_billingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sales_billingMouseClicked
        HealthCareEmrAdvanceHome.button_panel.setVisible(true);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.removeAll();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.updateUI();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setBackground(Color.WHITE);
        //HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PatientLookuppanel("Registration"),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PatientBillingPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setVisible(true);
    }//GEN-LAST:event_sales_billingMouseClicked

    private void pharmacy_purchaseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pharmacy_purchaseMouseClicked
        HealthCareEmrAdvanceHome.button_panel.setVisible(true);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.removeAll();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.updateUI();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setBackground(Color.WHITE);
        //HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PatientRegistrationPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PharmacyPurchasePanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setVisible(true);
    }//GEN-LAST:event_pharmacy_purchaseMouseClicked

    private void pharmacy_setupMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pharmacy_setupMouseClicked
        HealthCareEmrAdvanceHome.button_panel.setVisible(true);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.removeAll();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.updateUI();
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setBackground(Color.WHITE);
        //HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PatientRegistrationPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.add(new PharmacySetupPanel(),java.awt.BorderLayout.CENTER);
        HealthCareEmrAdvanceHome.patientinfo_right_display_panel.setVisible(true);
    }//GEN-LAST:event_pharmacy_setupMouseClicked

                                                     

    
    /**
     * Patientreg_label mouse clicked.
     *
     * @param evt the evt
     */
   
        
//    private void purchase_btActionPerformed(java.awt.event.ActionEvent evt) {                                            
//        home_display_panel.removeAll();
//        home_display_panel.updateUI();
//        home_display_panel.setBackground(Color.WHITE);
//        home_display_panel.add(new PharmacyPurchasePanel(),java.awt.BorderLayout.CENTER);
//        home_display_panel.setVisible(true);
//    }      
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel pharmacy_purchase;
    private javax.swing.JLabel pharmacy_setup;
    private javax.swing.JLabel reports_label;
    private javax.swing.JLabel sales_billing;
    // End of variables declaration//GEN-END:variables
   /** The Main app. */
    private javax.swing.JFrame MainAPP; 
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaEMR/src/main/java/com/bestray/healthcareemr/Views/PatientRegDisplayPanel.java

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