Newer
Older
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
package edu.ncsu.csc.itrust.action;
import java.util.ArrayList;
import java.util.List;
import edu.ncsu.csc.itrust.action.base.EditOfficeVisitBaseAction;
import edu.ncsu.csc.itrust.beans.LOINCbean;
import edu.ncsu.csc.itrust.beans.LabProcedureBean;
import edu.ncsu.csc.itrust.beans.PersonnelBean;
import edu.ncsu.csc.itrust.dao.DAOFactory;
import edu.ncsu.csc.itrust.dao.mysql.LOINCDAO;
import edu.ncsu.csc.itrust.dao.mysql.LabProcedureDAO;
import edu.ncsu.csc.itrust.dao.mysql.PersonnelDAO;
import edu.ncsu.csc.itrust.exception.DBException;
import edu.ncsu.csc.itrust.exception.ITrustException;
/**
* Handles lab procedures
* add lab procedure
* Edit lab procedure
* Remove lab procedure
*/
public class EditLabProceduresAction extends EditOfficeVisitBaseAction {
private LabProcedureDAO labProcedureDAO;
private PersonnelDAO personnelDAO;
private LOINCDAO loincDAO;
/**
* EditLabProceduresAction
* @param factory factory
* @param hcpid hcpid
* @param pidString pidString
* @param ovIDString ovIDString
* @throws ITrustException
*/
public EditLabProceduresAction(DAOFactory factory, long hcpid,
String pidString, String ovIDString)
throws ITrustException {
super(factory, hcpid, pidString, ovIDString);
labProcedureDAO = factory.getLabProcedureDAO();
personnelDAO = factory.getPersonnelDAO();
loincDAO = factory.getLOINCDAO();
}
/**
* EditLabProceduresAction
* @param factory factory
* @param hcpid hcpid
* @param pidString pidString
* @throws ITrustException
*/
public EditLabProceduresAction(DAOFactory factory, long hcpid,
String pidString)
throws ITrustException {
super(factory, hcpid, pidString);
labProcedureDAO = factory.getLabProcedureDAO();
personnelDAO = factory.getPersonnelDAO();
loincDAO = factory.getLOINCDAO();
}
/**
* getLabProcedures
* @return list
* @throws DBException
*/
public List<LabProcedureBean> getLabProcedures() throws DBException {
if (isUnsaved()) {
return new ArrayList<LabProcedureBean>();
} else {
return labProcedureDAO.getAllLabProceduresForDocOV(getOvID());
}
}
/**
* getLabProcedure
* @param id id
* @return lab procedure
* @throws ITrustException
*/
public LabProcedureBean getLabProcedure(long id) throws ITrustException {
verifySaved();
return labProcedureDAO.getLabProcedure(id);
}
/**
* addLabProcedure
* @param bean bean
* @throws ITrustException
*/
public void addLabProcedure(LabProcedureBean bean) throws ITrustException {
verifySaved();
//choose lab tech if not assigned in bean
if ("".equals(bean.getStatus())) {
bean.setStatus(LabProcedureBean.In_Transit);
}
labProcedureDAO.addLabProcedure(bean);
}
/**
* editLabProcedure
* @param bean bean
* @throws ITrustException
*/
public void editLabProcedure(LabProcedureBean bean) throws ITrustException {
verifySaved();
labProcedureDAO.updateLabProcedure(bean);
}
/**
* deleteLabProcedure
* @param bean bean
* @throws ITrustException
*/
public void deleteLabProcedure(LabProcedureBean bean) throws ITrustException {
verifySaved();
labProcedureDAO.removeLabProcedure(bean.getProcedureID());
}
/**
* getLabTechs
* @return lab techs
* @throws ITrustException
*/
public List<PersonnelBean> getLabTechs() throws ITrustException {
return personnelDAO.getLabTechs();
}
/**
* getLabTechName
* @param mid mid
* @return ""
* @throws ITrustException
*/
public String getLabTechName(long mid) throws ITrustException {
try {
return personnelDAO.getName(mid);
} catch (ITrustException e) {
return "";
}
}
/**
* getLabTechQueueSize
* @param mid mid
* @return lab tech queue size
* @throws ITrustException
*/
public int getLabTechQueueSize(long mid) throws ITrustException {
return labProcedureDAO.getLabTechQueueSize(mid);
}
/**
* getLabTechQueueSizeByPriority
* @param mid mid
* @return lab tech queue size by priority
* @throws ITrustException
*/
public int[] getLabTechQueueSizeByPriority(long mid) throws ITrustException {
return labProcedureDAO.getLabTechQueueSizeByPriority(mid);
}
/**
* getLabProcedureCodes
* @return get all loinc
* @throws DBException
*/
public List<LOINCbean> getLabProcedureCodes() throws DBException {
return loincDAO.getAllLOINC();
}
}