27. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/19/2019 1:19:08 PM Eastern 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.

27.1 Files compared

# Location File Last Modified
1 VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Web Site\Common StationDivisionAuthorization.aspx.cs Thu Jan 17 17:39:58 2019 UTC
2 VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Web Site\Common StationDivisionAuthorization.aspx.cs Sat Jan 19 18:02:24 2019 UTC

27.2 Comparison summary

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

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

27.4 Active regular expressions

No regular expressions were active.

27.5 Comparison detail

  1   using Syst em;
  2   using Syst em.Collect ions.Gener ic;
  3   using Syst em.Linq;
  4   using Syst em.Web;
  5   using Syst em.Web.UI;
  6   using Syst em.Web.UI. WebControl s;
  7   using VIRP _WEB.BaseC ode;
  8   using Anti XssEnc = M icrosoft.S ecurity.Ap plication;
  9  
  10   namespace  VIRP_WEB.C ommon
  11   {
  12       public  partial c lass Stati onDivision Authorizat ion : Base Page
  13       {
  14           #r egion Acti ons, Error  Codes, De scriptions  Shared wi th the ASP X
  15  
  16           pu blic stati c readonly  string Se ntillionRe asonDesc =  "The sent illion com ponents ar e not func tioning. T hey are ei ther missi ng or shou ld be rein stalled.";
  17           pu blic stati c readonly  string Se ntillionRe asonCode =  "sentilli on";
  18           pu blic stati c readonly  string Co ntextReaso nDesc = "I t is possi ble that u ser contex t sharing  has been d isabled by  CPRS";
  19           pu blic stati c readonly  string Co ntextReaso nCode = "c ontext";
  20           pu blic stati c readonly  string Lo ginReasonD esc = "Vis tALink Log in failed.  There is  either a p roblem con necting to  the servi ce or you  are not au thorized." ;
  21           pu blic stati c readonly  string Lo ginReasonC ode = "log in";
  22           pu blic stati c readonly  string Re questStati onAction =  "requestS tation";
  23           pu blic stati c readonly  string Co nfirmActio n = "confi rm";
  24           pu blic stati c readonly  string Ac tionQueryF ield = "ac tion";
  25           pu blic stati c readonly  string Re asonQueryF ield = "re ason";
  26           pu blic stati c readonly  string Vi staQueryFi eld = "vis ta";
  27           pu blic stati c readonly  string In validDivis ionErrorSn ippet = "D ivision sp ecified is  invalid f or user.";
  28           pu blic stati c readonly  string In validDivis ionPleasan tErrorPref ix = "The  VIA servic e reports  that you a re not aut horized fo r division  ";
  29           pu blic stati c readonly  string Di visionNotS upportedFo rmat = "Di vision [{0 }] not sup ported";
  30           pu blic stati c readonly  string Su ccessMessa ge = "SUCC ESS";
  31           pu blic stati c readonly  string VI ASiteLooku pSuccessPr efix = "Th e VIA serv ice report s that you r primary  station is  ";
  32  
  33           #e ndregion E rror Codes  and Descr iptions Sh ared with  the ASPX
  34  
  35           pr ivate Note sManager m anager = n ull;
  36           pr ivate stri ng siteCod e = null;
  37  
  38             // D N S  - unused  field
  39           // private Vi aServiceDa ta viaData  = null;
  40  
  41           pr otected ov erride voi d Page_Loa d(object s ender, Eve ntArgs e)
  42           {
  43                if (!Pag e.IsPostBa ck)
  44                {
  45                    if ( Request.Ht tpMethod = = "POST")
  46                    {
  47                         return;
  48                    }
  49                    Upda teUserLabe l();
  50                    bool  showSelec tion = fal se;
  51                    stri ng action  = Request. QueryStrin g[ActionQu eryField];
  52                    if ( string.IsN ullOrEmpty (action))
  53                    {
  54                         //The page  originall y loads wi th no quer y string v ariables.
  55                         //The show Selection  variable = = false wi ll cause t he page to  include t he
  56                         //CCOW sin gle sign o n code and  diagnosti cs display .
  57                         //Logging. WriteLogTo File("Stat ionDivisio nAuthoriza tion: Prep aring to u se CCOW to  authentic ate user t o VistALin k through  VIA.");
  58                    }
  59                    else  if (Reque stStationA ction.Equa ls(action,  StringCom parison.Or dinalIgnor eCase))
  60                    {
  61                         //If the d ivision co uld not be  determine d then the  RequestSt ationActio n
  62                         //flag is  set and we  attempt t o use the  site code  supplied b y CPRS ins tead
  63                         SetError(R equest.Que ryString[R easonQuery Field]);
  64                         showSelect ion = true ;
  65  
  66                         //Session[ "StationDi vision"] =  ViaData.S iteCode;
  67  
  68                         Response.R edirect("P atientCprs Main.aspx" );
  69                    }
  70                    else  if (Confi rmAction.E quals(acti on, String Comparison .OrdinalIg noreCase))
  71                    {
  72                         //The Sent illion com ponents we re found a nd user co ntext is s hared. We
  73                         //need to  Confirm th at the VIA  service i s availabl e and that  the divis ion
  74                         //we disco vered will  work for  this user.
  75                         string vis taID = Req uest.Query String[Vis taQueryFie ld];
  76                         if (!strin g.IsNullOr Empty(vist aID))
  77                         {
  78                             //Logg ing.WriteL ogToFile(" StationDiv isionAutho rization:  CCOW found  the follo wing Vista  ID: " + v istaID);
  79                             int fo und = vist aID.LastIn dexOf('^') ;
  80                             if (-1  != found  && vistaID .Length >  found)
  81                             {
  82                                 si teCode = v istaID.Sub string(fou nd + 1);
  83                                 // siteCode =  "442DT";/ /uncomment  this line  to test l ogin failu re
  84                                 At temptVIALo gin();
  85                                 sh owSelectio n = true;
  86                             }
  87                         }
  88                         else
  89                         {
  90                             //Logg ing.WriteL ogToFile(" StationDiv isionAutho rization:  CCOW was a ccessed bu t was unab le to dete rmine a Vi sta ID.");
  91                         }
  92                    }
  93                    Defa ultCCOWCon tent.Visib le = !show Selection;  //CCOW di agnostics
  94                    Defa ultJavascr ipt.Visibl e = !showS election;  //CCOW jav ascript
  95                    Sele ctionConte nt.Visible  = showSel ection; // Division S election D ialog (if  Single Sig n On fails /aborts)
  96                }
  97           }
  98  
  99           // / <summary >
  100           // / Logs a j avascript- generated  log messag e to the d atabase
  101           // / </summar y>
  102           // private vo id HandleL oggingRequ est()
  103           // {
  104           //     Stream Reader rea der = new  StreamRead er(Request .InputStre am);
  105           //     string  logMessag e = reader .ReadToEnd ();
  106           //     Loggin g.WriteLog ToFile(str ing.Format ("StationD ivisionAut horization : Message  from {0} o n {1} [{2} ]: {3}",
  107           //         Re quest.Logo nUserIdent ity.Name,  Request.Us erHostName , Request. UserHostAd dress, log Message));
  108           // }
  109  
  110           pr ivate void  AttemptVI ALogin()
  111           {
  112                ViaData. SiteCode =  siteCode;
  113                string e rror;
  114                var succ ess = Mana ger.TestVI ALogin(Htt pContext.C urrent.Use r.Identity .Name, Via Data, out  error);
  115                if (succ ess)
  116                {
  117                    //Se ssion["Sta tionDivisi on"] = sit eCode;
  118                    Resp onse.Redir ect("Patie ntCprsMain .aspx", tr ue);
  119                }
  120                else
  121                {
  122                    if ( error.Inde xOf(Invali dDivisionE rrorSnippe t, StringC omparison. OrdinalIgn oreCase) ! = -1)
  123                    {
  124                         error = In validDivis ionPleasan tErrorPref ix + siteC ode;
  125                    }
  126                    stri ng temp =  string.For mat(Divisi onNotSuppo rtedFormat , siteCode );
  127                    if ( error.Inde xOf(temp,  StringComp arison.Ord inalIgnore Case) != - 1)
  128                    {
  129                         error = te mp;
  130                    }
  131                    SetE rror(Login ReasonCode , error);
  132                }
  133           }
  134  
  135           // / <summary >
  136           // / Just sho w somethin g so that  the user l abel is no t empty
  137           // / </summar y>
  138           pr ivate void  UpdateUse rLabel()
  139           {
  140                //Label  labelUser  = (Label)M aster.Find Control("L abelCurren tUser");
  141                //labelU ser.Text =  "Validati ng...";
  142           }
  143  
  144           pr ivate ViaS erviceData  ViaData
  145           {
  146                get
  147                {
  148                    //if  (null ==  viaData)
  149                    //     viaData  = BuildTem pViaData() ;
  150                    //re turn viaDa ta;
  151                    retu rn ViaSess ion;
  152                }
  153           }
  154  
  155           // / <summary >
  156           // / Singleto n getter o f a TBIIns trumentsMa nager obje ct for thi s page ins tance
  157           // / </summar y>
  158           pr ivate Note sManager M anager
  159           {
  160                get
  161                {
  162                    if ( null == ma nager)
  163                         manager =  new NotesM anager();
  164                    retu rn manager ;
  165                }
  166           }
  167  
  168           // / <summary >
  169           // / Enables  calling Se tError wit hout a sec ondary, ex tended err or
  170           // / </summar y>
  171           // / <param n ame="error ">The prim ary error  to display </param>
  172           pr ivate void  SetError( string err or)
  173           {
  174                SetError (error, nu ll);
  175           }
  176  
  177           // / <summary >
  178           // / Sets des criptions  on error l abels to p resent to  the user.
  179           // / Displayi ng an erro r also mea ns we need  input fro m the user . So this  method
  180           // / also set s up the s tation sel ection lis t box and  displays i nstruction s.
  181           // / </summar y>
  182           // / <param n ame="error ">The prim ary error  to display </param>
  183           // / <param n ame="exten dedError"> The second ary error  to display </param>
  184           pr ivate void  SetError( string err or, string  extendedE rror)
  185           {
  186                //Extend edErrorLab el.Text =  AntiXssEnc .Encoder.H tmlEncode( extendedEr ror);
  187                //if (Se ntillionRe asonCode.E quals(erro r, StringC omparison. OrdinalIgn oreCase))
  188                //{
  189                //    Er rorLabel.T ext = Anti XssEnc.Enc oder.HtmlE ncode(Sent illionReas onDesc);
  190                //}
  191                //else i f (Context ReasonCode .Equals(er ror, Strin gCompariso n.OrdinalI gnoreCase) )
  192                //{
  193                //    Er rorLabel.T ext = Anti XssEnc.Enc oder.HtmlE ncode(Cont extReasonD esc);
  194                //}
  195                //else i f (LoginRe asonCode.E quals(erro r, StringC omparison. OrdinalIgn oreCase))
  196                //{
  197                //    Er rorLabel.T ext = Anti XssEnc.Enc oder.HtmlE ncode(Logi nReasonDes c);
  198                //}
  199                //else
  200                //{
  201                //    Er rorLabel.T ext = "Unk nown Error : " + Anti XssEnc.Enc oder.HtmlE ncode(erro r);
  202                //}
  203  
  204                //if (st ring.IsNul lOrEmpty(s iteCode))
  205                //{
  206                //    st ring temp  = Manager. LookupSite CodeByServ er(TBIServ iceTo.Serv erIP, out  error);
  207                //    if  (!string. IsNullOrEm pty(temp))
  208                //    {
  209                //         siteCode  = temp;
  210                //    }
  211                //    if  (!string. IsNullOrEm pty(error) )
  212                //    {
  213                //         if (erro r == Succe ssMessage)
  214                //         {
  215                //             Exte ndedErrorL abel.Text  = AntiXssE nc.Encoder .HtmlEncod e(VIASiteL ookupSucce ssPrefix +  siteCode) ;
  216                //         }
  217                //         else
  218                //         {
  219                //             Exte ndedErrorL abel.Text  = AntiXssE nc.Encoder .HtmlEncod e(error);
  220                //         }
  221                //    }
  222                //}
  223  
  224                //At thi s point we  have acce ss to the  errors tha t are goin g to be di splayed to  the user,  so log th em
  225                //Loggin g.WriteLog ToFile(str ing.Format ("StationD ivisionAut horization : Error:\r \nPrimary= {0}\r\nSec ondary=",  ErrorLabel .Text, Ext endedError Label.Text ));
  226                //Statio nBox.DataS ource = Ge tMatchingS tations(si teCode);
  227                //Statio nBox.DataB ind();
  228                //if (!s tring.IsNu llOrEmpty( siteCode))
  229                //{
  230                //    // if the log in fails d o not atte mpt again  automatica lly
  231                //    if  (StationB ox.Items.C ount == 1  && error ! = LoginRea sonCode)
  232                //    {
  233                //         string a vailableSt ation = (S tationBox. Items[0]). Value;
  234                //         if (avai lableStati on == site Code)
  235                //         {
  236                //             //th ere is onl y one avai lable stat ion and it  matches t he station  sent by C PRS
  237                //             //so  instead o f showing  an error a nd a selec tion list,  just go a head and
  238                //             //at tempt to L ogin the u ser using  that stati on
  239                //             Atte mptVIALogi n();
  240                //         }
  241                //    }
  242                //    St ationBox.S electedVal ue = siteC ode;
  243                //    In structions Label.Text  = "To try  signing o n to anoth er divisio n, select  it from th e list the n click Su bmit.";
  244                //}
  245                //else
  246                //{
  247                //    In structions Label.Text  = "To try  signing o n to a div ision, sel ect it fro m the list  then clic k Submit." ;
  248                //}
  249           }
  250  
  251           // / <summary >
  252           // / ViewMode l class fo r displayi ng availab le station s
  253           // / </summar y>
  254           pu blic class  Station
  255           {
  256                public s tring Code  { get; pr ivate set;  }
  257                public s tring Desc ription {  get; priva te set; }
  258                public S tation(str ing code,  string des cription)
  259                {
  260                    this .Code = co de;
  261                    this .Descripti on = descr iption;
  262                }
  263           }
  264  
  265             // D N S  - unused  method
  266           // / <summary >
  267           // / Selects  the divisi ons matchi ng a given  station
  268           // / </summar y>
  269           // / <param n ame="baseS tation">Ca n either b e null, a  three digi t station,  or a five  dight sta tion.</par am>
  270           // / <returns >Returns t he base st ation and  all divisi ons associ ated with  the base s tation. Re turns all  stations i f no base  station is  provided. </returns>
  271           // private IE numerable< Station> G etMatching Stations(s tring base Station)
  272           // {
  273           //     List<S tation> re sult = new  List<Stat ion>();
  274           //     //if ( null == ba seStation)
  275           //     //{
  276           //     //     baseStatio n = "";
  277           //     //}
  278           //     //else  if (baseS tation.Len gth > 3)
  279           //     //{
  280           //     //     baseStatio n = baseSt ation.Subs tring(0, 3 );
  281           //     //}
  282  
  283           //     //SqlD ataReader  sReader =  SqlProvide r.ExecuteS PReader("R egistryCon nectionStr ing", "CRS _SP_GET_IN STITUTIONS _BY_STATIO NNUMBER",  new object [] { baseS tation });
  284  
  285           //     //whil e (sReader .Read())
  286           //     //{
  287           //     //     string cod e = sReade r.GetStrin g(1);
  288           //     //     result.Add (new Stati on(code, s tring.Form at("{0} ({ 1})", sRea der.GetStr ing(0), co de)));
  289           //     //}
  290  
  291           //     return  result;
  292           // }
  293  
  294           // / <summary >
  295           // / Helper f unction us ed to retu rn a tempo rary TBISe rverTO obj ect that w ill be use d
  296           // / to test  whether or  not the c onfigurati on provide d can be u sed to suc cessfully
  297           // / login to  a VistALi nk server  through VI A.
  298           // / </summar y>
  299           // / <param n ame="page" >Page cont ext to pas s to helpe r function  that need s its Sess ion inform ation.</pa ram>
  300           // / <returns >Temporary  TBIServic eTO object  only used  to test l ogin</retu rns>
  301           // private Vi aServiceDa ta BuildTe mpViaData( )
  302           // {
  303           //     string  inSiteCod e, inDUZ,  inDFN, inS erverIP, i nServerPor t;
  304           //     int in TBIEvaluat ionNoteId,  inTBIFoll owUpNoteId ;
  305           //     //Help ers.Extrac tCPRSVaria bles(page,  out _inSi teCode, ou t _inDUZ,  out _inDFN , out _inS erverIP, o ut _inServ erPort, ou t _inTBIEv aluationNo teId, out  _inTBIFoll owUpNoteId );
  306  
  307           //     //Get  parameters  from sess ion variab les 
  308           //     inSite Code = Hel pers.GetSt ringFromSe ssionVaria ble(Sessio n["SiteCod e"]);
  309           //     inDUZ  = Helpers. GetStringF romSession Variable(S ession["DU Z"]);
  310           //     inDFN  = Helpers. GetStringF romSession Variable(S ession["DF N"]);
  311           //     inServ erIP = Hel pers.GetSt ringFromSe ssionVaria ble(Sessio n["ServerI P"]);
  312           //     inServ erPort = H elpers.Get StringFrom SessionVar iable(Sess ion["Serve rPort"]);
  313  
  314           //     int.Tr yParse(Hel pers.GetSt ringFromSe ssionVaria ble(Sessio n["TBIEval uationNote Id"]), out  inTBIEval uationNote Id);
  315           //     int.Tr yParse(Hel pers.GetSt ringFromSe ssionVaria ble(Sessio n["TBIFoll owUpNoteId "]), out i nTBIFollow UpNoteId);
  316  
  317           //     if (st ring.IsNul lOrEmpty(i nDUZ)
  318           //         ||  string.Is NullOrEmpt y(inDFN)
  319           //         ||  string.Is NullOrEmpt y(inSiteCo de)
  320           //         ||  string.Is NullOrEmpt y(inServer IP)
  321           //         ||  string.Is NullOrEmpt y(inServer Port))
  322           //     {
  323           //         // if any val ue is not  passed in  then the p age was ca lled incor rectly, di splay erro r message  to user
  324           //         // lblMessage .Text = "I ncorrect v alue has b een passed  from CPRS .";
  325           //     }
  326  
  327           //     //Add  to TBIServ iceTO
  328           //     ViaSer viceData v iaData = n ew ViaServ iceData();
  329  
  330           //     viaDat a.SiteCode  = inSiteC ode;
  331           //     viaDat a.DUZ = in DUZ;
  332           //     viaDat a.DFN = in DFN;
  333           //     viaDat a.CprsSent TBIEvaluat ionNoteId  = inTBIEva luationNot eId;
  334           //     viaDat a.CprsSent TBIFollowU pNoteId =  inTBIFollo wUpNoteId;
  335  
  336           //     viaDat a.ServerIP  = inServe rIP;
  337           //     viaDat a.ServerPo rt = inSer verPort;
  338  
  339           //     //ViaS erviceData  result =  Helpers.Bu ildTBIServ iceTO(_inS iteCode, _ inDUZ, _in DFN, _inSe rverIP, _i nServerPor t, _inTBIE valuationN oteId, _in TBIFollowU pNoteId);
  340           //     return  viaData;
  341           // }
  342  
  343           // public sta tic void E xtractCPRS Variables( System.Web .SessionSt ate.HttpSe ssionState  session,  HttpRespon se respons e, out str ing _inSit eCode, out  string _i nDUZ, out  string _in DFN, out s tring _inS erverIP, o ut string  _inServerP ort, out i nt _inTBIE valuationN oteId, out  int _inTB IFollowUpN oteId)
  344           // {
  345           //     _notes Manager.Ad dtoSession TBIService To(_tbiSer viceTo);
  346  
  347           //     _inSit eCode = Bu sinessHelp er.GetStri ngFromSess ionVariabl e(session[ "SiteCode" ]);
  348           //     _inDUZ  = Busines sHelper.Ge tStringFro mSessionVa riable(ses sion["DUZ" ]);
  349           //     _inDFN  = Busines sHelper.Ge tStringFro mSessionVa riable(ses sion["DFN" ]);
  350           //     _inSer verIP = Bu sinessHelp er.GetStri ngFromSess ionVariabl e(session[ "ServerIP" ]);
  351           //     _inSer verPort =  BusinessHe lper.GetSt ringFromSe ssionVaria ble(sessio n["ServerP ort"]);
  352  
  353           //     int.Tr yParse(Bus inessHelpe r.GetStrin gFromSessi onVariable (session[" TBIEvaluat ionNoteId" ]), out _i nTBIEvalua tionNoteId );
  354           //     int.Tr yParse(Bus inessHelpe r.GetStrin gFromSessi onVariable (session[" TBIFollowU pNoteId"]) , out _inT BIFollowUp NoteId);
  355  
  356           //         // if any val ue is not  passed in  then the p age was ca lled incor rectly, di splay erro r message  to user
  357           //         re sponse.Red irect("War ning.aspx? err=7", fa lse);
  358           //     }
  359           // }
  360  
  361           // protected  void Submi tButton_Cl ick(object  sender, E ventArgs e )
  362           // {
  363           //     if (St ationBox.S electedInd ex == -1)
  364           //         re turn;
  365           //     siteCo de = Stati onBox.Sele ctedValue;
  366           //     Sessio n["SiteCod e"] = site Code;
  367  
  368           //     Attemp tVIALogin( );
  369           // }
  370       }
  371   }