Procedure

SelectNoteForProcessing

Module

fCsltNote

Last Modified

7/15/2014 3:26:34 PM

Comments

Displays progress note selection form and returns a record of the selection

Scope

Interfaced

Declaration

procedure SelectNoteForProcessing(FontSize: Integer; ActionType: integer; NoteList: TStrings;
           var NoteIEN: integer; CPStatus: integer) ;

Calls Hierarchy


SelectNoteForProcessing
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 └MakeConsultNoteDisplayText

Called-By Hierarchy


           SelectNoteForProcessing
TfrmConsults.mnuActCompleteClick┘ 

Calls

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

Called-By

Name Declaration Comments
TfrmConsults.mnuActCompleteClick procedure mnuActCompleteClick(Sender: TObject); -


Source

35    procedure SelectNoteForProcessing(FontSize: Integer; ActionType: integer; NoteList: TStrings;
36               var NoteIEN: integer; CPStatus: integer) ;
37    { displays progress note selection form and returns a record of the selection }
38    var
39      frmCsltNote: TfrmCsltNote;
40      W, H, i: Integer;
41    begin
42      frmCsltNote := TfrmCsltNote.Create(Application);
43      try
44        with frmCsltNote do
45        begin
46          Font.Size := FontSize;
47          W := ClientWidth;
48          H := ClientHeight;
49          ResizeToFont(FontSize, W, H);
50          ClientWidth  := W; pnlBase.Width  := W;
51          ClientHeight := H; pnlBase.Height := H;
52          FChanged := False;
53          Caption := fConsults.ActionType[ActionType];
54          case ActionType of
55            CN_ACT_CP_COMPLETE:
56              begin
57                if CPStatus = CP_INSTR_INCOMPLETE then
58                  begin
59                    lblAction.Caption := 'Interpret Clinical Procedure Results:';
60                    cboCsltNote.Caption := lblAction.Caption;
61                    for i := 0 to NoteList.Count-1 do
62                      if ((not (Copy(Piece(Piece(NoteList[i], U, 1), ';', 2), 1, 4) = 'MCAR')) and
63                         (Piece(NoteList[i], U, 13) <> '%') and
64                         (Piece(NoteList[i], U, 7)  <> 'completed')) then
65                           cboCsltNote.Items.Add(Piece(NoteList[i], U, 1) + U + MakeConsultNoteDisplayText(Notelist[i]));
66                    cboCsltNote.ItemIndex := 0;
67                    FNoteIEN := cboCsltNote.ItemID;
68                    //ShowModal;
69                  end
70                else if CPStatus in [CP_NO_INSTRUMENT, CP_INSTR_COMPLETE] then
71                  begin
72                    lblAction.Caption := 'Select incomplete note to continue with:';
73                    cboCsltNote.Caption := lblAction.Caption;
74                    for i := 0 to NoteList.Count-1 do
75                      if ((not (Copy(Piece(Piece(NoteList[i], U, 1), ';', 2), 1, 4) = 'MCAR')) and
76                         (Piece(NoteList[i], U, 7)  <> 'completed') and
77                         ((Piece(Piece(NoteList[i], U, 5), ';', 1) = IntToStr(User.DUZ)) or
78                         (Piece(Piece(NoteList[i], U, 5), ';', 1) = '0')))  then
79                        cboCsltNote.Items.Add(Piece(NoteList[i], U, 1) + U + MakeConsultNoteDisplayText(Notelist[i]));
80                    if cboCsltNote.Items.Count > 0 then cboCsltNote.Items.Insert(0, CN_NEW_CP_NOTE + '^<Create new note>');
81                    if cboCsltNote.Items.Count > 0 then
82                      ShowModal
83                    else
84                      FNoteIEN := CN_NEW_CP_NOTE;
85                  end;
86              end;
87            CN_ACT_COMPLETE:
88              begin
89                lblAction.Caption := 'Select incomplete note to continue with:';
90                cboCsltNote.Caption := lblAction.Caption;
91                for i := 0 to NoteList.Count-1 do
92                  if ((not (Copy(Piece(Piece(NoteList[i], U, 1), ';', 2), 1, 4) = 'MCAR')) and
93                     (Piece(NoteList[i], U, 7)  <> 'completed') and
94                     (Piece(Piece(NoteList[i], U, 5), ';', 1) = IntToStr(User.DUZ)))  then
95                    cboCsltNote.Items.Add(Piece(NoteList[i], U, 1) + U + MakeConsultNoteDisplayText(Notelist[i]));
96                if cboCsltNote.Items.Count > 0 then cboCsltNote.Items.Insert(0, CN_NEW_CSLT_NOTE + '^<Create new note>');
97                if cboCsltNote.Items.Count > 0 then
98                  ShowModal
99                else
100                 FNoteIEN := CN_NEW_CSLT_NOTE;
101             end;
102   (*      CN_ACT_ADDENDUM:     //  no longer called in v15
103             begin
104               lblAction.Caption := 'Select completed note to addend to:';
105               for i := 0 to NoteList.Count-1 do
106                 begin
107                   if Copy(Piece(NoteList[i], U, 2), 1, 8) = 'Addendum' then continue;
108                   if Piece(NoteList[i], U, 13) = '%' then continue;
109                   cboCsltNote.Items.Add(Piece(NoteList[i], U, 1) + U + MakeConsultNoteDisplayText(Notelist[i]));
110                 end;
111               if cboCsltNote.Items.Count > 0 then
112                 ShowModal
113               else
114                 FNoteIEN := '-30';
115             end;*)
116         end; {case}
117   
118         NoteIEN:= StrToIntDef(FNoteIEN, -1) ;
119       end; {with frmCsltNote}
120     finally
121       frmCsltNote.Release;
122     end;
123   end;