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\ROICommands\main\src\java\gov\va\med\imaging\roi\cache | ROIVASourcedCacheDecorator.java | Mon Dec 4 21:35:04 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROICommands\main\src\java\gov\va\med\imaging\roi\cache | ROIVASourcedCacheDecorator.java | Mon Dec 4 22:05:20 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 390 |
| 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: Apr 9, 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.roi .cache; | |
| 27 | ||
| 28 | import jav a.io.IOExc eption; | |
| 29 | import jav a.io.Objec tInputStre am; | |
| 30 | import jav a.io.Objec tOutputStr eam; | |
| 31 | import jav a.nio.chan nels.Chann els; | |
| 32 | import jav a.nio.chan nels.Reada bleByteCha nnel; | |
| 33 | import jav a.nio.chan nels.Writa bleByteCha nnel; | |
| 34 | ||
| 35 | import org .apache.lo gging.log4 j.LogManag er; | |
| 36 | import org .apache.lo gging.log4 j.Logger; | |
| 37 | ||
| 38 | import gov .va.med.Pa tientIdent ifier; | |
| 39 | import gov .va.med.im aging.exch ange.stora ge.cache.V ASourcedCa che; | |
| 40 | import gov .va.med.im aging.exch ange.stora ge.cache.V ASourcedCa cheDecorat or; | |
| 41 | import gov .va.med.im aging.roi. ROIStudyLi st; | |
| 42 | import gov .va.med.im aging.stor age.cache. Cache; | |
| 43 | import gov .va.med.im aging.stor age.cache. Instance; | |
| 44 | import gov .va.med.im aging.stor age.cache. exceptions .CacheExce ption; | |
| 45 | ||
| 46 | /** | |
| 47 | * @author
|
|
| 48 | * | |
| 49 | */ | |
| 50 | public cla ss ROIVASo urcedCache Decorator | |
| 51 | extends VA SourcedCac heDecorato r | |
| 52 | implements ROIVASour cedCache | |
| 53 | { | |
| 54 | pr ivate stat ic ROIVASo urcedCache roiVaSour cedCache = null; | |
| 55 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(ROIV ASourcedCa cheDecorat or.class); | |
| 56 | ||
| 57 | pu blic synch ronized st atic ROIVA SourcedCac he getInst ance(VASou rcedCache vaSourcedC ache) | |
| 58 | { | |
| 59 | if(r oiVaSource dCache == null) | |
| 60 | { | |
| 61 | roiVaS ourcedCach e = new RO IVASourced CacheDecor ator(vaSou rcedCache. getWrapped Cache(), | |
| 62 | vaSourcedC ache.getMe tadataRegi onName(), vaSourcedC ache.getIm ageRegionN ame()); | |
| 63 | } | |
| 64 | retu rn roiVaSo urcedCache ; | |
| 65 | } | |
| 66 | ||
| 67 | pr ivate ROIV ASourcedCa cheDecorat or(Cache w rappedCach e, | |
| 68 | String metadataR egionName, | |
| 69 | String imageRegi onName) | |
| 70 | { | |
| 71 | supe r(wrappedC ache, meta dataRegion Name, imag eRegionNam e); | |
| 72 | } | |
| 73 | ||
| 74 | /* (non-Java doc) | |
| 75 | * @see gov. va.med.ima ging.roi.c ache.ROIVA SourcedCac he#getROIR equest(gov .va.med.im aging.GUID ) | |
| 76 | * / | |
| 77 | @O verride | |
| 78 | pu blic ROISt udyList ge tROIStudyL ist(Patien tIdentifie r patientI dentifier, String gu id) | |
| 79 | th rows Cache Exception | |
| 80 | { | |
| 81 | Stri ng[] group s = create ROIRequest GroupName( patientIde ntifier); | |
| 82 | Stri ng groupKe y = create ROIRequest Key(guid); | |
| 83 | ||
| 84 | retu rn getMeta dataFromIm ageRegion( ROIStudyLi st.class, groups, gr oupKey); | |
| 85 | } | |
| 86 | ||
| 87 | /* (non-Java doc) | |
| 88 | * @see gov. va.med.ima ging.roi.c ache.ROIVA SourcedCac he#createR OIRequest( gov.va.med .imaging.r oi.ROIRequ est) | |
| 89 | * / | |
| 90 | @O verride | |
| 91 | pu blic void createROIS tudyList(P atientIden tifier pat ientIdenti fier, Stri ng guid, | |
| 92 | ROIStu dyList roi StudyList) | |
| 93 | th rows Cache Exception | |
| 94 | { | |
| 95 | Stri ng[] group s = create ROIRequest GroupName( patientIde ntifier); | |
| 96 | Stri ng groupKe y = create ROIRequest Key(guid); | |
| 97 | ||
| 98 | crea teMetadata InImageReg ion(groups , groupKey , roiStudy List); | |
| 99 | } | |
| 100 | ||
| 101 | pr otected <T > void cre ateMetadat aInImageRe gion( | |
| 102 | String [] groups, | |
| 103 | String groupKey, | |
| 104 | T meta data) | |
| 105 | thro ws CacheEx ception | |
| 106 | { | |
| 107 | Writab leByteChan nel metada taWritable = null; | |
| 108 | Object OutputStre am metadat aOutStream = null; | |
| 109 | try | |
| 110 | { | |
| 111 | if( getW rappedCach e().isEnab led().bool eanValue() ) | |
| 112 | { | |
| 113 | Instance m etadataIns tance = ge tWrappedCa che().getO rCreateIns tance( | |
| 114 | getI mageRegion Name(), | |
| 115 | grou ps, | |
| 116 | grou pKey); | |
| 117 | if(metadat aInstance != null) | |
| 118 | { | |
| 119 | me tadataWrit able = met adataInsta nce.getWri tableChann el(); | |
| 120 | me tadataOutS tream = ne w ObjectOu tputStream (Channels. newOutputS tream(meta dataWritab le)); | |
| 121 | ||
| 122 | me tadataOutS tream.writ eObject(me tadata); | |
| 123 | } | |
| 124 | else | |
| 125 | lo gger.warn( "Unable to write to cache and cache is e nabled. A pplication will cont inue to op erate with reduced p erformance ."); | |
| 126 | } | |
| 127 | } | |
| 128 | catch (IOExcepti on e) | |
| 129 | { | |
| 130 | e.printS tackTrace( ); | |
| 131 | } | |
| 132 | finall y | |
| 133 | { | |
| 134 | try{if(m etadataOut Stream != null) meta dataOutStr eam.close( );} | |
| 135 | catch(Th rowable t) {} | |
| 136 | } | |
| 137 | ||
| 138 | return ; | |
| 139 | } | |
| 140 | ||
| 141 | pr otected <T > T getMet adataFromI mageRegion (Class<T> expectedRe sultClass, String[] groups, St ring group Key) | |
| 142 | th rows Cache Exception | |
| 143 | { | |
| 144 | T re sult = nul l; | |
| 145 | ||
| 146 | Read ableByteCh annel meta dataReadab le = null; | |
| 147 | Obje ctInputStr eam metada taInStream = null; | |
| 148 | try | |
| 149 | { | |
| 150 | Instan ce studyMe tadataInst ance = get WrappedCac he().getIn stance( | |
| 151 | getImageRe gionName() , | |
| 152 | groups, | |
| 153 | groupKey); | |
| 154 | ||
| 155 | if(stu dyMetadata Instance ! = null) | |
| 156 | { | |
| 157 | metadata Readable = studyMeta dataInstan ce.getRead ableChanne l(); | |
| 158 | ||
| 159 | metadata InStream = new Objec tInputStre am(Channel s.newInput Stream(met adataReada ble)); | |
| 160 | ||
| 161 | return e xpectedRes ultClass.c ast( metad ataInStrea m.readObje ct() ); | |
| 162 | } | |
| 163 | } | |
| 164 | catc h (IOExcep tion e) | |
| 165 | { | |
| 166 | e.prin tStackTrac e(); | |
| 167 | } | |
| 168 | catc h (ClassNo tFoundExce ption e) | |
| 169 | { | |
| 170 | e.prin tStackTrac e(); | |
| 171 | } | |
| 172 | fina lly | |
| 173 | { | |
| 174 | try{if (metadataI nStream != null)meta dataInStre am.close() ;} | |
| 175 | catch( Throwable t){} | |
| 176 | } | |
| 177 | ||
| 178 | retu rn result; | |
| 179 | } | |
| 180 | ||
| 181 | pr ivate Stri ng[] creat eROIReques tGroupName (PatientId entifier p atientIden tifier) | |
| 182 | { | |
| 183 | retu rn new Str ing [] | |
| 184 | { | |
| 185 | VASource dCacheDeco rator.file nameOctetE scaping.es capeIllega lCharacter s("roi"), | |
| 186 | VASource dCacheDeco rator.file nameOctetE scaping.es capeIllega lCharacter s(patientI dentifier. toString() ), | |
| 187 | VASource dCacheDeco rator.file nameOctetE scaping.es capeIllega lCharacter s("metadat a") | |
| 188 | }; | |
| 189 | } | |
| 190 | ||
| 191 | pr ivate Stri ng createR OIRequestK ey(String guid) | |
| 192 | { | |
| 193 | retu rn VASourc edCacheDec orator.fil enameOctet Escaping.e scapeIlleg alCharacte rs(guid); | |
| 194 | } | |
| 195 | ||
| 196 | ||
| 197 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.