8. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 11/2/2017 7:18:07 AM Central Daylight 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.

8.1 Files compared

# Location File Last Modified
1 CAPRI_CIF.zip\CAPRI_CIF\Source formtest.pas Wed Nov 1 18:09:36 2017 UTC
2 CAPRI_CIF.zip\CAPRI_CIF\Source formtest.pas Wed Nov 1 19:10:30 2017 UTC

8.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 694
Changed 1 2
Inserted 0 0
Removed 0 0

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

8.4 Active regular expressions

No regular expressions were active.

8.5 Comparison detail

  1   {
  2   VocRehabRe RouteReque st
  3  
  4   Added Patc h 197 JRL  2/1/17
  5  
  6   This unit  is called  when a Voc  Rehab 886 1 Medical  Request is  re-routed .
  7  
  8   RPCs calle d:
  9     DVBA CAP RI REROUTE  VAMC
  10     DVBA VR  REROUTEREA SONS
  11     DVBA VR  SEND REROU TE
  12     
  13   }
  14   unit formt est;
  15  
  16   interface
  17  
  18   uses
  19     Windows,  Messages,  SysUtils,  Variants,  Classes,  Graphics,  Controls,  Forms
  20     ,Dialogs
  21     ,StdCtrl s
  22     ,Trpcb
  23     ,VA508Ac cessibilit yManager
  24     ,CAPRISu pport
  25     ,dialogs CAPRI
  26     ;
  27  
  28   type
  29     TfrmTest  = class(T Form)
  30       lblReR outeReason : TLabel;
  31       cbReRo uteReason:  TComboBox ;
  32       labelV AMC: TLabe l;
  33       cbVAMC : TComboBo x;
  34       lblSor tByState:  TLabel;
  35       cbxSor tByState:  TCheckBox;
  36       lblDes cription:  TLabel;
  37       memoRe RouteDescr iption: TM emo;
  38       btnRer outeReques t: TButton ;
  39       btnCan celReRoute : TButton;
  40       VA508A ccessibili tyManager1 : TVA508Ac cessibilit yManager;
  41       proced ure FormCr eate(Sende r: TObject );
  42       proced ure FormCl ose(Sender : TObject;  var Actio n: TCloseA ction);
  43       proced ure cbxSor tByStateCl ick(Sender : TObject) ;
  44       proced ure btnCan celReRoute Click(Send er: TObjec t);
  45       proced ure btnRer outeReques tClick(Sen der: TObje ct);
  46     private
  47       { Priv ate declar ations }
  48       VAMC_I EN : Strin g;
  49       VAMC_I EN_List :  TStringLis t;
  50       VAMC_S tation_Lis t : TStrin gList;
  51       VAMC_N ame_List :  TStringLi st;
  52       VAMC_S tate_List  : TStringL ist;
  53       ReRout eReasonIEN List : TSt ringList;
  54       Select edStation  : String;
  55       SaveSt ationNumbe r : String ;
  56       proced ure GetVAM CLocations ;
  57       proced ure GetRer outeReason s;
  58       functi on  CheckU serInputVa lues: Bool ean;
  59       functi on  Create ReRouteReq uest : Boo lean;
  60     public
  61       { Publ ic declara tions }
  62     end;
  63  
  64   var
  65     frmTest:  TfrmTest;
  66  
  67   implementa tion
  68  
  69   uses VocRe habMedical Request, m ain;
  70  
  71   const
  72     CLOSE_FO RM = '1';       // Pa tch 197 JR L 12/21/16
  73     DONT_CLO SE_FORM =  '2'; // Pa tch 197 JR L 12/21/16
  74  
  75   {$R *.dfm}
  76  
  77  
  78   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  79   // Form Cr eate
  80   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  81   procedure  TfrmTest.F ormCreate( Sender: TO bject);
  82   begin
  83     // Creat e string l ists
  84     VAMC_IEN _List := T StringList .Create;
  85     VAMC_Sta tion_List  := TString List.Creat e;
  86     VAMC_Nam e_List :=  TStringLis t.Create;
  87     VAMC_Sta te_List :=  TStringLi st.Create;
  88     ReRouteR easonIENLi st := TStr ingList.Cr eate;
  89     // Popul ate initia l fields
  90     GetReRou teReasons;  // Popula te Re-Rout ing Reason s dropdown
  91     GetVAMCL ocations;   // Popula te VAMC Lo cations dr opdown
  92     SaveStat ionNumber  := '';
  93   end;
  94  
  95  
  96   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  97   // Form Cl ose
  98   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  99   procedure  TfrmTest.F ormClose(S ender: TOb ject; var  Action: TC loseAction );
  100   begin
  101     // Destr oy string  lists
  102     FreeAndN il(VAMC_IE N_List);
  103     FreeAndN il(VAMC_St ation_List );
  104     FreeAndN il(VAMC_Na me_List);
  105     FreeAndN il(VAMC_St ate_List);
  106     FreeAndN il(ReRoute ReasonIENL ist);
  107   end;
  108  
  109  
  110   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  111   // Cancel  Re-Route b utton Clic ked
  112   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  113   procedure  TfrmTest.b tnRerouteR equestClic k(Sender:  TObject);
  114   var
  115     request_ rerouted :  Boolean;
  116     CloseFor m : Boolea n;
  117   begin
  118     if Check UserInputV alues then  // if all  inputs ar e satisfie d, allow r e-routing
  119     begin
  120        reque st_reroute d := Creat eReRouteRe quest;      // send t he re-rout ed request
  121        if re quest_rero uted = TRU E then //  re-route w as success ful
  122           fr mVRMedical Request.Re turnValue  := CLOSE_F ORM
  123        else
  124           fr mVRMedical Request.Re turnValue  := DONT_CL OSE_FORM;
  125        Close ;
  126     end;  //  CheckUser InputValue s
  127   end;
  128  
  129  
  130  
  131   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  132   // Cancel  Re-Route b utton Clic ked
  133   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  134   procedure  TfrmTest.b tnCancelRe RouteClick (Sender: T Object);
  135   begin
  136     // No ac tion neede d except t o close th e form
  137     Close;
  138   end;
  139  
  140  
  141   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  142   // Sort By  State che ckbox clic ked
  143   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  144   procedure  TfrmTest.c bxSortBySt ateClick(S ender: TOb ject);
  145   begin
  146     GetVAMCL ocations;
  147   end;
  148  
  149  
  150   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  151   // Create  Re-Route R equest
  152   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  153   // RPC Inp ut:    
  154   //   Reque st IEN
  155   //   Patie nt IEN
  156   //   VAMC  IEN (Stati on Number)
  157   //   Routi ng Locatio n IEN
  158   //   Re-Ro ute Reason  IEN
  159   //   Re-Ro ute Descri ption
  160   //
  161   // RPC Out put:  
  162   //     1^Transmit ted as mes sage # 909 761 from t his site t o DEVVCC.
D NS        URL         
  163   //   0^Mes sage trans mission er ror! Reque st WILL NO T be rerou ted
  164   // ------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  165   // FROM TH E AMIE TRA NSFER DOCU MENTATION:
  166   //   If th e mail mes sage is se nt out suc cessfully,  the user  will see:
  167   //   "Tran smitted as  message #  {number}  from this  site to {s ite name}. VA.GOV."
  168   // 
  169   //   If th e message  fails (and  therefore  the trans fer fails)  the user  will be so  informed:
  170   //   "Mess age transm ission err or!   Requ est WILL N OT be sent  !"
  171   // ------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  172   function T frmTest.Cr eateReRout eRequest :  Boolean;
  173   CONST
  174     RPCNAME  = 'DVBA VR  SEND RERO UTE';
  175   var
  176     MailmanR PCStatus :  Integer;
  177     MailmanM essage : S tring;
  178     buffer :  string;
  179   begin
  180     Result : = FALSE; / / default  to re-rout e failed
  181     try
  182       Screen .Cursor :=  crHourGla ss;
  183       // Set up RPC
  184       frmMai n.RPCBroke r1.Results .Clear;
  185       frmMai n.RPCBroke r1.RemoteP rocedure : = RPCNAME;
  186       frmMai n.RPCBroke r1.Param[0 ].Value :=  frmVRMedi calRequest .SelectedM edicalRequ estIEN;  / / Request  IEN
  187       frmMai n.RPCBroke r1.Param[0 ].PType :=  literal;
  188       frmMai n.RPCBroke r1.Param[1 ].Value :=  PatientIE N;                                 // Patie nt IEN
  189       frmMai n.RPCBroke r1.Param[1 ].PType :=  literal;
  190       frmMai n.RPCBroke r1.Param[2 ].Value :=  VAMC_IEN;
  191       frmMai n.RPCBroke r1.Param[2 ].PType :=  literal;
  192       frmMai n.RPCBroke r1.Param[3 ].Value :=  ReRouteRe asonIENLis t[cbReRout eReason.It emIndex];
  193       frmMai n.RPCBroke r1.Param[3 ].PType :=  literal;
  194       frmMai n.RPCBroke r1.Param[4 ].Value :=  memoReRou teDescript ion.Text;
  195       frmMai n.RPCBroke r1.Param[4 ].Ptype :=  literal;
  196       
  197       frmMai n.RPCBroke rCall;
  198       Try
  199         frmM ain.RPCBro ker1.Call;
  200       Except
  201         On e : EBrokerE rror Do
  202         begi n
  203           bu ffer := RP CNAME + '  could not  be accesse d!  '+#10# 13 + E.Mes sage + '.' ;
  204           Sh owMessageC APRI(buffe r);
  205         end;
  206       End;
  207     finally
  208       Screen .Cursor :=  crDefault ;
  209     end;
  210  
  211     // Check  RPC resul ts  
  212     If frmMa in.RPCBrok er1.Result s.Count >  0 Then
  213     begin
  214       Mailma nRPCStatus  := StrToI ntDef(Piec e(frmMain. RPCBroker1 .Results[0 ], '^', 1) ,0);
  215       Mailma nMessage : = Piece(fr mMain.RPCB roker1.Res ults[0], ' ^', 2);
  216     
  217       if Mai lmanRPCSta tus > 0 th en // Succ ess, reque st was re- routed
  218       begin
  219         // F YI: An ema il is sent  to the or iginal req uester upo n successf ul re-rout ing (all M  code)
  220         Show MessageCAP RI(Mailman Message);   
  221         Resu lt := TRUE ;
  222         Clos e;
  223       end
  224     end;
  225     // if Re -Route mes sage faile d
  226     if not R esult then
  227       ShowMe ssageCAPRI (RPCNAME +  ' returne d a failur e.'+#10#13 +MailmanMe ssage);
  228   end;
  229  
  230  
  231   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  232   // Get VAM C Location s
  233   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  234   procedure  TfrmTest.G etVAMCLoca tions;
  235   var
  236     i : Inte ger;
  237   CONST
  238     RPCNAME  = 'DVBA CA PRI REROUT E VAMC';
  239     STRINGFO RMAT = '%- 28s%-15s%- 6s';
  240   begin
  241     // setup  and call  RPC
  242     frmMain. RPCBroker1 .Results.C lear;
  243     frmMain. RPCBroker1 .RemotePro cedure :=  RPCNAME;
  244     if cbxSo rtByState. Checked th en
  245        frmMa in.RPCBrok er1.Param[ 0].Value : = 'STATE'
  246     else
  247        frmMa in.RPCBrok er1.Param[ 0].Value : = 'NAME';
  248     frmMain. RPCBroker1 .Param[0]. PType := l iteral;
  249     frmMain. RPCBrokerC all;
  250     Try
  251       frmMai n.RPCBroke r1.Call;
  252     Except
  253       On E:  EBrokerErr or Do
  254         Show MessageCAP RI(RPCNAME  + ' could  not be ac cessed!'+# 13#10+E.Me ssage);
  255     End;
  256     // clear  all lists
  257     cbVAMC.I tems.Clear ;
  258     VAMC_Nam e_List.Cle ar;
  259     VAMC_Sta te_List.Cl ear;
  260     VAMC_IEN _List.Clea r;
  261     VAMC_Sta tion_List. Clear;
  262     // popul ate all li sts
  263     If frmMa in.RPCBrok er1.Result s.Count >  0 Then
  264     begin
  265       For i  := 0 To fr mMain.RPCB roker1.Res ults.Count  - 1 Do
  266       begin
  267         VAMC _Name_List .Add(Piece (frmMain.R PCBroker1. Results[i] , '^', 2)) ;
  268         VAMC _State_Lis t.Add(Piec e(frmMain. RPCBroker1 .Results[i ], '^', 1) );
  269         VAMC _IEN_List. Add(Piece( frmMain.RP CBroker1.R esults[i],  '^', 3));
  270         VAMC _Station_L ist.Add(Pi ece(frmMai n.RPCBroke r1.Results [i], '^',  4));
  271       end;
  272     end;
  273     // Add d ata to lis tbox and f ormat it i nto column s
  274     for i :=  0 to VAMC _Name_List .Count - 1  do
  275       cbVAMC .Items.Add (Format(ST RINGFORMAT ,[VAMC_Nam e_List[i], VAMC_State _List[i],V AMC_Statio n_List[i]] ));
  276  
  277   end;
  278  
  279  
  280   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  281   // Get Re- Route Reas ons
  282   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  283   // RPC:  D VBA CAPRI  REROUTEREA SONS
  284   //   Input :   None
  285   //   Outpu t:  Re-Rou te Code^IE N
  286   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  287   procedure  TfrmTest.G etReRouteR easons;
  288   const
  289     RPCNAME  = 'DVBA VR  REROUTERE ASONS';
  290   var
  291     i : Inte ger;
  292   begin
  293     frmMain. RPCBroker1 .Results.C lear;                                             
  294     frmMain. RPCBroker1 .RemotePro cedure :=  RPCNAME;           
  295     frmMain. RPCBrokerC all;                                                         
  296     try                                                                              
  297       frmMai n.RPCBroke r1.Call;                                                     
  298     except                                                                           
  299       On EBr okerError  Do                                                           
  300          Sho wMessageCA PRI('RPC:  '+RPCNAME  + ' could  not be acc essed!'); 
  301     end;                                                                             
  302     cbReRout eReason.It ems.Clear;                                         
  303     ReRouteR easonIENLi st := TStr ingList.Cr eate;                             
  304     if frmMa in.RPCBrok er1.Result s.Count >  0 then                                 
  305     begin                                                                            
  306       for i  := 0 To fr mMain.RPCB roker1.Res ults.Count  - 1 do                     
  307       begin                                                                          
  308         cbRe RouteReaso n.Items.Ad d(Piece(fr mMain.RPCB roker1.Res ults[i], ' ^', 2));
  309         ReRo uteReasonI ENList.Add (Piece(frm Main.RPCBr oker1.Resu lts[i], '^ ', 1));
  310       end;                                                                          
  311     end;
  312   end;
  313    
  314   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  315   // Check U ser Input  Values
  316   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  317   // Check a ll user in put values .  If valu es are inp ut correct ly, return  TRUE.
  318   // If valu es are mis sing, rout ine short  circuits b ack to inp ut form.
  319   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
  320   function T frmTest.Ch eckUserInp utValues:  Boolean;
  321   begin
  322     if cbReR outeReason .Text = ''  then
  323     begin
  324        ShowM essageCAPR I('Please  enter a Re -Routing R eason.');
  325        Resul t := FALSE ;
  326        exit;   // make  user compl ete form b efore send ing
  327     end;
  328     if cbReR outeReason .Text = 'O THER' then
  329     begin
  330       if Len gth(memoRe RouteDescr iption.Lin es.Text) =  0 then
  331       begin
  332          Sho wMessageCA PRI('Pleas e enter a  Re-Routing  Descripti on.');
  333          Res ult := FAL SE;
  334          exi t;  // mak e user com plete form  before se nding
  335       end;
  336     end;
  337     if cbVAM C.ItemInde x = -1 the n
  338     begin
  339       ShowMe ssageCAPRI ('Please e nter a VAM C.');
  340       Result  := FALSE;
  341       exit;   // make u ser comple te form be fore sendi ng
  342     end;
  343     Result : = TRUE;
  344   end;
  345    
  346  
  347  
  348   end.