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\dao\impl | EplVistaUpdateDaoImpl.java | Fri Jan 12 15:42:46 2018 UTC |
2 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\dao\impl | EplVistaUpdateDaoImpl.java | Tue Mar 6 23:54:06 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 344 |
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.dao .impl; | |
2 | ||
3 | ||
4 | import jav a.io.Seria lizable; | |
5 | ||
6 | import org .apache.lo gging.log4 j.LogManag er; | |
7 | import org .apache.lo gging.log4 j.Logger; | |
8 | import org .hibernate .Session; | |
9 | import org .hibernate .SessionFa ctory; | |
10 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
11 | ||
12 | import gov .va.med.ph armacy.pep s.common.o bject.Vist aStatus; | |
13 | import gov .va.med.ph armacy.pep s.common.u tility.sec urity.Untr ustedLogPa ram; | |
14 | import gov .va.med.ph armacy.pep s.common.v o.National Setting; | |
15 | import gov .va.med.ph armacy.pep s.common.v o.StatusVo ; | |
16 | import gov .va.med.ph armacy.pep s.common.v o.UserVo; | |
17 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplNationa lSettingDa o; | |
18 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplNdfUpda teFileDao; | |
19 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplStatusD ao; | |
20 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplVistaUp dateDao; | |
21 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNatio nalSetting Do; | |
22 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNdfUp dateFileDo ; | |
23 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplStatu sDo; | |
24 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplVista UpdateDo; | |
25 | ||
26 | ||
27 | /** | |
28 | * Main im plementati on of EplV istaUpdate Dao. | |
29 | * @author DN S DN S
|
|
30 | */ | |
31 | public cla ss EplVist aUpdateDao Impl exten ds DataAcc essObjectI mpl<EplVis taUpdateDo , Long> im plements E plVistaUpd ateDao { | |
32 | ||
33 | private static fin al Logger LOG = LogM anager.get Logger(Epl VistaUpdat eDaoImpl.c lass); | |
34 | ||
35 | @Autow ired | |
36 | privat e SessionF actory ses sionFactor y; | |
37 | ||
38 | @Autow ired | |
39 | privat e EplNdfUp dateFileDa o eplNdfUp dateFileDa o; | |
40 | @Autow ired | |
41 | privat e EplStatu sDao eplSt atusDao; | |
42 | @Autow ired | |
43 | privat e EplNatio nalSetting Dao eplNat ionalSetti ngDao; | |
44 | ||
45 | @Overr ide | |
46 | public EplVistaU pdateDo sa ve(EplVist aUpdateDo eplVistaUp date) { | |
47 | ||
48 | in t national Site = pop ulateNatio nalSite(); | |
49 | ||
50 | if (eplVista Update.get Site() == nationalSi te) { | |
51 | return s aveNationa lSiteUpdat e(eplVista Update); | |
52 | } | |
53 | ||
54 | Se ssion sess ion = sess ionFactory .getCurren tSession() ; | |
55 | Se rializable id = sess ion.save(e plVistaUpd ate); | |
56 | LO G.debug("S aved objec t with ID {}.", id); | |
57 | ||
58 | // This was not a nati onal site update: re turn null per method specifica tion. | |
59 | re turn null; | |
60 | } | |
61 | ||
62 | /** | |
63 | * Sav es a statu s update f rom the Na tional Sit e. | |
64 | * @pa ram eplVis taUpdate | |
65 | * @re turn | |
66 | */ | |
67 | privat e EplVista UpdateDo s aveNationa lSiteUpdat e( | |
68 | EplVista UpdateDo e plVistaUpd ate) { | |
69 | ||
70 | LO G.debug("P rocessing national V istA site update."); | |
71 | ||
72 | fi nal EplSta tusDo file Status = e plVistaUpd ate.getEpl NdfUpdateF ileDo().ge tEplStatus (); | |
73 | LO G.debug("C urrent fil e status i s: {}", ne w Untruste dLogParam( fileStatus )); | |
74 | if (!StatusV o.WAITING_ FOR_NATION AL_STATUSE S.contains (fileStatu s.getStatu sId())) { | |
75 | // This is probably not the be st thing t o do: shou ld return a validati on error t o VistA. | |
76 | LOG.warn(" File statu s {} does not permit updates f rom nation al VistA." , fileStat us.getStat usId()); | |
77 | return nul l; | |
78 | } | |
79 | Ep lNdfUpdate FileDo ndf UpdateFile Do = eplVi staUpdate. getEplNdfU pdateFileD o(); | |
80 | nd fUpdateFil eDo.setCom ments(eplV istaUpdate .getCommen ts()); | |
81 | if (VistaSta tus.STARTE D.toString ().equals( eplVistaUp date.getEp lVistaStat us().getSt atusName() )) { | |
82 | ndfUpdat eFileDo.se tEplStatus (eplStatus Dao.retrie ve(StatusV o.START_OF _NATIONAL_ PROCESSING )); | |
83 | } | |
84 | el se if (Vis taStatus.C OMPLETED.t oString(). equals(epl VistaUpdat e.getEplVi staStatus( ).getStatu sName())) { | |
85 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.NATIO NAL_INSTAL L_SUCCESS) ); | |
86 | } | |
87 | el se if (Vis taStatus.E RROR.toStr ing().equa ls(eplVist aUpdate.ge tEplVistaS tatus().ge tStatusNam e())) { | |
88 | // if we receive a VistA err or we auto matically reject the file | |
89 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.VISTA _ERROR)); | |
90 | eplVista Update.get EplNdfUpda teFileDo() | |
91 | .set Comments(" Automatica lly Reject ed: Unable to Instal l Update F ile in the Test Acco unt."); | |
92 | } | |
93 | el se { | |
94 | eplVista Update.get EplNdfUpda teFileDo() .setEplSta tus(eplSta tusDao.ret rieve(Stat usVo.VISTA _ERROR)); | |
95 | eplVista Update.get EplNdfUpda teFileDo() .setCommen ts("Invali d Status S ent from V istA."); | |
96 | } | |
97 | ep lNdfUpdate FileDao.up date(eplVi staUpdate. getEplNdfU pdateFileD o(), new U serVo()); | |
98 | re turn eplVi staUpdate; | |
99 | } | |
100 | ||
101 | /** | |
102 | * @re turn | |
103 | */ | |
104 | privat e int popu lateNation alSite() { | |
105 | Ep lNationalS ettingDo n s = eplNat ionalSetti ngDao.find ByKeyName( NationalSe tting.NATI ONAL_SITE_ NUMBER.toS tring()); | |
106 | ||
107 | Lo ng nationa lSite = ns .getIntege rValue(); | |
108 | re turn natio nalSite.in tValue(); | |
109 | } | |
110 | ||
111 | public SessionFa ctory getS essionFact ory() { | |
112 | re turn sessi onFactory; | |
113 | } | |
114 | ||
115 | public void setS essionFact ory(Sessio nFactory s essionFact ory) { | |
116 | th is.session Factory = sessionFac tory; | |
117 | } | |
118 | ||
119 | /** | |
120 | * Get s the EplN dfUpdateFi leDao. | |
121 | * | |
122 | * @re turn the e plNdfUpdat eFileDao | |
123 | */ | |
124 | public EplNdfUpd ateFileDao getEplNdf UpdateFile Dao() { | |
125 | re turn eplNd fUpdateFil eDao; | |
126 | } | |
127 | ||
128 | /** | |
129 | * Set s the EplN dfUpdateFi leDao. | |
130 | * | |
131 | * @pa ram eplNdf UpdateFile Dao the ep lNdfUpdate FileDao to set | |
132 | */ | |
133 | public void setE plNdfUpdat eFileDao(E plNdfUpdat eFileDao e plNdfUpdat eFileDao) { | |
134 | th is.eplNdfU pdateFileD ao = eplNd fUpdateFil eDao; | |
135 | } | |
136 | ||
137 | /** | |
138 | * Get s the EplS tatusDao. | |
139 | * | |
140 | * @re turn the e plStatusDa o | |
141 | */ | |
142 | public EplStatus Dao getEpl StatusDao( ) { | |
143 | re turn eplSt atusDao; | |
144 | } | |
145 | ||
146 | /** | |
147 | * Set s the EplS tatusDao. | |
148 | * | |
149 | * @pa ram eplSta tusDao the eplStatus Dao to set | |
150 | */ | |
151 | public void setE plStatusDa o(EplStatu sDao eplSt atusDao) { | |
152 | th is.eplStat usDao = ep lStatusDao ; | |
153 | } | |
154 | ||
155 | /** | |
156 | * Get s the EplN ationalSet tingDao. | |
157 | * | |
158 | * @re turn the e plNational SettingDao | |
159 | */ | |
160 | public EplNation alSettingD ao getEplN ationalSet tingDao() { | |
161 | re turn eplNa tionalSett ingDao; | |
162 | } | |
163 | ||
164 | /** | |
165 | * Set s the EplN ationalSet tingDao. | |
166 | * | |
167 | * @pa ram eplNat ionalSetti ngDao the eplNationa lSettingDa o to set | |
168 | */ | |
169 | public void setE plNational SettingDao (EplNation alSettingD ao eplNati onalSettin gDao) { | |
170 | th is.eplNati onalSettin gDao = epl NationalSe ttingDao; | |
171 | } | |
172 | ||
173 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.