Produced by Araxis Merge on 12/5/2017 12:06:48 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\SiteServiceCommon\main\src\java\gov\va\med\imaging\exchange\siteservice\rest\translator | SiteServiceRestTranslator.java | Mon Dec 4 21:35:28 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\SiteServiceCommon\main\src\java\gov\va\med\imaging\exchange\siteservice\rest\translator | SiteServiceRestTranslator.java | Mon Dec 4 22:05:33 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 496 |
| Changed | 2 | 4 |
| 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 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Mar 5, 2012 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.exc hange.site service.re st.transla tor; | |
| 27 | ||
| 28 | import jav a.net.Malf ormedURLEx ception; | |
| 29 | import jav a.util.Arr ayList; | |
| 30 | import jav a.util.Has hMap; | |
| 31 | import jav a.util.Lis t; | |
| 32 | import jav a.util.Map ; | |
| 33 | ||
| 34 | import org .apache.lo gging.log4 j.LogManag er; | |
| 35 | import org .apache.lo gging.log4 j.Logger; | |
| 36 | ||
| 37 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 38 | import gov .va.med.im aging.exch ange.busin ess.Region ; | |
| 39 | import gov .va.med.im aging.exch ange.busin ess.Region Impl; | |
| 40 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 41 | import gov .va.med.im aging.exch ange.busin ess.SiteCo nnection; | |
| 42 | import gov .va.med.im aging.exch ange.busin ess.SiteIm pl; | |
| 43 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceS iteConnect ionType; | |
| 44 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceS iteConnect ionsType; | |
| 45 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceS iteType; | |
| 46 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceS itesType; | |
| 47 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceV isnType; | |
| 48 | import gov .va.med.im aging.exch ange.sites ervice.res t.types.Si teServiceV isnsType; | |
| 49 | ||
| 50 | /** | |
| 51 | * @author
|
|
| 52 | * | |
| 53 | */ | |
| 54 | public cla ss SiteSer viceRestTr anslator | |
| 55 | { | |
| 56 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Site ServiceRes tTranslato r.class); | |
| 57 | ||
| 58 | pu blic stati c SiteServ iceSiteTyp e translat e(Site sit e) | |
| 59 | { | |
| 60 | if(s ite == nul l) | |
| 61 | return null; | |
| 62 | ||
| 63 | Site ServiceSit eType resu lt = new S iteService SiteType() ; | |
| 64 | ||
| 65 | resu lt.setVisn Number(sit e.getRegio nId()); | |
| 66 | resu lt.setSite Abbr(site. getSiteAbb r()); | |
| 67 | resu lt.setSite Name(site. getSiteNam e()); | |
| 68 | resu lt.setSite Number(sit e.getSiteN umber()); | |
| 69 | resu lt.setSite PatientLoo kupable(si te.isSiteP atientLook upable()); | |
| 70 | resu lt.setSite UserAuthen ticatable( site.isSit eUserAuthe nticatable ()); | |
| 71 | ||
| 72 | resu lt.setSite Connection s(translat e(site.get SiteConnec tions())); | |
| 73 | ||
| 74 | retu rn result; | |
| 75 | } | |
| 76 | ||
| 77 | pr ivate stat ic SiteSer viceSiteCo nnectionsT ype transl ate(Map<St ring, Site Connection > siteConn ections) | |
| 78 | { | |
| 79 | if(s iteConnect ions == nu ll) | |
| 80 | return null; | |
| 81 | Site ServiceSit eConnectio nType [] r esult = | |
| 82 | new Si teServiceS iteConnect ionType[si teConnecti ons.size() ]; | |
| 83 | int i = 0; | |
| 84 | for( SiteConnec tion siteC onnection : siteConn ections.va lues()) | |
| 85 | { | |
| 86 | result [i] = new SiteServic eSiteConne ctionType( siteConnec tion.getPr otocol(), siteConnec tion.getSe rver(), si teConnecti on.getPort ()); | |
| 87 | i++; | |
| 88 | } | |
| 89 | ||
| 90 | retu rn new Sit eServiceSi teConnecti onsType(re sult); | |
| 91 | } | |
| 92 | ||
| 93 | pu blic stati c SiteServ iceVisnsTy pe transla te(List<Re gion> regi ons) | |
| 94 | { | |
| 95 | Site ServiceVis nType [] v isns = tra nslateRegi ons(region s); | |
| 96 | retu rn new Sit eServiceVi snsType(vi sns); | |
| 97 | } | |
| 98 | ||
| 99 | ||
| 100 | pr ivate stat ic SiteSer viceVisnTy pe [] tran slateRegio ns(List<Re gion> regi ons) | |
| 101 | { | |
| 102 | if(r egions == null) | |
| 103 | return null; | |
| 104 | Site ServiceVis nType [] r esult = ne w SiteServ iceVisnTyp e[regions. size()]; | |
| 105 | for( int i = 0; i < regio ns.size(); i++) | |
| 106 | { | |
| 107 | result [i] = tran slate(regi ons.get(i) ); | |
| 108 | } | |
| 109 | retu rn result; | |
| 110 | } | |
| 111 | ||
| 112 | pu blic stati c SiteServ iceVisnTyp e translat e(Region r egion) | |
| 113 | { | |
| 114 | if(r egion == n ull) | |
| 115 | return null; | |
| 116 | ||
| 117 | Site ServiceVis nType resu lt = new S iteService VisnType() ; | |
| 118 | ||
| 119 | resu lt.setVisn Name(regio n.getRegio nName()); | |
| 120 | resu lt.setVisn Number(reg ion.getReg ionNumber( )); | |
| 121 | resu lt.setSite s(translat eSites(reg ion.getSit es())); | |
| 122 | ||
| 123 | retu rn result; | |
| 124 | } | |
| 125 | ||
| 126 | pu blic stati c SiteServ iceSitesTy pe transla teSites(Li st<Site> s ites) | |
| 127 | { | |
| 128 | retu rn new Sit eServiceSi tesType(tr anslateSit esToArray( sites)); | |
| 129 | } | |
| 130 | ||
| 131 | pr ivate stat ic SiteSer viceSiteTy pe[] trans lateSitesT oArray(Lis t<Site> si tes) | |
| 132 | { | |
| 133 | if(s ites == nu ll) | |
| 134 | return null; | |
| 135 | Site ServiceSit eType []re sult = new SiteServi ceSiteType [sites.siz e()]; | |
| 136 | for( int i = 0; i < sites .size(); i ++) | |
| 137 | { | |
| 138 | result [i] = tran slate(site s.get(i)); | |
| 139 | } | |
| 140 | retu rn result; | |
| 141 | } | |
| 142 | ||
| 143 | pu blic stati c List<Sit e> transla teToSites( SiteServic eVisnsType visns) | |
| 144 | th rows Metho dException | |
| 145 | { | |
| 146 | if(v isns == nu ll) | |
| 147 | return null; | |
| 148 | List <Site> res ult = new ArrayList< Site>(); | |
| 149 | ||
| 150 | for( SiteServic eVisnType visn : vis ns.getVisn s()) | |
| 151 | { | |
| 152 | logger .debug("Si teServiceV isnType: " + visn.ge tVisnName( ) + " - " + visn.get VisnNumber ()); | |
| 153 | for(Si teServiceS iteType si te : visn. getSites() .getSites( )) | |
| 154 | { | |
| 155 | logger.d ebug("Site ServiceSit eType: " + site.getV isnNumber( ) + " - " + site.get SiteName() + " - " + site.getS iteNumber( )); | |
| 156 | result.a dd(transla te(site)); | |
| 157 | } | |
| 158 | } | |
| 159 | ||
| 160 | retu rn result; | |
| 161 | } | |
| 162 | ||
| 163 | pu blic stati c List<Reg ion> trans lateToRegi ons(SiteSe rviceVisns Type visns ) | |
| 164 | th rows Metho dException | |
| 165 | { | |
| 166 | if(v isns == nu ll) | |
| 167 | return null; | |
| 168 | List <Region> r esult = ne w ArrayLis t<Region>( ); | |
| 169 | ||
| 170 | for( SiteServic eVisnType visn : vis ns.getVisn s()) | |
| 171 | { | |
| 172 | Region region = new Region Impl(visn. getVisnNam e(), visn. getVisnNum ber()); | |
| 173 | result .add(regio n); | |
| 174 | List<S ite> sites = new Arr ayList<Sit e>(); | |
| 175 | for(Si teServiceS iteType si te : visn. getSites() .getSites( )) | |
| 176 | { | |
| 177 | ||
| 178 | sites.ad d(translat e(site)); | |
| 179 | } | |
| 180 | region .setSites( sites); | |
| 181 | } | |
| 182 | ||
| 183 | retu rn result; | |
| 184 | } | |
| 185 | ||
| 186 | /* | |
| 187 | pu blic stati c List<Sit e> transla te(SiteSer viceSitesT ype sites) | |
| 188 | th rows Metho dException | |
| 189 | { | |
| 190 | if(s ites == nu ll) | |
| 191 | return null; | |
| 192 | List <Site> res ult = new ArrayList< Site>(); | |
| 193 | for( SiteServic eSiteType site : sit es.getSite s()) | |
| 194 | { | |
| 195 | result .add(trans late(site) ); | |
| 196 | } | |
| 197 | ||
| 198 | retu rn result; | |
| 199 | }* / | |
| 200 | ||
| 201 | pr ivate stat ic Site tr anslate(Si teServiceS iteType si te) | |
| 202 | th rows Metho dException | |
| 203 | { | |
| 204 | Map< String, Si teConnecti on> siteCo nnections = translat e(site.get SiteConnec tions()); | |
| 205 | Site Connection vistaSite Connection = siteCon nections.g et(SiteCon nection.si teConnecti onVista); | |
| 206 | Site Connection vixSiteCo nnection = siteConne ctions.get (SiteConne ction.site Connection Vix); | |
| 207 | ||
| 208 | Stri ng vistaSe rver = (vi staSiteCon nection == null ? "" : vistaSi teConnecti on.getServ er()); | |
| 209 | int vistaPort = (vistaSi teConnecti on == null ? 0 : vis taSiteConn ection.get Port()); | |
| 210 | Stri ng vixServ er = (vixS iteConnect ion == nul l ? "" : v ixSiteConn ection.get Server()); | |
| 211 | int vixPort = (vixSiteCo nnection = = null ? 0 : vixSite Connection .getPort() ); | |
| 212 | ||
| 213 | try | |
| 214 | { | |
| 215 | logger .debug("si teConnecti onVista = " + SiteCo nnection.s iteConnect ionVista); | |
| 216 | logger .debug("si teConnecti onVix = " + SiteConn ection.sit eConnectio nVix); | |
| 217 | logger .debug("si teConnecti onVixs = " + SiteCon nection.si teConnecti onVixs); | |
| 218 | ||
| 219 | logger .debug("vi staServer = " + vist aServer); | |
| 220 | logger .debug("vi staPort = " + vistaP ort); | |
| 221 | logger .debug("vi xServer = " + vixSer ver); | |
| 222 | logger .debug("vi xPort = " + vixPort) ; | |
| 223 | ||
| 224 | return new SiteI mpl(site.g etSiteNumb er(), site .getSiteNa me(), site .getSiteAb br(), | |
| 225 | vistaServe r, vistaPo rt, vixSer ver, vixPo rt, site.g etVisnNumb er(), site Connection s); | |
| 226 | } | |
| 227 | catc h(Malforme dURLExcept ion murlX) | |
| 228 | { | |
| 229 | throw new Method Exception( murlX); | |
| 230 | } | |
| 231 | } | |
| 232 | ||
| 233 | pr ivate stat ic Map<Str ing, SiteC onnection> translate (SiteServi ceSiteConn ectionsTyp e siteConn ections) | |
| 234 | { | |
| 235 | Map< String, Si teConnecti on> result = new Has hMap<Strin g, SiteCon nection>() ; | |
| 236 | ||
| 237 | for( SiteServic eSiteConne ctionType siteConnec tion : sit eConnectio ns.getConn ections()) | |
| 238 | { | |
| 239 | logger .debug("Si teConnecti on = " + s iteConnect ion.getPro tocol() + " " + site Connection .getServer () + " " + siteConne ction.getP ort()); | |
| 240 | ||
| 241 | result .put(siteC onnection. getProtoco l(), | |
| 242 | new SiteCo nnection(s iteConnect ion.getPro tocol(), s iteConnect ion.getSer ver(), | |
| 243 | site Connection .getPort() )); | |
| 244 | } | |
| 245 | retu rn result; | |
| 246 | ||
| 247 | ||
| 248 | } | |
| 249 | ||
| 250 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.