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

import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.service.CodeValuesService;
import com.bestray.healthcarecommonutil.vo.TCCodeType;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import java.util.List;
import java.util.Vector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;
import org.springframework.stereotype.Controller;

// TODO: Auto-generated Javadoc
/**
 * The Class CodeValuesController.
 *
 * @author user1
 */
@Controller
public class CodeValuesController {
    
    /** The codevalueservice. */
    @Autowired
    private CodeValuesService codevalueservice;
    
    /**
     * Instantiates a new code values controller.
     *
     * @param codevalueservice the codevalueservice
     
    public CodeValuesController(CodeValuesService codevalueservice){
        this.codevalueservice = codevalueservice; 
    }
    
    /**
     * Save code values.
     *
     * @param codevalues the codevalues
     * @param s the s
     * @return true, if successful
     * @throws ProcessingException the processing exception
     * @throws HibernateOptimisticLockingFailureException the hibernate optimistic locking failure exception
     */
    public boolean saveCodeValues(TCCodeValues codevalues, String s)throws ProcessingException,HibernateOptimisticLockingFailureException{
        try{
            return codevalueservice.createNewCodeValue(codevalues,s);
        }catch(  HibernateOptimisticLockingFailureException | ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the values list.
     *
     * @param codeType the code type
     * @param expr the expr
     * @param min the min
     * @param max the max
     * @return the values list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getValuesList(String codeType, String expr,int min,int max)throws ProcessingException {
        try{
            return codevalueservice.getValuesList(codeType,expr,min,max);
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the values.
     *
     * @param valuesId the values id
     * @return the values
     * @throws ProcessingException the processing exception
     */
    public TCCodeValues getValues(Long valuesId)throws ProcessingException {
        try{
            return codevalueservice.getValues(valuesId);
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Delete values.
     *
     * @param valuesId the values id
     * @throws ProcessingException the processing exception
     * @throws IllegalArgumentException the illegal argument exception
     */
    public void deleteValues(Long cId)throws ProcessingException,IllegalArgumentException {
        try{
            codevalueservice.deleteValues(cId);
        }catch(  IllegalArgumentException | ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the max id.
     *
     * @return the max id
     * @throws ProcessingException the processing exception
     */
    public Long getMaxId()throws ProcessingException {
        try{
            return codevalueservice.getMaxId();
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    /**
     * Number of code value records.
     *
     * @param expr the expr
     * @param codeType the code type
     * @return the int
     * @throws ProcessingException the processing exception
     */
    public int numberOfCodeValueRecords(String expr,String codeType)throws ProcessingException {
        try{
            return codevalueservice.numberOfCodeValueRecords(expr,codeType);
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the code all type.
     *
     * @return the code all type
     * @throws ProcessingException the processing exception
     */
    public Vector<TCCodeType> getCodeAllType()throws ProcessingException {
        Vector<TCCodeType> codetypes=null;
        try{
            List<TCCodeType> codeList = codevalueservice.getCodeAllType();
            codetypes = new Vector<TCCodeType>();
            for(TCCodeType ctype:codeList){
                codetypes.add(ctype);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return codetypes;
    }

    /**
     * Gets the code values.
     *
     * @param codeTypeName the code type name
     * @return the code values
     * @throws ProcessingException the processing exception
     */
    public Vector<TCCodeValues> getCodeValues(String codeTypeName)throws ProcessingException {
        Vector<TCCodeValues> codeValueList=null;
        try{
            List<TCCodeValues> codeValues = codevalueservice.getCodeValues(codeTypeName);
            codeValueList = new Vector<TCCodeValues>();
            for(TCCodeValues cvalue:codeValues){
                codeValueList.add(cvalue);
            }
        }catch(ProcessingException e){
            throw e;
        }
        return codeValueList;
    }
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaEMR/src/main/java/com/bestray/healthcareemr/Controller/CodeValuesController.java

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