30. EPMO Open Source Coordination Office Redaction File Detail Report

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.

30.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\BaseWebFacade\main\src\java\gov\va\med\imaging\exchange\business\taglib\patient AbstractImageHRefTag.java Mon Dec 4 21:35:32 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\BaseWebFacade\main\src\java\gov\va\med\imaging\exchange\business\taglib\patient AbstractImageHRefTag.java Mon Dec 4 21:57:16 2017 UTC

30.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 466
Changed 2 4
Inserted 0 0
Removed 0 0

30.3 Comparison options

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

30.4 Active regular expressions

No regular expressions were active.

30.5 Comparison detail

  1   /**
  2    * Package : MAG - Vi stA Imagin g
  3    * WARNING : Per VHA  Directive  2004-038,  this routi ne should  not be mod ified.
  4    * Date Cr eated: Feb  4, 2008
  5    * Site Na me:  Washi ngton OI F ield Offic e, Silver  Spring, MD
  6    * @author         
BECKEC
  7    * @versio n 1.0
  8    *
  9    * ------- ---------- ---------- ---------- ---------- ---------- -------
  10    * Propert y of the U S Governme nt.
  11    * No perm ission to  copy or re distribute  this soft ware is gi ven.
  12    * Use of  unreleased  versions  of this so ftware req uires the  user
  13    * to exec ute a writ ten test a greement w ith the Vi stA Imagin g
  14    * Develop ment Offic e of the D epartment  of Veteran s Affairs,
  15    * telepho ne (301) 7 34-0100.
  16    * 
  17    * The Foo d and Drug  Administr ation clas sifies thi s software  as
  18    * a Class  II medica l device.   As such,  it may not  be change d
  19    * in any  way.  Modi fications  to this so ftware may  result in  an
  20    * adulter ated medic al device  under 21CF R820, the  use of whi ch
  21    * is cons idered to  be a viola tion of US  Federal S tatutes.
  22    * ------- ---------- ---------- ---------- ---------- ---------- -------
  23    */
  24   package go v.va.med.i maging.exc hange.busi ness.tagli b.patient;
  25  
  26   import gov .va.med.im aging.exch ange.busin ess.Patien t;
  27  
  28   import jav ax.servlet .ServletRe quest;
  29   import jav ax.servlet .http.Http ServletReq uest;
  30   import jav ax.servlet .jsp.JspEx ception;
  31  
  32   import org .apache.lo gging.log4 j.Logger;
  33   import org .apache.lo gging.log4 j.LogManag er;
  34  
  35   /**
  36    * This ta g will gen erate a St ring that  can be use d as an hr ef to an i mage.
  37    * It need s, by defa ult, only  the applic ation path  (servlet  mapping )  of the WAI  servlet.
  38    * The ima ge specifi cation is  determined  by the su rrounding  AbstractPa tientTag.
  39    * The qua lity and a ccept type  may be se t using ta g properti es, or if  left blank
  40    * will be  defaulted .
  41    * Derived  classes o f this tag  specify t he image q uality (Th umbnail, R eference,  and Diagno stic).
  42    * 
  43    * @author         
BECKEC
  44    */
  45   public abs tract clas s Abstract ImageHRefT ag 
  46   extends Ab stractPati entPropert yTag
  47   {
  48           //  a derived  class may  specify t his key
  49           //  in the pa thInfoPatt ern
  50           pr otected fi nal static  String pa tientIcnPa rameterKey  = "[patie ntIcn]";
  51  
  52           pr otected ab stract Str ing getDef aultPathIn foPattern( );
  53           
  54           pr ivate Stri ng host =  null;
  55           pr ivate Stri ng context  = null;
  56           pr ivate Stri ng pathInf oPattern =  getDefaul tPathInfoP attern();
  57           pr ivate Stri ng protoco lOverride;
  58           pr ivate Stri ng targetS ite;
  59           
  60           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  61           
  62           /* *
  63            *  Set/Get t he host po rtion of t he URL.  T his proper ty is opti onal
  64            *  and, if n ot specifi ed will de fault to a  null, and  will prod uce relati ve
  65            *  reference s.
  66            *  
  67            *  @return
  68            * /
  69           pu blic Strin g getHost( )
  70       {
  71           re turn host;
  72       }
  73           pu blic void  setHost(St ring host)
  74       {
  75           th is.host =  host;
  76       }
  77           
  78           /* *
  79            *  Set/Get t he context  portion o f the URL.   This pro perty is o ptional
  80            *  and, if n ot specifi ed will de fault to a  null, and  will prod uce relati ve
  81            *  reference s.
  82            *  
  83            *  The value  returned  from here  must be co nsistent w ith the ge tContext()  
  84            *  method of  HttpServl etRequest.
  85            *  
  86            *  @return
  87            * /
  88           pu blic Strin g getConte xt()
  89       {
  90           re turn conte xt == null  ? 
  91                             null :  
  92                             contex t.length()  == 0 ? "/ " :
  93                                      context. charAt(0)  == '/' ?  
  94                                      context  :
  95                                      ("/" + c ontext);
  96       }
  97           pu blic void  setContext Base(Strin g contextB ase)
  98       {
  99           th is.context  = context Base;
  100       }
  101  
  102           /* *
  103            *  The href  is formed  by substit uting the  enclosing  image tags  identifyi ng informa tion
  104            *  into the  UrlRegex s tring.  Th e regex sh ould inclu de the fol lowing tag s where th e values
  105            *  are to be  substitut ed:
  106            *  <imageUrn >
  107            *  
  108            *  If this p roperty is  not speci fied then  the follow ing values  is used: 
  109            *  "<imageUr n>"
  110            *  
  111            *  @return
  112            * /
  113           pu blic Strin g getPathI nfoPattern ()
  114       {
  115           re turn pathI nfoPattern  == null | | pathInfo Pattern.le ngth() ==  0 ? getDef aultPathIn foPattern( ) : pathIn foPattern;
  116       }
  117           pu blic void  setPathInf oPattern(S tring urlR egex)
  118       {
  119           th is.pathInf oPattern =  urlRegex;
  120       }
  121  
  122           /* *
  123        * @re turn the p rotocolOve rride
  124        */
  125       public  String ge tProtocolO verride()
  126       {
  127           re turn proto colOverrid e;
  128       }
  129       
  130           /* *
  131        * @pa ram protoc olOverride  the proto colOverrid e to set
  132        */
  133       public  void setP rotocolOve rride(Stri ng protoco lOverride)
  134       {
  135           th is.protoco lOverride  = protocol Override;
  136       }
  137       
  138           /* *
  139        * @re turn the t argetSite
  140        */
  141       public  String ge tTargetSit e()
  142       {
  143           re turn targe tSite;
  144       }
  145       
  146           /* *
  147        * @pa ram target Site the t argetSite  to set
  148        */
  149       public  void setT argetSite( String tar getSite)
  150       {
  151           th is.targetS ite = targ etSite;
  152       }
  153       
  154           /* *
  155            *  @see gov. va.med.ima ging.excha nge.busine ss.taglib. image.Abst ractImageP ropertyTag #getElemen tValue()
  156            * /
  157           @O verride
  158           pr otected St ring getEl ementValue () 
  159           th rows JspEx ception
  160           {
  161                    Stri ng request Context =  null;
  162                    try
  163           {
  164                    Serv letRequest  servletRe quest = th is.pageCon text.getRe quest();
  165                    Http ServletReq uest req =  (HttpServ letRequest )servletRe quest;
  166                    requ estContext  = req.get ContextPat h();
  167           } 
  168                    catc h (ClassCa stExceptio n e1)
  169           {
  170                             logger .warn("Una ble to cas t request  to HttpSer vletReques t, tag lib rary expec ts to be r unning ove r HTTP, co ntinuing . ..");
  171           } 
  172                    
  173                    Stri ng pathInf o = buildP athInfo();
  174                    
  175                    // b uild the p ath to the  image ser vlet
  176                    Stri ngBuilder  sb = new S tringBuild er();
  177                    
  178                    // i f the host  is specif ied then a ppend the  host name 
  179                    if(g etHost() ! = null )
  180                             sb.app end(getHos t());
  181                    
  182                    // i f the cont ext base i s specifie d then use  that valu e
  183                    // e lse use th is request 's context
  184                    if(g etContext( ) != null  )
  185                             sb.app end(getCon text());
  186                    // a ppend a '/ ' if one i s not ther e already  and a cont ext was sp ecified
  187                    if(s b.length()  != 0 && ' /' != sb.c harAt(sb.l ength()-1) )
  188                             sb.app end("/");
  189                    
  190                    // a lways appe nd the pat h info
  191                    sb.a ppend(path Info);
  192  
  193                    // i f the prot ocol overr ide AND th e target s ite are pr ovided the n
  194                    // t ack them o nto the UR L as query  parameter s
  195                    if(g etProtocol Override()  != null & & getProto colOverrid e().length () > 0 && 
  196                             getTar getSite()  != null &&  getTarget Site().len gth() > 0  )
  197                    {
  198                             sb.app end("?");
  199                             sb.app end("proto colOverrid e=");
  200                             sb.app end(getPro tocolOverr ide());
  201                             sb.app end("&");
  202                             sb.app end("targe tSite=");
  203                             sb.app end(getTar getSite()) ;
  204                    }
  205                    
  206                    retu rn sb.toSt ring();
  207           }
  208           
  209           /* *
  210            *  Build the  pathInfo  portion of  the image  URL using  the patte rn
  211            *  in getPat hInfo and  the image  URN or the  patient I CN values  from the
  212            *  ancestor  Image elem ent.
  213            *  
  214        * @re turn
  215        * @th rows JspEx ception
  216        */
  217       privat e String b uildPathIn fo() 
  218       throws  JspExcept ion
  219       {
  220                String p athInfo =  getPathInf oPattern() ;
  221                    
  222                    Pati ent patien t = this.g etPatient( );
  223                    
  224                    if(p athInfo.co ntains(pat ientIcnPar ameterKey) )
  225                    {
  226                             String  patientIc nExternal  = null;
  227                             
  228                             patien tIcnExtern al = patie nt.getPati entIcn();
  229                             pathIn fo = pathI nfo.replac e(patientI cnParamete rKey, pati entIcnExte rnal);
  230                    }
  231                    
  232                return p athInfo;
  233       }
  234  
  235   }