Produced by Araxis Merge on 6/11/2019 10:54:09 AM 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 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\service\common\impl | MergeServiceImpl.java | Wed May 29 15:26:30 2019 UTC |
| 2 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\service\common\impl | MergeServiceImpl.java | Mon Jun 10 19:19:21 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 388 |
| 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 | * Copyrig ht � 2010 VHA. All r ights rese rved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | package go v.va.med.c cht.servic e.common.i mpl; | |
| 5 | ||
| 6 | import jav a.util.Has hSet; | |
| 7 | import jav a.util.Set ; | |
| 8 | ||
| 9 | import org .apache.co mmons.lang 3.Validate ; | |
| 10 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 11 | import org .springfra mework.ste reotype.Se rvice; | |
| 12 | ||
| 13 | import gov .va.med.cc ht.model.A ppUserGrou p; | |
| 14 | import gov .va.med.cc ht.model.U ser; | |
| 15 | import gov .va.med.cc ht.model.U serPrefere nce; | |
| 16 | import gov .va.med.cc ht.model.U serRole; | |
| 17 | import gov .va.med.cc ht.model.q ir.QIR; | |
| 18 | import gov .va.med.cc ht.model.q ir.QIRRema rks; | |
| 19 | import gov .va.med.cc ht.model.q ir.QIRSimp leAttachme nt; | |
| 20 | import gov .va.med.cc ht.model.q ir.QIRVend orAction; | |
| 21 | import gov .va.med.cc ht.service .common.Me rgeService ; | |
| 22 | import gov .va.med.fw .conversio n.CopyServ ice; | |
| 23 | import gov .va.med.fw .rule.Matc hRuleServi ce; | |
| 24 | import gov .va.med.fw .security. Role; | |
| 25 | import gov .va.med.fw .service.A bstractCom ponent; | |
| 26 | import gov .va.med.fw .service.S erviceExce ption; | |
| 27 | ||
| 28 | /** | |
| 29 | * @author DNS | |
| 30 | * | |
| 31 | */ | |
| 32 | @SuppressW arnings("d eprecation ") | |
| 33 | @Service | |
| 34 | public cla ss MergeSe rviceImpl extends Ab stractComp onent impl ements Mer geService { | |
| 35 | ||
| 36 | pr ivate stat ic final l ong serial VersionUID = 5352060 9288473246 34L; | |
| 37 | ||
| 38 | @A utowired | |
| 39 | pr ivate Copy Service co pyService = null; | |
| 40 | @A utowired | |
| 41 | pr ivate Matc hRuleServi ce matchRu leService = null; | |
| 42 | ||
| 43 | @O verride | |
| 44 | pu blic QIR m ergeQIR(QI R incoming , QIR onFi le) throws ServiceEx ception { | |
| 45 | // c opy editab le propert ies | |
| 46 | onFi le.setQirT ype(incomi ng.getQirT ype()); | |
| 47 | onFi le.setQirS tatusType( incoming.g etQirStatu sType()); | |
| 48 | onFi le.setVisn (incoming. getVisn()) ; | |
| 49 | onFi le.setFaci lity(incom ing.getFac ility()); | |
| 50 | onFi le.setDevi ceType(inc oming.getD eviceType( )); | |
| 51 | onFi le.setVend or(incomin g.getVendo r()); | |
| 52 | onFi le.setSeri alNumber(i ncoming.ge tSerialNum ber()); | |
| 53 | onFi le.setPurc haseOrderN umber(inco ming.getPu rchaseOrde rNumber()) ; | |
| 54 | onFi le.setSubm ittedDate( incoming.g etSubmitte dDate()); | |
| 55 | onFi le.setVend orResponse DueDate(in coming.get VendorResp onseDueDat e()); | |
| 56 | onFi le.setEmai lReminderS entDate(in coming.get EmailRemin derSentDat e()); | |
| 57 | onFi le.setStat usChangeDa te(incomin g.getStatu sChangeDat e()); | |
| 58 | onFi le.setComp laint(inco ming.getCo mplaint()) ; | |
| 59 | onFi le.setSumm ary(incomi ng.getSumm ary()); | |
| 60 | onFi le.setSubm ittedBy(in coming.get SubmittedB y()); | |
| 61 | onFi le.setIsDm pIssue(inc oming.getI sDmpIssue( )); | |
| 62 | onFi le.setDmpQ irType(inc oming.getD mpQirType( )); | |
| 63 | //co py interna l sets | |
| 64 | merg eQIRRemark s(incoming , onFile); | |
| 65 | merg eQIRVendor Actions(in coming, on File); | |
| 66 | merg eQIRAttach ments(inco ming, onFi le); | |
| 67 | retu rn null; | |
| 68 | } | |
| 69 | ||
| 70 | pu blic Role mergeRole( Role incom ing, Role onFile) th rows Servi ceExceptio n { | |
| 71 | ||
| 72 | inco ming.getPe rmissions( ).forEach( permission -> { | |
| 73 | onFile .getPermis sions().ad d(permissi on); | |
| 74 | }); | |
| 75 | ||
| 76 | retu rn onFile; | |
| 77 | } | |
| 78 | ||
| 79 | pu blic User mergeUser( User incom ing, User onFile) th rows Servi ceExceptio n { | |
| 80 | ||
| 81 | //gr oups | |
| 82 | merg eUserGroup s(incoming , onFile); | |
| 83 | //ro les | |
| 84 | merg eRoles(inc oming, onF ile); | |
| 85 | //pr eferences | |
| 86 | merg ePreferenc es(incomin g, onFile) ; | |
| 87 | retu rn onFile; | |
| 88 | } | |
| 89 | ||
| 90 | pr ivate void mergeUser Groups(Use r incoming , User onF ile) throw s ServiceE xception { | |
| 91 | ||
| 92 | fina l Set<AppU serGroup> groups = n ew HashSet <AppUserGr oup>(); | |
| 93 | grou ps.addAll( incoming.g etUserGrou ps()); | |
| 94 | grou ps.addAll( onFile.get UserGroups ()); | |
| 95 | ||
| 96 | grou ps.forEach (group -> { | |
| 97 | onFile .removeUse rGroup(gro up); | |
| 98 | onFile .addUserGr oup(group) ; | |
| 99 | }); | |
| 100 | ||
| 101 | } | |
| 102 | ||
| 103 | pr ivate void mergePref erences(Us er incomin g, User on File) thro ws Service Exception { | |
| 104 | ||
| 105 | fina l Set<User Preference > prefs = new HashSe t<UserPref erence>(); | |
| 106 | pref s.addAll(i ncoming.ge tPreferenc ees()); | |
| 107 | pref s.addAll(o nFile.getP referencee s()); | |
| 108 | ||
| 109 | pref s.forEach( pref -> { | |
| 110 | onFile .removePre ference(pr ef); | |
| 111 | onFile .addPrefer ence(pref) ; | |
| 112 | }); | |
| 113 | ||
| 114 | } | |
| 115 | ||
| 116 | pr ivate void mergeRole s(User inc oming, Use r onFile) throws Ser viceExcept ion { | |
| 117 | ||
| 118 | fina l Set<User Role> role s = new Ha shSet<User Role>(); | |
| 119 | role s.addAll(i ncoming.ge tRoles()); | |
| 120 | role s.addAll(o nFile.getR oles()); | |
| 121 | ||
| 122 | role s.forEach( role -> { | |
| 123 | onFile .addRole(r ole); | |
| 124 | onFile .removeRol e(role); | |
| 125 | }); | |
| 126 | ||
| 127 | } | |
| 128 | ||
| 129 | pr ivate void mergeQIRR emarks(QIR incoming, QIR onFil e) throws ServiceExc eption { | |
| 130 | for (QIRRemark s remarks: incoming.g etRemarks( )) { | |
| 131 | if (re marks.getI d() == nul l) { | |
| 132 | onFile.a ddRemarks( remarks); | |
| 133 | } | |
| 134 | } | |
| 135 | } | |
| 136 | pr ivate void mergeQIRV endorActio ns(QIR inc oming, QIR onFile) t hrows Serv iceExcepti on { | |
| 137 | for (QIRVendor Action act ions:incom ing.getVen dorActions ()) { | |
| 138 | if (ac tions.getI d() == nul l) { | |
| 139 | onFile.a ddVendorAc tions(acti ons); | |
| 140 | } | |
| 141 | } | |
| 142 | } | |
| 143 | pr ivate void mergeQIRA ttachments (QIR incom ing, QIR o nFile) thr ows Servic eException { | |
| 144 | for (QIRSimple Attachment attachmen t:incoming .getAttach ments()) { | |
| 145 | if (at tachment.g etId() == null) { | |
| 146 | onFile.a ddAttachme nt(attachm ent); | |
| 147 | } | |
| 148 | } | |
| 149 | } | |
| 150 | ||
| 151 | /* * | |
| 152 | * @return t he copySer vice | |
| 153 | * / | |
| 154 | pu blic CopyS ervice get CopyServic e() { | |
| 155 | retu rn copySer vice; | |
| 156 | } | |
| 157 | ||
| 158 | /* * | |
| 159 | * @param co pyService | |
| 160 | * the copy Service to set | |
| 161 | * / | |
| 162 | pu blic void setCopySer vice(CopyS ervice cop yService) { | |
| 163 | this .copyServi ce = copyS ervice; | |
| 164 | } | |
| 165 | ||
| 166 | /* * | |
| 167 | * @return t he matchRu leService | |
| 168 | * / | |
| 169 | pu blic Match RuleServic e getMatch RuleServic e() { | |
| 170 | retu rn matchRu leService; | |
| 171 | } | |
| 172 | ||
| 173 | /* * | |
| 174 | * @param ma tchRuleSer vice | |
| 175 | * the matc hRuleServi ce to set | |
| 176 | * / | |
| 177 | pu blic void setMatchRu leService( MatchRuleS ervice mat chRuleServ ice) { | |
| 178 | this .matchRule Service = matchRuleS ervice; | |
| 179 | } | |
| 180 | ||
| 181 | /* | |
| 182 | * (non-Java doc) | |
| 183 | * | |
| 184 | * @see gov. va.med.fw. service.Ab stractComp onent#afte rPropertie sSet() | |
| 185 | * / | |
| 186 | @O verride | |
| 187 | pu blic void afterPrope rtiesSet() throws Ex ception { | |
| 188 | supe r.afterPro pertiesSet (); | |
| 189 | // v alidate fo r required services | |
| 190 | Vali date.notNu ll(copySer vice, "Cop yService r equired fo r MergeSer vice"); | |
| 191 | Vali date.notNu ll(matchRu leService, "MatchRul eService r equired fo r MergeSer vice"); | |
| 192 | } | |
| 193 | ||
| 194 | ||
| 195 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.