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\ImagingDicomDCFCommon\src\java\gov\va\med\imaging\dicom\dcftoolkit\common\impl | DicomElementImpl.java | Mon Dec 4 21:35:26 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingDicomDCFCommon\src\java\gov\va\med\imaging\dicom\dcftoolkit\common\impl | DicomElementImpl.java | Mon Dec 4 22:02:21 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 872 |
| 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 | * | |
| 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: Marc h 23, 2005 | |
| 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 | package go v.va.med.i maging.dic om.dcftool kit.common .impl; | |
| 26 | ||
| 27 | ||
| 28 | import gov .va.med.im aging.dico m.common.C onstants; | |
| 29 | import gov .va.med.im aging.dico m.common.i nterfaces. IDicomElem ent; | |
| 30 | ||
| 31 | import org .apache.lo gging.log4 j.LogManag er; | |
| 32 | import org .apache.lo gging.log4 j.Logger; | |
| 33 | ||
| 34 | import com .lbs.DCS.A ttributeTa g; | |
| 35 | import com .lbs.DCS.D CM; | |
| 36 | import com .lbs.DCS.D CSExceptio n; | |
| 37 | import com .lbs.DCS.D icomDataSe t; | |
| 38 | import com .lbs.DCS.D icomElemen t; | |
| 39 | import com .lbs.DCS.D icomSQElem ent; | |
| 40 | import com .lbs.DCS.D icomString Element; | |
| 41 | ||
| 42 | /** | |
| 43 | * @author jon | |
| 44 | * | |
| 45 | * TODO To change th e template for this generated type comme nt go to | |
| 46 | * Window - Preferen ces - Java - Code St yle - Code Templates | |
| 47 | */ | |
| 48 | public cla ss DicomEl ementImpl implements IDicomEle ment { | |
| 49 | ||
| 50 | /* ********** ********** ********** ********** ********** ********** ********** *** | |
| 51 | * Static fi elds and i nitializer | |
| 52 | * ********** ********** ********** ********** ********** ********** ********** **/ | |
| 53 | pr ivate stat ic Logger logger = L ogManager. getLogger( DicomEleme ntImpl.cla ss); | |
| 54 | ||
| 55 | /* ********** ********** ********** ********** ********** ********** ********** *** | |
| 56 | * Member va riables | |
| 57 | * ********** ********** ********** ********** ********** ********** ********** **/ | |
| 58 | pr ivate Dico mElement e lement = n ull; | |
| 59 | ||
| 60 | /* ********** ********** ********** ********** ********** ********** ********** *** | |
| 61 | * Construct ors | |
| 62 | * ********** ********** ********** ********** ********** ********** ********** **/ | |
| 63 | /* * | |
| 64 | * @param el ement | |
| 65 | * / | |
| 66 | pu blic Dicom ElementImp l(DicomEle ment eleme nt) { | |
| 67 | supe r(); | |
| 68 | this .element = element; | |
| 69 | } | |
| 70 | ||
| 71 | /* ********** ********** ********** ********** ********** ********** ********** *** | |
| 72 | * Interface methods | |
| 73 | * ********** ********** ********** ********** ********** ********** ********** **/ | |
| 74 | ||
| 75 | /* (non-Java doc) | |
| 76 | * @see com. lbs.DCS.Di comElement #getValue( ) | |
| 77 | * / | |
| 78 | pu blic Objec t getValue () throws DCSExcepti on { | |
| 79 | // D elegate to the conta ined DCF D icomElemen t | |
| 80 | retu rn element .getValue( ); | |
| 81 | } | |
| 82 | ||
| 83 | /* (non-Java doc) | |
| 84 | * @see com. lbs.DCS.Di comElement #getValue( int) | |
| 85 | * / | |
| 86 | pu blic Objec t getValue (int index ) throws D CSExceptio n { | |
| 87 | // D elegate to the conta ined DCF D icomElemen t | |
| 88 | retu rn element .getValue( index); | |
| 89 | } | |
| 90 | ||
| 91 | /* (non-Java doc) | |
| 92 | * @see com. lbs.DCS.Di comElement #getString Value(java .lang.Stri ng, boolea n) | |
| 93 | * / | |
| 94 | pu blic Strin g getStrin gValue(Str ing arg0, boolean ar g1) throws DCSExcept ion { | |
| 95 | // D elegate to the conta ined DCF D icomElemen t | |
| 96 | ||
| 97 | //It was discovere d control and misc. characters were bein g passed i nto the | |
| 98 | // HashMap. This was causing p roblems wh en sending RPC calls in the Le gacy | |
| 99 | // busines layer. I added the .trim() me thod for t he meantim e. It mig ht help. | |
| 100 | Di comStringE lement str ingElement = (DicomS tringEleme nt)this.el ement; | |
| 101 | St ring strin gValue = " "; | |
| 102 | // try | |
| 103 | // { | |
| 104 | stringVa lue = str ingElement .getString Value(arg0 , arg1).tr im(); | |
| 105 | // } | |
| 106 | // catch (DCS Exception dcse){ | |
| 107 | // // log exception | |
| 108 | // logger .error(dcs e.getMessa ge()); | |
| 109 | // logger .error(thi s.getClass ().getName ()+": Fail ure to get String va lue."); | |
| 110 | // } | |
| 111 | re turn strin gValue; | |
| 112 | } | |
| 113 | ||
| 114 | /* (non-Java doc) | |
| 115 | * @see com. lbs.DCS.Di comElement #getDecima lValue() | |
| 116 | * / | |
| 117 | pu blic doubl e getDecim alValue() { | |
| 118 | // D elegate to the conta ined DCF D icomElemen t | |
| 119 | doub le decimal Value = 0; | |
| 120 | try | |
| 121 | { | |
| 122 | decima lValue = e lement.get DecimalVal ue(); | |
| 123 | } | |
| 124 | catc h (DCSExce ption dcse ){ | |
| 125 | logger.e rror(dcse. getMessage ()); | |
| 126 | logger.e rror(this. getClass() .getName() +": Failur e to get d ecimal val ue."); | |
| 127 | // log exception | |
| 128 | logger.e rror("Fail ure to get Decimal v alue."); | |
| 129 | } | |
| 130 | retu rn decimal Value; | |
| 131 | } | |
| 132 | ||
| 133 | /* (non-Java doc) | |
| 134 | * @see com. lbs.DCS.Di comElement #getDecima lValue(int ) | |
| 135 | * / | |
| 136 | pu blic doubl e getDecim alValue(in t index) { | |
| 137 | // D elegate to the conta ined DCF D icomElemen t | |
| 138 | doub le decimal Value = 0; | |
| 139 | try | |
| 140 | { | |
| 141 | decima lValue = e lement.get DecimalVal ue(index); | |
| 142 | } | |
| 143 | catc h (DCSExce ption dcse ){ | |
| 144 | logger.e rror("Erro r :"+dcse. getMessage ()); | |
| 145 | logger.e rror(this. getClass() .getName() +": Failur e to get d ecimal val ue."); | |
| 146 | // log exception | |
| 147 | logger.e rror("Fail ure to get Decimal v alue."); | |
| 148 | } | |
| 149 | retu rn decimal Value; | |
| 150 | } | |
| 151 | ||
| 152 | /* (non-Java doc) | |
| 153 | * @see com. lbs.DCS.Di comElement #getIntVal ue() | |
| 154 | * / | |
| 155 | pu blic int g etIntValue () { | |
| 156 | // D elegate to the conta ined DCF D icomElemen t | |
| 157 | int intValue = 0; | |
| 158 | try | |
| 159 | { | |
| 160 | intVal ue = elem ent.getInt Value(); | |
| 161 | } | |
| 162 | catc h (DCSExce ption dcse ) | |
| 163 | { | |
| 164 | // log exception | |
| 165 | logger.e rror(dcse. getMessage ()); | |
| 166 | logger.e rror(this. getClass() .getName() +": Failur e to get I nt value." ); | |
| 167 | } | |
| 168 | retu rn intValu e; | |
| 169 | } | |
| 170 | ||
| 171 | /* (non-Java doc) | |
| 172 | * @see com. lbs.DCS.Di comElement #getIntVal ue(int) | |
| 173 | * / | |
| 174 | pu blic int g etIntValue (int index ) { | |
| 175 | // D elegate to the conta ined DCF D icomElemen t | |
| 176 | int intValue = 0; | |
| 177 | try | |
| 178 | { | |
| 179 | intVal ue = elem ent.getInt Value(inde x); | |
| 180 | } | |
| 181 | catc h (DCSExce ption dcse ) | |
| 182 | { | |
| 183 | // log exception | |
| 184 | logger.e rror(dcse. getMessage ()); | |
| 185 | logger.e rror(this. getClass() .getName() +": Failur e to get I nt value") ; | |
| 186 | } | |
| 187 | retu rn intValu e; | |
| 188 | } | |
| 189 | ||
| 190 | /* (non-Java doc) | |
| 191 | * @see com. lbs.DCS.Di comElement #getString Value() | |
| 192 | * / | |
| 193 | pu blic Strin g getStrin gValue() { | |
| 194 | // D elegate to the conta ined DCF D icomElemen t | |
| 195 | ||
| 196 | Di comStringE lement str ingElement = (DicomS tringEleme nt)this.el ement; | |
| 197 | ||
| 198 | Stri ng stringV alue = ""; | |
| 199 | try | |
| 200 | { | |
| 201 | string Value = s tringEleme nt.getStri ppedValue( ); | |
| 202 | } | |
| 203 | catc h (DCSExce ption dcse ) | |
| 204 | { | |
| 205 | // log exception | |
| 206 | logger.e rror(dcse. getMessage ()); | |
| 207 | logger.e rror(this. getClass() .getName() +": Failur e to get S tring valu e"); | |
| 208 | } | |
| 209 | retu rn stringV alue; | |
| 210 | } | |
| 211 | ||
| 212 | /* (non-Java doc) | |
| 213 | * @see com. lbs.DCS.Di comElement #getString Value(int) | |
| 214 | * / | |
| 215 | pu blic Strin g getStrin gValue(int index) { | |
| 216 | // D elegate to the conta ined DCF D icomElemen t | |
| 217 | ||
| 218 | // Cast to Di comStringE lement to use method s that an remove err onous char acters fro m | |
| 219 | // from the String va riable. N ot doing t his was ca using prob lems with the Legacy | |
| 220 | // business layer. | |
| 221 | Di comStringE lement str ingElement = (DicomS tringEleme nt)this.el ement; | |
| 222 | ||
| 223 | St ring strin gValue = " "; | |
| 224 | tr y | |
| 225 | { | |
| 226 | stringVa lue = str ingElement .getStripp edValue(in dex); | |
| 227 | } | |
| 228 | ca tch (DCSEx ception dc se) | |
| 229 | { | |
| 230 | // log e xception | |
| 231 | logger.e rror(dcse. getMessage ()); | |
| 232 | logger.e rror(this. getClass() .getName() +": Failur e to get S tring valu e."); | |
| 233 | } | |
| 234 | re turn strin gValue; | |
| 235 | } | |
| 236 | /* (non-Java doc) | |
| 237 | * @see gov. va.med.ima ging.dicom .interface s.IDicomEl ement#getS equenceEle mentString Value(IDic omElement) | |
| 238 | * / | |
| 239 | pu blic Strin g getSeque nceElement StringValu e(String s eqtag) { | |
| 240 | Stri ng stringV alue = ""; | |
| 241 | try | |
| 242 | { | |
| 243 | DicomS QElement s q_e = (Dic omSQElemen t)element; // at thi s point it is assume d that ele ment is of VR_SQ | |
| 244 | DicomD ataSet sq _ds = sq_e .SQ(); // get the se quence Dat aSet | |
| 245 | string Value = sq _ds.findEl ement(new AttributeT ag(seqtag) ).getStrin gValue(); // fetch t he relevan t tag's st ring value | |
| 246 | } | |
| 247 | catc h (DCSExce ption dcse ) | |
| 248 | { | |
| 249 | // log exception | |
| 250 | logger.e rror(dcse. getMessage ()); | |
| 251 | logger.e rror(this. getClass() .getName() +": Failur e to get S equence El ement Stri ng value." ); | |
| 252 | } | |
| 253 | retu rn stringV alue; | |
| 254 | } | |
| 255 | ||
| 256 | /* (non-Java doc) | |
| 257 | * @see gov. va.med.ima ging.dicom .interface s.IDicomEl ement#getS equenceEle mentString Value(IDic omElement, int) | |
| 258 | * / | |
| 259 | pu blic Strin g getSeque nceElement StringValu e(String s eqtag, int index) { | |
| 260 | Stri ng stringV alue = ""; | |
| 261 | try | |
| 262 | { | |
| 263 | DicomS QElement s q_e = (Dic omSQElemen t)element; // at thi s point it is assume d that ele ment is of VR_SQ | |
| 264 | DicomD ataSet sq _ds = sq_e .SQ(index) ; // get t he proper sequence D ataSet ite m | |
| 265 | string Value = sq _ds.getEle mentString Value(new AttributeT ag(seqtag) ); // fetc h the rele vant tag's string va lue | |
| 266 | } | |
| 267 | catc h (DCSExce ption dcse ) | |
| 268 | { | |
| 269 | // log exception | |
| 270 | logger.e rror(dcse. getMessage ()); | |
| 271 | logger.e rror(this. getClass() .getName() +": Failur e to get S equence El ement Stri ng value." ); | |
| 272 | } | |
| 273 | retu rn stringV alue; | |
| 274 | } | |
| 275 | ||
| 276 | /* (non-Java doc) | |
| 277 | * @see gov. va.med.ima ging.dicom .interface s.IDicomEl ement#vm() | |
| 278 | * / | |
| 279 | pu blic int v m() { | |
| 280 | // D elegate to the conta ined DCF D icomElemen t | |
| 281 | retu rn element .vm(); | |
| 282 | } | |
| 283 | ||
| 284 | /* (non-Java doc) | |
| 285 | * @see gov. va.med.ima ging.dicom .interface s.IDicomEl ement#vr() | |
| 286 | * / | |
| 287 | pu blic short vr() { | |
| 288 | // D elegate to the conta ined DCF D icomElemen t | |
| 289 | retu rn transla teVR(eleme nt.vr()); | |
| 290 | } | |
| 291 | ||
| 292 | pu blic Strin g getTagNa me() | |
| 293 | { | |
| 294 | retu rn this.el ement.tag( ).toString (); | |
| 295 | } | |
| 296 | ||
| 297 | /* * | |
| 298 | * Translate s the vr c onstants f rom the DC F specific represent ation into our gener ic dicom | |
| 299 | * represent ation of t he same vr . | |
| 300 | * | |
| 301 | * @param vr | |
| 302 | * @return | |
| 303 | * / | |
| 304 | pr ivate shor t translat eVR(short vr) { | |
| 305 | ||
| 306 | swit ch (vr) | |
| 307 | { | |
| 308 | case D CM.VR_AE: | |
| 309 | return C onstants.D ICOM_VR_AE ; | |
| 310 | case D CM.VR_AS: | |
| 311 | return C onstants.D ICOM_VR_AS ; | |
| 312 | case D CM.VR_AT: | |
| 313 | return C onstants.D ICOM_VR_AT ; | |
| 314 | case D CM.VR_CS: | |
| 315 | return C onstants.D ICOM_VR_CS ; | |
| 316 | case D CM.VR_DA: | |
| 317 | return C onstants.D ICOM_VR_DA ; | |
| 318 | case D CM.VR_DS: | |
| 319 | return C onstants.D ICOM_VR_DS ; | |
| 320 | case D CM.VR_DT: | |
| 321 | return C onstants.D ICOM_VR_DT ; | |
| 322 | case D CM.VR_FD: | |
| 323 | return C onstants.D ICOM_VR_FD ; | |
| 324 | case D CM.VR_FL: | |
| 325 | return C onstants.D ICOM_VR_FL ; | |
| 326 | case D CM.VR_INVA LID: | |
| 327 | return C onstants.D ICOM_VR_IN VALID; | |
| 328 | case D CM.VR_IS: | |
| 329 | return C onstants.D ICOM_VR_IS ; | |
| 330 | case D CM.VR_LO: | |
| 331 | return C onstants.D ICOM_VR_LO ; | |
| 332 | case D CM.VR_LT: | |
| 333 | return C onstants.D ICOM_VR_LT ; | |
| 334 | case D CM.VR_OB: | |
| 335 | return C onstants.D ICOM_VR_OB ; | |
| 336 | case D CM.VR_OW: | |
| 337 | return C onstants.D ICOM_VR_OW ; | |
| 338 | case D CM.VR_PN: | |
| 339 | return C onstants.D ICOM_VR_PN ; | |
| 340 | case D CM.VR_SH: | |
| 341 | return C onstants.D ICOM_VR_SH ; | |
| 342 | case D CM.VR_SL: | |
| 343 | return C onstants.D ICOM_VR_SL ; | |
| 344 | case D CM.VR_SQ: | |
| 345 | return C onstants.D ICOM_VR_SQ ; | |
| 346 | case D CM.VR_SQ_D ELIM: | |
| 347 | return C onstants.D ICOM_VR_SQ _DELIM; | |
| 348 | case D CM.VR_SS: | |
| 349 | return C onstants.D ICOM_VR_SS ; | |
| 350 | case D CM.VR_ST: | |
| 351 | return C onstants.D ICOM_VR_ST ; | |
| 352 | case D CM.VR_TM: | |
| 353 | return C onstants.D ICOM_VR_TM ; | |
| 354 | case D CM.VR_UI: | |
| 355 | return C onstants.D ICOM_VR_UI ; | |
| 356 | case D CM.VR_UL: | |
| 357 | return C onstants.D ICOM_VR_UL ; | |
| 358 | case D CM.VR_UN: | |
| 359 | return C onstants.D ICOM_VR_UN ; | |
| 360 | case D CM.VR_US: | |
| 361 | return C onstants.D ICOM_VR_US ; | |
| 362 | case D CM.VR_UT: | |
| 363 | return C onstants.D ICOM_VR_UT ; | |
| 364 | defaul t: | |
| 365 | return C onstants.D ICOM_VR_UN ; | |
| 366 | } | |
| 367 | } | |
| 368 | /* * | |
| 369 | * Converts our generi c dicom re presentati on of the same vr co nstants to the DCF s pecific re presentati on * | |
| 370 | * @param vr | |
| 371 | * @return | |
| 372 | * / | |
| 373 | pr ivate shor t convertV R(short vr ) { | |
| 374 | ||
| 375 | swit ch (vr) | |
| 376 | { | |
| 377 | case C onstants.D ICOM_VR_AE : | |
| 378 | return D CM.VR_AE; | |
| 379 | case C onstants.D ICOM_VR_AS : | |
| 380 | return D CM.VR_AS; | |
| 381 | case C onstants.D ICOM_VR_AT : | |
| 382 | return D CM.VR_AT; | |
| 383 | case C onstants.D ICOM_VR_CS : | |
| 384 | return D CM.VR_CS; | |
| 385 | case C onstants.D ICOM_VR_DA : | |
| 386 | return D CM.VR_DA; | |
| 387 | case C onstants.D ICOM_VR_DS : | |
| 388 | return D CM.VR_DS; | |
| 389 | case C onstants.D ICOM_VR_DT : | |
| 390 | return D CM.VR_DT; | |
| 391 | case C onstants.D ICOM_VR_FD : | |
| 392 | return D CM.VR_FD; | |
| 393 | case C onstants.D ICOM_VR_FL : | |
| 394 | return D CM.VR_FL; | |
| 395 | case C onstants.D ICOM_VR_IN VALID: | |
| 396 | return D CM.VR_INVA LID; | |
| 397 | case C onstants.D ICOM_VR_IS : | |
| 398 | return D CM.VR_IS; | |
| 399 | case C onstants.D ICOM_VR_LO : | |
| 400 | return D CM.VR_LO; | |
| 401 | case C onstants.D ICOM_VR_LT : | |
| 402 | return D CM.VR_LT; | |
| 403 | case C onstants.D ICOM_VR_OB : | |
| 404 | return D CM.VR_OB; | |
| 405 | case C onstants.D ICOM_VR_OW : | |
| 406 | return D CM.VR_OW; | |
| 407 | case C onstants.D ICOM_VR_PN : | |
| 408 | return D CM.VR_PN; | |
| 409 | case C onstants.D ICOM_VR_SH : | |
| 410 | return D CM.VR_SH; | |
| 411 | case C onstants.D ICOM_VR_SL : | |
| 412 | return D CM.VR_SL; | |
| 413 | case C onstants.D ICOM_VR_SQ : | |
| 414 | return D CM.VR_SQ; | |
| 415 | case C onstants.D ICOM_VR_SQ _DELIM: | |
| 416 | return D CM.VR_SQ_D ELIM; | |
| 417 | case C onstants.D ICOM_VR_SS : | |
| 418 | return D CM.VR_SS; | |
| 419 | case C onstants.D ICOM_VR_ST : | |
| 420 | return D CM.VR_ST; | |
| 421 | case C onstants.D ICOM_VR_TM : | |
| 422 | return D CM.VR_TM; | |
| 423 | case C onstants.D ICOM_VR_UI : | |
| 424 | return D CM.VR_UI; | |
| 425 | case C onstants.D ICOM_VR_UL : | |
| 426 | return D CM.VR_UL; | |
| 427 | case C onstants.D ICOM_VR_UN : | |
| 428 | return D CM.VR_UN; | |
| 429 | case C onstants.D ICOM_VR_US : | |
| 430 | return D CM.VR_US; | |
| 431 | case C onstants.D ICOM_VR_UT : | |
| 432 | return D CM.VR_UT; | |
| 433 | defaul t: | |
| 434 | return D CM.VR_UN; | |
| 435 | } | |
| 436 | } | |
| 437 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.