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

import com.bestray.healthcarecommonutil.vo.TDepartmentMaster;
import com.bestray.healthcarecommonutil.vo.TDoctorInformation;
import com.bestray.healthcarecommonutil.vo.TSpecialityMaster;
import com.bestray.healthcarecommonutil.vo.TCCodeType;
import com.bestray.healthcarecommonutil.vo.TCCodeValues;
import com.bestray.healthcarecommonutil.vo.TRoomMaster;
import java.util.Vector;

// TODO: Auto-generated Javadoc
/**
 * The Class CollectionUtil.
 *
 * @author User1
 */
public class CollectionUtil {
    
    /**
     * Gets the department index.
     *
     * @param departmentList the department list
     * @param JobTypeId the job type id
     * @return the department index
     */
    public static int getDepartmentIndex(Vector<TDepartmentMaster> departmentList, Long JobTypeId) {
        int index = -1;
        if (departmentList != null && JobTypeId != null) {
            for (int i = 0; i < departmentList.size(); i++) {
                if (JobTypeId.longValue() == departmentList.get(i).getId().longValue()) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
/**
 * Gets the dept index.
 *
 * @param departmentList the department list
 * @param dept the dept
 * @return the dept index
 */
public static int getDeptIndex(Vector<TDepartmentMaster> departmentList, String dept) {
        int index = -1;
        if (departmentList != null && dept != null) {
            for (int i = 0; i < departmentList.size(); i++) {
                if (dept.equalsIgnoreCase(departmentList.get(i).getDepartmentName())) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
    
    /**
     * Gets the doctor index.
     *
     * @param doctorList the doctor list
     * @param JobTypeId the job type id
     * @return the doctor index
     */
    public static int getDoctorIndex(Vector<TDoctorInformation> doctorList, Integer JobTypeId) {
        int index = -1;
        if (doctorList != null && JobTypeId != null) {
            for (int i = 0; i < doctorList.size(); i++) {
                if (JobTypeId.intValue() == doctorList.get(i).getId().intValue()) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
    
    /**
     * Gets the dr speciality index.
     *
     * @param specialtyList the specialty list
     * @param JobTypeId the job type id
     * @return the dr speciality index
     */
    public static int getDrSpecialityIndex(Vector<TSpecialityMaster> specialtyList, Long JobTypeId) {
        int index = -1;
        if (specialtyList != null && JobTypeId != null) {
            for (int i = 0; i < specialtyList.size(); i++) {
                if (JobTypeId.longValue() == specialtyList.get(i).getId().longValue()) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
    
     /**
      * Gets the code type index.
      *
      * @param codeTypeList the code type list
      * @param codeTypeId the code type id
      * @return the code type index
      */
     public static int getCodeTypeIndex(Vector<TCCodeType> codeTypeList, Integer codeTypeId) {
        int index = -1;
        if (codeTypeList != null && codeTypeId != null) {
            for (int i = 0; i < codeTypeList.size(); i++) {
                if (codeTypeId.intValue() == codeTypeList.get(i).getCodeTypeId().intValue()) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
     
     /**
      * Gets the code value index.
      *
      * @param codeValueList the code value list
      * @param codeValueName the code value name
      * @return the code value index
      */
     public static int getCodeValueIndex(Vector<TCCodeValues> codeValueList,String codeValueName) {
        int index = -1;
        if (codeValueList != null && codeValueName != null) {
            for (int i = 0; i < codeValueList.size(); i++) {
                if (codeValueName.equalsIgnoreCase(codeValueList.get(i).getCodeValueName().toString())) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
     
     /**
      * Gets the default doctor index.
      *
      * @param doctorList the doctor list
      * @return the default doctor index
      */
     public static int getDefaultDoctorIndex(Vector<TDoctorInformation> doctorList) {
        int index = -1;
        for (int i = 0; i < doctorList.size(); i++) {
            if (doctorList.get(i).getDoctor_name().equalsIgnoreCase("SHAMI SALIM")) {
                index = i;
                break;
            }
        }
        return index;
    }
    
     public static int getRoomIndex(Vector<TRoomMaster> roomList, Long roomId) {
        int index = -1;
        if (roomList != null && roomId != null) {
            for (int i = 0; i < roomList.size(); i++) {
                if (roomId.longValue() == roomList.get(i).getId().longValue()) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    }
}

Commits for Satyam/AuroCareEMR/src/main/java/com/bestray/healthcareemr/Util/CollectionUtil.java

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