source: cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fOCAccept.pas@ 1703

Last change on this file since 1703 was 1693, checked in by healthsevak, 10 years ago

Committing the files for first time to this new branch

File size: 2.6 KB
RevLine 
[456]1unit fOCAccept;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
[1693]7 fAutoSz, StdCtrls, ComCtrls, ORFn, ExtCtrls, VA508AccessibilityManager, rOrders, fOCMonograph;
[456]8
9type
10 TfrmOCAccept = class(TfrmAutoSz)
11 memChecks: TRichEdit;
12 pnlBottom: TPanel;
13 cmdAccept: TButton;
14 cmdCancel: TButton;
[1693]15 Button1: TButton;
16 procedure Button1Click(Sender: TObject);
17 procedure cmdCancelClick(Sender: TObject);
18 procedure FormResize(Sender: TObject);
[456]19 private
20 { Private declarations }
21 public
22 { Public declarations }
23 end;
24
25function AcceptOrderWithChecks(OCList: TStringList): Boolean;
26
27implementation
28
29{$R *.DFM}
30
31function AcceptOrderWithChecks(OCList: TStringList): Boolean;
32var
[1693]33 i,j: Integer;
[456]34 frmOCAccept: TfrmOCAccept;
[1693]35 substring: String;
36 remOC: TStringList;
37begin
38 remOC := TStringList.Create;
[456]39 Result := True;
40 if OCList.Count > 0 then
41 begin
42 frmOCAccept := TfrmOCAccept.Create(Application);
43 try
44 ResizeFormToFont(TForm(frmOCAccept));
[1693]45 frmOCAccept.Button1.Enabled := false;
46 if IsMonograph then frmOCAccept.Button1.Enabled := true;
47
[456]48 for i := 0 to OCList.Count - 1 do
49 begin
[1693]50 substring := Copy(Piece(OCList[i], U, 4),0,2);
51 if substring='||' then
52 begin
53 substring := Copy(Piece(OCList[i], U, 4),3,Length(Piece(OCList[i], U, 4)));
54 GetXtraTxt(remOC,Piece(substring,'&',1),Piece(substring,'&',2));
55 frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(substring,'&',2));
56 for j:= 0 to remOC.Count - 1 do frmOCAccept.memChecks.Lines.Add(' '+remOC[j]);
57 frmOCAccept.memChecks.Lines.Add(' ');
58 end
59 else
60 begin
61 frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(OCList[i], U, 4));
62 end;
63
[456]64 frmOCAccept.memChecks.Lines.Add('');
65 end;
66 frmOCAccept.memChecks.SelStart := 0;
67 frmOCAccept.memChecks.SelLength := 0;
68 Result := frmOCAccept.ShowModal = mrYes;
69 finally
70 frmOCAccept.Release;
[1693]71 remOC.Destroy;
[456]72 end;
73 end;
74end;
75
[1693]76procedure TfrmOCAccept.Button1Click(Sender: TObject);
77var
78 monoList: TStringList;
79begin
80 inherited;
81 monoList := TStringList.Create;
82 GetMonographList(monoList);
83 ShowMonographs(monoList);
84 monoList.Free;
85end;
86
87procedure TfrmOCAccept.cmdCancelClick(Sender: TObject);
88begin
89 inherited;
90 DeleteMonograph;
91end;
92
93procedure TfrmOCAccept.FormResize(Sender: TObject);
94begin
95 inherited;
96 memChecks.Refresh;
97end;
98
[456]99end.
Note: See TracBrowser for help on using the repository browser.