24. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 5/13/2019 2:40:11 PM 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.

24.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\MPDU\Code\BCMA-master-20181214\BCMA-master\BCMApar VHA_Objects.pas Wed Nov 21 17:43:20 2018 UTC
2 C:\AraxisMergeCompare\Pri_re\MPDU\MPDU\Code\BCMA-master-20181214\BCMA-master\BCMApar VHA_Objects.pas Tue May 7 18:04:15 2019 UTC

24.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 6 1856
Changed 5 10
Inserted 0 0
Removed 0 0

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

24.4 Active regular expressions

No regular expressions were active.

24.5 Comparison detail

  1   unit VHA_O bjects;
  2   {
  3   ========== ========== ========== ========== ========== ========== ========== ==========
  4   *       Fi le:  VHA_O bjects.PAS
  5   *
  6   *       Ap plication:   Bar Code  Medicatio n Administ ration
  7   *       Re vision:      $Revisio n: 23 $  $ Modtime: 5 /08/02 3:5 0p $
  8   *
  9   *       De scription:   This is  a unit whi ch contain s VHA Obje cts develo ped for th e
  10   *                BCMA  applicati on.
  11   *
  12   *       No tes:
  13   *
  14   *
  15   ========== ========== ========== ========== ========== ========== ========== ==========
  16   }
  17  
  18   interface
  19  
  20   uses
  21     SysUtils ,
  22     Classes,
  23     Controls ,
  24     Windows,
  25     Forms,
  26     TRPCB,
  27   //  Shared RPCBroker,
  28     ComOBJ;
  29  
  30   const
  31     VersionI nfoKeys: a rray[1..10 ] of strin g = (
  32       'Compa nyName', ' FileDescri ption', 'F ileVersion ', 'Intern alName',
  33       'Legal CopyRight' , 'Origina lFileName' , 'Product Name', 'Pr oductVersi on',
  34       'Comme nts', 'Rel easeDate'
  35       );
  36  
  37     USEnglis h = $04090 4E4;
  38  
  39   type
  40     PTransBu ffer = ^TT ransBuffer ;
  41     TTransBu ffer = arr ay[1..13]  of smallin t;
  42  
  43   const
  44     CInfoStr : array[1. .13] of st ring =
  45     ('FileVe rsion',
  46       'Compa nyName',
  47       'FileD escription ',
  48       'Inter nalName',
  49       'Legal Copyright' ,
  50       'Legal TradeMarks ',
  51       'Origi nalFileNam e',
  52       'Produ ctName',
  53       'Produ ctVersion' ,
  54       'Comme nts',
  55       'Curre ntProgramV ersion',
  56       'Curre ntDatabase Version',
  57       'Versi onDetails' );
  58  
  59   function B rokerError Messages(e rrorCode:  integer; d efString:  string): s tring;
  60   (*
  61     A functi on which t ranslates  numerical  Error Code s into Eng lish.
  62   *)
  63   type
  64     TLogErro rProc = pr ocedure(ms g: string;  ex: excep tion; Msg2 : TStrings  = nil);
  65  
  66     EBrokerC onnectionE rror = cla ss(Excepti on)
  67       (*
  68         A re placement  for EBroke rError whi ch display s English  error mess ages
  69         inst ead of acr onyms.  Wr ites all m essages to  an error  log file,  if one
  70         exis ts.
  71       *)
  72       ErrorC ode: integ er;
  73       Mnemon ic: string ;
  74  
  75       constr uctor Crea te(eCode:  integer; s hortMsg, l ongMsg: st ring;
  76         LogE rrorProc:  TLogErrorP roc);
  77       (*
  78        Alloc ates memor y for the  exception,  uses meth od BrokerE rrorMessag es to
  79        repla ce errorco des with E nglish, wr ites error s to a log  file, if  one is
  80        assig ned, and d isplays th e English  error mess ages.
  81       *)
  82     end;
  83  
  84     TVersion Info = cla ss(TCompon ent)
  85     private
  86       FFileN ame: strin g;
  87       FLangu ageID: DWo rd;
  88       FInfo:  pointer;
  89       FInfoS ize: longi nt;
  90       FCtlCo mpanyName:  TControl;
  91       FCtlFi leDescript ion: TCont rol;
  92       FCtlFi leVersion:  TControl;
  93       FCtlIn ternalName : TControl ;
  94       FCtlLe galCopyRig ht: TContr ol;
  95       FCtlOr iginalFile Name: TCon trol;
  96       FCtlPr oductName:  TControl;
  97       FCtlPr oductVersi on: TContr ol;
  98       FCtlCo mments: TC ontrol;
  99       FCtlRe leaseDate:  TControl;
  100  
  101       proced ure SetFil eName(Valu e: string) ;
  102       proced ure SetVer Prop(index : integer;  value: TC ontrol);
  103       functi on GetVerP rop(index:  integer):  TControl;
  104       functi on GetInde xKey(index : integer) : string;
  105       functi on GetKey( const KNam e: string) : string;
  106       proced ure Refres h;
  107     protecte d
  108       proced ure Notifi cation(ACo mponent: T Component;  Operation : TOperati on);
  109         over ride;
  110     public
  111       proper ty Company Name: stri ng index 1  read GetI ndexKey;
  112       proper ty FileDes cription:  string ind ex 2 read  GetIndexKe y;
  113       proper ty FileVer sion: stri ng index 3  read GetI ndexKey;
  114       proper ty Interna lName: str ing index  4 read Get IndexKey;
  115       proper ty LegalCo pyRight: s tring inde x 5 read G etIndexKey ;
  116       proper ty Origina lFileName:  string in dex 6 read  GetIndexK ey;
  117       proper ty Product Name: stri ng index 7  read GetI ndexKey;
  118       proper ty Product Version: s tring inde x 8 read G etIndexKey ;
  119       proper ty Comment s: string  index 9 re ad GetInde xKey;
  120       proper ty Release Date: stri ng index 1 0 read Get IndexKey;
  121       proper ty FileNam e: string  read FFile Name write  SetFileNa me;
  122       proper ty Languag eID: DWord  read FLan guageID wr ite FLangu ageID;
  123  
  124       constr uctor Crea te(AOwner:  TComponen t); overri de;
  125       (*
  126         Allo cates memo ry and ini tializes v ariables f or the obj ect.
  127       *)
  128  
  129       destru ctor Destr oy; overri de;
  130       (*
  131         Rele ases all m emory allo cated for  the object .
  132       *)
  133  
  134       proced ure OpenFi le(FName:  string);
  135       (*
  136         Uses  method Ge tFileVersi onInfo to  retrieve v ersion inf ormation f or file
  137         FNam e.  If FNa me is blan k, version  informati on is obta ined for t he
  138         curr ent execut able (Appl ication.Ex eName).
  139       *)
  140  
  141       proced ure Close;
  142       (*
  143         Rele ases memor y allocate d and clea rs all sto rage varia bles.
  144       *)
  145  
  146     publishe d
  147       proper ty CtlComp anyName: T Control in dex 1 read  GetVerPro p write Se tVerProp;
  148       proper ty CtlFile Descriptio n: TContro l index 2  read GetVe rProp writ e
  149         SetV erProp;
  150       proper ty CtlFile Version: T Control in dex 3 read  GetVerPro p write Se tVerProp;
  151       proper ty CtlInte rnalName:  TControl i ndex 4 rea d GetVerPr op write S etVerProp;
  152       proper ty CtlLega lCopyRight : TControl  index 5 r ead GetVer Prop write
  153         SetV erProp;
  154       proper ty CtlOrig inalFileNa me: TContr ol index 6  read GetV erProp wri te
  155         SetV erProp;
  156       proper ty CtlProd uctName: T Control in dex 7 read  GetVerPro p write Se tVerProp;
  157       proper ty CtlProd uctVersion : TControl  index 8 r ead GetVer Prop write
  158         SetV erProp;
  159       proper ty CtlComm ents: TCon trol index  9 read Ge tVerProp w rite SetVe rProp;
  160       proper ty CtlRele aseDate: T Control in dex 10 rea d GetVerPr op write S etVerProp;
  161     end;
  162  
  163   { $IFDEF C AS_DDPE_TE ST}
  164     TBCMA_Br oker = cla ss(TRPCBro ker)
  165   { $ELSE}
  166   //  TBCMA_ Broker = c lass(TShar edRPCBroke r)
  167   { $ENDIF}
  168       //     TBCMA_Brok er = class  (tRPCBrok er)
  169           (*
  170              A desendan t of TRPCB roker that  provides  enhanced R PC paramet er handlin g,
  171              debugging  and error  trapping c apabilitie s.
  172           *)
  173     private
  174       {Priva te Stuff}
  175       FLogEr rorProc: T LogErrorPr oc;
  176     public
  177       {Publi c Stuff}
  178       proper ty LogErro rProc: TLo gErrorProc  read FLog ErrorProc  write FLog ErrorProc;
  179       (*
  180        Point er to an o ptional, e xternal pr ocedure wh ich writes  error inf ormation
  181        into  an applica tion error log file.
  182       *)
  183  
  184       functi on CallSer ver(RPC: s tring; cal lingParams : array of  string; M ultList:
  185         TStr ings; True Null: Bool ean = Fals e): boolea n;
  186       (*
  187        Uses:       Tfrm Debug = cl ass(TForm) ;
  188  
  189        This  is a wrapp er around  the inheri ted Call p rocedure.   Enhanceme nts are:
  190         - Th is is a fu nction, ra ther than  a procedur e, which r eturns a T rue value
  191          onl y if there  are no Br oker Error s.
  192         - If  DebugMode  is True,  then Call  input argu ments are  displayed  and
  193          the n the outp ut results  shown.
  194         - Th e Call its elf is in  a try/exce pt block s o that Bro ker Errors  can
  195          be  trapped an d handled  in a user  friendly f orm and de tailed err or
  196          inf o can be e ntered int o an appli cation err or log fil e, if one  has
  197          bee n assigned .
  198       *)
  199     end;
  200  
  201     TBCMA_Us er = class (TObject)
  202       (*
  203         An c lass that  holds User  data and  handles al l User int eraction w ith the
  204         Vist A server.
  205       *)
  206     private
  207       FRPCBr oker: TBCM A_Broker;
  208       FDUZ:  string;
  209       FUserN ame: strin g;
  210       FIsMan ager: Bool ean;
  211       FIsStu dent: Bool ean;
  212       FIsMOB uttonUser:  Boolean;
  213       FIsRea dOnly,
  214         FUna bleToScanK ey: Boolea n;
  215       FOrder Role: Inte ger;
  216  
  217       FDivis ionIEN,
  218       FDivis ionNum, //  rpk 4/14/ 2011
  219   //      FS iteIEN,
  220  
  221   {$IFDEF TE ST_ON}
  222       FStati on,
  223   {$ENDIF}
  224         FDiv isionName,
  225         FIns tructorDUZ : string;
  226       //If t his is a s tudent, th en this co ntains the  DUZ of th e instruct or
  227       FAgenc yCode: str ing; // rp k 8/6/2009
  228  
  229       FESigR equired: b oolean;
  230       FOnLin e: boolean ;
  231       FDTime : string;  //User tim eout inter val in sec onds.
  232  
  233       FChang ed: boolea n;
  234       FProdu ctionAccou nt: Boolea n;
  235  
  236     protecte d
  237       { set  to read on ly!
  238       proced ure setUse rName(newV alue: stri ng);
  239       proced ure setIsM anager(new Value: Boo lean);
  240       proced ure setIsS tudent(new Value: Boo lean);
  241       proced ure setCan OverrideOr der(newVal ue: Boolea n);
  242       }
  243  
  244       functi on getDTim e: integer ;
  245  
  246     public
  247       proper ty DUZ: st ring read  FDUZ;
  248       proper ty UserNam e: string  read FUser Name;
  249       proper ty IsManag er: Boolea n read FIs Manager;
  250       proper ty IsStude nt: Boolea n read FIs Student;
  251       proper ty IsMOBut tonUser: B oolean rea d FIsMOBut tonUser;
  252       proper ty IsReadO nly: Boole an read FI sReadOnly  write FIsR eadOnly;
  253       proper ty UnableT oScanKey:  Boolean re ad FUnable ToScanKey;
  254       proper ty Divisio nIEN: stri ng read FD ivisionIEN ;
  255       proper ty Divisio nNum: stri ng read FD ivisionNum ;  // rpk  4/14/2011
  256       proper ty Product ionAccount : Boolean  read FProd uctionAcco unt;
  257   //    prop erty SiteI EN: string  read FSit eIEN;
  258   {$IFDEF TE ST_ON}
  259       proper ty Station : string r ead FStati on;  // rp k 8/6/2010 ; future e nhancement
  260   {$ENDIF}
  261       proper ty Divisio nName: str ing read F DivisionNa me;
  262       proper ty Instruc torDUZ: st ring read  FInstructo rDUZ write  FInstruct orDUZ;
  263       proper ty AgencyC ode: strin g read FAg encyCode w rite FAgen cyCode; //  rpk 8/6/2 009
  264       proper ty ESigReq uired: boo lean read  FESigRequi red;
  265       proper ty OnLine:  boolean r ead FOnLin e;
  266       proper ty DTime:  integer re ad getDTim e; //User  Timeout in terval
  267       proper ty OrderRo le: intege r read FOr derRole;
  268  
  269       proper ty Changed : boolean  read FChan ged;
  270  
  271       constr uctor Crea te(RPCBrok er: TBCMA_ Broker); v irtual;
  272       (*
  273         Allo cates memo ry, initia lizes stor age variab les and sa ves a poin ter
  274         to a  global co py of the  TBCMA_Brok er object
  275       *)
  276  
  277       destru ctor Destr oy; overri de;
  278       (*
  279         Deal locates me mory and s ets FRPCBr oker := ni l;
  280       *)
  281  
  282       proced ure Clear;
  283       (*
  284         Inti talizes in ternal sto rage varia bles.
  285       *)
  286  
  287       functi on LoadDat a: boolean ;
  288       (*
  289         Crea tes user c ontext 'PS B GUI CONT EXT - USER ' then use s RPC
  290         'PSB  USERLOAD'  to retrie ve user da ta fron th e server,
  291       *)
  292  
  293       proced ure SaveDa ta;
  294       (*
  295         If a ny of the  User prope rties have  changed,  the change s will be  saved
  296         to t he server.
  297       *)
  298  
  299       functi on isValid ESig(ESig:  string):  boolean;
  300       (*
  301         Uses  RPC 'PSB  VALIDATE E SIG' to va lidate an  Electronic  Signature ,
  302         ESig .  If vali d, the ret urn value  is True.
  303       *)
  304  
  305     end;
  306  
  307   implementa tion
  308  
  309   uses
  310     Dialogs,  TypInfo,  Debug,
  311   //  MFunSt r,
  312     BCMA_Sta rtup, {2FA :Hash} XWB Hash, BCMA _Util
  313   {$IFDEF CA S_DDPE_TES T}
  314       , uZZ_RPCE vent, fZZ_ EventLog     //  DNS     andria 201 5-01-29 == ========== ========
  315   {$ENDIF}
  316     ;
  317  
  318   function B rokerError Messages(e rrorCode:  integer; d efString:  string): s tring;
  319   begin
  320     case Err orCode of
  321       10013:  result :=  'Winsock  Error!' +  #13 + 'Per mission de nied.';
  322       10048:  result :=  'Winsock  Error!' +  #13 + 'Add ress alrea dy in use. ';
  323       10049:  result :=  'Winsock  Error!' +  #13 +
  324         'Can not assign  requested  address.' ;
  325       10047:  result :=  'Winsock  Error!' +  #13 +
  326         'Add ress famil y not supp orted by p rotocol fa mily.';
  327       10037:  result :=  'Winsock  Error!' +  #13 + 'Ope ration alr eady in pr ogress.';
  328       10053:  result :=  'Winsock  Error!' +  #13 + 'Con nection ab orted by h ost.';
  329       10061:  result :=  'Winsock  Error!' +  #13 + 'Con nection re fused by h ost.';
  330       10054:  result :=  'Winsock  Error!' +  #13 + 'Con nection re set by hos t.';
  331       10039:  result :=  'Winsock  Error!' +  #13 + 'Des tination a ddress req uired.';
  332       10014:  result :=  'Winsock  Error!' +  #13 + 'Bad  address.' ;
  333       10064:  result :=  'Winsock  Error!' +  #13 + 'Hos t is down. ';
  334       10065:  result :=  'Winsock  Error!' +  #13 + 'No  route to h ost.';
  335       10036:  result :=  'Winsock  Error!' +  #13 + 'Ope ration now  in progre ss.';
  336       10004:  result :=  'Winsock  Error!' +  #13 + 'Int errupted f unction ca ll.';
  337       10022:  result :=  'Winsock  Error!' +  #13 + 'Inv alid argum ent.';
  338       10056:  result :=  'Winsock  Error!' +  #13 + 'Soc ket alread y connecte d.';
  339       10024:  result :=  'Winsock  Error!' +  #13 + 'Too  many open  files.';
  340       10040:  result :=  'Winsock  Error!' +  #13 + 'Mes sage too l ong.';
  341       10050:  result :=  'Winsock  Error!' +  #13 + 'Net work is do wn.';
  342       10052:  result :=  'Winsock  Error!' +  #13 +
  343         'Net work dropp ed connect ion on res et.';
  344       10051:  result :=  'Winsock  Error!' +  #13 + 'Net work is un reachable. ';
  345       10055:  result :=  'Winsock  Error!' +  #13 + 'No  buffer spa ce availab le.';
  346       10042:  result :=  'Winsock  Error!' +  #13 + 'Bad  protocol  option.';
  347       10057:  result :=  'Winsock  Error!' +  #13 + 'Soc ket is not  connected .';
  348       10038:  result :=  'Winsock  Error!' +  #13 + 'Soc ket operat ion on non -socket.';
  349       10045:  result :=  'Winsock  Error!' +  #13 + 'Ope ration not  supported .';
  350       10046:  result :=  'Winsock  Error!' +  #13 + 'Pro tocol fami ly not sup ported.';
  351       10067:  result :=  'Winsock  Error!' +  #13 + 'Too  many proc esses.';
  352       10043:  result :=  'Winsock  Error!' +  #13 + 'Pro tocol not  supported. ';
  353       10041:  result :=  'Winsock  Error!' +  #13 + 'Pro tocol wron g type for  socket.';
  354       10058:  result :=  'Winsock  Error!' +  #13 +
  355         'Can not send a fter socke t shutdown .';
  356       10044:  result :=  'Winsock  Error!' +  #13 + 'Soc ket type n ot support ed.';
  357       10060:  result :=  'Winsock  Error!' +  #13 + 'Con nection ti med out.';
  358       10035:  result :=  'Winsock  Error!' +  #13 +
  359         'Res ource temp orarily un available. ';
  360       11001:  result :=  'Winsock  Error!' +  #13 + 'Hos t not foun d.';
  361       10093:  result :=  'Winsock  Error!' +  #13 +
  362         'Suc cessful WS AStartup()  not yet p erformed.' ;
  363       11004:  result :=  'Winsock  Error!' +  #13 +
  364         'Val id name, n o data rec ord of req uested typ e.';
  365       11003:  result :=  'Winsock  Error!' +  #13 +
  366         'Thi s is a non -recoverab le error.' ;
  367       10091:  result :=  'Winsock  Error!' +  #13 +
  368         'Net work subsy stem is un available. ';
  369       11002:  result :=  'Winsock  Error!' +  #13 +
  370         'Non -authorita tive host  not found. ';
  371       10092:  result :=  'Winsock  Error!' +  #13 +
  372         'WIN SOCK.DLL v ersion out  of range. ';
  373       10094:  result :=  'Winsock  Error!' +  #13 + 'Gra ceful shut down in pr ogress.';
  374     else
  375       result  := defStr ing;
  376     end;
  377   end;
  378  
  379   //////////  EBrokerCo nnectionEr ror Mthods  ///////// ////////// /////////
  380  
  381   constructo r EBrokerC onnectionE rror.Creat e(eCode: i nteger; sh ortMsg, lo ngMsg:
  382     string;
  383     LogError Proc: TLog ErrorProc) ;
  384   begin
  385     ErrorCod e := eCode ;
  386     Message  := longMsg ;
  387  
  388     Mnemonic  := Broker ErrorMessa ges(ErrorC ode, short Msg);
  389     if Mnemo nic = '' t hen
  390       Mnemon ic := 'Bro ker Connec tion Error ';
  391     if Messa ge = '' th en
  392       Messag e := Mnemo nic;
  393  
  394     case Err orCode of
  395       10013,
  396         1004 8,
  397         1004 9,
  398         1004 7,
  399         1003 7,
  400         1005 3,
  401         1006 1,
  402         1005 4,
  403         1003 9,
  404         1001 4,
  405         1006 4,
  406         1006 5,
  407         1003 6,
  408         1000 4,
  409         1002 2,
  410         1005 6,
  411         1002 4,
  412         1004 0,
  413         1005 0,
  414         1005 2,
  415         1005 1,
  416         1005 5,
  417         1004 2,
  418         1005 7,
  419         1003 8,
  420         1004 5,
  421         1004 6,
  422         1006 7,
  423         1004 3,
  424         1004 1,
  425         1005 8,
  426         1004 4,
  427         1006 0,
  428         1003 5,
  429         1100 1,
  430         1009 3,
  431         1100 4,
  432         1100 3,
  433         1009 1,
  434         1100 2,
  435         1009 2,
  436         1009 4:
  437         Mess age := Mne monic + #1 3 + Messag e;
  438     else
  439     end;
  440  
  441     if assig ned(LogErr orProc) th en
  442     begin
  443       LogErr orProc('Co nnection t o server n ot establi shed!', se lf);
  444       DefMes sageDlg(Mn emonic, mt Error, [mb OK], 0);
  445     end;
  446   end;
  447  
  448   ///// TVer sionInfo M ethods /// ////////// ////////// ////////// /////////
  449  
  450   constructo r TVersion Info.Creat e(AOwner:  TComponent );
  451   begin
  452     inherite d Create(A Owner);
  453     FLanguag eID := USE nglish;
  454     SetFileN ame(EmptyS tr);
  455   end;
  456  
  457   destructor  TVersionI nfo.Destro y;
  458   begin
  459     if FInfo Size > 0 t hen
  460       FreeMe m(FInfo, F InfoSize);
  461     inherite d Destroy;
  462   end;
  463  
  464   procedure  TVersionIn fo.SetFile Name(Value : string);
  465   begin
  466     FFileNam e := Value ;
  467     if Value  = EmptySt r then //  default to  self
  468       FFileN ame := Ext ractFileNa me(Applica tion.ExeNa me);
  469     //             FFil eName := E xtractFile Path(Appli cation.Exe Name);
  470     if csDes igning in  ComponentS tate then
  471     begin
  472       Refres h
  473     end
  474     else
  475       OpenFi le(Value);
  476   end;
  477  
  478   procedure  TVersionIn fo.OpenFil e(FName: s tring);
  479   var
  480     vlen: DW ord;
  481   begin
  482     if FInfo Size > 0 t hen
  483       FreeMe m(FInfo, F InfoSize);
  484     if Lengt h(FName) < = 0 then
  485       FName  := Applica tion.ExeNa me;
  486     FInfoSiz e := GetFi leVersionI nfoSize(pc har(fname) , vlen);
  487     if FInfo Size > 0 t hen
  488     begin
  489       GetMem (FInfo, FI nfoSize);
  490       if not  GetFileVe rsionInfo( pchar(fnam e), vlen,  FInfoSize,  FInfo) th en
  491         rais e Exceptio n.Create(' Cannot ret rieve Vers ion Inform ation for  ' +
  492           fn ame);
  493       Refres h;
  494     end;
  495   end;
  496  
  497   procedure  TVersionIn fo.Close;
  498   begin
  499     if FInfo Size > 0 t hen
  500       FreeMe m(FInfo, F InfoSize);
  501     FInfoSiz e := 0;
  502     FFileNam e := Empty Str;
  503   end;
  504  
  505   const
  506     vqvFmt =  '\StringF ileInfo\%8 .8x\%s';
  507  
  508   function T VersionInf o.GetKey(c onst KName : string):  string;
  509   var
  510     //vptr:  pchar;
  511     vlen: DW ord;
  512     //Added  the follow ing
  513     transStr : string;
  514     vptr: PT ransBuffer ;
  515     value: P Char;
  516  
  517   begin
  518     Result : = EmptyStr ;
  519     if FInfo Size <= 0  then
  520       exit;
  521  
  522     //  If V erQueryVal ue(FInfo,  pchar(Form at(vqvFmt,  [FLanguag eID, KName ])), point er(vptr),  vlen) Then
  523     if VerQu eryValue(F Info, PCha r('\VarFil eInfo\Tran slation'),  Pointer(v ptr), vlen )
  524       then
  525     begin
  526       //Adde d the foll owing two  lines:
  527       transS tr := IntT oHex(vptr^ [1], 4) +  IntToHex(v ptr^[2], 4 );
  528       if Ver QueryValue (FInfo, pc har('Strin gFileInfo\ ' + transS tr + '\' +  KName),
  529         poin ter(value) , vlen) th en
  530         //Re sult := vp tr;
  531         Resu lt := Valu e;
  532     end;
  533   end;
  534  
  535   function T VersionInf o.GetIndex Key(index:  integer):  string;
  536   begin
  537     Result : = GetKey(V ersionInfo Keys[index ]);
  538   end;
  539  
  540   function T VersionInf o.GetVerPr op(index:  integer):  TControl;
  541   begin
  542     case ind ex of
  543       1: Res ult := FCt lCompanyNa me;
  544       2: Res ult := FCt lFileDescr iption;
  545       3: Res ult := FCt lFileVersi on;
  546       4: Res ult := FCt lInternalN ame;
  547       5: Res ult := FCt lLegalCopy Right;
  548       6: Res ult := FCt lOriginalF ileName;
  549       7: Res ult := FCt lProductNa me;
  550       8: Res ult := FCt lProductVe rsion;
  551       9: Res ult := FCt lComments;
  552       10: Re sult := FC tlReleaseD ate;
  553     else
  554       Result  := nil;
  555     end;
  556   end;
  557  
  558   procedure  TVersionIn fo.SetVerP rop(index:  integer;  value: TCo ntrol);
  559   begin
  560     case ind ex of
  561       1: FCt lCompanyNa me := Valu e;
  562       2: FCt lFileDescr iption :=  Value;
  563       3: FCt lFileVersi on := Valu e;
  564       4: FCt lInternalN ame := Val ue;
  565       5: FCt lLegalCopy Right := V alue;
  566       6: FCt lOriginalF ileName :=  Value;
  567       7: FCt lProductNa me := Valu e;
  568       8: FCt lProductVe rsion := V alue;
  569       9: FCt lComments  := Value;
  570       10: FC tlReleaseD ate := Val ue;
  571     end;
  572     Refresh;
  573   end;
  574  
  575   procedure  TVersionIn fo.Notific ation(ACom ponent: TC omponent;  Operation:
  576     TOperati on);
  577   begin
  578     if Opera tion = opR emove then
  579     begin
  580       if ACo mponent =  FCtlCompan yName then
  581         FCtl CompanyNam e := nil
  582       else i f ACompone nt = FCtlF ileDescrip tion then
  583         FCtl FileDescri ption := n il
  584       else i f ACompone nt = FCtlF ileVersion  then
  585         FCtl FileVersio n := nil
  586       else i f ACompone nt = FCtlI nternalNam e then
  587         FCtl InternalNa me := nil
  588       else i f ACompone nt = FCtlL egalCopyRi ght then
  589         FCtl LegalCopyR ight := ni l
  590       else i f ACompone nt = FCtlO riginalFil eName then
  591         FCtl OriginalFi leName :=  nil
  592       else i f ACompone nt = FCtlP roductName  then
  593         FCtl ProductNam e := nil
  594       else i f ACompone nt = FCtlP roductVers ion then
  595         FCtl ProductVer sion := ni l
  596       else i f ACompone nt = FCtlC omments th en
  597         FCtl Comments : = nil
  598       else i f ACompone nt = FCtlR eleaseDate  then
  599         FCtl ReleaseDat e := nil;
  600     end;
  601   end;
  602  
  603   procedure  TVersionIn fo.Refresh ;
  604   var
  605     PropInfo : PPropInf o;
  606  
  607     procedur e AssignTe xt(Actl: T Component;  txt: stri ng);
  608     begin
  609       if Ass igned(ACtl ) then
  610       begin
  611         Prop Info := Ge tPropInfo( ACtl.Class Info, 'Cap tion');
  612         if P ropInfo <>  nil then
  613           Se tStrProp(A Ctl, PropI nfo, txt)
  614         else
  615         begi n
  616           Pr opInfo :=  GetPropInf o(ACtl.Cla ssInfo, 'T ext');
  617           if  PropInfo  <> nil the n
  618              SetStrProp (ACtl, Pro pInfo, txt )
  619         end;
  620       end;
  621     end;
  622  
  623   begin
  624     if csDes igning in  ComponentS tate then
  625     begin
  626       Assign Text(FCtlC ompanyName , VersionI nfoKeys[1] );
  627       Assign Text(FCtlF ileDescrip tion, Vers ionInfoKey s[2]);
  628       Assign Text(FCtlF ileVersion , VersionI nfoKeys[3] );
  629       Assign Text(FCtlI nternalNam e, Version InfoKeys[4 ]);
  630       Assign Text(FCtlL egalCopyRi ght, Versi onInfoKeys [5]);
  631       Assign Text(FCtlO riginalFil eName, Ver sionInfoKe ys[6]);
  632       Assign Text(FCtlP roductName , VersionI nfoKeys[7] );
  633       Assign Text(FCtlP roductVers ion, Versi onInfoKeys [8]);
  634       Assign Text(FCtlC omments, V ersionInfo Keys[9]);
  635       Assign Text(FCtlR eleaseDate , VersionI nfoKeys[10 ]);
  636     end
  637     else
  638     begin
  639       Assign Text(FCtlC ompanyName , CompanyN ame);
  640       Assign Text(FCtlF ileDescrip tion, File Descriptio n);
  641       Assign Text(FCtlF ileVersion , FileVers ion);
  642       Assign Text(FCtlI nternalNam e, Interna lName);
  643       Assign Text(FCtlL egalCopyRi ght, Legal CopyRight) ;
  644       Assign Text(FCtlO riginalFil eName, Ori ginalFileN ame);
  645       Assign Text(FCtlP roductName , ProductN ame);
  646       Assign Text(FCtlP roductVers ion, Produ ctVersion) ;
  647       Assign Text(FCtlC omments, C omments);
  648       Assign Text(FCtlR eleaseDate , ReleaseD ate);
  649     end;
  650   end;
  651  
  652   ////////// ////////// /////////  TBCMA_Brok er
  653  
  654   function T BCMA_Broke r.CallServ er(RPC: st ring; call ingParams:  array of  string;
  655     MultList : TStrings ; TrueNull : Boolean  = False):  boolean;
  656   const
  657     ParamTyp eStrings:  array[TPar amType] of  string =
  658     ('Litera l', 'Refer ence', 'Li st', 'Glob al', 'Empt y', 'Strea m', 'Undef ined');
  659  
  660   var
  661   //  DNS     andria 201 5-01-29 == ========== ========== ========== ========== ========== =
  662   {$IFDEF CA S_DDPE_TES T}
  663     aStart,a Stop: TDat eTime;
  664     anEvent:  TRPCEvent Item;
  665   {$ENDIF}
  666   //  DNS     andria 201 5-01-29 == ========== ========== ========== ========== ========== =
  667     i, j: in teger;
  668     emsg: st ring;
  669   begin
  670     result : = False;
  671     if socke t = -1 the n
  672       DefMes sageDlg('N o VistA se rver conne ction!', m tWarning,  [mbOK], 0)
  673     else if  connected  = False th en
  674       exit
  675     else
  676     begin
  677       Screen .Cursor :=  crHourgla ss;
  678       Remote Procedure  := RPC;
  679       if Tru eNull = fa lse then
  680       begin
  681  
  682         //an  empty arr ay can't b e passed,  if we reci eve #127#1 27#, don't  create an y literals
  683         if c allingPara ms[0] <> ' ~!#null#~! ' then
  684           fo r i := 0 t o High(cal lingParams ) do
  685           be gin
  686              Param[i].V alue := ca llingParam s[i];
  687              Param[i].P Type := Li teral;
  688           en d;
  689  
  690         eMsg  := 'RPC:  ' + RPC;
  691         for  i := 0 to  Param.coun t - 1 do
  692           eM sg := eMsg  + #13#10  + 'Param['  + intToSt r(i) + ']= ' +
  693              ParamTypeS trings[Par am[i].ptyp e] + #9 +  Param[i].v alue;
  694  
  695         i :=  Param.Cou nt; // In  case we ha ve to add  a list to  the end... .
  696  
  697         if M ultList <>  nil then
  698         begi n
  699           fo r j := 0 t o MultList .Count - 1  do
  700           be gin
  701              Param[i].M ult[IntToS tr(j)] :=  MultList[j ];
  702              eMsg := eM sg + #13#1 0 + 'List[ ' + intToS tr(j) + '] =' + #9 +
  703                MultList [j];
  704           en d;
  705           Pa ram[i].PTy pe := List ;
  706         end;
  707       end;
  708       if Deb ugMode the n
  709         frmD ebug.Execu te('Callin g RPC Brok er', eMsg,  nil);
  710  
  711       if use DebugLog t hen
  712       begin
  713         writ eLogMessag eProc('',  nil);
  714         writ eLogMessag eProc(eMsg , nil);
  715       end;
  716   {$IFDEF CA S_DDPE_TES T}        //  DNS     andria 201 5-01-29 == ========== ========== =========
  717         anEv ent := nil ;
  718         try
  719           aS tart := No w;
  720           an Event := g etTRPCBEve ntItem(Sel f);
  721           Ca ll;
  722           aS top := Now ;
  723           an Event.Appe ndResults( Self.Resul ts,aStart, aStop);
  724           ad dRPCEvent( anEvent);
  725   {$ELSE}
  726       try
  727         call ;
  728   {$ENDIF}                 //  DNS     andria 201 5-01-29 == ========== ========== =========
  729         if D ebugMode t hen
  730           fr mDebug.Exe cute('RPC  Broker Ret urn Values ', 'RPC Ca ll: ' + RP C,
  731              Results);
  732  
  733         if u seDebugLog  then
  734         begi n
  735           wr iteLogMess ageProc('' , nil);
  736           wr iteLogMess ageProc(RP C + ', RPC  Return Va lues:', ni l, Results );
  737         end;
  738  
  739         resu lt := True ;
  740       except
  741         on E : EBrokerE rror do
  742         begi n
  743           re sult := Fa lse;
  744           eM sg := eMsg  + #13#10  + BrokerEr rorMessage s(E.Code,  E.Mnemonic ) +
  745              #13 + E.Me ssage +
  746              #13#13 + ' BCMA faile d to commu nicate wit h VistA an d is unabl e' +
  747              #13#10 + ' to continu e.  BCMA w ill now te rminate.';
  748           De fMessageDl g('Broker  RPC Error: ' + #13 +  eMsg, mtEr ror, [mbOK ], 0);
  749           E. message :=  eMsg + #1 3#10 + E.m essage;
  750   {$IFDEF CA S_DDPE_TES T}
  751           if  Assigned( anEvent) t hen
  752            a nEvent.App endError(E .Message);
  753           ad dRPCEvent( anEvent);
  754   {$ELSE}
  755           if  assigned( FLogErrorP roc) then
  756              FLogErrorP roc('Broke r RPC Erro r:', E);
  757           Co nnected :=  False;
  758           Sh utDown :=  True;
  759           ap plication. terminate;
  760           ab ort; // co pied from  BCMA GUI
  761   {$ENDIF}
  762         end;
  763       end;
  764       Screen .Cursor :=  crDefault ;
  765     end;
  766   end;
  767  
  768   ////////// ////////// /////////  TBCMA_User
  769  
  770   constructo r TBCMA_Us er.Create( RPCBroker:  TBCMA_Bro ker);
  771   begin
  772     inherite d Create;
  773  
  774     if RPCBr oker <> ni l then
  775       FRPCBr oker := RP CBroker;
  776  
  777     Clear;
  778   end;
  779  
  780   destructor  TBCMA_Use r.Destroy;
  781   begin
  782     (*
  783      if FCha nged then
  784       if Def MessageDlg ('The Curr ent User d ata has be en changed !'+#13#13+ 'Do you wi sh save yo ur changes ?',
  785               mtConfirm ation, [mb Yes, mbNo] , 0) = idY es then
  786        SaveD ata;
  787     *)
  788     inherite d Destroy;
  789   end;
  790  
  791   procedure  TBCMA_User .Clear;
  792   begin
  793     FDUZ :=  '';
  794     FUserNam e := '';
  795     FIsManag er := Fals e;
  796     FIsStude nt := Fals e;
  797     FIsMOBut tonUser :=  False;
  798     FIsReadO nly := Fal se;
  799     FUnableT oScanKey : = False;
  800     FDivisio nIEN := '' ;
  801   //  FSiteI EN := '';
  802     FDivisio nName := ' ';
  803     FAgencyC ode := '';  // rpk 8/ 6/2009
  804     FESigReq uired := F alse;
  805     FOnLine  := False;
  806     FDTime : = '';
  807     FOrderRo le := -1;
  808  
  809     FChanged  := False;
  810     FProduct ionAccount  := False;
  811   end;
  812  
  813   function T BCMA_User. LoadData:  boolean;
  814   begin
  815     result : = False;
  816     try
  817       if FRP CBroker <>  nil then
  818         with  FRPCBroke r do
  819         begi n
  820           if  FChanged  then
  821              if DefMess ageDlg('Th e Current  User data  has been c hanged!' +  #13#13 +
  822                'Do you  wish to sa ve your ch anges?',
  823                mtConfir mation, [m bYes, mbNo ], 0) = mr Yes then
  824                SaveData ;
  825  
  826           Cl ear;
  827  
  828           if  CreateCon text('PSB  GUI CONTEX T - USER')  then // t his is a u ser
  829           be gin
  830              if CheckVe rsion then
  831                exit;
  832              if CallSer ver('PSB U SERLOAD',  [''], nil)  then
  833              begin
  834                if piece (FRPCBroke r.Results[ 0], '^', 1 ) = '-1' t hen
  835                begin
  836                  DefMes sageDlg('C annot load  user para meters', m tError, [m bOK], 0);
  837                  Exit;
  838                end;
  839                FDUZ :=  Results[0] ;
  840                FUserNam e := Resul ts[1];
  841                FIsMOBut tonUser :=  (StrToInt Def(Result s[4], 0) =  1);
  842                FIsReadO nly := (St rToIntDef( Results[18 ], 0) = 1) ;
  843                FIsStude nt := (Str ToIntDef(R esults[2],  0) = 1);
  844                FUnableT oScanKey : = (StrToIn tDef(Resul ts[24], 0)  = 1);
  845                if FIsSt udent then
  846                begin
  847                  // Loa d as a stu dent
  848                  FIsMan ager := Fa lse;
  849                  FIsMOB uttonUser  := False;
  850                  FUnabl eToScanKey  := False;
  851                end
  852                else
  853                begin
  854                  // Man ager?
  855                  FIsMan ager := (S trToIntDef (Results[3 ], 0) = 1) ;
  856                end;
  857  
  858                FDivisio nIEN := pi ece(Result s[7], '^',  1);
  859   //             FSiteI EN := piec e(Results[ 7], '^', 2 );
  860   //             FDivis ionNum :=  piece(Resu lts[7], '^ ', 3);
  861                // corre cted to ma tch PSB US ERLOAD; rp k 5/2/2011
  862                FDivisio nNum := pi ece(Result s[7], '^',  2);
  863   {$IFDEF TE ST_ON}
  864                FStation  := piece( Results[7] , '^', 4);  // rpk 8/ 6/2010; fu ture enhan cement
  865   {$ENDIF}
  866                FProduct ionAccount  := (StrTo IntDef(pie ce(Results [7], '^',  3), 0) =
  867                  1);
  868                FDivisio nName := R esults[8];
  869                FESigReq uired := ( Results[9]  = '1');
  870                FOnLine  := (Result s[10] = '1 ');
  871                FDTime : = Results[ 11];
  872                FAgencyC ode := Res ults[27];  // rpk 6/2 4/2010
  873                ///
  874                /// FAge ncyCode :=  'I';  /// // DEBUG O NLY
  875                ///
  876                Result : = True; //  User is c onsidered  loaded
  877  
  878                FChanged  := False;
  879                if CallS erver('ORW UBCMA USER INFO', ['' ], nil, Tr ue) then
  880                  FOrder Role := St rToIntDef( Piece(Resu lts[0], '^ ', 6), 0);
  881  
  882              end
  883           en d
  884           el se
  885           be gin  // no t CreateCo ntext('PSB  GUI CONTE XT - USER' ) then //  this is a  user
  886              if assigne d(FLogErro rProc) the n
  887                FLogErro rProc('Use r Does Not  Have Acce ss To BCMA !', nil);
  888              DefMessage Dlg('User  Does Not H ave Access  To BCMA!' , mtError,  [mbok],
  889                0);
  890           en d;
  891         end;
  892     except
  893       on e:  EOleExcept ion do
  894       begin
  895         DefM essageDlg( e.message,  mtError,  [mbok], 0) ;
  896         if a ssigned(FR PCBroker.F LogErrorPr oc) then
  897           FR PCBroker.F LogErrorPr oc(e.messa ge, nil);
  898         Resu lt := Fals e;
  899       end;
  900     end;
  901   end;
  902  
  903   procedure  TBCMA_User .SaveData;
  904   begin
  905     if FRPCB roker <> n il then
  906       if FCh anged then
  907       begin
  908         (*
  909            N eed an RPC  to save V istA data  for curren t user.
  910         *)
  911         FCha nged := Fa lse;
  912       end;
  913   end;
  914  
  915   function T BCMA_User. isValidESi g(ESig: st ring): boo lean;
  916   begin
  917     result : = False;
  918     if FRPCB roker <> n il then
  919       with F RPCBroker  do
  920         if C allServer( 'PSB VALID ATE ESIG',  ['^' + en crypt(ESig )], nil) t hen
  921           //       If C allServer( 'PSB VALID ATE ESIG',  [ESig], N il) Then
  922           re sult := (p iece(Resul ts[0], '^' , 1) = '1' );
  923   end;
  924  
  925   function T BCMA_User. getDTime:  integer;
  926   begin
  927     result : = 0;
  928     if FDTim e <> '' th en
  929       result  := strToI ntDef(FDTi me, 0);
  930   end;
  931  
  932   end.
  933