Index: cprs/branches/GUI-config/AboutU.dfm
===================================================================
--- cprs/branches/GUI-config/AboutU.dfm	(revision 541)
+++ cprs/branches/GUI-config/AboutU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object AboutForm: TAboutForm
-  Left = 297
-  Top = 73
+  Left = 302
+  Top = 173
   AlphaBlend = True
   AlphaBlendValue = 50
@@ -1147,6 +1147,6 @@
     Font.Style = []
     Lines.Strings = (
-      'WorldVistA Configuration Utility, v1.0'
-      '(c) 2008; Released under LGPL'
+      'WorldVistA Configuration Utility, v1.10'
+      '(c) 12/2008; Released under LGPL'
       'Programmed by:  Kevin Toppenberg & Eddie Hagood')
     ParentFont = False
Index: cprs/branches/GUI-config/BatchAddU.dfm
===================================================================
--- cprs/branches/GUI-config/BatchAddU.dfm	(revision 541)
+++ cprs/branches/GUI-config/BatchAddU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object BatchAddForm: TBatchAddForm
-  Left = 242
-  Top = 151
+  Left = 73
+  Top = 196
   Width = 721
   Height = 480
@@ -29,8 +29,16 @@
       713
       41)
+    object EstTimeLabel: TLabel
+      Left = 656
+      Top = 16
+      Width = 48
+      Height = 13
+      Anchors = [akTop, akRight]
+      Caption = '1d:23h:15'
+    end
     object ProgressBar: TProgressBar
       Left = 16
       Top = 8
-      Width = 681
+      Width = 625
       Height = 25
       Anchors = [akLeft, akRight]
Index: cprs/branches/GUI-config/BatchAddU.pas
===================================================================
--- cprs/branches/GUI-config/BatchAddU.pas	(revision 541)
+++ cprs/branches/GUI-config/BatchAddU.pas	(revision 542)
@@ -29,5 +29,5 @@
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, Buttons, Grids, ExtCtrls, ComCtrls;
+  Dialogs, StdCtrls, Buttons, Grids, ExtCtrls, ComCtrls, DateUtils;
 
 type
@@ -46,4 +46,5 @@
     btnAbortRegistration: TBitBtn;
     SaveDialog: TSaveDialog;
+    EstTimeLabel: TLabel;
     procedure btnCreateTemplateClick(Sender: TObject);
     procedure btnClearGridClick(Sender: TObject);
@@ -66,9 +67,11 @@
     procedure ClearGrid;
     procedure LoadData(fileName : string);
-    procedure AddHeaderCol(oneEntry : string);  
+    procedure AddHeaderCol(oneEntry : string);
     procedure GetColFieldNums(List : TStringList);
     function GetOneRow(row : integer; ColFields : TStringList) : string;
+    function RowToStr(row : integer) : string;
+    procedure AddRowFromStr(Str : string);
     function RegisterOne(oneRow : string; Log : TStringList) : string;
-    procedure DelGridRow(BatchGrid : TStringGrid; row : integer);
+    //procedure DelGridRow(BatchGrid : TStringGrid; row : integer);
   public
     { Public declarations }
@@ -80,5 +83,7 @@
 implementation
 
-uses CreateTemplateU, StrUtils, ORNet, ORFn, Trpcb, FMErrorU;
+uses CreateTemplateU, StrUtils, ORNet, ORFn,
+     Trpcb,  //needed for .ptype types
+     FMErrorU;
 
 const NOT_ADDED='(Not Added)';
@@ -260,12 +265,40 @@
   end;
 
-  
+
   procedure TBatchAddForm.btnDoRegistrationClick(Sender: TObject);
-  var row : integer;
+  var i,row : integer;
+      FailedPatients : TStringList;
       ColFields : TStringList;
       onePostEntry : string;
-      newIEN : string;
+      RPCResult : string;
       Log : TStringList;
-      Success,Failure,PreExisting : integer;
+      Success,Failure,PreExisting,Errors : integer;
+      StartTime : TDateTime;
+
+      procedure ShowEstTime(Pct : single);
+      var  Delta : single;
+           EstTotalMin : Integer;
+           s : string;
+      begin
+        Delta := MinuteSpan(Now,StartTime);
+        if Pct=0 then begin
+          EstTimeLabel.caption := '';
+          exit;
+        end;
+        EstTotalMin := Round(Delta / Pct);
+        s := '';
+        if EstTotalMin > 1440 then begin  //extract number of days
+          s := s + IntToStr(EstTotalMin div 1440) + 'd:';
+          EstTotalMIn := EstTotalMin mod 1440;
+        end;
+        if EstTotalMin > 60 then begin  //extract number of hours
+          if s <> '' then s := s + IntToStr(EstTotalMin div 60) + 'h:'
+          else s := IntToStr(EstTotalMin div 60) + ':';
+          EstTotalMIn := EstTotalMin mod 60;
+        end;
+        s := s + IntToStr(EstTotalMin) + ':';
+        EstTimeLabel.Caption := s;
+      end;
+
   begin
     btnOpenDataFile.Enabled := false;
@@ -274,42 +307,75 @@
     btnClearGrid.Enabled := False;
     btnSaveGrid.Enabled := False;
-    
+
     Log := TStringList.Create;
     Success := 0;
     Failure := 0;
     PreExisting := 0;
+    Errors := 0;
     FMErrorForm.Memo.Lines.clear;
     ColFields := TStringList.Create;
+    FailedPatients := TStringList.Create;
     GetColFieldNums(ColFields);
     ProgressBar.Max := BatchGrid.RowCount-1;
     FAbortRegistration := false;  //abort button can change this.
+    StartTime := Now;
+    EstTimeLabel.Caption := '';
     for row := 2 to BatchGrid.RowCount-1 do begin
       if FAbortRegistration = true then break;
       ProgressBar.Position := row;
+      if (row mod 100) = 0 then ShowEstTime(row/(BatchGrid.RowCount-1));
       onePostEntry := GetOneRow(row,ColFields);
-      newIEN := RegisterOne(onePostEntry,Log);
-      BatchGrid.Cells[0,row] := newIEN;
-      if newIEN = NOT_ADDED then inc(Failure) 
-      else if newIEN = ALREADY_ADDED then inc(PreExisting) 
-      else inc(Success);     
+      RPCResult := RegisterOne(onePostEntry,Log);  //Returns: NewIEN^PrevReg^Reg'dNow^ErrorOccured
+      BatchGrid.Cells[0,row] := Piece(RPCResult,'^',1);
+      if Piece(RPCResult,'^',1)=NOT_ADDED then inc(Failure);
+      if Piece(RPCResult,'^',2)='1' then inc(PreExisting);
+      if Piece(RPCResult,'^',3)='1' then inc(Success);
+      if Piece(RPCResult,'^',4)='1' then inc(Errors);
       Application.ProcessMessages;
     end;
     ProgressBar.Position := 0;
     ColFields.free;
-    MessageDlg(IntToStr(Success)+' successful registrations,  '+#10+#13+
-               IntToStr(PreExisting)+' Patients were already registered,'+#10+#13+
-               IntToStr(Failure)+' failures.',
+    MessageDlg(IntToStr(Success)+' successful registrations or data refresh,  '+#10+#13+
+               IntToStr(PreExisting)+' patients were already registered,'+#10+#13+
+               IntToStr(Errors)+' filing errors encountered (including minor errors),'+#10+#13+
+               IntToStr(Failure)+' patients NOT registered.',
                mtInformation,[mbOK],0);
+    EstTimeLabel.Caption := '';
+    StartTime := Now;
+    if BatchGrid.RowCount > 1000 then ShowMessage('Will now clear out patients that have been registered.');
+    for row := 2 to BatchGrid.RowCount-1 do begin
+      if (BatchGrid.Cells[0,row] = NOT_ADDED) or (BatchGrid.Cells[0,row] = ADD_ROW) then begin
+        FailedPatients.Add(RowToStr(row));
+      end;
+      ProgressBar.Position := row;
+      if (row mod 100) = 0 then ShowEstTime(row/(BatchGrid.RowCount-1));
+      Application.ProcessMessages;
+    end;
+    BatchGrid.RowCount := 2;
+    ProgressBar.Max := FailedPatients.Count;
+    StartTime := Now;
+    for i := 0 to FailedPatients.Count-1 do begin
+      AddRowFromStr(FailedPatients.Strings[i]);
+      ProgressBar.Position := i;
+      if (i mod 100) = 0 then ShowEstTime(i/(FailedPatients.Count-1));
+      Application.ProcessMessages;
+    end;
+    {
     for row := BatchGrid.RowCount-1 downto 2 do begin
       if (BatchGrid.Cells[0,row] <> NOT_ADDED)
       and (BatchGrid.Cells[0,row] <> ADD_ROW) then begin
-        DelGridRow(BatchGrid,row);
-      end;
-    end;                        
+        DelGridRow(BatchGrid,row);  // <------- this is VERY SLOW!!@#@!
+      end;
+      ProgressBar.Position := row;
+      if (row mod 100) = 0 then ShowEstTime((BatchGrid.RowCount-1-row)/(BatchGrid.RowCount-1));
+      Application.ProcessMessages;
+    end;
+    }
+    EstTimeLabel.Caption := '';
     if Log.Count>0 then begin
       FMErrorForm.Memo.Lines.Assign(Log);
       FMErrorForm.PrepMessage;
       FMErrorForm.ShowModal;
-    end;  
+    end;
     Log.Free;
     if (BatchGrid.RowCount=3)and(BatchGrid.Cells[0,2]='') then begin
@@ -322,11 +388,19 @@
     end else begin
       btnClearGrid.Enabled := true;
-      btnSaveGrid.Enabled := true; 
+      btnSaveGrid.Enabled := true;
       btnAbortRegistration.Enabled := false;
     end;
+    FailedPatients.Free;
+
   end;
 
   function TBatchAddForm.RegisterOne(oneRow : string; Log : TStringList) : string;
-  var RPCResult : string;
+  //Returns: NewIEN^Bool1^Bool2^Bool3
+    //    NewIEN can be a #, or NOT_ADDED
+    //    For each Bool, 0=false, 1=true
+    //    Bool1 : Patient previously registered
+    //    Bool2 : Patient registered this time (using identifier fields)
+    //    Bool3 : Some Problem occurred during filing
+  var tempResult,RPCResult : string;
       Msg : string;
       i : integer;
@@ -336,13 +410,35 @@
     RPCBrokerV.Param[0].Mult['"REQUEST"'] := 'REGISTER PATIENT^'+oneRow;
     RPCBrokerV.Call;
-    RPCResult := RPCBrokerV.Results[0];    //returns:  error: -1;  success=1
-    Msg := piece(RPCResult,'^',2);
-    result := piece(RPCResult,'^',3);
-    if result = '' then result := NOT_ADDED;
-    if piece(RPCResult,'^',1)='-1' then begin
-      if Msg='Patient already registered' then begin
-        result := ALREADY_ADDED; 
-        exit;
-      end;  
+    RPCResult := RPCBrokerV.Results[0];
+    //returns:  error: -1^Message;  success=1^Success^IEN; or Equivical=0^Message^IEN
+    //If 0 then Message is in this format
+    //    [Bool1;Bool2;Bool3;Bool4;Bool5*MessageText]
+    //    For each Bool, 0=false, 1=true
+    //    Bool1 : Patient previously registered
+    //    Bool2 : Patient registered this time (using identifier fields)
+    //    Bool3 : Problem filing non-identifier fields
+    //    Bool4 : Problem filing data info sub-file fields
+    //    Bool5 : Problem filing HRN
+    tempResult := piece(RPCResult,'^',1);
+    if tempResult='1' then begin  //1=Success
+      result := piece(RPCResult,'^',3)+'^0^1^0';
+    end else if tempResult='0' then begin  //0=Mixed results
+      Msg := piece(RPCResult,'^',2);
+      result := piece(RPCResult,'^',3);
+      if result = '' then result := NOT_ADDED;
+      result := result + '^' + Piece(Msg,';',1) + '^' + Piece(Msg,';',2);
+      if Pos('1',Pieces(Msg,';',3,5))>0 then begin
+        result := result + '^1';
+        if RPCBrokerV.Results.Count > 1 then begin
+          Log.Add('-----------------------------------------------');
+          Log.Add('There was a problem with registering a patient.');
+          for i := 1 to RPCBrokerV.Results.Count-1 do begin
+            Log.Add(RPCBrokerV.Results.Strings[i]);
+          end;
+        end;
+      end else begin
+        result := result + '^0';
+      end;
+    end else begin  //should be tempResult='-1'   //-1=Error
       FMErrorForm.Memo.Lines.Assign(RPCBrokerV.Results);
       FMErrorForm.PrepMessage;  //Does some clean up of the message format
@@ -350,16 +446,14 @@
       Log.Add('-----------------------------------------------');
       Log.Add('There was a problem with registering a patient.');
-      //Log.Add('This was the data sent to the server: ');
-      //Log.Add('    '+oneRow);
       for i:= 0 to FMErrorForm.Memo.Lines.Count-1 do begin
         Log.Add(FMErrorForm.Memo.Lines.Strings[i]);
-      end;    
-      Log.Add(' ');      
-      FMErrorForm.Memo.Lines.Clear;      
-      if Msg='Success (but see message)' then exit;
-      result := NOT_ADDED;
-    end;     
-  end;
-
+      end;
+      Log.Add(' ');
+      FMErrorForm.Memo.Lines.Clear;
+      result := NOT_ADDED+'^0^0^1';  //Not-prev-reg^Not-reg-this-time^Problem-occured
+    end;
+  end;
+
+  {
   procedure TBatchAddForm.DelGridRow(BatchGrid : TStringGrid; row : integer);
   var col : integer;
@@ -374,5 +468,5 @@
         end else begin
           BatchGrid.RowCount := BatchGrid.RowCount-1;
-        end;  
+        end;
         exit;
       end;
@@ -381,6 +475,7 @@
       end;
       inc(row);
-    until (1=0);      
-  end;  
+    until (1=0);
+  end;
+  }
   
   procedure TBatchAddForm.FormDestroy(Sender: TObject);
@@ -395,5 +490,5 @@
     List.Add(''); //fill 0'th column will null
     for i := 1 to BatchGrid.ColCount-1 do begin
-      List.Add(BatchGrid.Cells[i,1]);      
+      List.Add(BatchGrid.Cells[i,1]);
     end;
   end;
@@ -402,6 +497,5 @@
   //Output format: FldNum1^Value1^fldNum2^Value2^FldNum3^Value3...
   var i : integer;
-      oneValue : string;
-  begin    
+  begin
     result := '';
     if row >= BatchGrid.RowCount then exit;
@@ -410,4 +504,27 @@
     end;
   end;
+
+  function TBatchAddForm.RowToStr(row : integer) : string;
+  //Output format: Cell0^Cell1^Cell2^Cell3^Cell4....
+  var i : integer;
+  begin
+    result := '';
+    if row >= BatchGrid.RowCount then exit;
+    for i := 0 to BatchGrid.ColCount-1 do begin
+      result := result + BatchGrid.Cells[i,row]+'^';
+    end;
+  end;
+
+  procedure TBatchAddForm.AddRowFromStr(Str : string);
+  var   row : integer;
+        i : integer;
+  begin
+    BatchGrid.RowCount := BatchGrid.RowCount + 1;
+    row := BatchGrid.RowCount-1;
+    for i := 0 to BatchGrid.ColCount-1 do begin
+      BatchGrid.Cells[i,row] := Piece(Str,'^',i+1);
+    end;
+  end;
+
 
   procedure TBatchAddForm.btnAbortRegistrationClick(Sender: TObject);
Index: cprs/branches/GUI-config/DebugU.dfm
===================================================================
--- cprs/branches/GUI-config/DebugU.dfm	(revision 541)
+++ cprs/branches/GUI-config/DebugU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object DebugForm: TDebugForm
-  Left = 6
-  Top = 2
+  Left = 324
+  Top = 204
   Width = 518
   Height = 488
Index: cprs/branches/GUI-config/EditTextU.dfm
===================================================================
--- cprs/branches/GUI-config/EditTextU.dfm	(revision 541)
+++ cprs/branches/GUI-config/EditTextU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object EditTextForm: TEditTextForm
-  Left = 160
-  Top = 115
+  Left = 281
+  Top = 207
   Width = 675
   Height = 480
Index: cprs/branches/GUI-config/EditTextU.pas
===================================================================
--- cprs/branches/GUI-config/EditTextU.pas	(revision 541)
+++ cprs/branches/GUI-config/EditTextU.pas	(revision 542)
@@ -62,5 +62,6 @@
 implementation
 
-uses FMErrorU, ORNet, ORFn, Trpcb;
+uses FMErrorU, ORNet, ORFn,
+     Trpcb ;  //needed for .ptype types
 
 {$R *.dfm}
Index: cprs/branches/GUI-config/FMErrorU.dfm
===================================================================
--- cprs/branches/GUI-config/FMErrorU.dfm	(revision 541)
+++ cprs/branches/GUI-config/FMErrorU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object FMErrorForm: TFMErrorForm
-  Left = 261
-  Top = 167
+  Left = 1217
+  Top = 320
   Width = 482
   Height = 417
Index: cprs/branches/GUI-config/GUI_Config.cfg
===================================================================
--- cprs/branches/GUI-config/GUI_Config.cfg	(revision 541)
+++ cprs/branches/GUI-config/GUI_Config.cfg	(revision 542)
@@ -34,8 +34,8 @@
 -LE"c:\program files\borland\delphi7\Projects\Bpl"
 -LN"c:\program files\borland\delphi7\Projects\Bpl"
--U"P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source"
--O"P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source"
--I"P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source"
--R"P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source"
+-U"P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source"
+-O"P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source"
+-I"P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source"
+-R"P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source"
 -DUSE_SKINS
 -w-UNSAFE_TYPE
Index: cprs/branches/GUI-config/GUI_Config.dof
===================================================================
--- cprs/branches/GUI-config/GUI_Config.dof	(revision 541)
+++ cprs/branches/GUI-config/GUI_Config.dof	(revision 542)
@@ -95,5 +95,5 @@
 PackageDLLOutputDir=
 PackageDCPOutputDir=
-SearchPath=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source
+SearchPath=P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source
 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclaxserver;TntUnicodeVcl_R70;dcldklang7;dklang7;PNGpackage
 Conditionals=USE_SKINS
@@ -101,5 +101,5 @@
 UsePackages=0
 [Parameters]
-RunParams=s=192.168.3.111 p=9230 debug=enable
+RunParams=
 HostApplication=
 Launcher=
@@ -111,8 +111,8 @@
 RootDir=C:\Program Files\Borland\Delphi7\Bin\
 [Version Info]
-IncludeVerInfo=0
+IncludeVerInfo=1
 AutoIncBuild=0
 MajorVer=1
-MinorVer=0
+MinorVer=1
 Release=0
 Build=0
@@ -127,5 +127,5 @@
 CompanyName=
 FileDescription=
-FileVersion=1.0.0.0
+FileVersion=1.1.0.0
 InternalName=
 LegalCopyright=
@@ -142,16 +142,18 @@
 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
 [HistoryLists\hlSearchPath]
-Count=11
-Item0=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source
-Item1=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff
-Item2=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu
-Item3=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;P:\Vista\GUI-config\SkinStuff
-Item4=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics;P:\Vista\GUI-config\SkinStuff
-Item5=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics
-Item6=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu
-Item7=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib
-Item8=..\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker\Source;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker\D6
-Item9=..\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics
-Item10=..\CPRS-Lib
+Count=13
+Item0=P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\GUI-config\BDK32;P:\vista\GUI-config\BDK32\Source
+Item1=P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source
+Item2=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;P:\vista\tmg-cprs\BDK32;P:\vista\tmg-cprs\BDK32\Source
+Item3=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff
+Item4=P:\Vista\GUI-config\CPRS-Lib;P:\Vista\GUI-config\CPRS-Lib\DCU;P:\Vista\GUI-config\SkinStuff;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu
+Item5=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;P:\Vista\GUI-config\SkinStuff
+Item6=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics;P:\Vista\GUI-config\SkinStuff
+Item7=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics
+Item8=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib\dcu
+Item9=C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-Lib
+Item10=..\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker\Source;C:\Program Files\Borland\Delphi7\Projects\Vista\CPRS-1.0.23.15\Broker\D6
+Item11=..\CPRS-Lib;C:\Program Files\Borland\Delphi7\Projects\TPNGGraphics
+Item12=..\CPRS-Lib
 [HistoryLists\hlUnitOutputDirectory]
 Count=1
Index: cprs/branches/GUI-config/GUI_Config.dpr
===================================================================
--- cprs/branches/GUI-config/GUI_Config.dpr	(revision 541)
+++ cprs/branches/GUI-config/GUI_Config.dpr	(revision 542)
@@ -1,13 +1,13 @@
 program GUI_Config;
-   (* 
+   (*
    WorldVistA Configuration Utility
    (c) 8/2008 Kevin Toppenberg
-   Programmed by Kevin Toppenberg, Eddie Hagood  
-   
+   Programmed by Kevin Toppenberg, Eddie Hagood
+
    Family Physicians of Greeneville, PC
    1410 Tusculum Blvd, Suite 2600
    Greeneville, TN 37745
    kdtop@yahoo.com
-                                                 
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -23,10 +23,9 @@
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-  *)   
+  *)
 
 uses
   Forms,
   MainU in 'MainU.pas' {MainForm},
-  ORFn in '..\CPRS-Lib\ORFn.pas',
   frmSplash in 'frmSplash.pas' {SplashForm},
   LookupU in 'LookupU.pas' {FieldLookupForm},
Index: cprs/branches/GUI-config/GUI_Config.dsk
===================================================================
--- cprs/branches/GUI-config/GUI_Config.dsk	(revision 541)
+++ cprs/branches/GUI-config/GUI_Config.dsk	(revision 542)
@@ -1,98 +1,54 @@
 [Closed Files]
-File_0=SourceModule,'P:\vista\tmg-cprs\BDK32\Source\wsockc.pas',0,1,1464,17,1475,0,0
-File_1=SourceModule,'P:\Vista\GUI-config\MainU.dfm',0,1,1,1,1,0,0
-File_2=SourceModule,'P:\vista\GUI-config\SkinFormU.pas',0,1,1,1,1,1,1
-File_3=SourceModule,'P:\Vista\GUI-config\LookupU.dfm',0,1,1,1,1,0,0
-File_4=SourceModule,'P:\vista\tmg-cprs\BDK32\Source\VERGENCECONTEXTORLib_TLB.pas',0,1,124,29,11,0,0
-File_5=SourceModule,'C:\Program Files\VISTA\BDK32_is_this_old\Source\Trpcb.pas',0,1,43,1,53,0,0
-File_6=SourceModule,'P:\vista\GUI-config\CPRS-Lib\ORNet.pas',0,1,188,21,195,0,0
-File_7=SourceModule,'C:\PROGRA~1\VISTA\BDK32\Source\VERGENCECONTEXTORLib_TLB.pas',0,1,1109,31,1120,0,0
-File_8=SourceModule,'c:\program files\borland\delphi7\source\vcl\OleCtrls.pas',0,1,86,12,92,0,0
-File_9=SourceModule,'c:\program files\borland\delphi7\source\rtl\Win\ShellAPI.pas',0,1,1,1,1,0,0
+File_0=SourceModule,'P:\vista\GUI-config\BDK32\Source\TRPCB.pas',0,1,1045,1,1059,0,0
+File_1=SourceModule,'P:\vista\GUI-config\CreateTemplateU.pas',0,1,140,11,145,0,0
+File_2=SourceModule,'P:\vista\GUI-config\SetSelU.pas',0,1,1,1,1,1,0
+File_3=SourceModule,'P:\vista\GUI-config\SubfilesU.pas',0,1,102,14,113,0,0
+File_4=SourceModule,'P:\vista\GUI-config\FMErrorU.pas',0,1,1,71,43,1,0
+File_5=SourceModule,'P:\vista\GUI-config\LookupU.pas',0,1,1,21,3,1,1
+File_6=SourceModule,'P:\vista\GUI-config\PostU.pas',0,1,70,1,1,1,0
+File_7=SourceModule,'P:\vista\GUI-config\BatchAddU.pas',0,1,459,3,480,0,0
 
 [Modules]
-Module0=P:\vista\GUI-config\GUI_Config.dpr
-Module1=P:\Vista\GUI-config\MainU.pas
-Module2=P:\vista\GUI-config\DebugU.pas
-Module3=P:\Vista\GUI-config\CPRS-Lib\ORCtrls.pas
-Module4=P:\Vista\GUI-config\SubfilesU.pas
-Module5=P:\Vista\GUI-config\CPRS-Lib\ORFn.pas
-Module6=P:\Vista\GUI-config\BatchAddU.pas
-Module7=P:\Vista\GUI-config\frmSplash.pas
-Module8=P:\vista\GUI-config\SkinFormU.dfm
-Module9=P:\vista\GUI-config\CreateTemplateU.pas
-Module10=P:\vista\GUI-config\EditTextU.pas
-Module11=P:\vista\GUI-config\PostU.pas
-Module12=P:\vista\GUI-config\SetSelU.pas
-Module13=P:\Vista\GUI-config\LookupU.pas
-Count=14
+Module0=P:\vista\GUI-config\MainU.pas
+Module1=P:\vista\GUI-config\frmSplash.pas
+Module2=P:\vista\GUI-config\AboutU.pas
+Module3=P:\Vista\GUI-config\CPRS-Lib\ORNet.pas
+Module4=P:\vista\GUI-config\SkinFormU.pas
+Module5=P:\vista\GUI-config\BDK32\Source\wsockc.pas
+Module6=P:\vista\GUI-config\GUI_Config.dpr
+Count=7
 EditWindowCount=1
 
+[P:\vista\GUI-config\MainU.pas]
+ModuleType=SourceModule
+FormState=1
+FormOnTop=0
+
+[P:\vista\GUI-config\frmSplash.pas]
+ModuleType=SourceModule
+FormState=1
+FormOnTop=1
+
+[P:\vista\GUI-config\AboutU.pas]
+ModuleType=SourceModule
+FormState=1
+FormOnTop=0
+
+[P:\Vista\GUI-config\CPRS-Lib\ORNet.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[P:\vista\GUI-config\SkinFormU.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[P:\vista\GUI-config\BDK32\Source\wsockc.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
 [P:\vista\GUI-config\GUI_Config.dpr]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\Vista\GUI-config\MainU.pas]
-ModuleType=SourceModule
-FormState=1
-FormOnTop=0
-
-[P:\vista\GUI-config\DebugU.pas]
-ModuleType=SourceModule
-FormState=1
-FormOnTop=0
-
-[P:\Vista\GUI-config\CPRS-Lib\ORCtrls.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\Vista\GUI-config\SubfilesU.pas]
-ModuleType=SourceModule
-FormState=1
-FormOnTop=0
-
-[P:\Vista\GUI-config\CPRS-Lib\ORFn.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\Vista\GUI-config\BatchAddU.pas]
-ModuleType=SourceModule
-FormState=1
-FormOnTop=0
-
-[P:\Vista\GUI-config\frmSplash.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\vista\GUI-config\SkinFormU.dfm]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\vista\GUI-config\CreateTemplateU.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\vista\GUI-config\EditTextU.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\vista\GUI-config\PostU.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\vista\GUI-config\SetSelU.pas]
-ModuleType=SourceModule
-FormState=0
-FormOnTop=0
-
-[P:\Vista\GUI-config\LookupU.pas]
 ModuleType=SourceModule
 FormState=0
@@ -104,6 +60,6 @@
 
 [EditWindow0]
-ViewCount=14
-CurrentView=11
+ViewCount=7
+CurrentView=3
 View0=0
 View1=1
@@ -113,11 +69,4 @@
 View5=5
 View6=6
-View7=7
-View8=8
-View9=9
-View10=10
-View11=11
-View12=12
-View13=13
 CodeExplorer=CodeExplorer@EditWindow0
 MessageView=MessageView@EditWindow0
@@ -125,43 +74,29 @@
 Visible=1
 State=0
-Left=240
-Top=118
-Width=776
-Height=614
+Left=22
+Top=121
+Width=927
+Height=648
 MaxLeft=-4
-MaxTop=109
-ClientWidth=768
-ClientHeight=580
-LeftPanelSize=0
+MaxTop=104
+ClientWidth=919
+ClientHeight=614
+LeftPanelSize=140
 LeftPanelClients=CodeExplorer@EditWindow0
-LeftPanelData=00000400010000000C000000436F64654578706C6F726572C600000000000000027F01000000000000010000000000000000000000000100000000C600000000000000FFFFFFFF
+LeftPanelData=000004000000000000000000000000000000000000000000000100000000000000000C000000436F64654578706C6F726572FFFFFFFF
 RightPanelSize=0
-BottomPanelSize=0
-BottomPanelClients=WatchWindow,MessageView@EditWindow0
-BottomPanelData=00000400020000000B000000576174636857696E646F770B0000004D65737361676556696577000300000000000002CD0000000000000001000000008B010000000000000100000001580300000000000002000000006C000000000000000200000002BE0000000000000003000000000000000000000000030000000000000000000000000300000000AC0100000000000003000000005803000000000000030000000058030000000000000300000000580300000000000003000000005803000000000000030000000058030000000000000200000000D80000000000000001000000005803000000000000010000000058030000000000000100000000AC0100000000000001000000005803000000000000010000000058030000000000000100000000AC010000000000000100000000C401000000000000010000000066000000000000000100000000D7020000000000000100000000160300000000000001000000001603000000000000010000000016030000000000000100000000160300000000000001000000008B0100000000000001000000008B0100000000000001000000008B010000000000000100000000F8020000000000000100000000FD02000000000000010000000016030000000000000100000000160300000000000001000000007E01000000000000010000000100030000000000000200000000CD0000000B0000004D657373616765566965770200000000CD0000000000000001000000000003000000000000FFFFFFFF
+BottomPanelSize=85
+BottomPanelClients=MessageView@EditWindow0
+BottomPanelData=00000400000000009703000000000000025500000000000000010000000000000000000000000100000000AE020000000000000100000000970300000B0000004D65737361676556696577FFFFFFFF
 
 [View0]
-Module=P:\Vista\GUI-config\MainU.pas
+Module=P:\vista\GUI-config\GUI_Config.dpr
 CursorX=1
-CursorY=297
-TopLine=281
+CursorY=66
+TopLine=58
 LeftCol=1
 
 [View1]
-Module=P:\Vista\GUI-config\CPRS-Lib\ORCtrls.pas
-CursorX=22
-CursorY=343
-TopLine=336
-LeftCol=1
-
-[View2]
-Module=P:\vista\GUI-config\DebugU.pas
-CursorX=28
-CursorY=4
-TopLine=1
-LeftCol=1
-
-[View3]
-Module=P:\Vista\GUI-config\LookupU.pas
+Module=P:\vista\GUI-config\frmSplash.pas
 CursorX=1
 CursorY=1
@@ -169,72 +104,37 @@
 LeftCol=1
 
+[View2]
+Module=P:\vista\GUI-config\AboutU.pas
+CursorX=1
+CursorY=108
+TopLine=107
+LeftCol=1
+
+[View3]
+Module=P:\vista\GUI-config\MainU.pas
+CursorX=1
+CursorY=1498
+TopLine=1481
+LeftCol=1
+
 [View4]
-Module=P:\Vista\GUI-config\CPRS-Lib\ORFn.pas
-CursorX=38
-CursorY=41
-TopLine=1
+Module=P:\vista\GUI-config\BDK32\Source\wsockc.pas
+CursorX=1
+CursorY=1479
+TopLine=1471
 LeftCol=1
 
 [View5]
-Module=P:\Vista\GUI-config\SubfilesU.pas
-CursorX=9
-CursorY=97
-TopLine=89
+Module=P:\vista\GUI-config\SkinFormU.pas
+CursorX=24
+CursorY=124
+TopLine=113
 LeftCol=1
 
 [View6]
-Module=P:\vista\GUI-config\SetSelU.pas
-CursorX=9
-CursorY=32
-TopLine=24
-LeftCol=1
-
-[View7]
-Module=P:\vista\GUI-config\PostU.pas
-CursorX=9
-CursorY=42
-TopLine=34
-LeftCol=1
-
-[View8]
-Module=P:\vista\GUI-config\EditTextU.pas
-CursorX=22
-CursorY=64
-TopLine=56
-LeftCol=1
-
-[View9]
-Module=P:\vista\GUI-config\CreateTemplateU.pas
-CursorX=22
-CursorY=87
-TopLine=79
-LeftCol=1
-
-[View10]
-Module=P:\vista\GUI-config\SkinFormU.dfm
+Module=P:\Vista\GUI-config\CPRS-Lib\ORNet.pas
 CursorX=1
-CursorY=1
-TopLine=1
-LeftCol=1
-
-[View11]
-Module=P:\vista\GUI-config\GUI_Config.dpr
-CursorX=1
-CursorY=67
-TopLine=59
-LeftCol=1
-
-[View12]
-Module=P:\Vista\GUI-config\frmSplash.pas
-CursorX=20
-CursorY=32
-TopLine=24
-LeftCol=1
-
-[View13]
-Module=P:\Vista\GUI-config\BatchAddU.pas
-CursorX=30
-CursorY=83
-TopLine=74
+CursorY=330
+TopLine=358
 LeftCol=1
 
@@ -252,8 +152,8 @@
 Visible=0
 State=0
-Left=12
-Top=102
-Width=756
-Height=103
+Left=0
+Top=0
+Width=764
+Height=129
 MaxLeft=-1
 MaxTop=-1
@@ -265,6 +165,7 @@
 
 [Breakpoints]
-Count=1
-Breakpoint0='P:\Vista\GUI-config\MainU.pas',295,'',0,1,'',1,0,0,'',1,'','',''
+Count=2
+Breakpoint0='P:\vista\GUI-config\MainU.pas',990,'',0,1,'',1,0,0,'',1,'','',''
+Breakpoint1='P:\vista\GUI-config\MainU.pas',1878,'',0,1,'',1,0,0,'',1,'','',''
 
 [AddressBreakpoints]
@@ -274,26 +175,28 @@
 Create=1
 Visible=1
-State=0
-Left=6
-Top=2
-Width=1013
+State=2
+Left=0
+Top=0
+Width=1024
 Height=112
 MaxLeft=-1
 MaxTop=-1
-ClientWidth=1005
+MaxWidth=1032
+MaxHeight=112
+ClientWidth=1024
 ClientHeight=78
 
 [ProjectManager]
 Create=1
-Visible=1
-State=0
-Left=172
-Top=159
-Width=689
-Height=561
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=681
-ClientHeight=535
+Visible=0
+State=0
+Left=403
+Top=294
+Width=429
+Height=383
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=421
+ClientHeight=357
 TBDockHeight=408
 LRDockWidth=623
@@ -321,5 +224,5 @@
 State=0
 Left=0
-Top=28
+Top=0
 Width=800
 Height=561
@@ -352,17 +255,17 @@
 Left=0
 Top=0
-Width=214
-Height=559
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=214
-ClientHeight=559
+Width=206
+Height=411
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=206
+ClientHeight=411
 TBDockHeight=527
 LRDockWidth=250
 Dockable=1
-SplitPos=114
+SplitPos=73
 ArrangeBy=Name
-SelectedItem=Visible
-ExpandedItems=Anchors,Options
+SelectedItem=Caption
+ExpandedItems=Anchors,Menu,Options
 HiddenCategories=Legacy
 
@@ -393,11 +296,11 @@
 Visible=0
 State=0
-Left=60
-Top=412
-Width=874
+Left=0
+Top=0
+Width=1024
 Height=210
 MaxLeft=-1
 MaxTop=-1
-ClientWidth=866
+ClientWidth=1016
 ClientHeight=184
 TBDockHeight=355
@@ -431,10 +334,10 @@
 Left=0
 Top=0
-Width=214
-Height=559
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=214
-ClientHeight=559
+Width=206
+Height=411
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=206
+ClientHeight=411
 TBDockHeight=527
 LRDockWidth=250
@@ -551,31 +454,31 @@
 [CodeExplorer@EditWindow0]
 Create=1
-Visible=0
+Visible=1
 State=0
 Left=0
 Top=12
-Width=198
-Height=371
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=198
-ClientHeight=371
-TBDockHeight=371
-LRDockWidth=198
+Width=140
+Height=514
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=140
+ClientHeight=514
+TBDockHeight=305
+LRDockWidth=140
 Dockable=1
 
 [MessageView@EditWindow0]
 Create=1
-Visible=0
+Visible=1
 State=0
 Left=12
 Top=0
-Width=756
-Height=205
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=756
-ClientHeight=205
-TBDockHeight=205
+Width=907
+Height=85
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=907
+ClientHeight=85
+TBDockHeight=85
 LRDockWidth=443
 Dockable=1
@@ -589,12 +492,12 @@
 Visible=1
 State=0
-Left=6
-Top=118
-Width=230
-Height=614
-MaxLeft=-1
-MaxTop=-1
-ClientWidth=222
-ClientHeight=588
+Left=3
+Top=152
+Width=222
+Height=466
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=214
+ClientHeight=440
 TBDockHeight=539
 LRDockWidth=258
Index: cprs/branches/GUI-config/GUI_Config.ini
===================================================================
--- cprs/branches/GUI-config/GUI_Config.ini	(revision 541)
+++ cprs/branches/GUI-config/GUI_Config.ini	(revision 542)
@@ -2,2 +2,5 @@
 Default Skin=SkinStuff\Skins\Mac ICQ.ipz
 Load At Startup=1
+[Settings]
+UCaseOnly=1
+
Index: cprs/branches/GUI-config/LookupU.dfm
===================================================================
--- cprs/branches/GUI-config/LookupU.dfm	(revision 541)
+++ cprs/branches/GUI-config/LookupU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object FieldLookupForm: TFieldLookupForm
-  Left = 435
-  Top = 120
+  Left = 1217
+  Top = 365
   Width = 302
   Height = 169
@@ -45,4 +45,5 @@
     OnDblClick = ORComboBoxDblClick
     OnNeedData = ORComboBoxNeedData
+    CharsNeedMatch = 1
   end
   object OKBtn: TBitBtn
Index: cprs/branches/GUI-config/LookupU.pas
===================================================================
--- cprs/branches/GUI-config/LookupU.pas	(revision 541)
+++ cprs/branches/GUI-config/LookupU.pas	(revision 542)
@@ -48,5 +48,5 @@
     //procedure InitORComboBox(ORComboBox: TORComboBox; initValue : string);
     procedure PrepForm(FileNum,InitValue : string);
-    function SubSetOfFile(FileNum: string; const StartFrom: string; 
+    function SubSetOfFile(FileNum: string; const StartFrom: string;
                           Direction: Integer): TStrings;
   end;
@@ -58,12 +58,14 @@
 
 uses
-ORNet, ORFn, Trpcb, QControls, MainU;
+ORNet, ORFn,
+Trpcb,   //needed for .ptype types
+QControls, MainU;
 {$R *.dfm}
 
   procedure TFieldLookupForm.ORComboBoxNeedData(Sender: TObject;
-                                                const StartFrom: String; 
+                                                const StartFrom: String;
                                                 Direction, InsertAt: Integer);
   var
-    Result : TStrings;                                                
+    Result : TStrings;
   begin
     Result := SubSetOfFile(FFileNum, StartFrom, Direction);
Index: cprs/branches/GUI-config/MainU.dfm
===================================================================
--- cprs/branches/GUI-config/MainU.dfm	(revision 541)
+++ cprs/branches/GUI-config/MainU.dfm	(revision 542)
@@ -1,7 +1,7 @@
 object MainForm: TMainForm
-  Left = 246
-  Top = 131
-  Width = 672
-  Height = 551
+  Left = 63
+  Top = 33
+  Width = 861
+  Height = 706
   Caption = 'WorldVistA Configuration Utility'
   Color = 14405057
@@ -46,7 +46,7 @@
     Left = 0
     Top = 0
-    Width = 664
-    Height = 497
-    ActivePage = tsAdvanced
+    Width = 853
+    Height = 652
+    ActivePage = tsPatients
     Align = alClient
     OwnerDraw = True
@@ -60,5 +60,5 @@
         Left = 177
         Top = 0
-        Height = 469
+        Height = 624
         ResizeStyle = rsUpdate
       end
@@ -67,5 +67,5 @@
         Top = 0
         Width = 177
-        Height = 469
+        Height = 624
         Align = alLeft
         BevelOuter = bvNone
@@ -76,5 +76,5 @@
           Top = 0
           Width = 177
-          Height = 434
+          Height = 589
           Hint = 'Select User to Edit'
           Align = alClient
@@ -98,5 +98,5 @@
         object Panel5: TPanel
           Left = 0
-          Top = 434
+          Top = 589
           Width = 177
           Height = 35
@@ -198,6 +198,6 @@
         Left = 180
         Top = 0
-        Width = 476
-        Height = 469
+        Width = 665
+        Height = 624
         Align = alClient
         BevelOuter = bvNone
@@ -207,6 +207,6 @@
           Left = 0
           Top = 0
-          Width = 476
-          Height = 438
+          Width = 665
+          Height = 593
           ActivePage = tsBasicPage
           Align = alClient
@@ -269,6 +269,6 @@
         object ButtonPanel: TPanel
           Left = 0
-          Top = 438
-          Width = 476
+          Top = 593
+          Width = 665
           Height = 31
           Align = alBottom
@@ -277,8 +277,8 @@
           TabOrder = 1
           DesignSize = (
-            476
+            665
             31)
           object btnUsersApply: TBitBtn
-            Left = 395
+            Left = 584
             Top = 3
             Width = 75
@@ -317,5 +317,5 @@
           end
           object btnUsersRevert: TBitBtn
-            Left = 311
+            Left = 500
             Top = 4
             Width = 75
@@ -362,6 +362,6 @@
         Left = 0
         Top = 0
-        Width = 656
-        Height = 469
+        Width = 845
+        Height = 624
         Align = alClient
         BevelOuter = bvNone
@@ -371,5 +371,5 @@
           Left = 177
           Top = 0
-          Height = 469
+          Height = 624
           ResizeStyle = rsUpdate
         end
@@ -377,6 +377,6 @@
           Left = 180
           Top = 0
-          Width = 476
-          Height = 469
+          Width = 665
+          Height = 624
           Align = alClient
           BevelOuter = bvNone
@@ -386,6 +386,6 @@
             Left = 0
             Top = 0
-            Width = 476
-            Height = 438
+            Width = 665
+            Height = 593
             ActivePage = tsBasicSettings
             Align = alClient
@@ -448,6 +448,6 @@
           object Panel3: TPanel
             Left = 0
-            Top = 438
-            Width = 476
+            Top = 593
+            Width = 665
             Height = 31
             Align = alBottom
@@ -456,8 +456,8 @@
             TabOrder = 1
             DesignSize = (
-              476
+              665
               31)
             object btnSettingsApply: TBitBtn
-              Left = 395
+              Left = 584
               Top = 3
               Width = 75
@@ -496,5 +496,5 @@
             end
             object btnSettingsRevert: TBitBtn
-              Left = 311
+              Left = 500
               Top = 4
               Width = 75
@@ -538,5 +538,5 @@
           Top = 0
           Width = 177
-          Height = 469
+          Height = 624
           Align = alLeft
           BevelOuter = bvNone
@@ -547,5 +547,5 @@
             Top = 0
             Width = 177
-            Height = 434
+            Height = 589
             Hint = 'Select User to Edit'
             Align = alClient
@@ -569,5 +569,5 @@
           object Panel6: TPanel
             Left = 0
-            Top = 434
+            Top = 589
             Width = 177
             Height = 35
@@ -586,6 +586,6 @@
         Left = 0
         Top = 0
-        Width = 656
-        Height = 469
+        Width = 845
+        Height = 624
         Align = alClient
         BevelOuter = bvNone
@@ -595,5 +595,5 @@
           Left = 177
           Top = 0
-          Height = 469
+          Height = 624
           ResizeStyle = rsUpdate
         end
@@ -601,6 +601,6 @@
           Left = 180
           Top = 0
-          Width = 476
-          Height = 469
+          Width = 665
+          Height = 624
           Align = alClient
           BevelOuter = bvNone
@@ -610,7 +610,7 @@
             Left = 0
             Top = 0
-            Width = 476
-            Height = 438
-            ActivePage = tsBasicPatients
+            Width = 665
+            Height = 593
+            ActivePage = tsAdvancedPatients
             Align = alClient
             OwnerDraw = True
@@ -650,6 +650,6 @@
                 Left = 0
                 Top = 0
-                Width = 468
-                Height = 410
+                Width = 657
+                Height = 565
                 Cursor = crHandPoint
                 Hint = 'Edit User Fields Here'
@@ -673,6 +673,6 @@
           object Panel9: TPanel
             Left = 0
-            Top = 438
-            Width = 476
+            Top = 593
+            Width = 665
             Height = 31
             Align = alBottom
@@ -681,8 +681,8 @@
             TabOrder = 1
             DesignSize = (
-              476
+              665
               31)
             object btnPatientApply: TBitBtn
-              Left = 395
+              Left = 584
               Top = 3
               Width = 75
@@ -721,5 +721,5 @@
             end
             object btnPatientRevert: TBitBtn
-              Left = 311
+              Left = 500
               Top = 4
               Width = 75
@@ -763,5 +763,5 @@
           Top = 0
           Width = 177
-          Height = 469
+          Height = 624
           Align = alLeft
           BevelOuter = bvNone
@@ -770,5 +770,5 @@
           object Panel11: TPanel
             Left = 0
-            Top = 434
+            Top = 589
             Width = 177
             Height = 35
@@ -868,5 +868,5 @@
             Top = 0
             Width = 177
-            Height = 434
+            Height = 589
             Style = orcsSimple
             Align = alClient
@@ -901,6 +901,6 @@
         Left = 0
         Top = 0
-        Width = 656
-        Height = 469
+        Width = 845
+        Height = 624
         Align = alClient
         BevelOuter = bvNone
@@ -910,5 +910,5 @@
           Left = 177
           Top = 0
-          Height = 469
+          Height = 624
           ResizeStyle = rsUpdate
         end
@@ -916,6 +916,6 @@
           Left = 180
           Top = 0
-          Width = 476
-          Height = 469
+          Width = 665
+          Height = 624
           Align = alClient
           BevelOuter = bvNone
@@ -925,6 +925,6 @@
             Left = 0
             Top = 0
-            Width = 476
-            Height = 438
+            Width = 665
+            Height = 593
             ActivePage = TabSheet2
             Align = alClient
@@ -964,6 +964,6 @@
           object Panel14: TPanel
             Left = 0
-            Top = 438
-            Width = 476
+            Top = 593
+            Width = 665
             Height = 31
             Align = alBottom
@@ -971,8 +971,8 @@
             TabOrder = 1
             DesignSize = (
-              476
+              665
               31)
             object btnAdvancedApply: TBitBtn
-              Left = 395
+              Left = 584
               Top = 3
               Width = 75
@@ -1011,5 +1011,5 @@
             end
             object btnAdvancedRevert: TBitBtn
-              Left = 311
+              Left = 500
               Top = 4
               Width = 75
@@ -1053,5 +1053,5 @@
           Top = 0
           Width = 177
-          Height = 469
+          Height = 624
           Align = alLeft
           BevelOuter = bvNone
@@ -1060,5 +1060,5 @@
           object BotLeftAdvBtnPanel: TPanel
             Left = 0
-            Top = 434
+            Top = 589
             Width = 177
             Height = 35
@@ -1112,5 +1112,5 @@
             Top = 0
             Width = 177
-            Height = 434
+            Height = 589
             Align = alClient
             BevelOuter = bvNone
@@ -1181,5 +1181,5 @@
               Top = 204
               Width = 177
-              Height = 230
+              Height = 385
               Align = alClient
               BevelOuter = bvNone
@@ -1205,5 +1205,5 @@
                 Top = 13
                 Width = 177
-                Height = 217
+                Height = 372
                 Style = orcsSimple
                 Align = alClient
Index: cprs/branches/GUI-config/MainU.pas
===================================================================
--- cprs/branches/GUI-config/MainU.pas	(revision 541)
+++ cprs/branches/GUI-config/MainU.pas	(revision 542)
@@ -5,5 +5,5 @@
    (c) 8/2008 Kevin Toppenberg
    Programmed by Kevin Toppenberg, Eddie Hagood  
-   
+
    Family Physicians of Greeneville, PC
    1410 Tusculum Blvd, Suite 2600
@@ -36,5 +36,5 @@
   ipSkinManager,
   {$ENDIF}
-  Trpcb,
+  Trpcb, //needed for .ptype types
   ValEdit;
 
@@ -201,5 +201,5 @@
     RPCBrokerParams : TTreeNode;
     Devices : TTreeNode;
-    FLastSelectedRow,FLastSelectedCol : integer;                  
+    FLastSelectedRow,FLastSelectedCol : integer;
     FLoadingGrid: boolean;
     DataForGrid : TStringList;   // doesn't own TGridInfo objects
@@ -208,4 +208,5 @@
     CachedWPField : TStringList;
     FVisibleGridIdx : integer;
+    FINIFileName : string;  // 8-12-09   elh
     procedure ShowDebugClick(Sender: TObject);
     function FindParam(Param : string) : string;
@@ -282,7 +283,8 @@
 
 uses
-  frmSplash, {Trpcb,}  LookupU, SubfilesU, SetSelU, SelDateTimeU, PostU,
+  frmSplash, LookupU, SubfilesU, SetSelU, SelDateTimeU, PostU,
   FMErrorU, AboutU, PleaseWaitU, EditTextU, CreateTemplateU, SkinFormU,
-  BatchAddU, DebugU;
+  BatchAddU, DebugU,
+  inifiles;  //8-12-09  elh
 
 {$R *.dfm}
@@ -343,4 +345,5 @@
     if not ORNet.ConnectToServer(RPC_CONTEXT) then begin
       DebugForm.Memo.Lines.Add('Failed connection.  Closing.');
+      messagedlg('Login Failed.',mtError,[mbOK],0);
       Close;
       Exit;
@@ -1167,5 +1170,5 @@
         Inc(GridRow);
       end;
-    end;  
+    end;
     FLoadingGrid := false;
   end;
@@ -1174,8 +1177,8 @@
   procedure TMainForm.GridSelectCell(Sender: TObject; ACol, ARow: Integer;
                                      var CanSelect: Boolean);
-    (*  
+    (*
     For Field def, here is the legend
     character     meaning
-    
+
     BC 	          The data is Boolean Computed (true or false).
     C 	          The data is Computed.
@@ -1187,15 +1190,15 @@
     Pn 	          The data is a Pointer reference to file "n".
     S 	          The data is from a discrete Set of codes.
-    
-    N 	          The data is Numeric-valued.    
-    
+
+    N 	          The data is Numeric-valued.
+
     Jn 	          To specify a print length of n characters.
     Jn,d 	        To specify printing n characters with decimals.
-    
+
     V 	          The data is a Variable pointer.
     W 	          The data is Word processing.
     WL 	          The Word processing data is normally printed in Line mode (i.e., without word wrap).
       *)
-  var oneEntry,FieldDef : string;                                     
+  var oneEntry,FieldDef : string;
       date,time: string;
       FileNum,FieldNum,SubFileNum : string;
@@ -1242,5 +1245,5 @@
           IEN := RecordORComboBox.ItemID;  //get info from selected record
           if IEN > 0 then IENS := InttoStr(IEN) + ',';
-        end;  
+        end;
         if IENS <> '' then begin
           SubFileForm := TSubFileForm.Create(self);
@@ -1250,5 +1253,5 @@
         end else begin
           MessageDlg('IENS for File="".  Can''t process.',mtInformation,[MBOK],0);
-        end;  
+        end;
       end;  
     end else if Pos('C',FieldDef)>0 then begin  //computed fields.
@@ -1268,5 +1271,5 @@
         Grid.Cells[ACol,ARow] := date;
       end;
-      CanSelect := true;    
+      CanSelect := true;
     end else if Pos('S',FieldDef)>0 then begin  //Set of Codes
       SetSelForm.PrepForm(Piece(oneEntry,'^',7));
@@ -1284,5 +1287,5 @@
         Grid.Cells[ACol,ARow] := FieldLookupForm.ORComboBox.Text;
         CanSelect := true;
-      end;      
+      end;
     end;
     if CanSelect then begin
@@ -1290,9 +1293,9 @@
       FLastSelectedCol := ACol;
     end;
-    GridInfo.ApplyBtn.Enabled := true;    
-    GridInfo.RevertBtn.Enabled := true;    
-  end;
-
-  
+    GridInfo.ApplyBtn.Enabled := true;
+    GridInfo.RevertBtn.Enabled := true;
+  end;
+
+
   function TMainForm.GetLineInfo(Grid : TStringGrid; CurrentUserData : TStringList; ARow: integer) : tFileEntry;
   var fieldNum : string;
@@ -1302,5 +1305,5 @@
   begin
     fieldNum := Grid.Cells[0,ARow];
-    gridRow := FindInStrings(fieldNum, CurrentUserData, fileNum);    
+    gridRow := FindInStrings(fieldNum, CurrentUserData, fileNum);
     if gridRow > -1 then begin
       oneEntry := CurrentUserData.Strings[gridRow];
@@ -1310,5 +1313,5 @@
       Result.IENS := Piece(oneEntry,'^',2);
       Result.oldValue := Piece(oneEntry,'^',4);
-      Result.newValue := Grid.Cells[2,ARow];     
+      Result.newValue := Grid.Cells[2,ARow];
     end else begin
       Result.Field := '';
@@ -1347,7 +1350,7 @@
       break;
     end;
-  end;  
-  
-  
+  end;
+
+
   function TMainForm.IsSubFile(FieldDef: string ; var SubFileNum : string) : boolean;
   //SubFileNum is OUT parameter
@@ -1455,6 +1458,6 @@
     FVisibleGridIdx := GetInfoIndexForGrid(Grid);
   end;
-  
-  
+
+
   procedure TMainForm.CompileChanges(Grid : TStringGrid; CurrentUserData,Changes : TStringList);
   //Output format:
@@ -1464,20 +1467,47 @@
       Entry : tFileEntry;
       oneEntry : string;
-  begin
+      iniFile : TIniFile; // 8-12-09   elh
+      UCaseOnly : boolean;
+  begin
+    FINIFileName := ExtractFilePath(ParamStr(0)) + 'GUI_Config.ini';
+    iniFile := TIniFile.Create(FINIFileName);            //8-12-09  elh
+    UCaseOnly := inifile.ReadBool('Settings','UCaseOnly',true);
+    iniFile.Free;
     for row := 1 to Grid.RowCount-1 do begin
       Entry := GetLineInfo(Grid,CurrentUserData, row);
-      if Entry.oldValue <> Entry.newValue then begin
-        if (Entry.newValue <> CLICK_FOR_SUBS) and
-          (Entry.newValue <> COMPUTED_FIELD) and
-          (Entry.newValue <> CLICK_TO_EDIT) then begin   
-          oneEntry := Entry.FileNum + '^' + Entry.IENS + '^' + Entry.Field + '^' + Entry.FieldName;
-          oneEntry := oneEntry + '^' + Entry.newValue + '^' + Entry.oldValue;
-          Changes.Add(oneEntry);
-        end;  
+      //Reject any value containing a "^"
+      //Do we need an @ here as well?
+      if (AnsiPos('^',Entry.newvalue) > 0){ or (AnsiPos('@',Entry.newvalue) > 0)} then begin
+         messagedlg('Invalid value entered for ' + Entry.Fieldname + #13 + #10
+                     + #13 + #10 + 'Invalid Entry:   ' + Entry.newvalue + #13 + #10 +
+                     'Ignoring Value.',mtError,[mbOK],0);
+      end else begin
+         if Entry.oldValue <> Entry.newValue then begin
+           if (Entry.newValue <> CLICK_FOR_SUBS) and
+              (Entry.newValue <> COMPUTED_FIELD) and
+              (Entry.newValue <> CLICK_TO_EDIT) then begin
+             oneEntry := Entry.FileNum + '^' + Entry.IENS + '^' + Entry.Field + '^' + Entry.FieldName;
+             //Test to see if change is an AV Code (2 or 11) or ES Code (20.4) in User File (200)
+             //If so, make it uppercase.       8/12/09   elh
+             if Entry.FileNum = '200' then begin
+                if ((Entry.Field = '2') and (UCaseOnly = true)) or
+                   ((Entry.Field = '11') and (UCaseOnly = true)) or
+                   ((Entry.Field = '20.4') and (UCaseOnly = true)) then begin
+                   messagedlg('Converting ' + Entry.Fieldname + ' to uppercase for VistA interactivity.' +#13 +#10 +
+                              #13 +#10 +
+                              'Old Value: ' + Entry.newvalue + '  ' + 'New Value: ' + Uppercase(Entry.newvalue),
+                              mtinformation,[mbOK],0);
+                   Entry.newValue := Uppercase(Entry.newValue);
+                end;
+             end;
+             oneEntry := oneEntry + '^' + Entry.newValue + '^' + Entry.oldValue;
+             Changes.Add(oneEntry);
+           end;
+         end;
       end;
     end;
   end;
 
-  
+
   function TMainForm.PostChanges(Grid : TStringGrid) : TModalResult;
   //Results:  mrNone -- no post done (not needed)
@@ -1705,5 +1735,5 @@
     SrchStr := FileNum + '^' + FieldNum + '^' + HelpStyle;
     Idx := CachedHelpIdx.IndexOf(SrchStr);
-    if Idx = -1 then begin    
+    if Idx = -1 then begin
       RPCBrokerV.remoteprocedure := 'TMG CHANNEL';
       RPCBrokerV.param[0].ptype := list;
@@ -1718,10 +1748,13 @@
       end else begin
         RPCBrokerV.Results.Delete(0);
-        if RPCBrokerV.Results.Strings[RPCBrokerV.Results.Count-1]='' then begin
-          RPCBrokerV.Results.Delete(RPCBrokerV.Results.Count-1);
+        if RPCBrokerV.Results.Count > 0 then begin
+          if RPCBrokerV.Results.Strings[RPCBrokerV.Results.Count-1]='' then begin
+            RPCBrokerV.Results.Delete(RPCBrokerV.Results.Count-1);
+          end;
         end;
-        result := RPCBrokerV.Results.Text;        
+        result := RPCBrokerV.Results.Text;
+        if result = '' then result := ' ';
         //Maybe later replace text with "Enter F1 for more help."
-        Result := AnsiReplaceText(Result,'Enter ''??'' for more help.','');        
+        Result := AnsiReplaceText(Result,'Enter ''??'' for more help.','');
         while Result[Length(Result)] in [#10,#13] do begin
           Result := AnsiLeftStr(Result,Length(Result)-1);
@@ -2126,9 +2159,9 @@
         SetPiece(oneEntry,'^',2,IENS);
         Data.Add(oneEntry); 
-      end;    
+      end;
     end;  
   end;
-  
-  
+
+
   procedure TMainForm.ApplicationEventsException(Sender: TObject; E: Exception);
   begin
@@ -2178,4 +2211,6 @@
   end;
 
+
+
 end.
 
Index: cprs/branches/GUI-config/PostU.dfm
===================================================================
--- cprs/branches/GUI-config/PostU.dfm	(revision 541)
+++ cprs/branches/GUI-config/PostU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object PostForm: TPostForm
-  Left = 83
-  Top = 285
+  Left = 1059
+  Top = 337
   Width = 735
   Height = 342
Index: cprs/branches/GUI-config/PostU.pas
===================================================================
--- cprs/branches/GUI-config/PostU.pas	(revision 541)
+++ cprs/branches/GUI-config/PostU.pas	(revision 542)
@@ -40,5 +40,7 @@
 {$R *.dfm}
 uses
-  ORNet, ORFn, ORCtrls, Trpcb, FMErrorU, StrUtils;
+  ORNet, ORFn, ORCtrls,
+  Trpcb, // needed for .ptype types
+  FMErrorU, StrUtils;
 
   procedure TPostForm.PrepForm(Changes : TStringList);
Index: cprs/branches/GUI-config/SetSelU.dfm
===================================================================
--- cprs/branches/GUI-config/SetSelU.dfm	(revision 541)
+++ cprs/branches/GUI-config/SetSelU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object SetSelForm: TSetSelForm
-  Left = 529
-  Top = 124
+  Left = 1322
+  Top = 417
   Width = 240
   Height = 70
Index: cprs/branches/GUI-config/SubfilesU.dfm
===================================================================
--- cprs/branches/GUI-config/SubfilesU.dfm	(revision 541)
+++ cprs/branches/GUI-config/SubfilesU.dfm	(revision 542)
@@ -1,5 +1,5 @@
 object SubfileForm: TSubfileForm
-  Left = 239
-  Top = 266
+  Left = 58
+  Top = 196
   Width = 769
   Height = 385
Index: cprs/branches/GUI-config/SubfilesU.pas
===================================================================
--- cprs/branches/GUI-config/SubfilesU.pas	(revision 541)
+++ cprs/branches/GUI-config/SubfilesU.pas	(revision 542)
@@ -95,5 +95,6 @@
 
 uses
-  ORNet, ORFn, ORCtrls, Trpcb,
+  ORNet, ORFn, ORCtrls,
+  Trpcb,  //needed for .ptype types
   ToolWin, SelDateTimeU, SetSelU, LookupU, PostU, FMErrorU;
 
Index: cprs/branches/GUI-config/frmSplash.dfm
===================================================================
--- cprs/branches/GUI-config/frmSplash.dfm	(revision 541)
+++ cprs/branches/GUI-config/frmSplash.dfm	(revision 542)
@@ -4,5 +4,5 @@
   BorderStyle = bsNone
   Caption = 'SplashForm'
-  ClientHeight = 300
+  ClientHeight = 298
   ClientWidth = 400
   Color = clBtnFace
@@ -20,5 +20,5 @@
     Top = 0
     Width = 400
-    Height = 300
+    Height = 298
     Align = alClient
     Picture.Data = {
