Procedure

TfrmODCslt.treServiceChange

Module

fODConsult

Last Modified

7/15/2014 3:26:34 PM

Visibility

Public/Published

Owner

TfrmODCslt

Declaration

procedure treServiceChange(Sender: TObject; Node: TTreeNode);

Calls Hierarchy


TfrmODCslt.treServiceChange
 ├TfrmODBase.OrderMessage
 │ └TfrmODBase.ShowOrderMessage
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 ├TResponses.Clear
 ├TResponses.SetQuickOrder
 │ ├TResponses.Clear
 │ └LoadResponses
 │   └ExtractToResponses
 │     └ExpandOrderObjects
 │       ├TdmodShared.BoilerplateOK
 │       │ ├ErrCount
 │       │ ├AddErr
 │       │ └TdmodShared.LoadTIUObjects
 │       │   └GetObjectList
 │       └GetTemplateText
 │         └TEncounter.GetVisitStr
 │           └TEncounter.GetVisitCategory
 ├TResponses.FindResponseByName
 ├TfrmODCslt.setup508Label
 ├TfrmODCslt.ShowPrerequisites
 │ ├GetServicePrerequisites
 │ └DisplayPrerequisites
 │   └CreateReportBox
 │     └TfrmBase508Form.Create
 │       ├TfrmBase508Form.UpdateAccessibilityActions
 │       ├UnfocusableControlEnter
 │       └AdjustControls
 │         ├TfrmBase508Form.ModifyUnfocusableControl
 │         └..(rec)..
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects...
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 ├SetTemplateDialogCanceled
 ├WasTemplateDialogCanceled
 ├TfrmODCslt.DefaultReasonForRequest
 │ ├GetDefaultReasonForRequest
 │ ├ExpandOrderObjects...
 │ ├WasTemplateDialogCanceled
 │ ├TemplateBPHasObjects
 │ └FastAssignWith508Msg
 │   └SpeakTextInserted
 ├TfrmODCslt.SetupReasonForRequest
 │ ├TfrmODCslt.DefaultReasonForRequest...
 │ ├ReasonForRequestEditable
 │ ├EnableReason
 │ └DisableReason
 ├TfrmODCslt.GetProvDxandValidateCode
 │ ├TResponses.FindResponseByName
 │ ├IsActiveICDCode
 │ │ └IsActiveCode
 │ └TfrmODCslt.SetUpCopyConsultDiagnoses
 │   ├IsOrderBillable
 │   │ └PrepOrderID
 │   └rpcRetrieveSelectedOrderInfo
 ├TfrmODCslt.SetProvDiagPromptingMode
 │ ├GetProvDxMode
 │ └TfrmODCslt.ControlChange
 │   ├TResponses.Update...
 │   └TResponses.GetOrderText
 │     ├TResponses.NextInstance
 │     ├TResponses.FindResponseByName
 │     ├TResponses.FormatResponse
 │     │ └TResponses.FindResponseByIEN
 │     └TResponses.AppendChildren
 │       ├TResponses.FindPromptByIEN
 │       ├TResponses.FindResponseByIEN
 │       └TResponses.FormatResponse...
 ├TfrmODCslt.SetUpEarliestDate
 │ ├IsProstheticsService
 │ └TResponses.Update...
 ├ConsultMessage
 └TfrmODCslt.ControlChange...

Called-By Hierarchy


   TfrmODCslt.treServiceChange
TfrmODCslt.treServiceKeyDown┘ 

Calls

Name Declaration Comments
TResponses.Clear procedure Clear; overload; -
ConsultMessage function ConsultMessage(AnIEN: Integer): string; -
TfrmODCslt.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODCslt.DefaultReasonForRequest function DefaultReasonForRequest(Service: string; Resolve: Boolean): TStrings; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TfrmODCslt.GetProvDxandValidateCode procedure GetProvDxandValidateCode(AResponses: TResponses); -
TfrmODBase.OrderMessage procedure OrderMessage(const AMessage: string); -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -
TfrmODCslt.SetProvDiagPromptingMode procedure SetProvDiagPromptingMode; -
TResponses.SetQuickOrder procedure SetQuickOrder(AnIEN: Integer); -
SetTemplateDialogCanceled procedure SetTemplateDialogCanceled(value: Boolean); -
TfrmODCslt.setup508Label procedure setup508Label(lbl: TVA508StaticText; ctrl: TORComboBox); -
TfrmODCslt.SetUpEarliestDate procedure SetUpEarliestDate; -
TfrmODCslt.SetupReasonForRequest procedure SetupReasonForRequest(OrderAction: integer); -
TfrmODCslt.ShowPrerequisites function ShowPrerequisites: boolean; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -
WasTemplateDialogCanceled function WasTemplateDialogCanceled: Boolean; -

Called-By

Name Declaration Comments
TfrmODCslt.treServiceKeyDown procedure treServiceKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -


Source

538   procedure TfrmODCslt.treServiceChange(Sender: TObject; Node: TTreeNode);
539   var
540     i: integer;
541     tmpSvc: string;
542   begin
543     inherited;
544     pnlMessage.Visible := False;
545     if Changing or (treService.Selected = nil)
546        or FKeyBoarding or FcboServiceKeyDownStopClick then exit;
547     Changing := True;
548     with cboService do
549      begin
550       if treService.Selected <> nil then
551         begin
552           if (TORTreeNode(treService.Selected).StringData <> '') and
553              (Piece(TORTreeNode(treService.Selected).StringData, U, 5) <> '1') then
554             cboService.ItemIndex := cboService.Items.IndexOf(Trim(Piece(TORTreeNode(treService.Selected).StringData, U, 2)))
555             //cboService.SelectByID(Piece(string(treService.Selected.Data), U, 1))
556           else
557             begin
558               pnlMessage.TabOrder := treService.TabOrder + 1;
559               OrderMessage(TX_GROUPER);
560               cboService.ItemIndex := -1;
561               Changing := False;
562               Exit;
563             end;
564         end
565       else
566         ItemIndex := -1;
567   (*    if (treService.Selected.Data <> nil) then
568         SelectByID(Piece(string(treService.Selected.Data), U, 1))
569       else
570         ItemIndex := -1;*)
571       Changing := False;
572       if ItemIndex < 0 then exit;
573       if Piece(Items[ItemIndex],U,5) = '1' then
574         begin
575           Responses.Update('ORDERABLE', 1, '', '');
576           memOrder.Clear;
577           cboService.ItemIndex := -1;
578           FLastServiceID := '';
579           Changing := True;
580           treService.Selected := nil;
581           Changing := False;
582           pnlMessage.TabOrder := treService.TabOrder + 1;
583           OrderMessage(TX_GROUPER);
584           Exit;
585         end;
586       treService.Visible := False;
587       memReason.Clear;
588       if ItemID <> FLastServiceID then FLastServiceID := ItemID else Exit;
589       Changing := True;
590       if Sender <> Self then
591         Responses.Clear;       // Sender=Self when called from SetupDialog
592       Changing := False;
593       if CharAt(ItemID, 1) = 'Q' then
594         begin
595           Changing := True;
596           consultQuickOrder := True;   
597           Responses.QuickOrder := ExtractInteger(ItemID);
598           tmpSvc := TResponse(Responses.FindResponseByName('ORDERABLE',1)).IValue;
599           with treService do for i := 0 to Items.Count-1 do
600             begin
601               if Piece(TORTreeNode(Items[i]).StringData, U, 6) = tmpSvc then
602                 begin
603                   Selected := Items[i];
604                   break;
605                 end;
606             end;
607           if treService.Selected <> nil then
608             begin
609               if (TORTreeNode(treService.Selected).StringData <> '') and
610                  (Piece(TORTreeNode(treService.Selected).StringData, U, 5) <> '1') then
611                    cboService.ItemIndex := cboService.Items.IndexOf(Trim(Piece(TORTreeNode(treService.Selected).StringData, U, 2)))
612                 //cboService.SelectByID(Piece(string(treService.Selected.Data), U, 1))
613               else
614                 cboService.ItemIndex := -1;
615             end
616           else
617             cboService.ItemIndex := -1;
618           FLastServiceID := ItemID;
619           cboService.Enabled := False;
620           setup508Label(servicelbl508, cboService);
621           cboService.Font.Color := clGrayText;
622           btnServiceTree.Enabled := False;
623           pnlServiceTreeButton.Enabled := False;
624           Changing := False;
625         end;
626      end;
627     with Responses do if QuickOrder > 0 then
628       begin
629         tmpSvc := TResponse(Responses.FindResponseByName('ORDERABLE',1)).IValue;
630         with treService do for i := 0 to Items.Count-1 do
631           begin
632             if Piece(TORTreeNode(Items[i]).StringData, U, 6) = tmpSvc then
633               begin
634                 Selected := Items[i];
635                 break;
636               end;
637           end;
638         if treService.Selected <> nil then
639           begin
640             if (TORTreeNode(treService.Selected).StringData <> '') and
641                (Piece(TORTreeNode(treService.Selected).StringData, U, 5) <> '1') then
642                   cboService.ItemIndex := cboService.Items.IndexOf(Trim(Piece(TORTreeNode(treService.Selected).StringData, U, 2)))
643               //cboService.SelectByID(Piece(string(treService.Selected.Data), U, 1))
644             else
645               cboService.ItemIndex := -1;
646           end
647         else
648           cboService.ItemIndex := -1;
649         Changing := True;
650         if not ShowPrerequisites then
651           begin
652             Close;
653             Exit;
654           end;
655         SetControl(cboCategory,   'CLASS',      1);
656         if cboCategory.ItemID = 'I' then radInpatient.Checked := True
657         else radOutpatient.Checked := True ;
658         SetControl(cboUrgency,    'URGENCY',     1);
659         SetControl(cboPlace,      'PLACE',     1);
660         SetControl(txtAttn,       'PROVIDER',  1);
661         SetControl(calEarliest,   'EARLIEST',  1);
662         SetTemplateDialogCanceled(FALSE);
663         SetControl(memReason,     'COMMENT',   1);
664         if WasTemplateDialogCanceled and OrderContainsObjects then
665         begin
666           AbortOrder := TRUE;
667   		SetTemplateDialogCanceled(FALSE);
668           Close;
669           Exit;
670         end;
671         if ((cboService.ItemIEN > 0) and (Length(memReason.Text) = 0)) then
672           QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason);
673         SetupReasonForRequest(ORDER_QUICK);
674         GetProvDxandValidateCode(Responses);
675         Changing := False;
676       end
677     else
678       begin
679         if cboService.ItemIEN > 0 then
680           begin
681             if not ShowPrerequisites then
682               begin
683                 Close;
684                 Exit;
685               end;
686             QuickCopy(DefaultReasonForRequest(cboService.ItemID, True), memReason);
687             SetupReasonForRequest(ORDER_NEW);
688           end;
689       end;
690     SetProvDiagPromptingMode;
691     SetUpEarliestDate; //wat v28
692     tmpSvc := Piece(cboService.Items[cboService.ItemIndex], U, 6);
693     pnlMessage.TabOrder := treService.TabOrder + 1;
694     OrderMessage(ConsultMessage(StrToIntDef(tmpSvc, 0)));
695     //OrderMessage(ConsultMessage(cboService.ItemIEN));
696     ControlChange(Self) ;
697   end;