source: cprs/branches/tmg-cprs/CPRS-Chart/fPrintList.pas@ 454

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

Initial upload of TMG-CPRS 1.0.26.69

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