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

import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.service.AllergiesMasterService;
import com.bestray.healthcarecommonutil.service.DiagnosisMasterService;
import com.bestray.healthcarecommonutil.service.GroupProcedureService;
import com.bestray.healthcarecommonutil.service.MedicationMasterService;
import com.bestray.healthcarecommonutil.service.MyFavService;
import com.bestray.healthcarecommonutil.service.ProcedureMasterService;
import com.bestray.healthcarecommonutil.vo.TAccount;
import com.bestray.healthcarecommonutil.vo.TAllergiesMaster;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcarecommonutil.vo.TDiagnosisMaster;
import com.bestray.healthcarecommonutil.vo.TEncounterProcedure;
import com.bestray.healthcarecommonutil.vo.TEncounterTreatmentSession;
import com.bestray.healthcarecommonutil.vo.TGroupMaster;
import com.bestray.healthcarecommonutil.vo.TMedicationMaster;
import com.bestray.healthcarecommonutil.vo.TMyFav;
import com.bestray.healthcarecommonutil.vo.TPatientEncounter;
import com.bestray.healthcarecommonutil.vo.TProcedureMaster;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;
import org.springframework.stereotype.Controller;

/**
 *
 * @author user3
 */
@Controller
public class MyFavController {
    @Autowired
    private MyFavService myFavService;
    @Autowired
    private DiagnosisMasterService diagnosisMasterService;
    @Autowired
    private ProcedureMasterService procedureMasterService;
    @Autowired
    private MedicationMasterService medicationMasterService;
    @Autowired
    private AllergiesMasterService allergyMasterService;
    @Autowired
    private GroupProcedureService groupProcedureService;
    
    public void saveMyFavDiagnosis(List<TMyFav> favdiaglist)throws ProcessingException{
        try{
            myFavService.saveMyFavDiagnosis(favdiaglist);
        }catch(ProcessingException e){
            throw e;
        }
    }
    public Vector<TDiagnosisMaster> getFavDiagByAccount(TAccount useracc,String type)throws ProcessingException{
        Vector<TDiagnosisMaster> diagList=null;
        try{
            List<TMyFav> favdiags = myFavService.getFavDiagByAccount(useracc,type);
            diagList = new Vector<TDiagnosisMaster>();
            for(TMyFav mfav:favdiags){
                TDiagnosisMaster diag = diagnosisMasterService.getDiagnosisValues(Integer.valueOf(mfav.getObjId().toString()));
                diagList.add(diag);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return diagList;
    }
    
    public Vector<TProcedureMaster> getFavProcedureByAccount(TAccount useracc,String type)throws ProcessingException{
        Vector<TProcedureMaster> procList=null;
        try{
            List<TMyFav> favprocs = myFavService.getFavDiagByAccount(useracc,type);
            procList = new Vector<TProcedureMaster>();
            for(TMyFav mfav:favprocs){
                TProcedureMaster proc = procedureMasterService.getProcedureValues(mfav.getObjId());
                procList.add(proc);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return procList;
    }
    
    public Vector<TMedicationMaster> getFavMedicationByAccount(TAccount useracc,String type)throws ProcessingException{
        Vector<TMedicationMaster> medList=null;
        try{
            List<TMyFav> favprocs = myFavService.getFavDiagByAccount(useracc,type);
            medList = new Vector<TMedicationMaster>();
            for(TMyFav mfav:favprocs){
                TMedicationMaster med = medicationMasterService.getMedicationValues(mfav.getObjId());
                medList.add(med);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return medList;
    }
    
    public Vector<TAllergiesMaster> getFavAllergyByAccount(TAccount useracc,String type)throws ProcessingException{
        Vector<TAllergiesMaster> allergyList=null;
        try{
            List<TMyFav> favprocs = myFavService.getFavDiagByAccount(useracc,type);
            allergyList = new Vector<TAllergiesMaster>();
            for(TMyFav mfav:favprocs){
                TAllergiesMaster allergy = allergyMasterService.getAllergiesValues(mfav.getObjId());
                allergyList.add(allergy);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return allergyList;
    }
    
    public Vector<TMedicationMaster> getMedicationByName(String expr)throws ProcessingException {
        try{
            Vector<TMedicationMaster> medics = new Vector<TMedicationMaster>();
            List<TMedicationMaster> medicationList = medicationMasterService.getMedicationByName(expr);
            for(TMedicationMaster med:medicationList){
                medics.addElement(med);
            }
            return medics;
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    public Vector<TDiagnosisMaster> getDiagnosisByName(String expr)throws ProcessingException {
        try{
            Vector<TDiagnosisMaster> diagnosis = new Vector<TDiagnosisMaster>();
            List<TDiagnosisMaster> diagnosisList = diagnosisMasterService.getDiagnosisByName(expr);
            for(TDiagnosisMaster diagnos:diagnosisList){
                diagnosis.addElement(diagnos);
            }
            return diagnosis;
        }catch(ProcessingException e){
            throw e;
        }
    }

    public Vector<TProcedureMaster> getProcedureByName(String expr)throws ProcessingException {
        try{
            Vector<TProcedureMaster> procedures = new Vector<TProcedureMaster>();
            List<TProcedureMaster> procedureList = procedureMasterService.getProcedureListBySearch(expr);
            for(TProcedureMaster procedure:procedureList){
                procedures.addElement(procedure);
            }
            return procedures;
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    public Vector<TAllergiesMaster> getAllergyByName(String expr)throws ProcessingException {
        try{
            Vector<TAllergiesMaster> allergies = new Vector<TAllergiesMaster>();
            List<TAllergiesMaster> allergiesList = allergyMasterService.searchForAllergyName(expr);
            System.out.println("ALLERGY SIZE:::"+allergiesList.size());
            for(TAllergiesMaster allergy:allergiesList){
                allergies.addElement(allergy);
            }
            System.out.println("ALLERGY SIZE:::"+allergies.size());
            return allergies;
        }catch(ProcessingException e){
            throw e;
        }
    }

    public List<TCCodeValues> getAllTreatmentList()throws ProcessingException {
        try{
            return myFavService.getAllTreatmentList();
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    public Vector<TCCodeValues> getAllTreatmentVector()throws ProcessingException {
        try{
            Vector<TCCodeValues> allergies = new Vector<TCCodeValues>();
            List<TCCodeValues> allergiesList = myFavService.getAllTreatmentList();
            for(TCCodeValues allergy:allergiesList){
                allergies.addElement(allergy);
            }
            return allergies;
        }catch(ProcessingException e){
            throw e;
        }
    }

    public void deleteFavList(Long ObjId,String type) throws ProcessingException{
        try {
            myFavService.deleteFavList(ObjId,type);
        } catch (ProcessingException ex) {
            Logger.getLogger(MyFavController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public Vector<TGroupMaster> getAllGroups() throws ProcessingException{
     
        List<TGroupMaster> groupList;
        try {
            groupList = myFavService.getAllGroupList();
            Vector<TGroupMaster> groupData = new Vector<>();
            for (TGroupMaster tGroupMaster : groupList) {
                groupData.addElement(tGroupMaster);
            }
            return groupData;
        } catch (ProcessingException ex) {
            Logger.getLogger(MyFavController.class.getName()).log(Level.SEVERE, null, ex);
            throw new ProcessingException();      
        }  
    }
    
    public List<TProcedureMaster> getSelectedProcedureByGroup(TGroupMaster groupMaster)throws ProcessingException{
        try {
            return groupProcedureService.getSelectedProcedureByGroup(groupMaster); 
        } catch (Exception ex) {
            Logger.getLogger(MyFavController.class.getName()).log(Level.SEVERE, null, ex);
            throw new ProcessingException();
        }
    }
    public List<TEncounterProcedure> getAllTreatmentsByEncounter(TPatientEncounter encounter)throws ProcessingException{
        try{
           return myFavService.getAllTreatmentsByEncounter(encounter);
        }catch(ProcessingException e){
            throw e;
        }
    }
    public List<TEncounterTreatmentSession> getAllSessionByTreatment(TEncounterProcedure encProcedure)throws ProcessingException{
        try{
            return myFavService.getAllSessionByTreatment(encProcedure);
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    
    public void UpdateTreatmentSession(TEncounterTreatmentSession encounterTreatmentSession)throws ProcessingException,HibernateOptimisticLockingFailureException{
        try{
            myFavService.UpdateTreatmentSession(encounterTreatmentSession);
        }catch(  HibernateOptimisticLockingFailureException | ProcessingException e){
            throw e;
        }
    }

    
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaCommonUtil/src/main/java/com/bestray/healthcarecommonutil/controller/MyFavController.java

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