Function

TfrmPrintList.SelectParentFromList

Module

fPrintList

Last Modified

7/15/2014 3:26:38 PM

Comments

Public declarations
strObj: TStringList;

Visibility

Public

Owner

TfrmPrintList

Declaration

function SelectParentFromList(ATree: TORTreeView; PageID: Integer): string;

Calls Hierarchy


TfrmPrintList.SelectParentFromList
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 ├MakeNoteDisplayText
 └MakeConsultDisplayText

Called-By Hierarchy


          TfrmPrintList.SelectParentFromList
                TfrmDCSumm.LstSummsToPrint┤ 
TfrmFrame.mnuFilePrintSelectedItemsClick┘ │ 
           TfrmConsults.LstConsultsToPrint┤ 
TfrmFrame.mnuFilePrintSelectedItemsClick┘ │ 
                 TfrmNotes.LstNotesToPrint┘ 
TfrmFrame.mnuFilePrintSelectedItemsClick┘   

Calls

Name Declaration Comments
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
MakeConsultDisplayText function MakeConsultDisplayText(RawText:string): string; -
MakeNoteDisplayText function MakeNoteDisplayText(RawText: string): string; -

Called-By

Name Declaration Comments
TfrmConsults.LstConsultsToPrint procedure LstConsultsToPrint; -
TfrmNotes.LstNotesToPrint procedure LstNotesToPrint; -
TfrmDCSumm.LstSummsToPrint procedure LstSummsToPrint; -


Source

62    function TfrmPrintList.SelectParentFromList(ATree: TORTreeView; PageID: Integer): string;
63    var
64      frmPrintList: TfrmPrintList;
65      i, AnImg: integer;
66      x: string;
67      tmpList: TStringList;
68      //strObj: TStringList;
69    begin
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;
135   end;