Procedure

TfrmODMedOut.ControlChange

Module

fODMedOut

Last Modified

7/15/2014 3:26:42 PM

Comments

All controls

Visibility

Public/Published

Owner

TfrmODMedOut

Declaration

procedure ControlChange(Sender: TObject);

Calls Hierarchy


TfrmODMedOut.ControlChange
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 └TResponses.GetOrderText
   ├TResponses.NextInstance
   ├TResponses.FindResponseByName
   ├TResponses.FormatResponse
   │ └TResponses.FindResponseByIEN
   └TResponses.AppendChildren
     ├TResponses.FindPromptByIEN
     ├TResponses.FindResponseByIEN
     └TResponses.FormatResponse...

Called-By Hierarchy


                 TfrmODMedOut.ControlChange
                 TfrmODMedOut.SetupDialog┤ 
         TfrmODMedOut.cboMedicationSelect┘ 
              TfrmODMedOut.CheckFormAlt┘   
         TfrmODMedOut.cboDispenseExit┤     
   TfrmODMedOut.cboDispenseMouseClick┘     
TfrmODMedOut.cboMedicationSelect...┘       

Calls

Name Declaration Comments
TResponses.GetOrderText function GetOrderText: string; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -

Called-By

Name Declaration Comments
TfrmODMedOut.cboMedicationSelect procedure cboMedicationSelect(Sender: TObject); -
TfrmODMedOut.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

588   procedure TfrmODMedOut.ControlChange(Sender: TObject);
589   begin
590     inherited;
591     if csLoading in ComponentState then Exit;  // to prevent error caused by txtRefills
592     if Changing then Exit;
593     if FMedCombo.ItemIEN = 0 then Exit;        // prevent txtRefills from updating early
594     with FMedCombo do if ItemIEN > 0
595       then Responses.Update('ORDERABLE', 1, ItemID, Piece(Items[ItemIndex], U, 3))
596       else Responses.Update('ORDERABLE', 1, '', '');
597     with cboDispense   do if ItemIEN > 0
598       then Responses.Update('DRUG', 1, ItemID, Piece(Items[ItemIndex], U, 2))
599       else Responses.Update('DRUG', 1, '', '');
600     if memComplex.Visible = False then
601     begin
602       with cboInstructions do Responses.Update('INSTR', 1, Text, Text);
603       with btnUnits        do if Visible then Responses.Update('MISC',  1, Caption, Caption);
604       with cboRoute        do if ItemIndex > -1
605         then Responses.Update('ROUTE', 1, ItemID, Piece(Items[ItemIndex], U, 3)) // abbreviation
606         else Responses.Update('ROUTE', 1, Text, Text);
607       with cboSchedule     do Responses.Update('SCHEDULE', 1, Text, Text);
608     end;
609     with txtQuantity     do Responses.Update('QTY', 1, Text, Text);
610     with txtRefills      do Responses.Update('REFILLS', 1, Text, Text);
611     with cboPickup       do Responses.Update('PICKUP', 1, ItemID, Text);
612     with cboPriority     do Responses.Update('URGENCY', 1, ItemID, Text);
613     with memComments     do Responses.Update('COMMENT', 1, TX_WPTYPE, Text);
614     with cboSC           do if Enabled then Responses.Update('SC', 1, ItemID, Text);
615     memOrder.Text := Responses.OrderText;
616   end;