Procedure

TfrmPtSelOptns.cmdSaveListClick

Module

fPtSelOptns

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public

Owner

TfrmPtSelOptns

Declaration

procedure cmdSaveListClick(Sender: TObject);

Calls Hierarchy


TfrmPtSelOptns.cmdSaveListClick
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 ├SavePtListDflt
 └TfrmPtSelOptns.UpdateDefault
   ├DfltPtList
   └TfrmPtSelOptns.SetDefaultPtList

Called-By Hierarchy


TfrmPtSelOptns.cmdSaveListClick
   TfrmPtSel.cmdSaveListClick┘ 

Calls

Name Declaration Comments
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
SavePtListDflt procedure SavePtListDflt(const x: string); -
TfrmPtSelOptns.UpdateDefault procedure UpdateDefault; -

Called-By

Name Declaration Comments
TfrmPtSel.cmdSaveListClick procedure cmdSaveListClick(Sender: TObject); -


Source

314   procedure TfrmPtSelOptns.cmdSaveListClick(Sender: TObject);
315   var
316     x: string;
317   begin
318     x := '';
319     case FSrcType of
320     TAG_SRC_DFLT: InfoBox(TX_LS_DFLT, TC_LS_FAIL, MB_OK);
321     TAG_SRC_PROV: if cboList.ItemIEN <= 0
322                     then InfoBox(TX_LS_PROV, TC_LS_FAIL, MB_OK)
323                     else x := 'P^' + IntToStr(cboList.ItemIEN) + U + U +
324                               'Provider = ' + cboList.Text;
325     TAG_SRC_TEAM: if cboList.ItemIEN <= 0
326                     then InfoBox(TX_LS_TEAM, TC_LS_FAIL, MB_OK)
327                     else x := 'T^' + IntToStr(cboList.ItemIEN) + U + U +
328                               'Team = ' + cboList.Text;
329     TAG_SRC_SPEC: if cboList.ItemIEN <= 0
330                     then InfoBox(TX_LS_SPEC, TC_LS_FAIL, MB_OK)
331                     else x := 'S^' + IntToStr(cboList.ItemIEN) + U + U +
332                               'Specialty = ' + cboList.Text;
333     TAG_SRC_CLIN: if (cboList.ItemIEN <= 0) or (Pos(';', cboDateRange.ItemID) = 0)
334                     then InfoBox(TX_LS_CLIN, TC_LS_FAIL, MB_OK)
335                     else
336                       begin
337                         clinDefaults := 'Clinic = ' + cboList.Text + ',  ' + cboDaterange.text;
338                         frmPtSelOptSave := TfrmPtSelOptSave.Create(Application); // Calls dialogue form for user input.
339                         frmPtSelOptSave.showModal;
340                         frmPtSelOptSave.free;
341                         if (not clinDoSave) then
342                           Exit;
343                         if clinSaveToday then
344                           x := 'CT^' + IntToStr(cboList.ItemIEN) + U + cboDateRange.ItemID + U +
345                               'Clinic = ' + cboList.Text + ',  ' +  cboDateRange.Text
346                         else
347                           x := 'C^' + IntToStr(cboList.ItemIEN) + U + cboDateRange.ItemID + U +
348                               'Clinic = ' + cboList.Text + ',  ' +  cboDateRange.Text;
349                       end;
350     TAG_SRC_WARD: if cboList.ItemIEN <= 0
351                     then InfoBox(TX_LS_WARD, TC_LS_FAIL, MB_OK)
352                     else x := 'W^' + IntToStr(cboList.ItemIEN) + U + U +
353                               'Ward = ' + cboList.Text;
354     TAG_SRC_ALL : x := 'A';
355     end;
356     if (x <> '') then
357       begin
358         if not (FSrcType = TAG_SRC_CLIN) then // Clinics already have a "confirm" d-box.
359           begin
360             if (InfoBox(TX_LS_SAV1 + Piece(x, U, 4) + TX_LS_SAV2, TC_LS_SAVE, MB_YESNO) = IDYES) then
361               begin
362                 SavePtListDflt(x);
363                 UpdateDefault;
364               end;
365           end
366         else // Skip second confirmation box for clinics.
367           begin
368             SavePtListDflt(x);
369             UpdateDefault;
370           end;
371       end;
372   end;