Produced by Araxis Merge on 3/8/2018 10:11:37 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_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\utility\converter | DrugDrugInteractionConverter.java | Fri Jan 12 15:44:02 2018 UTC |
2 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\utility\converter | DrugDrugInteractionConverter.java | Wed Mar 7 01:48:11 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 512 |
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.domain. common.uti lity.conve rter; | |
2 | ||
3 | ||
4 | ||
5 | import jav a.util.Map ; | |
6 | import jav a.util.Set ; | |
7 | ||
8 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
9 | ||
10 | import gov .va.med.ph armacy.pep s.common.v o.DrugDrug Interactio nVo; | |
11 | import gov .va.med.ph armacy.pep s.common.v o.DrugSeve rityVo; | |
12 | import gov .va.med.ph armacy.pep s.common.v o.FieldKey ; | |
13 | import gov .va.med.ph armacy.pep s.common.v o.ItemStat us; | |
14 | import gov .va.med.ph armacy.pep s.common.v o.PrimaryI ngredientV o; | |
15 | import gov .va.med.ph armacy.pep s.common.v o.RequestI temStatus; | |
16 | import gov .va.med.ph armacy.pep s.common.v o.ValueObj ect; | |
17 | import gov .va.med.ph armacy.pep s.common.v o.diff.Dif ference; | |
18 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplDdiSeve rityDao; | |
19 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplIngredi entDao; | |
20 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.DataObje ct; | |
21 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplDdiSe verityDo; | |
22 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplDrugD rugInterac tionDo; | |
23 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplIngre dientDo; | |
24 | import gov .va.med.ph armacy.pep s.external .common.vo .outbound. common.Ite mAction; | |
25 | ||
26 | ||
27 | /** | |
28 | * Convert to/from { @link Drug DrugIntera ctionVo} a nd {@link EplDrugDru gInteracti onDo}. | |
29 | * @author DNS | |
30 | */ | |
31 | public cla ss DrugDru gInteracti onConverte r extends Converter< DrugDrugIn teractionV o, EplDrug DrugIntera ctionDo> { | |
32 | ||
33 | privat e EplIngre dientDao e plIngredie ntDao; | |
34 | ||
35 | privat e EplDdiSe verityDao eplDdiSeve rityDao; | |
36 | ||
37 | privat e PrimaryI ngredientC onverter p rimaryIngr edientConv erter; | |
38 | ||
39 | privat e DrugSeve rityConver ter drugSe verityConv erter; | |
40 | ||
41 | ||
42 | ||
43 | ||
44 | ||
45 | /** | |
46 | * Ful ly copies data from the given {@link Val ueObject} into a {@l ink DataOb ject}. | |
47 | * | |
48 | * @pa ram data { @link Valu eObject} t o convert | |
49 | * @re turn fully populated {@link Da taObject} | |
50 | * | |
51 | */ | |
52 | @Overr ide | |
53 | public EplDrugDr ugInteract ionDo toDa taObject(D rugDrugInt eractionVo data) { | |
54 | ||
55 | Ep lDrugDrugI nteraction Do drugInt eraction = new EplDr ugDrugInte ractionDo( ); | |
56 | ||
57 | if (null!=dat a.getId()) { | |
58 | drugInte raction.se tEplDrugDr ugInteract ionId(new Long(data. getId())); | |
59 | } | |
60 | ||
61 | ||
62 | dr ugInteract ion.setInt eractionNa me(data.co nvertToInt eractionNa me(data)); | |
63 | ||
64 | ||
65 | if (null!=da ta.getDrug DrugIntera ctionIen() ) { | |
66 | drugInte raction.se tVistaIen( new Long(d ata.getDru gDrugInter actionIen( ))); | |
67 | } | |
68 | ||
69 | dr ugInteract ion.setDru gIngredien t1(findIng redient(da ta.getIngr edient1(). getValue() )); | |
70 | dr ugInteract ion.setDru gIngredien t2(findIng redient(da ta.getIngr edient2(). getValue() )); | |
71 | dr ugInteract ion.setSev erity(find Severity(d ata.getDru gSeverity( ).getValue ())); | |
72 | ||
73 | dr ugInteract ion.setCre atedBy(dat a.getCreat edBy()); | |
74 | dr ugInteract ion.setCre atedDtm(da ta.getCrea tedDate()) ; | |
75 | dr ugInteract ion.setLas tModifiedB y(data.get ModifiedBy ()); | |
76 | dr ugInteract ion.setLas tModifiedD tm(data.ge tModifiedD ate()); | |
77 | ||
78 | dr ugInteract ion.setIna ctivationD ate(data.g etInactiva tionDate() ); | |
79 | ||
80 | // some defa ult values for now. | |
81 | dr ugInteract ion.setNat ionallyEnt ered(true) ; | |
82 | dr ugInteract ion.setLoc allyEdited (false); | |
83 | dr ugInteract ion.setTot alIndexes( new Long(0 )); | |
84 | ||
85 | ||
86 | re turn drugI nteraction ; | |
87 | } | |
88 | ||
89 | ||
90 | ||
91 | ||
92 | ||
93 | /** | |
94 | * Ful ly copies data from the given EplDrugDru gInteracti onDo into a DrugDrug Interactio nVo. | |
95 | * | |
96 | * @pa ram data E plDrugDrug Interactio nDo to con vert | |
97 | * @re turn fully populated DrugDrugI nteraction Vo | |
98 | * | |
99 | */ | |
100 | @Overr ide | |
101 | public DrugDrugI nteraction Vo toValue Object(Epl DrugDrugIn teractionD o data) { | |
102 | ||
103 | Dr ugDrugInte ractionVo drugIntera ction = ne w DrugDrug Interactio nVo(); | |
104 | ||
105 | dr ugInteract ion.setId( data.getEp lDrugDrugI nteraction Id().toStr ing()); | |
106 | ||
107 | Pr imaryIngre dientVo in gredient1 = primaryI ngredientC onverter.t oValueObje ct(data.ge tDrugIngre dient1()); | |
108 | ||
109 | Pr imaryIngre dientVo in gredient2 = primaryI ngredientC onverter.t oValueObje ct(data.ge tDrugIngre dient2()); | |
110 | ||
111 | Dr ugSeverity Vo drugSev erityVo = drugSeveri tyConverte r.toValueO bject(data .getSeveri ty()); | |
112 | ||
113 | ||
114 | if (null!=da ta.getVist aIen()) { | |
115 | drugInte raction.se tDrugDrugI nteraction Ien(data.g etVistaIen ().toStrin g()); | |
116 | } | |
117 | ||
118 | ||
119 | dr ugInteract ion.setVal ue(data.ge tInteracti onName()); | |
120 | dr ugInteract ion.setDru gDrugInter actionDisp lay(data.g etInteract ionName()) ; | |
121 | ||
122 | dr ugInteract ion | |
123 | .setItem Status(dat a.getInact ivationDat e() != nul l ? ItemSt atus.value Of("INACTI VE") : Ite mStatus.va lueOf("ACT IVE")); | |
124 | dr ugInteract ion.setReq uestItemSt atus(Reque stItemStat us.valueOf ("APPROVED ")); | |
125 | ||
126 | dr ugInteract ion.setIng redient1(i ngredient1 ); | |
127 | dr ugInteract ion.setIng redient2(i ngredient2 ); | |
128 | dr ugInteract ion.setDru gSeverity( drugSeveri tyVo); | |
129 | ||
130 | ||
131 | dr ugInteract ion.setCre atedBy(dat a.getCreat edBy()); | |
132 | dr ugInteract ion.setCre atedDate(d ata.getCre atedDtm()) ; | |
133 | dr ugInteract ion.setMod ifiedBy(da ta.getLast ModifiedBy ()); | |
134 | dr ugInteract ion.setMod ifiedDate( data.getLa stModified Dtm()); | |
135 | ||
136 | ||
137 | dr ugInteract ion.setIna ctivationD ate(data.g etInactiva tionDate() ); | |
138 | ||
139 | ||
140 | dr ugInteract ion.setNat ionallyEnt ered(Strin g.valueOf( data.getNa tionallyEn tered())); | |
141 | dr ugInteract ion.setLoc allyEdited (String.va lueOf(data .getLocall yEdited()) ); | |
142 | dr ugInteract ion.setTot alIndexes( data.getTo talIndexes ().toStrin g()); | |
143 | ||
144 | re turn drugI nteraction ; | |
145 | } | |
146 | ||
147 | ||
148 | privat e EplIngre dientDo fi ndIngredie nt(String name) { | |
149 | re turn getEp lIngredien tDao().fin dIngredien tByName(na me); | |
150 | } | |
151 | ||
152 | privat e EplDdiSe verityDo f indSeverit y(String n ame) { | |
153 | re turn getEp lDdiSeveri tyDao().fi ndByName(n ame); | |
154 | ||
155 | } | |
156 | ||
157 | /** | |
158 | * Get s the EplI ngredientD ao. | |
159 | * | |
160 | * @re turn the e plIngredie ntDao | |
161 | */ | |
162 | public EplIngred ientDao ge tEplIngred ientDao() { | |
163 | re turn eplIn gredientDa o; | |
164 | } | |
165 | ||
166 | /** | |
167 | * Set s the EplI ngredientD ao. | |
168 | * | |
169 | * @pa ram eplIng redientDao the eplIn gredientDa o to set | |
170 | */ | |
171 | @Autow ired(requi red = true ) | |
172 | public void setE plIngredie ntDao(EplI ngredientD ao eplIngr edientDao) { | |
173 | th is.eplIngr edientDao = eplIngre dientDao; | |
174 | } | |
175 | ||
176 | /** | |
177 | * Get s the EplD diSeverity Dao. | |
178 | * | |
179 | * @re turn the e plDdiSever ityDao | |
180 | */ | |
181 | public EplDdiSev erityDao g etEplDdiSe verityDao( ) { | |
182 | re turn eplDd iSeverityD ao; | |
183 | } | |
184 | ||
185 | /** | |
186 | * Set s the EplD diSeverity Dao. | |
187 | * @pa ram eplDdi SeverityDa o the eplD diSeverity Dao to set | |
188 | */ | |
189 | @Autow ired | |
190 | public void setE plDdiSever ityDao(Epl DdiSeverit yDao eplDd iSeverityD ao) { | |
191 | th is.eplDdiS everityDao = eplDdiS everityDao ; | |
192 | } | |
193 | ||
194 | /** | |
195 | * Get s the Prim aryIngredi entConvert er. | |
196 | * | |
197 | * @re turn the p rimaryIngr edientConv erter | |
198 | */ | |
199 | public PrimaryIn gredientCo nverter ge tPrimaryIn gredientCo nverter() { | |
200 | re turn prima ryIngredie ntConverte r; | |
201 | } | |
202 | ||
203 | ||
204 | /** | |
205 | * Set s the Prim aryIngredi entConvert er. | |
206 | * @pa ram primar yIngredien tConverter the prima ryIngredie ntConverte r to set | |
207 | */ | |
208 | @Autow ired | |
209 | public void setP rimaryIngr edientConv erter(Prim aryIngredi entConvert er primary Ingredient Converter) { | |
210 | th is.primary Ingredient Converter = primaryI ngredientC onverter; | |
211 | } | |
212 | ||
213 | ||
214 | /** | |
215 | * Get s the Drug SeverityCo nverter. | |
216 | * | |
217 | * @re turn the d rugSeverit yConverter | |
218 | */ | |
219 | public DrugSever ityConvert er getDrug SeverityCo nverter() { | |
220 | re turn drugS everityCon verter; | |
221 | } | |
222 | ||
223 | ||
224 | ||
225 | /** | |
226 | * Set s the Drug SeverityCo nverter. | |
227 | * @pa ram drugSe verityConv erter the drugSeveri tyConverte r to set | |
228 | */ | |
229 | @Autow ired | |
230 | public void setD rugSeverit yConverter (DrugSever ityConvert er drugSev erityConve rter) { | |
231 | th is.drugSev erityConve rter = dru gSeverityC onverter; | |
232 | } | |
233 | ||
234 | /** | |
235 | * Che ck for new /modified fields in the differ ence set. | |
236 | * | |
237 | * @pa ram fields set of de fined fiel ds | |
238 | * @pa ram differ ences diff erence set | |
239 | * @pa ram itemAc tion add/m odify/inac tivate | |
240 | * @re turn true if has mod ified fiel ds | |
241 | */ | |
242 | public static bo olean hasN ewOrModifi edFields(S et<FieldKe y> fields, Map<Field Key, Diffe rence> dif ferences, | |
243 | It emAction i temAction) { | |
244 | if (ItemActi on.ADD.equ als(itemAc tion)) { | |
245 | return t rue; | |
246 | } else { // check for modified V istA field | |
247 | for (Fie ldKey key : fields) { | |
248 | if ( difference s.contains Key(key)) { | |
249 | return tru e; | |
250 | } | |
251 | } | |
252 | } | |
253 | ||
254 | re turn false ; | |
255 | } | |
256 | ||
257 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.