Ignore:
Timestamp:
Jul 7, 2010, 4:51:54 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrading to version 27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/fActivateDeactivate.pas

    r456 r830  
    66  Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls, Forms,
    77  Dialogs, fAutoSz, StdCtrls, ExtCtrls, ORCtrls,ORFn, rCore, uCore, oRNet, Math, fOrders, ORClasses, rOrders,
    8   fMeds, rMeds;
     8  fMeds, rMeds, VA508AccessibilityManager;
    99
    1010type
     
    2020    { Private declarations }
    2121    procedure GetOriginalOrders(OrderID: TStringList; var OriginalOrder: TORStringList);
     22    procedure DCOriginalOrder(OrderID: string);
    2223    procedure BuildForm(Str1: String);
    2324    function PromptForm(Text: String): String;
     
    4748  with frmActivateDeactive do
    4849     begin
    49         str := 'This order ' + str1 +' is currently in a pending status. ';
    50         str := str + CRLF + 'If this order is discontinued, the original order status will be changed to active, unless it is discontinued.';
     50        str := 'This order is in a pending status.  If this pending order is discontinued, the original order will still be active.';
     51        str := str + CRLF + CRLF + str1;
    5152        str := str + CRLF + CRLF + 'Click:';
    52         str := str + CRLF + '     "Yes" to discontinue the original order';
    53         str := str + CRLF + '     "No" to change the status to active';
    54         str := str + CRLF + '     "Cancel" to stop the discontinue process for this order';
     53        str := str + CRLF + '     "DC BOTH" to discontinue both orders ';
     54        str := str + CRLF + '     "DC Pending Order" to discontinue only the pending order and return the original order back to an active status ';
     55        str := str + CRLF + '     "Cancel - No Action Taken" to stop the discontinue process ';
    5556        Memo1.ReadOnly := False;
    5657        Memo1.Text := str;
     
    6465procedure TfrmActivateDeactive.fActivateDeactive(OrderID: TStringList);
    6566var
    66 i,j,Pos: integer;
     67i,Pos: integer;
    6768tmpArr: TORStringList;
    6869ActDeact: string;
    69 AnOrder,AnOrder1: TOrder;
     70AnOrder: TOrder;
    7071begin
    7172  //called from order tab
     
    7980            begin
    8081              ActDeact := PromptForm(AnOrder.Text);
    81               if ActDeact = 'D' then
    82                 begin
    83                   for j := 0 to forders.frmOrders.lstOrders.Items.Count-1 do
    84                     begin
    85                       AnOrder1 := TOrder(forders.frmOrders.lstOrders.Items.Objects[j]);
    86                       if AnOrder1.ID = Piece(tmpArr.Strings[Pos],U,2) then
    87                         forders.frmOrders.lstOrders.Selected[j] := True;
    88                     end;
    89                 end;
     82              if ActDeact = 'D' then AnOrder.DCOriginalOrder := True;
     83              if ActDeact = 'A' then AnOrder.DCOriginalOrder := False;
    9084              if ActDeact = 'C' then Selected[i] := False;
    9185            end;
     
    9589procedure TfrmActivateDeactive.fActivateDeactive(OrderID: TStringList; AList: TListBox);
    9690var
    97 i,j,Pos: integer;
     91i,Pos: integer;
    9892tmpArr: TORStringList;
    9993ActDeact: String;
    100 AMed,AMed1: TMedListRec;
     94AMed: TMedListRec;
     95AnOrder: TOrder;
    10196begin
    10297  //called from Med tab
    10398  tmpArr := TORStringList.Create;
    10499  GetOriginalOrders(OrderID,tmpArr);
    105       with AList do for i := 0 to items.Count-1 do if Selected[i] then
     100  AnOrder := TOrder.Create;
     101     with AList do for i := 0 to items.Count-1 do if Selected[i] then
    106102        begin
    107103          AMed := TMedListRec(Items.Objects[i]);
     104          if AMed = nil then Continue;
    108105          Pos := tmpArr.IndexOfPiece(AMed.OrderID,U,1);
    109106          if Pos > -1 then
     
    112109              if ActDeact = 'D' then
    113110                begin
    114                   for j := 0 to Alist.Items.Count-1 do
    115                     begin
    116                       AMed1 := TMedListRec(Alist.Items.Objects[j]);
    117                       if AMed1.OrderID = Piece(tmpArr.Strings[Pos],U,2) then
    118                         begin
    119                           Alist.Selected[j] := True;
    120                           break;
    121                         end;
    122                       //some med orders may not have an action defined tends to be renew order of orders that were renew from another
    123                       //order and outpatient orders
    124                       if (AMed1.OrderID = Piece(Piece(tmpArr.Strings[Pos],U,2),';',1)) then
    125                         begin
    126                           Alist.Selected[j] := True;
    127                           break;
    128                         end;
    129 
    130                     end;
     111                  AnOrder := GetOrderByIFN(Piece(tmpArr.Strings[Pos],U,1));
     112                  DCOriginalOrder(AnOrder.ID);
     113                  //AnOrder.DCOriginalOrder := True;
    131114                end;
     115              if ActDeact = 'A' then AnOrder.DCOriginalOrder := False;
    132116              if ActDeact = 'C' then Selected[i] := False;
    133117            end;
     
    180164end;
    181165
     166procedure TfrmActivateDeactive.DCOriginalOrder(OrderID: string);
     167begin
     168 CallV('ORWDX1 DCORIG', [OrderID]);
     169end;
     170
    182171end.
Note: See TracChangeset for help on using the changeset viewer.