source: cprs/trunk/CPRS-Chart/fPrintList.pas

Last change on this file was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 3.9 KB
Line 
1unit fPrintList;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, fAutoSz, StdCtrls, ORCtrls, fConsult513Prt, VA508AccessibilityManager;
8
9type
10 TfrmPrintList = class(TfrmAutoSz)
11 lbIDParents: TORListBox;
12 cmdOK: TButton;
13 cmdCancel: TButton;
14 lblListName: TLabel;
15 procedure FormCreate(Sender: TObject);
16 procedure cmdCancelClick(Sender: TObject);
17 procedure cmdOKClick(Sender: TObject);
18
19 private
20 { Private declarations }
21 FParentNode: string;
22 public
23 { Public declarations }
24 function SelectParentFromList(ATree: TORTreeView; PageID: Integer): string;
25 end;
26
27var
28 frmPrintList: TfrmPrintList;
29 HLDPageID: Integer;
30
31implementation
32
33{$R *.dfm}
34uses
35 uTIU, rTIU, uConst, fNotes, fNotePrt, ORFn, fConsults, fDCSumm, fFrame;
36
37procedure TfrmPrintList.FormCreate(Sender: TObject);
38begin
39 inherited;
40 FParentNode := '';
41end;
42
43procedure TfrmPrintList.cmdCancelClick(Sender: TObject);
44begin
45 inherited;
46 FParentNode := '';
47 Close;
48end;
49
50procedure TfrmPrintList.cmdOKClick(Sender: TObject);
51begin
52 inherited;
53 case HLDPageID of
54 CT_NOTES: frmNotes.RequestMultiplePrint(Self);
55 CT_CONSULTS: frmConsults.RequestMultiplePrint(Self);
56 CT_DCSUMM: frmDCSumm.RequestMultiplePrint(Self);
57 end; {case}
58 FParentNode := lbIDParents.ItemID;
59 Close;
60end;
61
62function TfrmPrintList.SelectParentFromList(ATree: TORTreeView; PageID: Integer): string;
63var
64 frmPrintList: TfrmPrintList;
65 i, AnImg: integer;
66 x: string;
67 tmpList: TStringList;
68 //strObj: TStringList;
69begin
70 HLDPageID := PageID;
71 frmPrintList := TfrmPrintList.Create(Application);
72 frmPrintList.Parent := Self;
73 tmpList := TStringList.Create;
74 try
75 ResizeFormToFont(TForm(frmPrintList));
76 for i := 0 to ATree.Items.Count - 1 do
77 begin
78 AnImg := TORTreeNode(ATree.Items.Item[i]).ImageIndex;
79 if AnImg in [IMG_SINGLE, IMG_PARENT,IMG_IDNOTE_SHUT, IMG_IDNOTE_OPEN,
80 IMG_IDPAR_ADDENDA_SHUT, IMG_IDPAR_ADDENDA_OPEN] then
81 begin
82 x := TORTreeNode(ATree.Items.Item[i]).Stringdata;
83 tmpList.Add(x);
84 //strObj := TStringList.Create;
85 //strObj.Insert(0,x);
86 //tmpList.AddObject(x, strObj) // notes and dc/summs & Consults
87 end; {if}
88 end; {for}
89
90 frmPrintList.lbIDParents.Sorted := FALSE;
91
92 case PageID of
93 CT_NOTES:
94 begin
95 SortByPiece(tmpList, U, 3);
96 InvertStringList(tmpList);
97 for i := 0 to tmpList.Count - 1 do
98 begin
99 x := tmpList[i];
100 tmpList[i] := Piece(x, U, 1) + U + (MakeNoteDisplayText(x));
101 end;
102 frmPrintList.lblListName.Caption := 'Select Notes to be printed.';
103 end;
104 CT_CONSULTS:
105 begin
106 SortByPiece(tmpList, U, 11);
107 InvertStringList(tmpList);
108 for i := 0 to tmpList.Count - 1 do
109 begin
110 x := tmpList[i];
111 tmpList[i] := Piece(x, U, 1) + U + (MakeConsultDisplayText(x));
112 end;
113 frmPrintList.lblListName.Caption := 'Select Consults to be printed.';
114 end;
115 CT_DCSUMM:
116 begin
117 SortByPiece(tmpList, U, 3);
118 InvertStringList(tmpList);
119 for i := 0 to tmpList.Count - 1 do
120 begin
121 x := tmpList[i];
122 tmpList[i] := Piece(x, U, 1) + U + (MakeNoteDisplayText(x));
123 end;
124 frmPrintList.lblListName.Caption := 'Select Discharge Summaries to be printed.';
125 end;
126 end; //case
127
128 FastAssign(tmpList, frmPrintList.lbIDParents.Items);
129 frmPrintList.ShowModal;
130 Result := frmPrintList.FParentNode;
131 finally
132 tmpList.Free;
133 frmPrintList.Release;
134 end;
135end;
136
137end.
Note: See TracBrowser for help on using the repository browser.