Produced by Araxis Merge on 12/5/2017 12:06:46 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\ImagingRouter\main\src\java\gov\va\med\imaging\router\commands\documents | DocumentSetResultCache.java | Mon Dec 4 21:35:20 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingRouter\main\src\java\gov\va\med\imaging\router\commands\documents | DocumentSetResultCache.java | Mon Dec 4 22:03:31 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 368 |
| 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: Jan 20, 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.rou ter.comman ds.documen ts; | |
| 27 | ||
| 28 | import org .apache.lo gging.log4 j.LogManag er; | |
| 29 | import org .apache.lo gging.log4 j.Logger; | |
| 30 | ||
| 31 | import gov .va.med.Pa tientIdent ifier; | |
| 32 | import gov .va.med.Ro utingToken ; | |
| 33 | import gov .va.med.im aging.exch ange.BaseT imedCache; | |
| 34 | import gov .va.med.im aging.exch ange.BaseT imedCacheV alueItem; | |
| 35 | import gov .va.med.im aging.exch ange.TaskS cheduler; | |
| 36 | import gov .va.med.im aging.exch ange.busin ess.docume nts.Docume ntSetResul t; | |
| 37 | ||
| 38 | /** | |
| 39 | * This is a short t erm in mem ory cache of documen t set resu lts | |
| 40 | * | |
| 41 | * @author
|
|
| 42 | * | |
| 43 | */ | |
| 44 | public cla ss Documen tSetResult Cache | |
| 45 | { | |
| 46 | pr ivate fina l static l ong DOCUME NT_SET_RES ULT_CACHE_ TIMER_REFR ESH = 1000 * 60 * 10 ; // check for expir ed items i n cache ev ery 10 min utes | |
| 47 | pr ivate fina l static l ong DOCUME NT_SET_RES ULT_CACHE_ RETENTION_ PERIOD = 1 000 * 60 * 10; // it ems last i n cache fo r 10 minut es | |
| 48 | // private st atic BaseT imedCache< String, Do cumentSetR esultCache ValueItem> documentS etResultCa che = null ; | |
| 49 | pr ivate fina l BaseTime dCache<Str ing, Docum entSetResu ltCacheVal ueItem> do cumentSetR esultCache ; | |
| 50 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Docu mentSetRes ultCache.c lass); | |
| 51 | ||
| 52 | /* | |
| 53 | st atic | |
| 54 | { | |
| 55 | docu mentSetRes ultCache = | |
| 56 | new Ba seTimedCac he<String, DocumentS etResultCa cheValueIt em>(Docume ntSetResul tCache.cla ss.toStrin g()); | |
| 57 | //im ageListCac he.setRete ntionPerio d(VISTA_IM AGE_LIST_C ACHE_TIMER _REFRESH); | |
| 58 | docu mentSetRes ultCache.s etRetentio nPeriod(DO CUMENT_SET _RESULT_CA CHE_RETENT ION_PERIOD ); | |
| 59 | Task Scheduler. getTaskSch eduler().s chedule(do cumentSetR esultCache , | |
| 60 | DOCUMENT _SET_RESUL T_CACHE_TI MER_REFRES H, DOCUMEN T_SET_RESU LT_CACHE_T IMER_REFRE SH); | |
| 61 | }* / | |
| 62 | ||
| 63 | pr ivate Docu mentSetRes ultCache() | |
| 64 | { | |
| 65 | supe r(); | |
| 66 | docu mentSetRes ultCache = | |
| 67 | new Ba seTimedCac he<String, DocumentS etResultCa cheValueIt em>(Docume ntSetResul tCache.cla ss.toStrin g()); | |
| 68 | //im ageListCac he.setRete ntionPerio d(VISTA_IM AGE_LIST_C ACHE_TIMER _REFRESH); | |
| 69 | docu mentSetRes ultCache.s etRetentio nPeriod(DO CUMENT_SET _RESULT_CA CHE_RETENT ION_PERIOD ); | |
| 70 | Task Scheduler. getTaskSch eduler().s chedule(do cumentSetR esultCache , | |
| 71 | DOCUMENT _SET_RESUL T_CACHE_TI MER_REFRES H, DOCUMEN T_SET_RESU LT_CACHE_T IMER_REFRE SH); | |
| 72 | } | |
| 73 | ||
| 74 | pr ivate fina l static D ocumentSet ResultCach e singleto n = new Do cumentSetR esultCache (); | |
| 75 | pr ivate stat ic Documen tSetResult Cache getS ingleton() | |
| 76 | { | |
| 77 | retu rn singlet on; | |
| 78 | } | |
| 79 | ||
| 80 | pu blic stati c void cac heDocument SetResult( RoutingTok en routing Token, Pat ientIdenti fier patie ntIdentifi er, | |
| 81 | Docume ntSetResul t document SetResult) | |
| 82 | { | |
| 83 | try | |
| 84 | { | |
| 85 | if(doc umentSetRe sult != nu ll) | |
| 86 | { | |
| 87 | Document SetResultC ache cache = getSing leton(); | |
| 88 | Document SetResultC acheValueI tem cacheI tem = | |
| 89 | new Docume ntSetResul tCacheValu eItem(rout ingToken, patientIde ntifier, d ocumentSet Result); | |
| 90 | synchron ized(cache .documentS etResultCa che) | |
| 91 | { | |
| 92 | cache.docu mentSetRes ultCache.u pdateItem( cacheItem) ; | |
| 93 | } | |
| 94 | } | |
| 95 | } | |
| 96 | catc h(Exceptio n ex) | |
| 97 | { | |
| 98 | logger .error("Er ror cachin g document set for r outing tok en '" + ro utingToken .toRouting TokenStrin g() + "', patient '" + patient Identifier + "', " + ex.getMes sage()); | |
| 99 | } | |
| 100 | } | |
| 101 | ||
| 102 | pu blic stati c Document SetResult getCachedD ocumentSet Result(Rou tingToken routingTok en, Patien tIdentifie r patientI dentifier) | |
| 103 | { | |
| 104 | ||
| 105 | Stri ng key = D ocumentSet ResultCach eValueItem .createKey (routingTo ken, patie ntIdentifi er); | |
| 106 | Docu mentSetRes ultCache c ache = get Singleton( ); | |
| 107 | sync hronized(c ache.docum entSetResu ltCache) | |
| 108 | { | |
| 109 | Docume ntSetResul tCacheValu eItem cach eItem = | |
| 110 | (Documen tSetResult CacheValue Item) cach e.document SetResultC ache.getIt em(key); | |
| 111 | if(cac heItem != null) | |
| 112 | { | |
| 113 | return c acheItem.g etDocument SetResult( ); | |
| 114 | } | |
| 115 | } | |
| 116 | retu rn null; | |
| 117 | } | |
| 118 | ||
| 119 | st atic class DocumentS etResultCa cheValueIt em | |
| 120 | ex tends Base TimedCache ValueItem | |
| 121 | { | |
| 122 | priv ate final RoutingTok en routing Token; | |
| 123 | priv ate final PatientIde ntifier pa tientIdent ifier; | |
| 124 | priv ate final DocumentSe tResult do cumentSetR esult; | |
| 125 | ||
| 126 | /** | |
| 127 | * @ param rout ingToken | |
| 128 | * @ param pati entIcn | |
| 129 | * @ param docu mentSetRes ult | |
| 130 | */ | |
| 131 | publ ic Documen tSetResult CacheValue Item(Routi ngToken ro utingToken , | |
| 132 | PatientI dentifier patientIde ntifier, D ocumentSet Result doc umentSetRe sult) | |
| 133 | { | |
| 134 | super( ); | |
| 135 | this.r outingToke n = routin gToken; | |
| 136 | this.p atientIden tifier = p atientIden tifier; | |
| 137 | this.d ocumentSet Result = d ocumentSet Result; | |
| 138 | } | |
| 139 | ||
| 140 | /** | |
| 141 | * @ return the routingTo ken | |
| 142 | */ | |
| 143 | publ ic Routing Token getR outingToke n() | |
| 144 | { | |
| 145 | return routingTo ken; | |
| 146 | } | |
| 147 | ||
| 148 | publ ic Patient Identifier getPatien tIdentifie r() | |
| 149 | { | |
| 150 | return patientId entifier; | |
| 151 | } | |
| 152 | ||
| 153 | /** | |
| 154 | * @ return the documentS etResult | |
| 155 | */ | |
| 156 | publ ic Documen tSetResult getDocume ntSetResul t() | |
| 157 | { | |
| 158 | return documentS etResult; | |
| 159 | } | |
| 160 | ||
| 161 | /* ( non-Javado c) | |
| 162 | * @ see gov.va .med.imagi ng.exchang e.BaseTime dCacheValu eItem#getK ey() | |
| 163 | */ | |
| 164 | @Ove rride | |
| 165 | publ ic Object getKey() | |
| 166 | { | |
| 167 | return createKey (getRoutin gToken(), getPatient Identifier ()); | |
| 168 | //retu rn getRout ingToken() .toRouting TokenStrin g() + "_" + getPatie ntIcn(); | |
| 169 | } | |
| 170 | ||
| 171 | /* ( non-Javado c) | |
| 172 | * @ see java.l ang.Object #toString( ) | |
| 173 | */ | |
| 174 | @Ove rride | |
| 175 | publ ic String toString() | |
| 176 | { | |
| 177 | return getKey(). toString() ; | |
| 178 | } | |
| 179 | ||
| 180 | stat ic String createKey( RoutingTok en routing Token, Pat ientIdenti fier patie ntIdentifi er) | |
| 181 | { | |
| 182 | return routingTo ken.toRout ingTokenSt ring() + " _" + patie ntIdentifi er.toStrin g(); | |
| 183 | } | |
| 184 | } | |
| 185 | ||
| 186 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.