Produced by Araxis Merge on 3/8/2018 10:11:21 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | PRE_PPS-N_v3.0.1.zip\PS_PPS_common\src\main\java\gov\va\med\pharmacy\peps\common\vo | DrugDrugInteractionVo.java | Fri Jan 12 15:43:20 2018 UTC |
2 | PRE_PPS-N_v3.0.1.zip\PS_PPS_common\src\main\java\gov\va\med\pharmacy\peps\common\vo | DrugDrugInteractionVo.java | Tue Mar 6 19:09:02 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 758 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | package go v.va.med.p harmacy.pe ps.common. vo; | |
2 | ||
3 | import jav a.lang.ref lect.Field ; | |
4 | import jav a.util.Col lection; | |
5 | import jav a.util.Has hSet; | |
6 | import jav a.util.Set ; | |
7 | ||
8 | ||
9 | ||
10 | ||
11 | /** | |
12 | * @author DNS | |
13 | * | |
14 | * Data re presenting a Drug Dr ug interac tion | |
15 | * | |
16 | */ | |
17 | public cla ss DrugDru gInteracti onVo exten ds Managed DataVo { | |
18 | ||
19 | ||
20 | privat e static f inal long serialVers ionUID = 1 L; | |
21 | ||
22 | privat e String d rugDrugInt eractionIe n; | |
23 | ||
24 | privat e PrimaryI ngredientV o ingredi ent1; // i ngredient1 relating to ingred ient in EP L_INGREDIE NTS | |
25 | ||
26 | privat e PrimaryI ngredientV o ingredie nt2; // i ngredient2 relating to ingred ient in EP L_INGREDIE NTS | |
27 | ||
28 | privat e DrugSeve rityVo dru gSeverity; // name o f severity | |
29 | ||
30 | privat e String n ationallyE ntered; | |
31 | ||
32 | privat e String l ocallyEdit ed; | |
33 | ||
34 | privat e String t otalIndexe s; | |
35 | ||
36 | privat e String d rugDrugInt eractionDi splay; | |
37 | ||
38 | privat e static f inal Strin g FORWARD_ SLASH ="/" ; | |
39 | ||
40 | public DrugDrugI nteraction Vo() { | |
41 | ||
42 | su per(); | |
43 | ||
44 | } | |
45 | ||
46 | ||
47 | ||
48 | /** | |
49 | * @re turn the d rugDrugInt eractionIe n | |
50 | */ | |
51 | public String ge tDrugDrugI nteraction Ien() { | |
52 | ||
53 | re turn drugD rugInterac tionIen; | |
54 | } | |
55 | ||
56 | ||
57 | ||
58 | /** | |
59 | * @pa ram drugDr ugInteract ionIen the drugDrugI nteraction Ien to set | |
60 | */ | |
61 | public void setD rugDrugInt eractionIe n(String d rugDrugInt eractionIe n) { | |
62 | ||
63 | th is.drugDru gInteracti onIen = dr ugDrugInte ractionIen ; | |
64 | } | |
65 | ||
66 | ||
67 | /** | |
68 | * @re turn the i ngredient1 | |
69 | */ | |
70 | public Ingredien tVo getIng redient1() { | |
71 | ||
72 | re turn ingre dient1; | |
73 | } | |
74 | ||
75 | ||
76 | ||
77 | /** | |
78 | * @pa ram ingred ient1 the ingredient 1 to set | |
79 | */ | |
80 | public void setI ngredient1 (PrimaryIn gredientVo ingredien t1) { | |
81 | ||
82 | th is.ingredi ent1 = ing redient1; | |
83 | } | |
84 | ||
85 | ||
86 | ||
87 | /** | |
88 | * @re turn the i ngredient2 | |
89 | */ | |
90 | public Ingredien tVo getIng redient2() { | |
91 | ||
92 | re turn ingre dient2; | |
93 | } | |
94 | ||
95 | ||
96 | ||
97 | /** | |
98 | * @pa ram ingred ient2 the ingredient 2 to set | |
99 | */ | |
100 | public void setI ngredient2 (PrimaryIn gredientVo ingredien t2) { | |
101 | ||
102 | th is.ingredi ent2 = ing redient2; | |
103 | } | |
104 | ||
105 | ||
106 | ||
107 | /** | |
108 | * @re turn the d rugSeverit y | |
109 | */ | |
110 | public DrugSever ityVo getD rugSeverit y() { | |
111 | ||
112 | re turn drugS everity; | |
113 | } | |
114 | ||
115 | ||
116 | ||
117 | /** | |
118 | * @pa ram drugSe verity the drugSever ity to set | |
119 | */ | |
120 | public void setD rugSeverit y(DrugSeve rityVo dru gSeverity) { | |
121 | ||
122 | th is.drugSev erity = dr ugSeverity ; | |
123 | } | |
124 | ||
125 | ||
126 | ||
127 | /** | |
128 | * @re turn the n ationallyE ntered | |
129 | */ | |
130 | public String ge tNationall yEntered() { | |
131 | ||
132 | re turn natio nallyEnter ed; | |
133 | } | |
134 | ||
135 | ||
136 | ||
137 | ||
138 | /** | |
139 | * @pa ram nation allyEntere d the nati onallyEnte red to set | |
140 | */ | |
141 | public void setN ationallyE ntered(Str ing nation allyEntere d) { | |
142 | ||
143 | th is.nationa llyEntered = nationa llyEntered ; | |
144 | } | |
145 | ||
146 | ||
147 | ||
148 | ||
149 | /** | |
150 | * @re turn the l ocallyEdit ed | |
151 | */ | |
152 | public String ge tLocallyEd ited() { | |
153 | ||
154 | re turn local lyEdited; | |
155 | } | |
156 | ||
157 | ||
158 | ||
159 | ||
160 | /** | |
161 | * @pa ram locall yEdited th e locallyE dited to s et | |
162 | */ | |
163 | public void setL ocallyEdit ed(String locallyEdi ted) { | |
164 | ||
165 | th is.locally Edited = l ocallyEdit ed; | |
166 | } | |
167 | ||
168 | ||
169 | ||
170 | ||
171 | /** | |
172 | * @re turn the t otalIndexe s | |
173 | */ | |
174 | public String ge tTotalInde xes() { | |
175 | ||
176 | re turn total Indexes; | |
177 | } | |
178 | ||
179 | ||
180 | ||
181 | ||
182 | /** | |
183 | * @pa ram totalI ndexes the totalInde xes to set | |
184 | */ | |
185 | public void setT otalIndexe s(String t otalIndexe s) { | |
186 | ||
187 | th is.totalIn dexes = to talIndexes ; | |
188 | } | |
189 | ||
190 | ||
191 | /** | |
192 | * @re turn the d rugDrugInt eractionDi splay | |
193 | */ | |
194 | public String ge tDrugDrugI nteraction Display() { | |
195 | ||
196 | re turn drugD rugInterac tionDispla y; | |
197 | } | |
198 | ||
199 | ||
200 | /** | |
201 | * @pa ram drugDr ugInteract ionDisplay the drugD rugInterac tionDispla y to set | |
202 | */ | |
203 | public void setD rugDrugInt eractionDi splay(Stri ng drugDru gInteracti onDisplay) { | |
204 | ||
205 | th is.drugDru gInteracti onDisplay = drugDrug Interactio nDisplay; | |
206 | } | |
207 | ||
208 | ||
209 | ||
210 | ||
211 | ||
212 | public EntityTyp e getEntit yType() { | |
213 | re turn Entit yType.DRUG _DRUG_INTE RACTION; | |
214 | } | |
215 | ||
216 | ||
217 | ||
218 | ||
219 | /* (no n-Javadoc) | |
220 | * @se e gov.va.m ed.pharmac y.peps.com mon.vo.Man agedDataVo #isStandar dized() | |
221 | */ | |
222 | @Overr ide | |
223 | public boolean i sStandardi zed() { | |
224 | ||
225 | re turn true; | |
226 | } | |
227 | ||
228 | /* (no n-Javadoc) | |
229 | * @se e gov.va.m ed.pharmac y.peps.com mon.vo.Man agedDataVo #isNdf() | |
230 | */ | |
231 | @Overr ide | |
232 | public boolean i sNdf() { | |
233 | ||
234 | re turn false ; | |
235 | } | |
236 | ||
237 | /* (no n-Javadoc) | |
238 | * @se e gov.va.m ed.pharmac y.peps.com mon.vo.Man agedDataVo #getDomain Group() | |
239 | */ | |
240 | @Overr ide | |
241 | public DomainGro up getDoma inGroup() { | |
242 | ||
243 | re turn Domai nGroup.DRU G_DRUG_INT ERACTION; | |
244 | } | |
245 | ||
246 | /* (no n-Javadoc) | |
247 | * @se e gov.va.m ed.pharmac y.peps.com mon.vo.Man agedItemVo #isLocalOn lyData() | |
248 | */ | |
249 | @Overr ide | |
250 | public boolean i sLocalOnly Data() { | |
251 | ||
252 | re turn false ; | |
253 | } | |
254 | ||
255 | @Overr ide | |
256 | public boolean i sTwoReview Item() { | |
257 | re turn false ; | |
258 | } | |
259 | ||
260 | ||
261 | /** | |
262 | * Lis t all disa bled field s for this ValueObje ct, with t he pre-con dition tha t the curr ent instan ce is not a new one, nor | |
263 | * a r ead-only o ne. | |
264 | * | |
265 | * @pa ram enviro nment the current {@ link Envir onment} | |
266 | * @pa ram roles Collection of {@link Role} ins tances for the curre nt user | |
267 | * @re turn Set<F ieldKey> A ll disable d fields f or this ob ject. | |
268 | */ | |
269 | protec ted Set<Fi eldKey> ha ndleListDi sabledFiel ds(Environ ment envir onment, Co llection<R ole> roles ) { | |
270 | Se t<FieldKey > disabled Fields = s uper.handl eListDisab ledFields( environmen t, roles); | |
271 | di sabledFiel ds.remove( FieldKey.S EVERITY); | |
272 | di sabledFiel ds.add(Fie ldKey.DRUG _DRUG_INTE RACTION_DI SPLAY_ONLY ); | |
273 | di sabledFiel ds.add(Fie ldKey.DRUG _DRUG_INTE RACTION); | |
274 | re turn disab ledFields; | |
275 | } | |
276 | ||
277 | ||
278 | public Set<Field Key> listN onEditable Fields(Env ironment e nvironment , Collecti on<Role> r oles) { | |
279 | Se t<FieldKey > readOnly Fields = s uper.listN onEditable Fields(env ironment, roles); | |
280 | ||
281 | re adOnlyFiel ds.add(Fie ldKey.DRUG _DRUG_INTE RACTION_DI SPLAY_ONLY ); | |
282 | re adOnlyFiel ds.add(Fie ldKey.DRUG _DRUG_INTE RACTION); | |
283 | re turn readO nlyFields; | |
284 | } | |
285 | ||
286 | ||
287 | /** | |
288 | * Lis t all requ ired field s for this ValueObje ct, with t he pre-con dition tha t the curr ent instan ce is not a read-onl y | |
289 | * one . | |
290 | * | |
291 | * @pa ram enviro nment the current {@ link Envir onment} | |
292 | * @pa ram roles Collection of {@link Role} ins tances for the curre nt user | |
293 | * @re turn Set<F ieldKey> A ll require d fields f or this Dr ugClassVo. | |
294 | */ | |
295 | protec ted Set<Fi eldKey> ha ndleListRe quiredFiel ds(Environ ment envir onment, Co llection<R ole> roles ) { | |
296 | Se t<FieldKey > required Fields = s uper.handl eListRequi redFields( environmen t, roles); | |
297 | re quiredFiel ds.remove( FieldKey.V ALUE); | |
298 | re quiredFiel ds.add(Fie ldKey.SEVE RITY); | |
299 | re quiredFiel ds.add(Fie ldKey.DRUG _INGREDIEN T_1); | |
300 | re quiredFiel ds.add(Fie ldKey.DRUG _INGREDIEN T_2); | |
301 | re turn requi redFields; | |
302 | } | |
303 | ||
304 | /** | |
305 | * Ret urns a lis t of all f ields appr opriate fo r display on the wiz ard. | |
306 | * | |
307 | * @re turn colle ction | |
308 | */ | |
309 | public Collectio n<FieldKey > listAllW izardField s() { | |
310 | Co llection<F ieldKey> f ields = su per.listAl lWizardFie lds(); | |
311 | fi elds.add(F ieldKey.SE VERITY); | |
312 | fi elds.add(F ieldKey.DR UG_INGREDI ENT_1); | |
313 | fi elds.add(F ieldKey.DR UG_INGREDI ENT_2); | |
314 | ||
315 | re turn field s; | |
316 | } | |
317 | ||
318 | /** | |
319 | * Lis t all uniq ueness cri teria for this Value Object. | |
320 | * | |
321 | * @re turn Set<F ieldKey> A ll uniquen ess fields for this object. | |
322 | */ | |
323 | @Overr ide | |
324 | public Set<Field Key> listU niquenessC riteria() { | |
325 | Se t<FieldKey > uniquene ss = new H ashSet<Fie ldKey>(); | |
326 | un iqueness.a dd(FieldKe y.DRUG_ING REDIENT_1) ; | |
327 | un iqueness.a dd(FieldKe y.DRUG_ING REDIENT_2) ; | |
328 | re turn uniqu eness; | |
329 | } | |
330 | ||
331 | ||
332 | public String co nvertToInt eractionNa me(DrugDru gInteracti onVo data) { | |
333 | ||
334 | if (null!=dat a.getIngre dient1().g etValue() && null!=d ata.getIng redient2() .getValue( )){ | |
335 | ||
336 | ||
337 | in t compare = data.get Ingredient 1().getVal ue().compa reTo(data. getIngredi ent2().get Value()); | |
338 | ||
339 | St ringBuilde r interact ionNameBui lder = new StringBui lder(); | |
340 | ||
341 | if (compare < 0){ | |
342 | ||
343 | interact ionNameBui lder.appen d((data.ge tIngredien t1().getVa lue()+FORW ARD_SLASH+ data.getIn gredient2( ).getValue ())); | |
344 | } | |
345 | el se if(comp are > 0){ | |
346 | ||
347 | interact ionNameBui lder.appen d((data.ge tIngredien t2().getVa lue()+FORW ARD_SLASH+ data.getIn gredient1( ).getValue ())); | |
348 | } | |
349 | el se { | |
350 | ||
351 | interact ionNameBui lder.appen d((data.ge tIngredien t1().getVa lue()+FORW ARD_SLASH+ data.getIn gredient2( ).getValue ())); | |
352 | } | |
353 | ||
354 | re turn inter actionName Builder.to String(); | |
355 | ||
356 | } | |
357 | el se | |
358 | { | |
359 | return " "; | |
360 | } | |
361 | } | |
362 | ||
363 | ||
364 | ||
365 | @Overr ide | |
366 | public <T> T ref lectFieldV alue(Field field) th rows Illeg alArgument Exception, IllegalAc cessExcept ion { | |
367 | re turn (T) f ield.get(t his); | |
368 | } | |
369 | ||
370 | ||
371 | ||
372 | @Overr ide | |
373 | public void setA ttributeBy Field(Fiel d field, O bject fiel dValue) th rows Illeg alArgument Exception, IllegalAc cessExcept ion { | |
374 | fi eld.set(th is, fieldV alue); | |
375 | } | |
376 | ||
377 | ||
378 | ||
379 | ||
380 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.