16. 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.

16.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\client Awiv.java Mon Dec 4 21:35:14 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\client Awiv.java Mon Dec 4 21:56:47 2017 UTC

16.2 Comparison summary

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

16.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

16.4 Active regular expressions

No regular expressions were active.

16.5 Comparison detail

  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  7, 2011
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  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;
  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   import gov .va.med.im aging.awiv .business. UUID;
  34   import gov .va.med.im aging.awiv .client.da o.PatientL ookupServi ceDao;
  35   import gov .va.med.im aging.awiv .client.da o.UserServ iceDao;
  36   import gov .va.med.im aging.awiv .client.ev ents.About DialogEven t;
  37   import gov .va.med.im aging.awiv .client.ev ents.LogVi sibleEvent ;
  38   import gov .va.med.im aging.awiv .client.ev ents.Patie ntSelected Event;
  39   import gov .va.med.im aging.awiv .client.ev ents.ShowP atientSele ctEvent;
  40   import gov .va.med.im aging.awiv .client.ev ents.UserA uthenticat edEvent;
  41   import gov .va.med.im aging.awiv .client.ev ents.UserL ogoutEvent ;
  42   import gov .va.med.im aging.awiv .client.ui .widgets.A wivConstan ts;
  43   import gov .va.med.im aging.awiv .client.ui .widgets.A wivExcepti onHandler;
  44   import gov .va.med.im aging.awiv .client.ui .widgets.A wivViewerM anager;
  45   import gov .va.med.im aging.awiv .client.ui .widgets.M asthead;
  46   import gov .va.med.im aging.awiv .client.ui .widgets.T abArea;
  47   import gov .va.med.im aging.awiv .client.ui .widgets.d ialogs.Aut henticateU serDialog;
  48   import gov .va.med.im aging.awiv .client.ui .widgets.d ialogs.Wai tDialog;
  49   import gov .va.med.im aging.awiv .exception s.AwivUser NotLoggedI nException ;
  50  
  51   import com .google.gw t.core.cli ent.EntryP oint;
  52   import com .google.gw t.core.cli ent.GWT;
  53   import com .google.gw t.core.cli ent.Schedu ler;
  54   import com .google.gw t.resource s.client.C lientBundl e;
  55   import com .google.gw t.resource s.client.C ssResource ;
  56   import com .google.gw t.resource s.client.C ssResource .NotStrict ;
  57   import com .google.gw t.user.cli ent.Cookie s;
  58   import com .google.gw t.user.cli ent.Window ;
  59   import com .google.gw t.user.cli ent.Window .ClosingEv ent;
  60   import com .google.gw t.user.cli ent.Window .Location;
  61   import com .google.gw t.user.cli ent.rpc.As yncCallbac k;
  62   import com .google.gw t.user.cli ent.ui.Roo tLayoutPan el;
  63   import com .smartgwt. client.typ es.Vertica lAlignment ;
  64   import com .smartgwt. client.uti l.BooleanC allback;
  65   import com .smartgwt. client.uti l.SC;
  66   import com .smartgwt. client.wid gets.Label ;
  67   import com .smartgwt. client.wid gets.layou t.HLayout;
  68   import com .smartgwt. client.wid gets.layou t.VLayout;
  69  
  70   /**
  71    * This is  the main  entry poin t for the  applicatio n
  72    * 
  73    * @author         
WERFEJ
  74    *
  75    */
  76   public cla ss Awiv
  77   implements  EntryPoin t, Patient SelectedEv ent, LogVi sibleEvent , ShowPati entSelectE vent, 
  78   GWT.Uncaug htExceptio nHandler,  UserLogout Event, Win dow.Closin gHandler, 
  79   AboutDialo gEvent, Us erAuthenti catedEvent
  80   {
  81           // private st atic final  int NORTH _HEIGHT =  Applicatio nMenu.APPL ICATION_ME NU_HEIGHT  + Masthead .MASTHEAD_ HEIGHT;//  85; // MAS THEAD_HEIG HT + APPLI CATION_MEN U_HEIGHT
  82           pr ivate stat ic final i nt NORTH_H EIGHT = Ma sthead.MAS THEAD_HEIG HT;
  83  
  84           pr ivate VLay out mainLa yout;
  85           pr ivate HLay out northL ayout;
  86           pr ivate HLay out southL ayout;
  87           pr ivate TabA rea tabAre a;
  88           pr ivate Mast head mastH ead = null ;
  89           pr ivate stat ic Logger  logger = L ogManager. getLogger( "");
  90           pr ivate Auth enticateUs erDialog a uthenticat eUserDialo g = null;
  91           
  92           pr ivate Awiv UserInform ation awiv UserInform ation = nu ll;
  93           
  94             
  95           in terface Gl obalResour ces
  96                             extend s ClientBu ndle
  97           {
  98                    @Not Strict
  99                    @Sou rce("Awiv. css")
  100                    CssR esource cs s();
  101           }
  102  
  103           pu blic void  onModuleLo ad()
  104           {
  105                    GWT. <GlobalRes ources> cr eate(Globa lResources .class).cs s()
  106                             .ensur eInjected( );
  107                    
  108                // get r id of scro ll bars, a nd clear o ut the win dow's buil t-in margi n,
  109                // becau se we want  to take a dvantage o f the enti re client  area
  110                Window.e nableScrol ling(false );
  111                Window.s etMargin(" 0px");
  112                
  113                // initi alize the  main layou t containe r
  114                mainLayo ut = new V Layout();
  115                mainLayo ut.setWidt h100();  
  116                mainLayo ut.setHeig ht100();  
  117                
  118                // initi alize the  North layo ut contain er
  119                northLay out = new  HLayout();   
  120                northLay out.setHei ght(NORTH_ HEIGHT); 
  121                VLayout  vLayout =  new VLayou t(); 
  122                // add t he Masthea d to the n ested layo ut contain er
  123                mastHead  = new Mas thead(this , this, th is);
  124                vLayout. addMember( mastHead);
  125                // add t he Applica tion menu  to the nes ted layout  container
  126                //vLayou t.addMembe r(new Appl icationMen u(this, th is));
  127                // add t he nested  layout con tainer to  the  North  layout co ntainer
  128                northLay out.addMem ber(vLayou t);
  129                // initi alize the  East layou t containe r
  130                tabArea  = new TabA rea(this);  
  131                // initi alize the  South layo ut contain er
  132                southLay out = new  HLayout();  
  133                // set t he Navigat ion Pane a nd Context Area as me mbers of t he South 
  134                // layou t containe
  135                southLay out.setMem bers(tabAr ea);  
  136                // add t he North a nd South l ayout cont ainers to  the main l ayout cont ainer
  137                mainLayo ut.addMemb er(northLa yout);  
  138                mainLayo ut.addMemb er(southLa yout); 
  139  
  140                // add t he main la yout conta iner to GW T's root p anel 
  141                RootLayo utPanel.ge t().add(ma inLayout);           
  142                
  143                GWT.setU ncaughtExc eptionHand ler(this);           
  144                
  145                mainLayo ut.setRedr awOnResize (false);
  146                Window.a ddWindowCl osingHandl er(this);
  147  
  148                // start  by loadin g informat ion about  the user
  149                //loadUs erInformat ion();
  150                
  151                //authen ticateUser ();
  152                Schedule r.get().sc heduleDefe rred(new S cheduler.S cheduledCo mmand () {
  153                    publ ic void ex ecute () 
  154                    {
  155                             authen ticateUser ();
  156                    }
  157                });
  158           }
  159           
  160           /* *
  161            *  Check if  the user i s authenti cated, if  not reques t credenti als. Also  ensure usi ng SSL con nection 
  162            * /
  163           pr ivate void  authentic ateUser()
  164           {
  165                    if(! AwivConsta nts.sslHtt pProtocol. equalsIgno reCase(Loc ation.getP rotocol()) )
  166                    {
  167                             SC.war n("The Vis tA Imaging  AWIV requ ires a sec ure connec tion, clic k OK to re direct wit h SSL", ne w BooleanC allback()
  168                             {                                  
  169                                      @Overrid e
  170                                      public v oid execut e(Boolean  value)
  171                                      {
  172                                               String new Url = Awiv Helper.get SslUrl();
  173                                               Location.a ssign(newU rl);
  174                                      }
  175                             });
  176                    }
  177                    else
  178                    {                         
  179                             String  userCooki e = Cookie s.getCooki e(AwivCons tants.user CookieName );
  180                             if(use rCookie ==  null || u serCookie. length() < = 0)
  181                             {
  182                                      // authe nticate th e user
  183                                      authenti cateUserDi alog = new  Authentic ateUserDia log(this,  getSpecifi edSiteNumb er());
  184                                      authenti cateUserDi alog.show( );                            
  185                             }
  186                             else
  187                             {
  188                                      // the c ookie is v alidated w hen gettin g user inf ormation
  189                                      loadUser Informatio n();
  190                             }
  191                    }
  192           }
  193           
  194           /* *
  195            *  Retrieve  user infor mation fro m the serv er
  196            * /
  197           pr ivate void  loadUserI nformation ()
  198           {
  199                    fina l com.smar tgwt.clien t.widgets. Window wai tDialog =  new com.sm artgwt.cli ent.widget s.Window() ;
  200                    
  201                    wait Dialog.set Width(360) ;  
  202                    wait Dialog.set Height(115 );  
  203                    wait Dialog.set Title("Loa ding User  Informatio n");  
  204                    wait Dialog.set ShowMinimi zeButton(f alse);
  205                    wait Dialog.set ShowCloseB utton(fals e);
  206                    wait Dialog.set IsModal(tr ue);  
  207                    wait Dialog.set ShowModalM ask(true);   
  208                    wait Dialog.cen terInPage( );  
  209           
  210           La bel label  = new Labe l("Please  wait while  loading u ser inform ation");  
  211           la bel.setHei ght100();   
  212           la bel.setPad ding(5);  
  213           la bel.setVal ign(Vertic alAlignmen t.TOP);  
  214           
  215           wa itDialog.a ddItem(lab el);  
  216           
  217           wa itDialog.s how();
  218           
  219           St ring trans actionId =  UUID.uuid ();
  220                    logg er.info("R etrieving  user infor mation wit h transact ion Id '"  + transact ionId + "' .");
  221                    
  222                    User ServiceDao .userServi ceDao.getU serInforma tion(trans actionId,  new AsyncC allback<Aw ivUserInfo rmation>()
  223                    {
  224                             
  225                             @Overr ide
  226                             public  void onSu ccess(Awiv UserInform ation arg0 )
  227                             {
  228                                      waitDial og.hide();
  229                                      setUserI nformation (arg0);
  230                                      if(!isUs erAllowedA ccess())
  231                                      {
  232                                               logger.war n("User do es not hav e sufficie nt permiss ions to ac cess AWIV,  alerting  user and l ogging out .");
  233                                               SC.warn(Aw ivHelper.g etInsuffic ientPermis sionsWarni ngMessage( ), new Boo leanCallba ck()
  234                                               {                                                   
  235                                                       @O verride
  236                                                       pu blic void  execute(Bo olean valu e)
  237                                                       {                                                             
  238                                                                OnLo goutUser() ;
  239                                                       }
  240                                               });
  241                                      }
  242  
  243                                      // if th e user set  the debug  parameter  and has t he MAG SYS TEM key, a llow the d ebug tab
  244                                      // JMW 2 /27/2012 -  the debug  tab doesn 't have an ything use ful on it  right now  so disabli ng it
  245                                      /*
  246                                 if (AwivHelpe r.isDebugM ode() && a rg0.userHa sKey(AwivC onstants.m agSystemSe curityKey) )
  247                                      tabArea. displayDeb ugTab();
  248                                      */
  249                                      AwivHelp er.resetSe ssionTimer ();
  250                                      
  251                                      if(isPat ientSpecif ied())
  252                                      {
  253                                               String icn  = getSpec ifiedPatie ntIcn();
  254                                               logger.inf o("Patient  Id '" + i cn + "' ha s been spe cified, wi ll only al low viewin g this pat ient.");
  255                                               // kill th e cookie!
  256                                               Cookies.re moveCookie (AwivConst ants.patie ntCookieNa me);
  257                                               getPatient Informatio n(icn);
  258                                      }
  259                                      else
  260                                      {                                  
  261                                               if(arg0.is ClaimsAuth entication ())
  262                                               {
  263                                                       lo gger.info( "User is a uthenticat ed to the  claims sys tem, will  request th e user sel ect a site  to lookup  patient") ;
  264                                                       ta bArea.disp layPatient SiteLookup ();
  265                                               }
  266                                               else
  267                                               {
  268                                                       lo gger.info( "User is a uthenticat ed to Vist A site, pa tient look up will be  done agai nst site ' " + arg0.g etPatientL ookupSiteN umber() +  "'.");
  269                                                       ta bArea.disp layPatient SelectionT ab();   
  270                                               }
  271                                      }
  272                             }
  273                             
  274                             @Overr ide
  275                             public  void onFa ilure(Thro wable arg0 )
  276                             {
  277                                      waitDial og.hide();
  278                                      if(!Awiv ExceptionH andler.han dleService Exception( arg0))
  279                                      {
  280                                               logger.err or("Error  retriving  user infor mation, "  + arg0.get Message()) ;
  281                                               if(arg0 in stanceof A wivUserNot LoggedInEx ception)
  282                                               {
  283                                                       au thenticate User(); //  try again
  284                                               }                                          
  285                                      }
  286                             }
  287                    });
  288           }
  289           
  290           /* *
  291            *  Determine s if the u ser has pe rmission t o access t he AWIV
  292            *  @return
  293            * /
  294           pr ivate bool ean isUser AllowedAcc ess()
  295           {
  296                    // i f this is  a claims u ser then t hey can vi ew any dat a
  297                    if(t his.awivUs erInformat ion.isClai msAuthenti cation())
  298                    {
  299                             return  true;                      
  300                    }
  301                    retu rn this.aw ivUserInfo rmation.us erHasNeces saryKeys() ;
  302           }
  303           
  304           pr ivate bool ean isPati entSpecifi ed()
  305           {
  306                    Stri ng patient Icn = getS pecifiedPa tientIcn() ;
  307                    if(p atientIcn  != null &&  patientIc n.length()  > 0)
  308                             return  true;
  309                    retu rn false;
  310           }
  311           
  312           /* *
  313            *  Find the  (optional)  specified  patient I CN from th e URL para meter
  314            *  @return
  315            * /
  316           pr ivate Stri ng getSpec ifiedPatie ntIcn()
  317           {
  318                    retu rn Cookies .getCookie (AwivConst ants.patie ntCookieNa me);
  319           }
  320           
  321           /* *
  322            *  Find the  (optional)  specified  site numb er from th e URL para meter
  323            *  @return
  324            * /
  325           pr ivate Stri ng getSpec ifiedSiteN umber()
  326           {
  327                    retu rn Window. Location.g etParamete r("siteNum ber");
  328           }
  329           
  330           /* *
  331            *  Retrieve  user infor mation giv en the pat ient ICN
  332            *  @param pa tientIcn
  333            * /
  334           pr ivate void  getPatien tInformati on(final S tring pati entIcn)
  335           {
  336                    Stri ng transac tionId = U UID.uuid() ;
  337                    Stri ng siteNum ber = awiv UserInform ation.getP atientLook upSiteNumb er();
  338                    logg er.info("R etrieving  patient in formation   for patie nt '" + pa tientIcn +  "' with t ransaction  Id '" + t ransaction Id + "'.") ;
  339                    Wait Dialog.dis playWaitDi alog("Load ing Patien t Informat ion", "Loa ding patie nt informa tion");
  340                    Pati entLookupS erviceDao. patientLoo kupService Dao.getPat ientInform ation(tran sactionId,  siteNumbe r, patient Icn, new A syncCallba ck<Patient >()
  341                    {
  342                             /* (no n-Javadoc)
  343                              * @se e com.goog le.gwt.use r.client.r pc.AsyncCa llback#onF ailure(jav a.lang.Thr owable)
  344                              */
  345                             @Overr ide
  346                             public  void onFa ilure(Thro wable arg0 )
  347                             {
  348                                      WaitDial og.hideWai tDialog();
  349                                      if(!Awiv ExceptionH andler.han dleService Exception( arg0))
  350                                      {
  351                                               logger.err or("Error  retriving  patient in formation,  " + arg0. getMessage ());
  352                                               SC.warn("E rror findi ng informa tion for p atient '"  + patientI cn + "' fr om site '"  + awivUse rInformati on.getPati entLookupS iteNumber( ) + "'.");
  353                                      }
  354                             }
  355  
  356                             /* (no n-Javadoc)
  357                              * @se e com.goog le.gwt.use r.client.r pc.AsyncCa llback#onS uccess(jav a.lang.Obj ect)
  358                              */
  359                             @Overr ide
  360                             public  void onSu ccess(Pati ent patien t)
  361                             {
  362                                      WaitDial og.hideWai tDialog();
  363                                      logger.i nfo("Got i nformation  about pat ient");
  364                                      onPatien tSelected( patient, f alse); //  only allow  viewing t his patien t                             
  365                             }                         
  366                    });
  367           }
  368           
  369           pr ivate void  setUserIn formation( AwivUserIn formation  awivUserIn formation)
  370           {
  371                    
  372                    this .awivUserI nformation  = awivUse rInformati on;
  373                    tabA rea.setAwi vUserInfor mation(awi vUserInfor mation);
  374                    mast Head.setUs erInformat ion(awivUs erInformat ion);
  375                    Awiv Helper.set AwivServer Informatio n(awivUser Informatio n.getAwivS erverInfor mation());
  376                    logg er.info("R eceived us er informa tion from  site '" +  this.awivU serInforma tion.getSi teName() +  " [" + th is.awivUse rInformati on.getSite Number() +  "].");
  377                    if(t his.awivUs erInformat ion.getKey s() == nul l || this. awivUserIn formation. getKeys(). length <=  0)
  378                    {
  379                             logger .info("Use r has no s ecurity ke ys");
  380                    }
  381                    else
  382                    {
  383                             for(St ring key :  this.awiv UserInform ation.getK eys())
  384                             {
  385                                      logger.i nfo("User  has key ["  + key + " ]");
  386                             }
  387                    }
  388           }
  389  
  390           @O verride
  391           pu blic void  onPatientS elected(Pa tient pati ent, boole an canClos ePatient)
  392           {
  393                    if(A wivHelper. canUserVie wPatients( this.awivU serInforma tion))
  394                    {
  395                             tabAre a.displayP atient(pat ient, canC losePatien t);
  396                    }
  397           }        
  398  
  399           @O verride
  400           pu blic void  OnDisplayL og(boolean  visible)
  401           {
  402                    tabA rea.displa yLog(visib le);
  403           }
  404  
  405           @O verride
  406           pu blic void  OnShowPati entSelect( )
  407           {
  408                    tabA rea.displa yPatientSe lectionTab ();            
  409           }
  410  
  411           @O verride
  412           pu blic void  onUncaught Exception( Throwable  arg0)
  413           {
  414                    Stri ng msg = " UncaughtEx ception: "  +arg0.get Message();
  415                    if(a rg0.getCau se() != nu ll)
  416                             msg +=  "<br>" +  arg0.getCa use().toSt ring();
  417                    Wind ow.alert(m sg);
  418                    
  419                    //lo gger.log(L evel.SEVER E, msg);
  420                    logg er.error(m sg, arg0);
  421           }
  422  
  423           @O verride
  424           pu blic void  OnLogoutUs er()
  425           {
  426                    Awiv Helper.log out();
  427           }
  428  
  429           /*  (non-Java doc)
  430            *  @see com. google.gwt .user.clie nt.Window. ClosingHan dler#onWin dowClosing (com.googl e.gwt.user .client.Wi ndow.Closi ngEvent)
  431            * /
  432           @O verride
  433           pu blic void  onWindowCl osing(Clos ingEvent c losingEven t)
  434           {
  435                    try
  436                    {
  437                             // ens ure the AW IV window  is closed
  438                             AwivVi ewerManage r.closeAwi vViewer();
  439                             AwivHe lper.clear UserCookie (); // jus t to be su re it gets  removed
  440                    }
  441                    catc h(Exceptio n ex)
  442                    {
  443                             // do  nothing wi th the exc eption sin ce we are  closing
  444                    }
  445           }
  446  
  447           /*  (non-Java doc)
  448            *  @see gov. va.med.ima ging.awiv. client.eve nts.AboutD ialogEvent #onShowAbo utDialog()
  449            * /
  450           @O verride
  451           pu blic void  onShowAbou tDialog()
  452           {
  453                    Stri ngBuilder  sb = new S tringBuild er();
  454                    sb.a ppend("<b> VistA Imag ing AWIV</ b>");
  455                    sb.a ppend("<br >");
  456                    sb.a ppend("Ver sion: " +  awivUserIn formation. getAwivSer verInforma tion().get ServerVers ion());
  457                    
  458                    if(A wivHelper. isDebugMod e())
  459                    {                 
  460                             sb.app end("<br>" );
  461                             sb.app end("GWT V ersion: "  + GWT.getV ersion());
  462                             sb.app end("<br>" );
  463                             sb.app end("Smart GWT Versio n: " + com .smartgwt. client.Ver sion.getVe rsion());
  464                    }
  465                    
  466                    SC.s ay("About" , sb.toStr ing());
  467           }
  468  
  469           /*  (non-Java doc)
  470            *  @see gov. va.med.ima ging.awiv. client.eve nts.UserAu thenticate dEvent#onU serAuthent icated()
  471            * /
  472           @O verride
  473           pu blic void  onUserAuth enticated( )
  474           {
  475                    auth enticateUs erDialog.d estroy();
  476                    load UserInform ation();
  477           }
  478   }