Produced by Araxis Merge on 12/5/2017 12:06:44 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\ImagingCommon\main\src\java\gov\va\med | HealthSummaryURN.java | Mon Dec 4 21:34:10 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingCommon\main\src\java\gov\va\med | HealthSummaryURN.java | Mon Dec 4 22:01:49 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 624 |
| 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: Aug 8, 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; | |
| 27 | ||
| 28 | import jav a.io.Seria lizable; | |
| 29 | import jav a.util.reg ex.Matcher ; | |
| 30 | import jav a.util.reg ex.Pattern ; | |
| 31 | ||
| 32 | import org .apache.lo gging.log4 j.LogManag er; | |
| 33 | import org .apache.lo gging.log4 j.Logger; | |
| 34 | ||
| 35 | import gov .va.med.Gl obalArtifa ctIdentifi er; | |
| 36 | import gov .va.med.Gl obalArtifa ctIdentifi erImpl; | |
| 37 | import gov .va.med.Na mespaceIde ntifier; | |
| 38 | import gov .va.med.Ro utingToken ; | |
| 39 | import gov .va.med.Ro utingToken Impl; | |
| 40 | import gov .va.med.SE RIALIZATIO N_FORMAT; | |
| 41 | import gov .va.med.UR N; | |
| 42 | import gov .va.med.UR NComponent s; | |
| 43 | import gov .va.med.UR NType; | |
| 44 | import gov .va.med.We llKnownOID ; | |
| 45 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
| 46 | ||
| 47 | /** | |
| 48 | * @author
|
|
| 49 | * | |
| 50 | */ | |
| 51 | @URNType(n amespace=" vahealthsu mmary") | |
| 52 | public cla ss HealthS ummaryURN | |
| 53 | extends UR N | |
| 54 | implements Serializa ble, Globa lArtifactI dentifier | |
| 55 | { | |
| 56 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 57 | ||
| 58 | pr otected St ring origi natingSite Id; | |
| 59 | pr otected St ring summa ryId; | |
| 60 | ||
| 61 | pr ivate stat ic final S tring name space = "v ahealthsum mary"; | |
| 62 | pu blic stati c final We llKnownOID DEFAULT_H OME_COMMUN ITY_ID = W ellKnownOI D.VA_RADIO LOGY_IMAGE ; | |
| 63 | ||
| 64 | pr ivate stat ic final S tring name spaceSpeci ficStringR egex = | |
| 65 | "([^ -]+)" + // the site ID | |
| 66 | URN. namespaceS pecificStr ingDelimit er + | |
| 67 | "([^ -]+)"; // t he summary ID | |
| 68 | pr ivate stat ic final P attern nam espaceSpec ificString Pattern = Pattern.co mpile(name spaceSpeci ficStringR egex); | |
| 69 | pr ivate stat ic final i nt SITE_ID _GROUP = 1 ; | |
| 70 | pr ivate stat ic final i nt SUMMARY _ID_GROUP = 2; | |
| 71 | ||
| 72 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Heal thSummaryU RN.class); | |
| 73 | ||
| 74 | pr ivate stat ic Namespa ceIdentifi er namespa ceIdentifi er = new N amespaceId entifier(n amespace); | |
| 75 | pu blic stati c synchron ized Names paceIdenti fier getMa nagedNames pace() | |
| 76 | { | |
| 77 | retu rn namespa ceIdentifi er; | |
| 78 | } | |
| 79 | ||
| 80 | pu blic stati c HealthSu mmaryURN c reate(Stri ng origina tingSiteId , | |
| 81 | String summaryId ) | |
| 82 | th rows URNFo rmatExcept ion | |
| 83 | { | |
| 84 | retu rn new Hea lthSummary URN(Health SummaryURN .getManage dNamespace (), | |
| 85 | originat ingSiteId, summaryId ); | |
| 86 | } | |
| 87 | ||
| 88 | pu blic stati c HealthSu mmaryURN c reate(URNC omponents urnCompone nts, | |
| 89 | SERIAL IZATION_FO RMAT seria lizationFo rmat) | |
| 90 | th rows URNFo rmatExcept ion | |
| 91 | { | |
| 92 | retu rn new Hea lthSummary URN(urnCom ponents, s erializati onFormat); | |
| 93 | } | |
| 94 | ||
| 95 | /* * | |
| 96 | * Used dire ctly and a pass thro ugh for de rived clas ses. | |
| 97 | * The const ructor cal led by the URN class when a UR N derived class | |
| 98 | * is being created fr om a Strin g represen tation. | |
| 99 | * | |
| 100 | * @param co mponents | |
| 101 | * @throws U RNFormatEx ception | |
| 102 | * / | |
| 103 | pr otected He althSummar yURN(URNCo mponents u rnComponen ts, SERIAL IZATION_FO RMAT seria lizationFo rmat) | |
| 104 | th rows URNFo rmatExcept ion | |
| 105 | { | |
| 106 | supe r(urnCompo nents, ser ialization Format); | |
| 107 | } | |
| 108 | ||
| 109 | pr otected He althSummar yURN(Names paceIdenti fier names paceIdenti fier, | |
| 110 | String originati ngSiteId, String sum maryId) | |
| 111 | th rows URNFo rmatExcept ion | |
| 112 | { | |
| 113 | supe r(namespac eIdentifie r); | |
| 114 | setO riginating SiteId(ori ginatingSi teId); | |
| 115 | setS ummaryId(s ummaryId); | |
| 116 | } | |
| 117 | ||
| 118 | @O verride | |
| 119 | pu blic Strin g getHomeC ommunityId () | |
| 120 | { | |
| 121 | // I mages are always in the VA com munity | |
| 122 | retu rn WellKno wnOID.VA_R ADIOLOGY_I MAGE.getCa nonicalVal ue().toStr ing(); | |
| 123 | } | |
| 124 | ||
| 125 | @O verride | |
| 126 | pu blic Strin g getRepos itoryUniqu eId() | |
| 127 | { | |
| 128 | retu rn origina tingSiteId ; | |
| 129 | } | |
| 130 | ||
| 131 | @O verride | |
| 132 | pu blic boole an isEquiv alent(Rout ingToken t hat) | |
| 133 | { | |
| 134 | retu rn Routing TokenImpl. isEquivale nt(this, t hat); | |
| 135 | } | |
| 136 | ||
| 137 | @O verride | |
| 138 | pu blic boole an isInclu ding(Routi ngToken th at) | |
| 139 | { | |
| 140 | retu rn Routing TokenImpl. isIncludin g(this, th at); | |
| 141 | } | |
| 142 | ||
| 143 | @O verride | |
| 144 | pu blic Strin g toRoutin gTokenStri ng() | |
| 145 | { | |
| 146 | retu rn getHome CommunityI d() + "," + getRepos itoryUniqu eId(); | |
| 147 | } | |
| 148 | ||
| 149 | @O verride | |
| 150 | pu blic int c ompareTo(G lobalArtif actIdentif ier o) | |
| 151 | { | |
| 152 | retu rn GlobalA rtifactIde ntifierImp l.compareT o(this, o) ; | |
| 153 | } | |
| 154 | ||
| 155 | @O verride | |
| 156 | pu blic boole an equalsG lobalArtif actIdentif ier(Global ArtifactId entifier t hat) | |
| 157 | { | |
| 158 | retu rn GlobalA rtifactIde ntifierImp l.equalsGl obalArtifa ctIdentifi er(this, t hat); | |
| 159 | } | |
| 160 | ||
| 161 | @O verride | |
| 162 | pu blic Healt hSummaryUR N clone() | |
| 163 | th rows Clone NotSupport edExceptio n | |
| 164 | { | |
| 165 | try | |
| 166 | { | |
| 167 | return create(ge tOriginati ngSiteId() , getSumma ryId()); | |
| 168 | } | |
| 169 | catc h (URNForm atExceptio n e) | |
| 170 | { | |
| 171 | throw new CloneN otSupporte dException (e.getMess age()); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | pu blic Strin g getSumma ryId() | |
| 176 | { | |
| 177 | retu rn summary Id; | |
| 178 | } | |
| 179 | ||
| 180 | pu blic void setSummary Id(String summaryId) | |
| 181 | { | |
| 182 | this .summaryId = summary Id; | |
| 183 | } | |
| 184 | ||
| 185 | pu blic Strin g getOrigi natingSite Id() | |
| 186 | { | |
| 187 | retu rn origina tingSiteId ; | |
| 188 | } | |
| 189 | ||
| 190 | pu blic void setOrigina tingSiteId (String or iginatingS iteId) | |
| 191 | { | |
| 192 | this .originati ngSiteId = originati ngSiteId; | |
| 193 | } | |
| 194 | ||
| 195 | /* (non-Java doc) | |
| 196 | * @see gov. va.med.URN #toString( ) | |
| 197 | * / | |
| 198 | @O verride | |
| 199 | pu blic Strin g toString () | |
| 200 | { | |
| 201 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 202 | ||
| 203 | // b uild the s cheme iden tifier | |
| 204 | ahno ld.append( urnSchemaI dentifier) ; | |
| 205 | ahno ld.append( urnCompone ntDelimite r); | |
| 206 | ||
| 207 | // b uild the n amespace i dentifier | |
| 208 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 209 | ahno ld.append( urnCompone ntDelimite r); | |
| 210 | ||
| 211 | ahno ld.append( this.getNa mespaceSpe cificStrin g()); | |
| 212 | ||
| 213 | retu rn ahnold. toString() ; | |
| 214 | } | |
| 215 | ||
| 216 | /* (non-Java doc) | |
| 217 | * @see gov. va.med.URN #toStringA sNative() | |
| 218 | * / | |
| 219 | @O verride | |
| 220 | pr otected St ring toStr ingNative( ) | |
| 221 | { | |
| 222 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 223 | ||
| 224 | // b uild the s cheme iden tifier | |
| 225 | ahno ld.append( urnSchemaI dentifier) ; | |
| 226 | ahno ld.append( urnCompone ntDelimite r); | |
| 227 | ||
| 228 | // b uild the n amespace i dentifier | |
| 229 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 230 | ahno ld.append( urnCompone ntDelimite r); | |
| 231 | ||
| 232 | // r estore any RFC2141 i llegal cha racters | |
| 233 | ahno ld.append( RFC2141_E SCAPING.un escapeIlle galCharact ers(this.g etNamespac eSpecificS tring()) ) ; | |
| 234 | ||
| 235 | retu rn ahnold. toString() ; | |
| 236 | } | |
| 237 | ||
| 238 | /* (non-Java doc) | |
| 239 | * @see gov. va.med.URN #toStringA sVAInterna l() | |
| 240 | * / | |
| 241 | @O verride | |
| 242 | pu blic Strin g toString CDTP() | |
| 243 | { | |
| 244 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 245 | ||
| 246 | // b uild the s cheme iden tifier | |
| 247 | ahno ld.append( urnSchemaI dentifier) ; | |
| 248 | ahno ld.append( urnCompone ntDelimite r); | |
| 249 | ||
| 250 | // b uild the n amespace i dentifier | |
| 251 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 252 | ahno ld.append( urnCompone ntDelimite r); | |
| 253 | ||
| 254 | Stri ng nss = t his.getNam espaceSpec ificString (); | |
| 255 | // e scape any filename i llegal cha racters | |
| 256 | nss = FILENAME _ESCAPING. escapeIlle galCharact ers(nss); | |
| 257 | ahno ld.append( nss); | |
| 258 | ||
| 259 | Stri ng additio nalIdentif iers = thi s.getAddit ionalIdent ifiersStri ng(); | |
| 260 | // e scape any filename i llegal cha racters | |
| 261 | addi tionalIden tifiers = FILENAME_E SCAPING.es capeIllega lCharacter s(addition alIdentifi ers); | |
| 262 | ahno ld.append( additional Identifier s); | |
| 263 | ||
| 264 | retu rn ahnold. toString() ; | |
| 265 | } | |
| 266 | ||
| 267 | /* * | |
| 268 | * | |
| 269 | * / | |
| 270 | @O verride | |
| 271 | pu blic Strin g getNames paceSpecif icString(S ERIALIZATI ON_FORMAT serializat ionFormat) | |
| 272 | { | |
| 273 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 274 | ||
| 275 | // b uild the n amespace s pecific st ring | |
| 276 | ahno ld.append( this.origi natingSite Id); | |
| 277 | ahno ld.append( URN.namesp aceSpecifi cStringDel imiter); | |
| 278 | ahno ld.append( this.summa ryId); | |
| 279 | ||
| 280 | retu rn ahnold. toString() ; | |
| 281 | } | |
| 282 | ||
| 283 | @O verride | |
| 284 | pu blic void parseNames paceSpecif icString(N amespaceId entifier n amespace, | |
| 285 | String namespace SpecificSt ring, | |
| 286 | SERIAL IZATION_FO RMAT seria lizationFo rmat) | |
| 287 | th rows URNFo rmatExcept ion | |
| 288 | { | |
| 289 | if(n amespaceSp ecificStri ng == null ) | |
| 290 | throw new URNFor matExcepti on("The na mespace sp ecific str ing for a( n) " + thi s.getClass ().getSimp leName() + " cannot be null.") ; | |
| 291 | ||
| 292 | Matc her nssMat cher = nam espaceSpec ificString Pattern.ma tcher(name spaceSpeci ficString) ; | |
| 293 | ||
| 294 | if(! nssMatche r.matches( )) | |
| 295 | { | |
| 296 | String msg = "Na mespace sp ecific str ing '" + n amespaceSp ecificStri ng + "' is not valid ."; | |
| 297 | logger .warn(msg) ; | |
| 298 | throw new URNFor matExcepti on(msg); | |
| 299 | } | |
| 300 | ||
| 301 | setO riginating SiteId( ns sMatcher.g roup(Healt hSummaryUR N.SITE_ID_ GROUP).tri m() ); | |
| 302 | setS ummaryId( nssMatcher .group(Hea lthSummary URN.SUMMAR Y_ID_GROUP ).trim() ) ; | |
| 303 | } | |
| 304 | ||
| 305 | @O verride | |
| 306 | pu blic Strin g getDocum entUniqueI d() | |
| 307 | { | |
| 308 | Stri ngBuilder sb = new S tringBuild er(); | |
| 309 | ||
| 310 | sb.a ppend(getS ummaryId() ); | |
| 311 | ||
| 312 | retu rn sb.toSt ring(); | |
| 313 | } | |
| 314 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.