Produced by Araxis Merge on 12/5/2017 12:06:34 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\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\client\ui\widgets | PhotoIdViewer.java | Mon Dec 4 21:35:32 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\client\ui\widgets | PhotoIdViewer.java | Mon Dec 4 21:56:52 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 496 |
| 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: Dec 29, 2011 | |
| 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.awi v.client.u i.widgets; | |
| 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.im aging.awiv .business. AwivUserIn formation; | |
| 32 | import gov .va.med.im aging.awiv .business. Patient; | |
| 33 | ||
| 34 | import com .google.gw t.dom.clie nt.Element ; | |
| 35 | import com .google.gw t.event.do m.client.E rrorEvent; | |
| 36 | import com .google.gw t.event.do m.client.E rrorHandle r; | |
| 37 | import com .google.gw t.event.do m.client.L oadEvent; | |
| 38 | import com .google.gw t.event.do m.client.L oadHandler ; | |
| 39 | import com .google.gw t.user.cli ent.ui.Ima ge; | |
| 40 | import com .smartgwt. client.typ es.Alignme nt; | |
| 41 | import com .smartgwt. client.typ es.Overflo w; | |
| 42 | import com .smartgwt. client.wid gets.Label ; | |
| 43 | import com .smartgwt. client.wid gets.Widge tCanvas; | |
| 44 | import com .smartgwt. client.wid gets.layou t.HLayout; | |
| 45 | import com .smartgwt. client.wid gets.layou t.VLayout; | |
| 46 | ||
| 47 | /** | |
| 48 | * Compone nt for dis playing th e photo ID image and patient i nformation | |
| 49 | * @author
|
|
| 50 | * | |
| 51 | */ | |
| 52 | public cla ss PhotoId Viewer | |
| 53 | extends VL ayout | |
| 54 | { | |
| 55 | pr ivate Pati ent patien t = null; | |
| 56 | pr ivate Labe l patientL abel = nul l; | |
| 57 | pr ivate Labe l patientS snLabel = null; | |
| 58 | pr ivate Labe l veteranS tatusLabel ; | |
| 59 | pr ivate Labe l errorLab el = null; | |
| 60 | pr ivate Labe l dobLabel = null; | |
| 61 | pr ivate Imag e image = null; | |
| 62 | pr ivate bool ean showPa tientInfo = true; | |
| 63 | pr ivate Awiv UserInform ation awiv UserInform ation = nu ll; | |
| 64 | ||
| 65 | pr ivate fina l int MAX_ IMAGE_HEIG HT = 150; | |
| 66 | pr ivate fina l int MAX_ IMAGE_WIDT H = 150; | |
| 67 | ||
| 68 | pr ivate stat ic Logger logger = L ogManager. getLogger( ""); | |
| 69 | ||
| 70 | pu blic Photo IdViewer() | |
| 71 | { | |
| 72 | supe r(2); | |
| 73 | ||
| 74 | pati entLabel = new Label (); | |
| 75 | pati entSsnLabe l = new La bel(); | |
| 76 | erro rLabel = n ew Label() ; | |
| 77 | HLay out imageL ayout = ne w HLayout( ); | |
| 78 | ||
| 79 | imag e = new Im age(); | |
| 80 | imag eLayout.se tHeight(MA X_IMAGE_HE IGHT); | |
| 81 | ||
| 82 | //im ageLayout. setWidth10 0(); | |
| 83 | imag eLayout.se tWidth(MAX _IMAGE_WID TH); | |
| 84 | imag eLayout.se tAlign(Ali gnment.LEF T); | |
| 85 | // n eed to put the image in a Widg etCanvas s o we can s et its wid th to 100% - was def aulting to 100px and caused pr oblems in FireFox | |
| 86 | Widg etCanvas w c = new Wi dgetCanvas (image); | |
| 87 | wc.s etWidth100 (); | |
| 88 | imag eLayout.ad dMember(wc ); | |
| 89 | ||
| 90 | imag eLayout.se tOverflow( Overflow.V ISIBLE); | |
| 91 | ||
| 92 | pati entLabel.s etHeight(2 0); | |
| 93 | pati entLabel.s etAlign(Al ignment.LE FT); | |
| 94 | pati entLabel.s etPadding( 2); | |
| 95 | erro rLabel.set Height(20) ; | |
| 96 | erro rLabel.set Align(Alig nment.LEFT ); | |
| 97 | ||
| 98 | pati entSsnLabe l = new La bel(); | |
| 99 | pati entSsnLabe l.setAlign (Alignment .LEFT); | |
| 100 | pati entSsnLabe l.setOverf low(Overfl ow.HIDDEN) ; | |
| 101 | pati entSsnLabe l.setHeigh t(20); | |
| 102 | ||
| 103 | vete ranStatusL abel = new Label(); | |
| 104 | vete ranStatusL abel.setAl ign(Alignm ent.LEFT); | |
| 105 | vete ranStatusL abel.setOv erflow(Ove rflow.HIDD EN); | |
| 106 | vete ranStatusL abel.setHe ight(20); | |
| 107 | dobL abel = new Label(); | |
| 108 | dobL abel.setAl ign(Alignm ent.LEFT); | |
| 109 | dobL abel.setOv erflow(Ove rflow.HIDD EN); | |
| 110 | dobL abel.setHe ight(20); | |
| 111 | ||
| 112 | this .setDefaul tLayoutAli gn(Alignme nt.LEFT); | |
| 113 | ||
| 114 | // a dd a handl er if ther e is an er ror | |
| 115 | imag e.addError Handler(ne w ErrorHan dler() | |
| 116 | { | |
| 117 | @Overr ide | |
| 118 | public void onEr ror(ErrorE vent arg0) | |
| 119 | { | |
| 120 | logger.e rror("Erro r loading photo ID i mage, " + arg0.toStr ing()); | |
| 121 | image.se tVisible(f alse); | |
| 122 | image.se tAltText(" No photo I D image"); | |
| 123 | errorLab el.setVisi ble(true); | |
| 124 | errorLab el.setCont ents("No p hoto ID im age"); | |
| 125 | } | |
| 126 | }); | |
| 127 | ||
| 128 | imag e.addLoadH andler(new LoadHandl er() | |
| 129 | { | |
| 130 | @Overr ide | |
| 131 | public void onLo ad(LoadEve nt event) | |
| 132 | { | |
| 133 | Element element = event.getR elativeEle ment(); | |
| 134 | if (elem ent == ima ge.getElem ent()) | |
| 135 | { | |
| 136 | int origin alHeight = image.get OffsetHeig ht(); | |
| 137 | int origin alWidth = image.getO ffsetWidth (); | |
| 138 | if (origin alHeight > originalW idth) | |
| 139 | { | |
| 140 | im age.setHei ght(MAX_IM AGE_HEIGHT + "px"); | |
| 141 | lo gger.info( "Set image height to '" + MAX_ IMAGE_HEIG HT + "'.") ; | |
| 142 | } | |
| 143 | else | |
| 144 | { | |
| 145 | im age.setWid th(MAX_IMA GE_WIDTH + "px"); | |
| 146 | lo gger.info( "Set image width to '" + MAX_I MAGE_WIDTH + "'."); | |
| 147 | } | |
| 148 | logger.inf o("Image w idth: "+ i mage.getWi dth() + ", height: " + image.g etHeight() + ", offs et width: + " + imag e.getOffse tWidth() + ", offset height: " + image.g etOffsetHe ight()); | |
| 149 | } | |
| 150 | } | |
| 151 | }); | |
| 152 | ||
| 153 | this .addMember (patientLa bel); | |
| 154 | this .addMember (patientSs nLabel); | |
| 155 | this .addMember (dobLabel) ; | |
| 156 | this .addMember (veteranSt atusLabel) ; | |
| 157 | this .addMember (errorLabe l); | |
| 158 | this .addMember (imageLayo ut); | |
| 159 | ||
| 160 | disp layPatient (); | |
| 161 | } | |
| 162 | ||
| 163 | /* * | |
| 164 | * @return t he awivUse rInformati on | |
| 165 | * / | |
| 166 | pu blic AwivU serInforma tion getAw ivUserInfo rmation() | |
| 167 | { | |
| 168 | retu rn awivUse rInformati on; | |
| 169 | } | |
| 170 | ||
| 171 | /* * | |
| 172 | * @param aw ivUserInfo rmation th e awivUser Informatio n to set | |
| 173 | * / | |
| 174 | pu blic void setAwivUse rInformati on(AwivUse rInformati on awivUse rInformati on) | |
| 175 | { | |
| 176 | this .awivUserI nformation = awivUse rInformati on; | |
| 177 | } | |
| 178 | ||
| 179 | pu blic void setPatient (Patient p atient) | |
| 180 | { | |
| 181 | this .patient = patient; | |
| 182 | clea rPatient() ; // hide the photo ID image b efore disp laying the new one | |
| 183 | disp layPatient (); | |
| 184 | } | |
| 185 | ||
| 186 | /* * | |
| 187 | * display t he specifi ed patient , if the p atient is null then clear the displayed patient | |
| 188 | * / | |
| 189 | pr ivate void displayPa tient() | |
| 190 | { | |
| 191 | if(p atient == null) | |
| 192 | { | |
| 193 | clearP atient(); | |
| 194 | } | |
| 195 | else | |
| 196 | { | |
| 197 | patien tLabel.set Contents(p atient.get Name()); | |
| 198 | patien tSsnLabel. setContent s(patient. getSsn()); | |
| 199 | vetera nStatusLab el.setCont ents(patie nt.getVete ranStatus( )); | |
| 200 | dobLab el.setCont ents(patie nt.getDobF ormatted() ); | |
| 201 | errorL abel.setCo ntents("") ; | |
| 202 | errorL abel.setVi sible(fals e); | |
| 203 | logger .info("Loa ding photo ID image for patien t '" + pat ient.getIc n() + "'." ); | |
| 204 | image. setWidth(M AX_IMAGE_W IDTH + "px "); | |
| 205 | image. setHeight( MAX_IMAGE_ HEIGHT + " px"); | |
| 206 | image. setUrl("/A wiv/photoi d/" + getA wivUserInf ormation() .getPatien tLookupSit eNumber() + "/" + pa tient.getI cn()); | |
| 207 | image. setVisible (true); | |
| 208 | ||
| 209 | //img. setSrc("/A wiv/photoi d/" + pati ent.getIcn ()); | |
| 210 | //img. setVisible (true); | |
| 211 | } | |
| 212 | } | |
| 213 | ||
| 214 | /* * | |
| 215 | * Clear the displayed patient | |
| 216 | * / | |
| 217 | pr ivate void clearPati ent() | |
| 218 | { | |
| 219 | pati entLabel.s etContents (""); | |
| 220 | pati entSsnLabe l.setConte nts(""); | |
| 221 | vete ranStatusL abel.setCo ntents("") ; | |
| 222 | dobL abel.setCo ntents("") ; | |
| 223 | erro rLabel.set Contents(" "); | |
| 224 | erro rLabel.set Visible(fa lse); | |
| 225 | load ClearImage (); | |
| 226 | imag e.setVisib le(false); | |
| 227 | //im g.setVisib le(false); | |
| 228 | } | |
| 229 | ||
| 230 | /* * | |
| 231 | * To ensure the previ ous patien t image is not displ ayed a bla nk image i s loaded w hen cleari ng the dis played pat ient | |
| 232 | * / | |
| 233 | pr ivate void loadClear Image() | |
| 234 | { | |
| 235 | imag e.setUrl(" /Awiv/imag es/blankIm age.JPG"); | |
| 236 | } | |
| 237 | ||
| 238 | pu blic boole an isShowP atientInfo () | |
| 239 | { | |
| 240 | retu rn showPat ientInfo; | |
| 241 | } | |
| 242 | ||
| 243 | pu blic void setShowPat ientInfo(b oolean sho wPatientIn fo) | |
| 244 | { | |
| 245 | this .showPatie ntInfo = s howPatient Info; | |
| 246 | vete ranStatusL abel.setVi sible(this .showPatie ntInfo); | |
| 247 | dobL abel.setVi sible(this .showPatie ntInfo); | |
| 248 | pati entSsnLabe l.setVisib le(this.sh owPatientI nfo); | |
| 249 | } | |
| 250 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.