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

Last change on this file since 773 was 456, checked in by Kevin Toppenberg, 16 years ago

Initial Upload of Official WV CPRS 1.0.26.76

File size: 3.8 KB
Line 
1unit fPrintList;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, fAutoSz, StdCtrls, ORCtrls, fConsult513Prt;
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 strObj := TStringList.Create;
84 strObj.Insert(0,x);
85 tmpList.AddObject(x, strObj) // notes and dc/summs & Consults
86 end; {if}
87 end; {for}
88
89 frmPrintList.lbIDParents.Sorted := FALSE;
90
91 case PageID of
92 CT_NOTES:
93 begin
94 SortByPiece(tmpList, U, 3);
95 InvertStringList(tmpList);
96 for i := 0 to tmpList.Count - 1 do
97 begin
98 x := tmpList[i];
99 tmpList[i] := (MakeNoteDisplayText(x));
100 end;
101 frmPrintList.lblListName.Caption := 'Select Notes to be printed.';
102 end;
103 CT_CONSULTS:
104 begin
105 SortByPiece(tmpList, U, 11);
106 InvertStringList(tmpList);
107 for i := 0 to tmpList.Count - 1 do
108 begin
109 x := tmpList[i];
110 tmpList[i] := (MakeConsultDisplayText(x));
111 end;
112 frmPrintList.lblListName.Caption := 'Select Consults to be printed.';
113 end;
114 CT_DCSUMM:
115 begin
116 SortByPiece(tmpList, U, 3);
117 InvertStringList(tmpList);
118 for i := 0 to tmpList.Count - 1 do
119 begin
120 x := tmpList[i];
121 tmpList[i] := (MakeNoteDisplayText(x));
122 end;
123 frmPrintList.lblListName.Caption := 'Select Discharge Summaries to be printed.';
124 end;
125 end; //case
126
127 frmPrintList.lbIDParents.Items.Assign(tmpList);
128 frmPrintList.ShowModal;
129 Result := frmPrintList.FParentNode;
130 finally
131 tmpList.Free;
132 frmPrintList.Release;
133 end;
134end;
135
136end.
Note: See TracBrowser for help on using the repository browser.