50. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/22/2018 8:26:01 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

50.1 Files compared

# Location File Last Modified
1 OR_30_405V42.zip\OR_30_405V42_SRC\Womens Health oWVController.pas Wed Jan 17 18:08:12 2018 UTC
2 OR_30_405V42.zip\OR_30_405V42_SRC\Womens Health oWVController.pas Wed Mar 21 14:43:55 2018 UTC

50.2 Comparison summary

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

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

50.4 Active regular expressions

No regular expressions were active.

50.5 Comparison detail

  1   unit oWVCo ntroller;
  2   {
  3     ======== ========== ========== ========== ========== ========== ========== ========== ==
  4     *
  5     *        Applicatio n:  TDrugs  Patch OR* 3*377 and  WV*1*24
  6              Developer:       PII                   
  7     *        Site:          Salt L ake City I SC
  8     *
  9     *        Descriptio n:  Primar y controll er accesse d via the  WVControll er
  10     *                       method  in iWVInt erface.pas  as IWVCon troller.
  11     *
  12     *        Notes:         Implem entation u ses clause  contains  non-standa rd link to
  13     *                       CPRS f ile ORNet. pas for us e with CPR S.
  14     *
  15     ======== ========== ========== ========== ========== ========== ========== ========== ==
  16   }
  17  
  18   interface
  19  
  20   uses
  21     Dialogs,
  22     System.C lasses,
  23     System.G enerics.Co llections,
  24     System.S ysUtils,
  25     System.U ITypes,
  26     iWVInter face,
  27     oWVWebSi te;
  28  
  29   type
  30     TWVContr oller = cl ass(TInter facedObjec t, IWVCont roller)
  31     private
  32       { Priv ate decler ations }
  33       fEDDMe thod: stri ng;
  34       fEDDMe thodAccess ible: stri ng;
  35       fIniti alized: bo olean;
  36       fLastE rror: stri ng;
  37       fWebSi teListName : string;
  38       fWebSi tes: TObje ctList<TWV WebSite>;
  39  
  40       functi on getEDDM ethod: str ing;
  41       functi on getEDDM ethodAcces sible: str ing;
  42       functi on getWebS ite(aIndex : integer) : IWVWebSi te;
  43       functi on getWebS iteCount:  integer;
  44       functi on getWebS iteListNam e: string;
  45     protecte d
  46       { Prot ected decl arations }
  47       functi on GetLast Error: str ing;
  48  
  49       functi on EditPre gLacData(a DFN: strin g): boolea n;
  50       functi on GetReco rdIDType(a RecordID:  string; va r aType: s tring): bo olean;
  51       functi on GetWebS iteURL(aWe bSiteName:  string):  string;
  52       functi on InitCon troller(aF orceInit:  boolean =  False): bo olean; vir tual;
  53       functi on IsValid WVPatient( aDFN: stri ng): boole an;
  54       functi on MarkAsE nteredInEr ror(aItemI D: string) : boolean;
  55       functi on OpenExt ernalWebsi te(aWebsit e: IWVWebS ite): bool ean;
  56       functi on SavePre gnancyAndL actationDa ta(aList:  TStrings):  boolean;
  57     public
  58       constr uctor Crea te;
  59       destru ctor Destr oy; overri de;
  60     end;
  61  
  62   implementa tion
  63  
  64   uses
  65     fWVPregL acStatusUp date, // U pdate Form
  66     fWVEIERe asonsDlg,  // Reason  Selection  Dialog
  67     oDelimit edString,
  68     ORNet, / / Access t o CallVist A() method  in CPRS s o RPC's ar e logged -  Would lik e to route  this thro ugh an eve nt.
  69     WinAPI.W indows, //  Call to S hellExecut e for the  WebSites
  70     ShellAPI , // Call  to ShellEx ecute for  the WebSit es
  71     VAUtils;
  72  
  73   const
  74     { VistA  RPC's }
  75     RPC_CONS AVE = 'WVR PCOR CONSA VE';
  76     RPC_COVE R = 'WVRPC OR COVER';
  77     RPC_EIE  = 'WVRPCOR  EIE';
  78     RPC_SAVE DATA = 'WV RPCOR SAVE DATA';
  79     RPC_REAS ONS = 'WVR PCOR REASO NS';
  80     RPC_WEBS ITES = 'WV RPCOR SITE S';
  81  
  82     { TWVCon troller }
  83  
  84   constructo r TWVContr oller.Crea te;
  85   begin
  86     inherite d Create;
  87     fInitial ized := Fa lse;
  88     fLastErr or := '';
  89  
  90     fWebSite s := TObje ctList<TWV WebSite>.C reate;
  91     fWebSite s.OwnsObje cts := Tru e;
  92   end;
  93  
  94   destructor  TWVContro ller.Destr oy;
  95   begin
  96     inherite d;
  97     FreeAndN il(fWebSit es);
  98   end;
  99  
  100   function T WVControll er.EditPre gLacData(a DFN: strin g): boolea n;
  101   var
  102     aList: T StringList ;
  103   begin
  104     aList :=  TStringLi st.Create;
  105     Result : = False;
  106     try
  107       CallVi stA(RPC_CO NSAVE, [aD FN], aList );
  108       if aLi st.Count >  1 then
  109       begin
  110         with  NewDelimi tedString( aList[1])  do
  111         try
  112           fE DDMethod : = GetPiece (2);
  113           fE DDMethodAc cessible : = GetPiece (3);
  114         fina lly
  115           Fr ee;
  116         end;
  117       end
  118       else
  119       begin
  120         fEDD Method :=  '';
  121         fEDD MethodAcce ssible :=  '';
  122       end;
  123  
  124       if Cop y(aList[0] , 1, 2) =  '1^' then  // Get con firmation  to result  or exit.
  125         if M essageDlg( Copy(aList [0], 3, Le ngth(aList [0])), mtC onfirmatio n, [mbYes,  mbNo], 0)  <> mrYes  then
  126           be gin
  127              Result :=  True;
  128              Exit;
  129           en d;
  130  
  131       if Cop y(aList[0] , 1, 3) =  '-1^' then  // Error  from serve r, abort.
  132         begi n
  133           fL astError : = aList[0] ;
  134           Re sult := Fa lse;
  135           Ex it;
  136         end;
  137  
  138       with N ewPLUpdate Form(aDFN)  do
  139         try
  140  
  141           if  ScreenRea derActive  then
  142           be gin
  143              stxtEDDMet hod.Captio n := getED DMethodAcc essible;
  144           en d
  145           el se
  146           be gin
  147              stxtEDDMet hod.Captio n := getED DMethod;
  148           en d;
  149  
  150           if  Execute t hen
  151              begin
  152                if GetDa ta(aList)  then
  153                  Result  := SavePr egnancyAnd LactationD ata(aList)
  154                else
  155                  begin
  156                    fLas tError :=  Copy(aList [0], 3, Le ngth(aList [0]));
  157                    Resu lt := Fals e;
  158                  end
  159              end
  160           el se
  161              Result :=  True;
  162         fina lly
  163           Fr ee;
  164         end;
  165     except
  166       on E:  Exception  do
  167         fLas tError :=  E.Message;
  168     end;
  169     FreeAndN il(aList);
  170   end;
  171  
  172   function T WVControll er.GetLast Error: str ing;
  173   begin
  174     Result : = fLastErr or;
  175   end;
  176  
  177   function T WVControll er.GetReco rdIDType(a RecordID:  string; va r aType: s tring): bo olean;
  178   begin
  179     try
  180       case S trToInt(Co py(aRecord ID, 1, Pos (';', aRec ordID) - 1 )) of
  181         4:
  182           be gin
  183              aType := ' Pregnancy  Status';
  184              Result :=  True;
  185           en d;
  186         5:
  187           be gin
  188              aType := ' Lactation  Status';
  189              Result :=  True;
  190           en d;
  191       else
  192         begi n
  193           aT ype := 'Un known Reco rd ID Type  ' + aReco rdID;
  194           Re sult := Fa lse;
  195         end;
  196       end;
  197     except
  198       on E:  Exception  do
  199         begi n
  200           aT ype := 'Er ror gettin g Record I D Type ' +  E.Message ;
  201           Re sult := Fa lse;
  202         end;
  203     end;
  204   end;
  205  
  206   function T WVControll er.getEDDM ethod: str ing;
  207   begin
  208     // Note:  This meth od is blan k until a  call to TW VControlle r.EditPreg LacData is  made
  209     // This  is by desi gn and if  the value  is needed  sooner the n a pre-em ptive call  is needed .
  210     if fEDDM ethod <> ' ' then
  211       Result  := fEDDMe thod
  212     else
  213       Result  := 'EDD i nput metho d unknown. ';
  214   end;
  215  
  216   function T WVControll er.getEDDM ethodAcces sible: str ing;
  217   begin
  218     // Note:  This meth od is blan k until a  call to TW VControlle r.EditPreg LacData is  made
  219     // This  is by desi gn and if  the value  is needed  sooner the n a pre-em ptive call  is needed .
  220     if fEDDM ethodAcces sible <> ' ' then
  221       Result  := fEDDMe thodAccess ible
  222     else
  223       Result  := 'Expec ted Due Da te input m ethod unkn own.';
  224   end;
  225  
  226   function T WVControll er.getWebS ite(aIndex : integer) : IWVWebSi te;
  227   begin
  228     InitCont roller;
  229     try
  230       fWebSi tes.Items[ aIndex].Ge tInterface (IWVWebSit e, Result) ;
  231     except
  232       Result  := nil;
  233     end;
  234   end;
  235  
  236   function T WVControll er.GetWebS iteURL(aWe bSiteName:  string):  string;
  237   var
  238     aWebsite : TWVWebSi te;
  239   begin
  240     for aWeb site in fW ebSites do
  241       if Com pareStr(aW ebsite.Get Name, aWeb SiteName)  = 0 then
  242         begi n
  243           Re sult := aW ebsite.Get URL;
  244           Br eak;
  245         end;
  246   end;
  247  
  248   function T WVControll er.getWebS iteCount:  integer;
  249   begin
  250     InitCont roller;
  251     Result : = fWebSite s.Count;
  252   end;
  253  
  254   function T WVControll er.getWebS iteListNam e: string;
  255   begin
  256     InitCont roller;
  257     Result : = fWebSite ListName;
  258   end;
  259  
  260   function T WVControll er.InitCon troller(aF orceInit:  boolean =  False): bo olean;
  261   var
  262     aReturn:  TStringLi st;
  263     i: integ er;
  264   begin
  265     if not f Initialize d then
  266       begin
  267         aRet urn := TSt ringList.C reate;
  268         try
  269           Ca llVistA(RP C_WEBSITES , [], aRet urn);
  270           if  aReturn.C ount < 1 t hen
  271              fWebSiteLi stName :=  'Error loa ding Web S ites!'
  272           el se
  273              begin
  274                fWebSite ListName : = aReturn[ 0];
  275                for i :=  1 to aRet urn.Count  - 1 do
  276                  fWebSi tes.Add(TW VWebSite.C reate(aRet urn[i]));
  277              end;
  278           fI nitialized  := True;
  279         fina lly
  280           Fr eeAndNil(a Return);
  281         end;
  282       end;
  283     Result : = fInitial ized;
  284   end;
  285  
  286   function T WVControll er.IsValid WVPatient( aDFN: stri ng): boole an;
  287   var
  288     aList: T StringList ;
  289   begin
  290     aList :=  TStringLi st.Create;
  291     try
  292       CallVi stA(RPC_CO VER, [aDFN ], aList);
  293       Result  := aList[ 0] <> '0';
  294     except
  295       Result  := False;
  296     end;
  297     FreeAndN il(aList);
  298   end;
  299  
  300   function T WVControll er.MarkAsE nteredInEr ror(aItemI D: string) : boolean;
  301   var
  302     aList: T StringList ;
  303   begin
  304     fLastErr or := '';
  305     aList :=  TStringLi st.Create;
  306     with New WVEIEReaso nsDlg do
  307       try
  308         Call VistA(RPC_ REASONS, [ ], aList);
  309         AddR eason(aLis t);
  310         if E xecute the n
  311           tr y
  312              GetReasons (aList);
  313              CallVistA( RPC_EIE, [ aItemID, a List], aLi st);
  314              with NewDe limitedStr ing(aList[ 0]) do
  315                try
  316                  Result  := GetPie ceAsIntege r(1) = 1;
  317                  if not  Result th en
  318                    fLas tError :=  GetPiece(2 );
  319                finally
  320                  Free;
  321                end;
  322           ex cept
  323              on E: Exce ption do
  324                begin
  325                  fLastE rror := E. Message;
  326                  Result  := False;
  327                end;
  328           en d
  329         else
  330           Re sult := Tr ue;
  331       finall y
  332         Free ;
  333       end;
  334     FreeAndN il(aList);
  335   end;
  336  
  337   function T WVControll er.OpenExt ernalWebsi te(aWebsit e: IWVWebS ite): bool ean;
  338   begin
  339     try
  340       ShellE xecute(0,  'open', PW ideChar(aW ebsite.URL ), nil, ni l, SW_SHOW NORMAL);
  341       Result  := True;
  342     except
  343       on E:  Exception  do
  344         begi n
  345           fL astError : = E.Messag e;
  346           Re sult := Fa lse;
  347         end;
  348     end;
  349   end;
  350  
  351   function T WVControll er.SavePre gnancyAndL actationDa ta(aList:  TStrings):  boolean;
  352   begin
  353     try
  354       CallVi stA(RPC_SA VEDATA, [a List], aLi st);
  355       with N ewDelimite dString(aL ist[0]) do
  356         try
  357           Re sult := (G etPieceAsI nteger(1)  = 1);
  358           if  not Resul t then
  359              fLastError  := GetPie ce(2);
  360         fina lly
  361           Fr ee;
  362         end;
  363     except
  364       on E:  Exception  do
  365         begi n
  366           fL astError : = E.Messag e;
  367           Re sult := Fa lse;
  368         end;
  369     end;
  370   end;
  371  
  372   end.