Changeset 830 for cprs/trunk/CPRS-Chart/fActivateDeactivate.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fActivateDeactivate.pas
r456 r830 6 6 Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls, Forms, 7 7 Dialogs, fAutoSz, StdCtrls, ExtCtrls, ORCtrls,ORFn, rCore, uCore, oRNet, Math, fOrders, ORClasses, rOrders, 8 fMeds, rMeds ;8 fMeds, rMeds, VA508AccessibilityManager; 9 9 10 10 type … … 20 20 { Private declarations } 21 21 procedure GetOriginalOrders(OrderID: TStringList; var OriginalOrder: TORStringList); 22 procedure DCOriginalOrder(OrderID: string); 22 23 procedure BuildForm(Str1: String); 23 24 function PromptForm(Text: String): String; … … 47 48 with frmActivateDeactive do 48 49 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; 51 52 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 '; 55 56 Memo1.ReadOnly := False; 56 57 Memo1.Text := str; … … 64 65 procedure TfrmActivateDeactive.fActivateDeactive(OrderID: TStringList); 65 66 var 66 i, j,Pos: integer;67 i,Pos: integer; 67 68 tmpArr: TORStringList; 68 69 ActDeact: string; 69 AnOrder ,AnOrder1: TOrder;70 AnOrder: TOrder; 70 71 begin 71 72 //called from order tab … … 79 80 begin 80 81 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; 90 84 if ActDeact = 'C' then Selected[i] := False; 91 85 end; … … 95 89 procedure TfrmActivateDeactive.fActivateDeactive(OrderID: TStringList; AList: TListBox); 96 90 var 97 i, j,Pos: integer;91 i,Pos: integer; 98 92 tmpArr: TORStringList; 99 93 ActDeact: String; 100 AMed,AMed1: TMedListRec; 94 AMed: TMedListRec; 95 AnOrder: TOrder; 101 96 begin 102 97 //called from Med tab 103 98 tmpArr := TORStringList.Create; 104 99 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 106 102 begin 107 103 AMed := TMedListRec(Items.Objects[i]); 104 if AMed = nil then Continue; 108 105 Pos := tmpArr.IndexOfPiece(AMed.OrderID,U,1); 109 106 if Pos > -1 then … … 112 109 if ActDeact = 'D' then 113 110 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; 131 114 end; 115 if ActDeact = 'A' then AnOrder.DCOriginalOrder := False; 132 116 if ActDeact = 'C' then Selected[i] := False; 133 117 end; … … 180 164 end; 181 165 166 procedure TfrmActivateDeactive.DCOriginalOrder(OrderID: string); 167 begin 168 CallV('ORWDX1 DCORIG', [OrderID]); 169 end; 170 182 171 end.
Note:
See TracChangeset
for help on using the changeset viewer.