Produced by Araxis Merge on 7/10/2017 1:01:46 PM Central 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 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Thu Jun 29 17:22:13 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Fri Jul 7 17:06:28 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 502 |
| 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.i maging.url .mix.confi guration; | |
| 2 | ||
| 3 | import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ; | |
| 4 | ||
| 5 | import jav a.io.Seria lizable; | |
| 6 | import jav a.util.Arr ayList; | |
| 7 | import jav a.util.Lis t; | |
| 8 | ||
| 9 | import org .apache.lo g4j.Logger ; | |
| 10 | ||
| 11 | /** | |
| 12 | * | |
| 13 | * @author DNS TITTOC | |
| 14 | * | |
| 15 | */ | |
| 16 | public cla ss MIXConf iguration | |
| 17 | implements Serializa ble | |
| 18 | { | |
| 19 | pr ivate fina l static l ong serial VersionUID = 1L; | |
| 20 | ||
| 21 | pr ivate stat ic final S tring DEFA ULT_DAS_US ERNAME = " vixuser"; | |
| 22 | pr ivate stat ic final S tring DEFA ULT_DAS_PA SSWORD = " vixvix1."; | |
| 23 | pu blic stati c final St ring DEFAU LT_DAS_SIT E = "200"; | |
| 24 | ||
| 25 | pu blic final static St ring defau ltDODXChan geApplicat ion = "hai ms"; // DA S is proxy only... | |
| 26 | pu blic final static St ring defau ltDODMetad ataXChange Path1 = "/ mix/v1/Dia gnosticRep ort/subjec t"; // "/m ix/Diagnos ticReport/ subject" ( FHIR) -- p ass 1 leve l 1 | |
| 27 | pu blic final static St ring defau ltDODMetad ataXChange Path2 = "/ mix/v1/Ima gingStudy" ; // "/mix /ImagingSt udy" (FHIR ) -- pass 1 level 2 | |
| 28 | pu blic final static St ring defau ltDODImage XChangePat h1 = "/mix /v1/Retrie veThumbnai l"; // "/m ix/Retriev eThumbnail " (WADO-UR I) -- pass 2 (TN) | |
| 29 | pu blic final static St ring defau ltDODImage XChangePat h2 = "/mix /v1/Retrie veInstance "; // "/mi x/Retrieve Instance" (WADO-RS) -- pass 2 (Ref/Diag) | |
| 30 | pu blic final static St ring defau ltDODImage Host = ""; | |
| 31 | pu blic final static in t defaultD ODImagePor t = 0; | |
| 32 | ||
| 33 | pu blic final static St ring defau ltImageXCh angeApplic ation = "M IXWebApp"; // was "Im agingExcha ngeWebApp" ; | |
| 34 | pu blic final static St ring defau ltImageMet adataXChan gePath1 = "/restserv ices/mix/D iagnosticR eport/subj ect"; // ( FHIR) -- p ass 1 leve l 1 | |
| 35 | pu blic final static St ring defau ltImageMet adataXChan gePath2 = "/restserv ices/mix/I magingStud y"; // (FH IR) -- pas s 1 level 2 | |
| 36 | pu blic final static St ring defau ltImageXCh angePath1 = "/mix/re trieveThum bnail"; // (WADO-URI ) -- pass 2 (TN) | |
| 37 | pu blic final static St ring defau ltImageXCh angePath2 = "/mix/re trieveInst ance"; // (WADO-URI ) -- pass 2 (Ref/Dia g); later WADO-RS | |
| 38 | pu blic final static St ring defau ltImageHos t = ""; | |
| 39 | pu blic final static in t defaultI magePort = 0; | |
| 40 | ||
| 41 | pr ivate fina l static L ogger logg er = Logge r.getLogge r(MIXConfi guration.c lass); | |
| 42 | ||
| 43 | pr ivate List <MIXSiteCo nfiguratio n> configu rations; | |
| 44 | pr ivate List <String> e mptyStudyM odalities; | |
| 45 | pr ivate int metadataTi meout; | |
| 46 | ||
| 47 | pu blic final static in t defaultM etadataTim eout = 450 00; | |
| 48 | ||
| 49 | /* * | |
| 50 | * | |
| 51 | * / | |
| 52 | pu blic MIXCo nfiguratio n() | |
| 53 | { | |
| 54 | supe r(); | |
| 55 | conf igurations = new Arr ayList<MIX SiteConfig uration>() ; | |
| 56 | empt yStudyModa lities = n ew ArrayLi st<String> (); | |
| 57 | meta dataTimeou t = defaul tMetadataT imeout; // 45 sec | |
| 58 | } | |
| 59 | ||
| 60 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration(S tring [] v aSites, | |
| 61 | String dasUserna me, String dasPasswo rd, List<M IXSiteConf iguration> alienSite s, | |
| 62 | List<S tring> emp tyStudyMod alities, i nt metadat aTimeout) | |
| 63 | th rows MIXCo nfiguratio nException | |
| 64 | { | |
| 65 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
| 66 | if(v aSites != null) | |
| 67 | { | |
| 68 | for(St ring vaSit e : vaSite s) | |
| 69 | { | |
| 70 | if(vaSit e != null) | |
| 71 | { | |
| 72 | System.out .println(" Adding VA template f or site [" + vaSite + "]"); | |
| 73 | MIXSiteCon figuration site = | |
| 74 | ne w MIXSiteC onfigurati on( | |
| 75 | vaSi te, "", "" , | |
| 76 | defa ultImageXC hangeAppli cation, | |
| 77 | defa ultImageMe tadataXCha ngePath1, | |
| 78 | defa ultImageMe tadataXCha ngePath2, | |
| 79 | defa ultImageXC hangePath1 , | |
| 80 | defa ultImageXC hangePath2 , | |
| 81 | true , | |
| 82 | defa ultImageHo st, | |
| 83 | defa ultImagePo rt); | |
| 84 | ||
| 85 | mixConfigu ration.add SiteConfig uration(si te); | |
| 86 | } | |
| 87 | } | |
| 88 | } | |
| 89 | mixC onfigurati on.createD ODSite(das Username, dasPasswor d); | |
| 90 | if(a lienSites != null) | |
| 91 | { | |
| 92 | for(MI XSiteConfi guration a lienSiteCo nfig : ali enSites) | |
| 93 | { | |
| 94 | alienSit eConfig.se tImagePath 1(defaultD ODImageXCh angePath1) ; | |
| 95 | alienSit eConfig.se tImagePath 2(defaultD ODImageXCh angePath2) ; | |
| 96 | alienSit eConfig.se tMetadataP ath1(defau ltDODMetad ataXChange Path1); | |
| 97 | alienSit eConfig.se tMetadataP ath2(defau ltDODMetad ataXChange Path2); | |
| 98 | alienSit eConfig.se tXChangeAp plication( defaultDOD XChangeApp lication); | |
| 99 | mixConfi guration.a ddSiteConf iguration( alienSiteC onfig); | |
| 100 | } | |
| 101 | } | |
| 102 | //xc hangeConfi guration.e mptyStudyM odalities. add("PR"); // we kno w PR studi es from th e DoD have 0 images | |
| 103 | mixC onfigurati on.emptySt udyModalit ies.addAll (emptyStud yModalitie s); | |
| 104 | mixC onfigurati on.metadat aTimeout = metadataT imeout; | |
| 105 | retu rn mixConf iguration; | |
| 106 | } | |
| 107 | ||
| 108 | /* * | |
| 109 | * Create an MIXConfig uration in stance wit h a DOD an d multiple VA site | |
| 110 | * entries. | |
| 111 | * | |
| 112 | * @param va Sites | |
| 113 | * @return | |
| 114 | * @throws M IXConfigur ationExcep tion | |
| 115 | * / | |
| 116 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration(S tring[] va Sites) | |
| 117 | th rows MIXCo nfiguratio nException | |
| 118 | { | |
| 119 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
| 120 | /* | |
| 121 | xcha ngeConfigu ration.set DasPasswor d(DEFAULT_ DAS_PASSWO RD); | |
| 122 | xcha ngeConfigu ration.set DasUsernam e(DEFAULT_ DAS_USERNA ME); | |
| 123 | */ | |
| 124 | ||
| 125 | if(v aSites != null) | |
| 126 | { | |
| 127 | for(St ring vaSit e : vaSite s) | |
| 128 | { | |
| 129 | System.o ut.println ("Adding V A template for site [" + vaSit e + "]"); | |
| 130 | if(vaSit e != null) | |
| 131 | { | |
| 132 | MIXSiteCon figuration site = | |
| 133 | ne w MIXSiteC onfigurati on( | |
| 134 | vaSi te, "", "" , | |
| 135 | defa ultImageXC hangeAppli cation, | |
| 136 | defa ultImageMe tadataXCha ngePath1, | |
| 137 | defa ultImageMe tadataXCha ngePath2, | |
| 138 | defa ultImageXC hangePath1 , | |
| 139 | defa ultImageXC hangePath2 , | |
| 140 | true , | |
| 141 | defa ultImageHo st, | |
| 142 | defa ultImagePo rt); | |
| 143 | ||
| 144 | mixConfigu ration.add SiteConfig uration(si te); | |
| 145 | } | |
| 146 | } | |
| 147 | } | |
| 148 | ||
| 149 | mixC onfigurati on.createD ODSite(); | |
| 150 | retu rn mixConf iguration; | |
| 151 | } | |
| 152 | ||
| 153 | pr ivate void createDOD Site() | |
| 154 | { | |
| 155 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
| 156 | DEFAULT_ DAS_USERNA ME, DEFAUL T_DAS_PASS WORD, defa ultDODXCha ngeApplica tion, | |
| 157 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
| 158 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
| 159 | defaultD ODImageHos t, default DODImagePo rt); | |
| 160 | addS iteConfigu ration(sit e); | |
| 161 | } | |
| 162 | ||
| 163 | pr ivate void createDOD Site(Strin g dasUsern ame, Strin g dasPassw ord) | |
| 164 | { | |
| 165 | Stri ng usernam e = DEFAUL T_DAS_USER NAME; | |
| 166 | Stri ng passwor d = DEFAUL T_DAS_PASS WORD; | |
| 167 | if(d asUsername != null) | |
| 168 | userna me = dasUs ername; | |
| 169 | if(d asPassword != null) | |
| 170 | passwo rd = dasPa ssword; | |
| 171 | Syst em.out.pri ntln("Addi ng DOD Sit e with use rname [" + username + "] and p assword [" + passwor d + "]"); | |
| 172 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
| 173 | username , password , defaultD ODXChangeA pplication , | |
| 174 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
| 175 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
| 176 | defaultD ODImageHos t, default DODImagePo rt); | |
| 177 | addS iteConfigu ration(sit e); | |
| 178 | } | |
| 179 | ||
| 180 | pr ivate void addSiteCo nfiguratio n(MIXSiteC onfigurati on site) | |
| 181 | { | |
| 182 | this .configura tions.add( site); | |
| 183 | } | |
| 184 | ||
| 185 | pu blic MIXSi teConfigur ation getS iteConfigu ration(Str ing prefer redSiteNum ber, Strin g alternat eSiteNumbe r) | |
| 186 | th rows MIXCo nfiguratio nException | |
| 187 | { | |
| 188 | logg er.debug(" Searching for MIX da ta source site confi guration [ " + prefer redSiteNum ber + "]") ; | |
| 189 | for( int i = 0; i < confi gurations. size(); i+ +) | |
| 190 | { | |
| 191 | MIXSit eConfigura tion site = configur ations.get (i); | |
| 192 | if((si te != null ) && (site .equals(pr eferredSit eNumber))) | |
| 193 | { | |
| 194 | logger.d ebug("Foun d MIX data source si te configu ration [" + preferre dSiteNumbe r + "]"); | |
| 195 | return s ite; | |
| 196 | } | |
| 197 | } | |
| 198 | logg er.warn("U nable to f ind prefer red site [ " + prefer redSiteNum ber + "] i n MIX conf iguration" ); | |
| 199 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 200 | { | |
| 201 | logger .debug("Se arching fo r MIX data source si te configu ration wit h alternat ive site [ " + altern ateSiteNum ber + "]") ; | |
| 202 | for(in t i = 0; i < configu rations.si ze(); i++) | |
| 203 | { | |
| 204 | MIXSiteC onfigurati on site = configurat ions.get(i ); | |
| 205 | if((site != null) && (site.e quals(alte rnateSiteN umber))) | |
| 206 | { | |
| 207 | logger.deb ug("Found MIX data s ource site configura tion for a lternate s ite [" + a lternateSi teNumber + "]"); | |
| 208 | return sit e; | |
| 209 | } | |
| 210 | } | |
| 211 | } | |
| 212 | Stri ng msg = " Unable to find prefe rred site [" + prefe rredSiteNu mber + "]" ; | |
| 213 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 214 | msg += " or alte rnate site number [" + alterna teSiteNumb er + "]"; | |
| 215 | msg += " in MI X configur ation"; | |
| 216 | thro w new MIXC onfigurati onExceptio n(msg); | |
| 217 | } | |
| 218 | ||
| 219 | /* * | |
| 220 | * return an unmodifia ble List o f configur ations | |
| 221 | * @return | |
| 222 | * / | |
| 223 | pu blic List< MIXSiteCon figuration > getConfi gurations( ) | |
| 224 | { | |
| 225 | retu rn configu rations; | |
| 226 | } | |
| 227 | ||
| 228 | pu blic void setConfigu rations(Li st<MIXSite Configurat ion> confi gurations) | |
| 229 | { | |
| 230 | this .configura tions = co nfiguratio ns; | |
| 231 | } | |
| 232 | ||
| 233 | pu blic List< String> ge tEmptyStud yModalitie s() | |
| 234 | { | |
| 235 | retu rn emptySt udyModalit ies; | |
| 236 | } | |
| 237 | ||
| 238 | pu blic void setEmptySt udyModalit ies(List<S tring> emp tyStudyMod alities) | |
| 239 | { | |
| 240 | this .emptyStud yModalitie s = emptyS tudyModali ties; | |
| 241 | } | |
| 242 | ||
| 243 | pu blic int g etMetadata Timeout() | |
| 244 | { | |
| 245 | retu rn metadat aTimeout; | |
| 246 | } | |
| 247 | ||
| 248 | pu blic void setMetadat aTimeout(i nt metadat aTimeout) | |
| 249 | { | |
| 250 | this .metadataT imeout = m etadataTim eout; | |
| 251 | } | |
| 252 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.