Procedure

TfrmODProc.cboProcSelect

Module

fODProc

Last Modified

7/15/2014 3:26:34 PM

Visibility

Public/Published

Owner

TfrmODProc

Declaration

procedure cboProcSelect(Sender: TObject);

Calls Hierarchy


TfrmODProc.cboProcSelect
 ├TResponses.Clear
 ├TResponses.SetQuickOrder
 │ ├TResponses.Clear
 │ └LoadResponses
 │   └ExtractToResponses
 │     └ExpandOrderObjects
 │       ├TdmodShared.BoilerplateOK
 │       │ ├ErrCount
 │       │ ├AddErr
 │       │ └TdmodShared.LoadTIUObjects
 │       │   └GetObjectList
 │       └GetTemplateText
 │         └TEncounter.GetVisitStr
 │           └TEncounter.GetVisitCategory
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects...
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 ├GetProcedureServices
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 ├TfrmODProc.InitDialog
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├TfrmODBase.OrderForInpatient
 │ │ ├OrderEventTypeOnCreate
 │ │ └IsPassEvt1
 │ ├TfrmODProc.SetProvDiagPromptingMode
 │ │ ├GetProvDxMode
 │ │ └TfrmODProc.ControlChange
 │ │   ├TResponses.Update...
 │ │   ├TfrmODProc.updateService
 │ │   │ ├TfrmODProc.setup508Label
 │ │   │ └TResponses.Update...
 │ │   └TResponses.GetOrderText
 │ │     ├TResponses.NextInstance
 │ │     ├TResponses.FindResponseByName
 │ │     ├TResponses.FormatResponse
 │ │     │ └TResponses.FindResponseByIEN
 │ │     └TResponses.AppendChildren
 │ │       ├TResponses.FindPromptByIEN
 │ │       ├TResponses.FindResponseByIEN
 │ │       └TResponses.FormatResponse...
 │ └TfrmODProc.ShowPrerequisites
 │   ├GetServicePrerequisites
 │   └DisplayPrerequisites
 │     └CreateReportBox
 │       └TfrmBase508Form.Create
 │         ├TfrmBase508Form.UpdateAccessibilityActions
 │         ├UnfocusableControlEnter
 │         └AdjustControls
 │           ├TfrmBase508Form.ModifyUnfocusableControl
 │           └..(rec)..
 ├TfrmODProc.ShowPrerequisites...
 ├SetTemplateDialogCanceled
 ├WasTemplateDialogCanceled
 ├TfrmODProc.SetupReasonForRequest
 │ ├TfrmODProc.DefaultReasonForRequest
 │ │ ├GetDefaultReasonForRequest
 │ │ ├ExpandOrderObjects...
 │ │ ├WasTemplateDialogCanceled
 │ │ ├TemplateBPHasObjects
 │ │ └FastAssignWith508Msg
 │ │   └SpeakTextInserted
 │ ├ReasonForRequestEditable
 │ ├EnableReason
 │ └DisableReason
 ├TfrmODProc.GetProvDxandValidateCode
 │ ├TResponses.FindResponseByName
 │ └IsActiveICDCode
 │   └IsActiveCode
 ├TfrmODProc.DefaultReasonForRequest...
 ├TfrmODProc.SetProvDiagPromptingMode...
 ├TfrmODBase.OrderMessage
 │ └TfrmODBase.ShowOrderMessage
 ├ConsultMessage
 └TfrmODProc.ControlChange...

Calls

Name Declaration Comments
TResponses.Clear procedure Clear; overload; -
ConsultMessage function ConsultMessage(AnIEN: Integer): string; -
TfrmODProc.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODProc.DefaultReasonForRequest function DefaultReasonForRequest(Service: string; Resolve: Boolean): TStrings; -
GetProcedureServices function GetProcedureServices(ProcIEN: integer): TStrings; -
TfrmODProc.GetProvDxandValidateCode procedure GetProvDxandValidateCode(AResponses: TResponses); -
TfrmODProc.InitDialog procedure InitDialog; override; -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODProc.SetProvDiagPromptingMode procedure SetProvDiagPromptingMode; -
TResponses.SetQuickOrder procedure SetQuickOrder(AnIEN: Integer); -
SetTemplateDialogCanceled procedure SetTemplateDialogCanceled(value: Boolean); -
TfrmODProc.SetupReasonForRequest procedure SetupReasonForRequest(OrderAction: integer); -
TfrmODProc.ShowPrerequisites function ShowPrerequisites: boolean; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -
WasTemplateDialogCanceled function WasTemplateDialogCanceled: Boolean; -


Source

404   procedure TfrmODProc.cboProcSelect(Sender: TObject);
405   begin
406     inherited;
407     with cboProc do
408      begin
409       if ItemIndex = -1 then Exit;
410       if ItemID <> FLastProcID then FLastProcID := ItemID else Exit;
411       Changing := True;
412       if Sender <> Self then Responses.Clear;       // Sender=Self when called from SetupDialog
413       Changing := False;
414       if CharAt(ItemID, 1) = 'Q' then
415        begin
416         Responses.QuickOrder := ExtractInteger(ItemID);
417         Responses.SetControl(cboProc, 'ORDERABLE', 1);
418         FLastProcID := ItemID;
419        end; 
420       with cboService do
421         begin
422           Clear;
423           FastAssign(GetProcedureServices(cboProc.ItemIEN), cboService.Items);
424           if Items.Count > 1 then
425             ItemIndex := -1
426           else if Items.Count = 1 then
427             begin
428               ItemIndex := 0 ;
429               Responses.Update('SERVICE', 1, ItemID, Text);
430             end
431           else
432             begin
433               if Sender = Self then    // Sender=Self when called from SetupDialog
434                 InfoBox('There are no services defined for this procedure.',
435                 'Information', MB_OK or MB_ICONINFORMATION);
436               cboProc.ItemIndex := -1;
437               InitDialog;
438               Exit ;
439             end;
440         end;
441      end;
442     with Responses do if QuickOrder > 0 then
443       begin
444         SetControl(cboProc,       'ORDERABLE', 1);
445         Changing := True;
446         with cboService do
447           begin
448             FastAssign(GetProcedureServices(cboProc.ItemIEN), cboService.Items);
449             if Items.Count > 1 then
450               ItemIndex := -1
451             else if Items.Count = 1 then
452               ItemIndex := 0 ;
453           end;
454         if not ShowPrerequisites then
455           begin
456             Close;
457             Exit;
458           end;
459         SetControl(cboCategory,   'CLASS',      1);
460         if cboCategory.ItemID = 'I' then radInpatient.Checked := True
461         else radOutpatient.Checked := True ;
462         SetControl(cboUrgency,    'URGENCY',     1);
463         SetControl(cboPlace,      'PLACE',     1);
464         SetControl(txtAttn,       'PROVIDER',  1);
465         SetControl(calEarliest,   'EARLIEST',  1);
466         SetTemplateDialogCanceled(FALSE);
467         SetControl(memReason,     'COMMENT',   1);
468         if WasTemplateDialogCanceled and OrderContainsObjects then
469         begin
470           AbortOrder := TRUE;
471           Close;
472           Exit;
473         end;
474         SetupReasonForRequest(ORDER_QUICK);
475         GetProvDxandValidateCode(Responses);
476         SetControl(cboService,    'SERVICE',   1);
477         cboProc.Enabled := False;
478         cboProc.Font.Color := clGrayText;
479         if cboService.ItemIndex > -1 then
480           begin
481             cboService.Enabled := False;
482             cboService.Font.Color := clGrayText;
483           end
484         else
485           begin
486             cboService.Enabled := True;
487             cboService.Font.Color := clWindowText;
488           end;
489         Changing := False;
490       end
491     else
492       begin
493         if cboProc.ItemIEN > 0 then
494           begin
495             if cboService.ItemIndex > -1 then
496               begin
497                 cboService.Enabled := False;
498                 cboService.Font.Color := clGrayText;
499               end
500             else
501               begin
502                 cboService.Enabled := True;
503                 cboService.Font.Color := clWindowText;
504               end;
505             if not ShowPrerequisites then
506               begin
507                 Close;
508                 Exit;
509               end;
510             FastAssign(DefaultReasonForRequest(Piece(cboProc.Items[cboProc.ItemIndex], U, 4), True), memReason.Lines);
511             SetupReasonForRequest(ORDER_NEW);
512           end;
513       end;
514     SetProvDiagPromptingMode;
515     OrderMessage(ConsultMessage(cboProc.ItemIEN));
516     ControlChange(Self) ;
517   end;