Produced by Araxis Merge on 7/9/2017 11:00:53 PM Eastern Daylight 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 | PPS_N_3.0_Iter2_Build_360.zip\Unredacted\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\dao\impl | EplVistaUpdateDaoImpl.java | Fri Jun 30 19:12:36 2017 UTC |
2 | PPS_N_3.0_Iter2_Build_360.zip\Unredacted\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\dao\impl | EplVistaUpdateDaoImpl.java | Fri Jul 7 13:18:31 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 384 |
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 | /** | |
2 | * | |
3 | */ | |
4 | ||
5 | ||
6 | package go v.va.med.p harmacy.pe ps.domain. common.dao .impl; | |
7 | ||
8 | ||
9 | import gov .va.med.ph armacy.pep s.common.o bject.Vist aStatus; | |
10 | import gov .va.med.ph armacy.pep s.common.v o.National Setting; | |
11 | import gov .va.med.ph armacy.pep s.common.v o.StatusVo ; | |
12 | import gov .va.med.ph armacy.pep s.common.v o.UserVo; | |
13 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplNationa lSettingDa o; | |
14 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplNdfUpda teFileDao; | |
15 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplStatusD ao; | |
16 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplVistaUp dateDao; | |
17 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNatio nalSetting Do; | |
18 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNdfUp dateFileDo ; | |
19 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplVista UpdateDo; | |
20 | ||
21 | import org .apache.lo gging.log4 j.LogManag er; | |
22 | import org .apache.lo gging.log4 j.Logger; | |
23 | import org .hibernate .Session; | |
24 | import org .hibernate .SessionFa ctory; | |
25 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
26 | import org .springfra mework.ste reotype.Re pository; | |
27 | ||
28 | ||
29 | /** | |
30 | * @author DN S DN S
|
|
31 | * | |
32 | */ | |
33 | //@Reposit ory | |
34 | public cla ss EplVist aUpdateDao Impl exten ds DataAcc essObjectI mpl<EplVis taUpdateDo , Long> im plements E plVistaUpd ateDao { | |
35 | ||
36 | private static fin al Logger LOG = LogM anager.get Logger(Epl VistaUpdat eDaoImpl.c lass); | |
37 | ||
38 | public static fi nal int NA TIONAL_SIT E = 521; | |
39 | public static fi nal int NA TIONAL_SIT E_ALT = 20 0; | |
40 | @Autow ired | |
41 | privat e SessionF actory ses sionFactor y; | |
42 | ||
43 | @Autow ired | |
44 | privat e EplNdfUp dateFileDa o eplNdfUp dateFileDa o; | |
45 | @Autow ired | |
46 | privat e EplStatu sDao eplSt atusDao; | |
47 | @Autow ired | |
48 | privat e EplNatio nalSetting Dao eplNat ionalSetti ngDao; | |
49 | ||
50 | /** | |
51 | * Sav es the Epl VistaUpdat eDo. If i t is from the Nation al Site, i t updates the file s tatus and does not s ave a EplV istaUpdate row. | |
52 | * @se e gov.va.m ed.pharmac y.peps.dom ain.common .dao.EplVi staUpdateD ao#save(go v.va.med.p harmacy.pe ps.domain. common.mod el.EplVist aUpdateDo) | |
53 | */ | |
54 | @Overr ide | |
55 | public EplVistaU pdateDo sa ve(EplVist aUpdateDo eplVistaUp date) { | |
56 | ||
57 | in t national Site = pop ulateNatio nalSite(); | |
58 | ||
59 | if (eplVista Update.get Site() == nationalSi te) { | |
60 | return s aveNationa lSiteUpdat e(eplVista Update); | |
61 | } | |
62 | ||
63 | po pulateFile ForEplVist aUpdate(ep lVistaUpda te); | |
64 | ||
65 | Se ssion sess ion = sess ionFactory .getCurren tSession() ; | |
66 | // Long id = (Long) ses sion.save( eplVistaUp date); | |
67 | se ssion.save (eplVistaU pdate); | |
68 | re turn null; | |
69 | // EplVistaUp dateDo sav edEplVista Update = | |
70 | // (EplVi staUpdateD o) session .get(EplVi staUpdateD o.class, i d); | |
71 | // return sav edEplVista Update; | |
72 | } | |
73 | ||
74 | /** | |
75 | * Sav es a statu s update f rom the Na tional Sit e. | |
76 | * @pa ram eplVis taUpdate | |
77 | * @re turn | |
78 | */ | |
79 | privat e EplVista UpdateDo s aveNationa lSiteUpdat e( | |
80 | EplVista UpdateDo e plVistaUpd ate) { | |
81 | ||
82 | LOG. debug("Pro cessing na tional Vis tA site up date."); | |
83 | ||
84 | po pulateFile (eplVistaU pdate); | |
85 | if (eplVista Update.get EplNdfUpda teFileDo() == null) { | |
86 | // This is probably not the be st thing t o do: shou ld return a validati on error t o VistA. | |
87 | LOG.warn(" No matchin g update f ile found. Doing not hing."); | |
88 | return nul l; | |
89 | } | |
90 | Ep lNdfUpdate FileDo ndf UpdateFile Do = eplVi staUpdate. getEplNdfU pdateFileD o(); | |
91 | nd fUpdateFil eDo.setCom ments(eplV istaUpdate .getCommen ts()); | |
92 | if (VistaSta tus.STARTE D.toString ().equals( eplVistaUp date.getEp lVistaStat us().getSt atusName() )) { | |
93 | ndfUpdat eFileDo.se tEplStatus (eplStatus Dao.retrie ve(StatusV o.START_OF _NATIONAL_ PROCESSING )); | |
94 | } | |
95 | else if (Vista Status.COM PLETED.toS tring().eq uals(eplVi staUpdate. getEplVist aStatus(). getStatusN ame())) { | |
96 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.NATIO NAL_INSTAL L_SUCCESS) ); | |
97 | } | |
98 | el se if (Vis taStatus.E RROR.toStr ing().equa ls(eplVist aUpdate.ge tEplVistaS tatus().ge tStatusNam e())) { | |
99 | // if we receive a VistA err or we auto matically reject the file | |
100 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.VISTA _ERROR)); | |
101 | eplVista Update.get EplNdfUpda teFileDo() | |
102 | .set Comments(" Automatica lly Reject ed: Unable to Instal l Update F ile in the Test Acco unt."); | |
103 | } | |
104 | el se { | |
105 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.VISTA _ERROR)); | |
106 | eplVista Update.get EplNdfUpda teFileDo() .setCommen ts("Invali d Status S ent from V istA."); | |
107 | } | |
108 | ep lNdfUpdate FileDao.up date(eplVi staUpdate. getEplNdfU pdateFileD o(), new U serVo()); | |
109 | re turn eplVi staUpdate; | |
110 | } | |
111 | ||
112 | /** | |
113 | * @re turn | |
114 | */ | |
115 | privat e int popu lateNation alSite() { | |
116 | Ep lNationalS ettingDo n s = eplNat ionalSetti ngDao.find ByKeyName( NationalSe tting.NATI ONAL_SITE_ NUMBER.toS tring()); | |
117 | ||
118 | Lo ng nationa lSite = ns .getIntege rValue(); | |
119 | re turn natio nalSite.in tValue(); | |
120 | } | |
121 | ||
122 | /** | |
123 | * @pa ram eplVis taUpdate | |
124 | */ | |
125 | privat e void pop ulateFile( EplVistaUp dateDo epl VistaUpdat e) { | |
126 | Ep lNdfUpdate FileDo fil e = eplNdf UpdateFile Dao.retrie veVistaWai tingByName (eplVistaU pdate.getE plNdfUpdat eFileDo(). getFileNam e()); | |
127 | ep lVistaUpda te.setEplN dfUpdateFi leDo(file) ; | |
128 | } | |
129 | ||
130 | /** | |
131 | * @pa ram eplVis taUpdate | |
132 | */ | |
133 | privat e void pop ulateFileF orEplVista Update(Epl VistaUpdat eDo eplVis taUpdate) { | |
134 | Ep lNdfUpdate FileDo fil e = eplNdf UpdateFile Dao.retrie veByName(e plVistaUpd ate.getEpl NdfUpdateF ileDo().ge tFileName( )); | |
135 | ep lVistaUpda te.setEplN dfUpdateFi leDo(file) ; | |
136 | } | |
137 | ||
138 | @Overr ide | |
139 | @Autow ired | |
140 | public SessionFa ctory getS essionFact ory() { | |
141 | re turn sessi onFactory; | |
142 | } | |
143 | ||
144 | @Overr ide | |
145 | public void setS essionFact ory(Sessio nFactory s essionFact ory) { | |
146 | th is.session Factory = sessionFac tory; | |
147 | } | |
148 | ||
149 | /** | |
150 | * @re turn the e plNdfUpdat eFileDao | |
151 | */ | |
152 | @Overr ide | |
153 | public EplNdfUpd ateFileDao getEplNdf UpdateFile Dao() { | |
154 | re turn eplNd fUpdateFil eDao; | |
155 | } | |
156 | ||
157 | /** | |
158 | * @pa ram eplNdf UpdateFile Dao the ep lNdfUpdate FileDao to set | |
159 | */ | |
160 | @Overr ide | |
161 | public void setE plNdfUpdat eFileDao(E plNdfUpdat eFileDao e plNdfUpdat eFileDao) { | |
162 | th is.eplNdfU pdateFileD ao = eplNd fUpdateFil eDao; | |
163 | } | |
164 | ||
165 | /** | |
166 | * @re turn the e plStatusDa o | |
167 | */ | |
168 | public EplStatus Dao getEpl StatusDao( ) { | |
169 | re turn eplSt atusDao; | |
170 | } | |
171 | ||
172 | /** | |
173 | * @pa ram eplSta tusDao the eplStatus Dao to set | |
174 | */ | |
175 | public void setE plStatusDa o(EplStatu sDao eplSt atusDao) { | |
176 | th is.eplStat usDao = ep lStatusDao ; | |
177 | } | |
178 | ||
179 | /** | |
180 | * @re turn the e plNational SettingDao | |
181 | */ | |
182 | public EplNation alSettingD ao getEplN ationalSet tingDao() { | |
183 | re turn eplNa tionalSett ingDao; | |
184 | } | |
185 | ||
186 | /** | |
187 | * @pa ram eplNat ionalSetti ngDao the eplNationa lSettingDa o to set | |
188 | */ | |
189 | public void setE plNational SettingDao (EplNation alSettingD ao eplNati onalSettin gDao) { | |
190 | th is.eplNati onalSettin gDao = epl NationalSe ttingDao; | |
191 | } | |
192 | ||
193 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.