Procedure

TfrmODMedNVA.btnSelectClick

Module

fODMedNVA

Last Modified

7/15/2014 3:26:42 PM

Comments

Medication is now selected ---------------------------------------------------------------- 

MedName: string;

Visibility

Public/Published

Owner

TfrmODMedNVA

Declaration

procedure btnSelectClick(Sender: TObject);

Calls Hierarchy


TfrmODMedNVA.btnSelectClick
 ├TfrmODMedNVA.ResetOnMedChange
 │ ├ResetControl
 │ └TResponses.Clear
 ├TResponses.SetQuickOrder
 │ ├TResponses.Clear
 │ └LoadResponses
 │   └ExtractToResponses
 │     └ExpandOrderObjects
 │       ├TdmodShared.BoilerplateOK
 │       │ ├ErrCount
 │       │ ├AddErr
 │       │ └TdmodShared.LoadTIUObjects
 │       │   └GetObjectList
 │       └GetTemplateText
 │         └TEncounter.GetVisitStr
 │           └TEncounter.GetVisitCategory
 ├TResponses.IValueFor
 ├IsActivateOI
 ├TfrmODMedNVA.SetOnMedSelect
 │ ├GetPKISite
 │ ├TCtrlInits.LoadOrderItem
 │ │ ├TCtrlInits.ClearOI
 │ │ └TCtrlInits.ExtractInits
 │ │   └TCtrlInit.Create
 │ ├OIForNVA
 │ ├TCtrlInits.SetControl
 │ │ ├ClearControl
 │ │ └TCtrlInits.FindInitByName
 │ ├TfrmODMedNVA.cboRouteChange
 │ │ └TfrmODMedNVA.ControlChange
 │ │   ├TResponses.Clear
 │ │   ├TResponses.Update
 │ │   │ ├TResponses.FindResponseByName
 │ │   │ └TResponses.IENForPrompt
 │ │   ├TfrmODMedNVA.FindCommonDrug
 │ │   │ ├TfrmODMedNVA.FindDoseFields
 │ │   │ ├SaveDrug
 │ │   │ └KillDrug
 │ │   ├TfrmODMedNVA.ConstructedDoseFields
 │ │   ├TfrmODMedNVA.ValueOf
 │ │   │ ├GetSchedule
 │ │   │ └GetScheduleEX
 │ │   ├TfrmODMedNVA.OutpatientSig
 │ │   │ ├TfrmODMedNVA.ValueOf...
 │ │   │ └TfrmODMedNVA.CheckDecimal
 │ │   └TResponses.GetOrderText
 │ │     ├TResponses.NextInstance
 │ │     ├TResponses.FindResponseByName
 │ │     ├TResponses.FormatResponse
 │ │     │ └TResponses.FindResponseByIEN
 │ │     └TResponses.AppendChildren
 │ │       ├TResponses.FindPromptByIEN
 │ │       ├TResponses.FindResponseByIEN
 │ │       └TResponses.FormatResponse...
 │ ├TCtrlInits.DefaultText
 │ │ └TCtrlInits.FindInitByName
 │ ├TfrmODMedNVA.ValueOf...
 │ └TCtrlInits.TextOf
 │   └TCtrlInits.FindInitByName
 ├TfrmODMedNVA.SetOnQuickOrder
 │ ├TResponses.InstanceCount
 │ ├TResponses.NextInstance
 │ ├TfrmODMedNVA.SetDosage
 │ ├TResponses.IValueFor
 │ ├TResponses.SetControl
 │ │ ├TResponses.FindResponseByName
 │ │ └AssignBPText
 │ │   ├DisplayGroupToLinkType
 │ │   │ └DisplayGroupByName
 │ │   ├TResponses.EValueFor
 │ │   ├GetServiceIEN
 │ │   ├TResponses.IValueFor
 │ │   ├GetProcedureIEN
 │ │   ├ExpandOrderObjects...
 │ │   ├SetTemplateDialogCanceled
 │ │   ├CheckBoilerplate4Fields
 │ │   ├ExecuteTemplateOrBoilerPlate
 │ │   └WasTemplateDialogCanceled
 │ ├TfrmODMedNVA.SetSchedule
 │ ├TfrmODMedNVA.ValueOf...
 │ ├QuantityMessage
 │ ├TfrmODMedNVA.SetStartDate
 │ ├TResponses.EValueFor
 │ ├TfrmODMedNVA.SetStatements
 │ │ └TfrmODMedNVA.SearchStatements
 │ ├QOHasRouteDefined
 │ ├GetPickupForLocation
 │ ├TResponses.FindResponseByName
 │ ├NameOfDGroup
 │ │ └LoadDGroupMap
 │ ├TfrmODMedNVA.ValueOfResponse
 │ │ └TResponses.IValueFor
 │ └TfrmODMedNVA.UpdateStartExpires
 │   ├LoadAdminInfo
 │   └FMToday
 │     └FMNow
 ├TfrmODMedNVA.ShowMedFields
 │ └TfrmODMedNVA.ShowControlsSimple
 ├TfrmODMedNVA.UpdateRelated
 │ └TfrmODMedNVA.timCheckChangesTimer
 │   ├TfrmODMedNVA.ControlChange...
 │   ├TResponses.NextInstance
 │   ├TfrmODMedNVA.ValueOfResponse...
 │   ├TfrmODMedNVA.ValueOf...
 │   └TfrmODMedNVA.UpdateStartExpires...
 ├TfrmODMedNVA.ControlChange...
 └TfrmODMedNVA.ShowMedSelect
   └TfrmODMedNVA.ChangeDelayed
     ├TfrmODMedNVA.FindQuickOrder
     ├IndexOfOrderable
     ├TfrmODMedNVA.isUniqueQuickOrder
     └TfrmODMedNVA.ScrollToVisible

Called-By Hierarchy


TfrmODMedNVA.btnSelectClick
TfrmODMedNVA.UMDelayClick┘ 

Calls

Name Declaration Comments
TfrmODMedNVA.ControlChange procedure ControlChange(Sender: TObject); -
IsActivateOI procedure IsActivateOI(var AMsg: string; theOI: integer); -
TResponses.IValueFor function IValueFor(const APromptID: string; AnInstance: Integer): string; -
TfrmODMedNVA.ResetOnMedChange procedure ResetOnMedChange; -
TfrmODMedNVA.SetOnMedSelect procedure SetOnMedSelect; -
TfrmODMedNVA.SetOnQuickOrder procedure SetOnQuickOrder; -
TResponses.SetQuickOrder procedure SetQuickOrder(AnIEN: Integer); -
TfrmODMedNVA.ShowMedFields procedure ShowMedFields; -
TfrmODMedNVA.ShowMedSelect procedure ShowMedSelect; -
TfrmODMedNVA.UpdateRelated procedure UpdateRelated(DelayUpdate: Boolean = TRUE); -

Called-By

Name Declaration Comments
TfrmODMedNVA.UMDelayClick procedure UMDelayClick(var Message: TMessage); message UM_DELAYCLICK; -


Source

835   procedure TfrmODMedNVA.btnSelectClick(Sender: TObject);
836   var
837     MedIEN: Integer;
838     //MedName: string;
839     QOQuantityStr: string;
840     ErrMsg, temp: string;
841   begin
842     inherited;
843     QOQuantityStr := '';
844     btnSelect.SetFocus;
845     self.MedName := '';                             // let the exit events finish
846     if pnlMeds.Visible then                         // display the medication fields
847     begin
848       Changing := True;
849       ResetOnMedChange;
850       if (FActiveMedList = lstQuick) and (lstQuick.Selected <> nil) then   // quick order
851       begin
852         ErrMsg := '';
853         FIsQuickOrder := True;
854         FQOInitial := True;
855         Responses.QuickOrder := Integer(lstQuick.Selected.Data);
856         txtMed.Tag  := StrToIntDef(Responses.IValueFor('ORDERABLE', 1), 0);
857         IsActivateOI(ErrMsg, txtMed.Tag);
858         if Length(ErrMsg)>0 then
859         begin
860           //btnSelect.Visible := False;
861           btnSelect.Enabled := False;
862           ShowMsg(ErrMsg);
863           Exit;
864         end;
865         if txtMed.Tag = 0 then
866         begin
867           //btnSelect.Visible := False;
868           btnSelect.Enabled := False;
869           txtMed.SetFocus;
870           Exit;
871         end;
872         SetOnMedSelect;   // set up for this medication
873         SetOnQuickOrder;  // insert quick order responses
874         ShowMedFields;
875       end
876       else if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then  // orderable item
877       begin
878         MedIEN := Integer(lstAll.Selected.Data);
879         self.MedName := lstAll.Selected.Caption;
880         txtMed.Tag := MedIEN;
881         ErrMsg := '';
882         IsActivateOI(ErrMsg, txtMed.Tag);
883         if Length(ErrMsg)>0 then
884         begin
885           btnSelect.Enabled := False;
886           ShowMsg(ErrMsg);
887           Exit;
888         end;
889   
890        { if Pos(' NF', MedName) > 0 then
891         begin
892           CheckFormularyOI(MedIEN, MedName, FNonVADlg);
893           FAltChecked := True;
894         end;
895        }
896         if MedIEN <> txtMed.Tag then
897         begin
898           txtMed.Tag := MedIEN;
899           temp := self.MedName;
900           self.MedName := txtMed.Text;
901           txtMed.Text := Temp;
902         end;
903         SetOnMedSelect;
904         ShowMedFields;
905       end
906       else                                           // no selection
907       begin
908         MessageBeep(0);
909         Exit;
910       end;
911       UpdateRelated(False);
912       Changing := False;
913       ControlChange(Self);
914     end
915     else ShowMedSelect;                             // show the selection fields
916     FNoZERO   := False;
917   end;