Procedure

TfrmODDiet.SetValuesFromResponsesDO

Module

fODDiet

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODDiet

Declaration

procedure SetValuesFromResponsesDO;

Calls Hierarchy


TfrmODDiet.SetValuesFromResponsesDO
 ├TfrmODDiet.ResetControlsDO
 ├TResponses.NextInstance
 ├TResponses.FindResponseByName
 ├DietAttributes
 ├TResponses.SetControl
 │ ├TResponses.FindResponseByName
 │ └AssignBPText
 │   ├DisplayGroupToLinkType
 │   │ └DisplayGroupByName
 │   ├TResponses.EValueFor
 │   ├GetServiceIEN
 │   ├TResponses.IValueFor
 │   ├GetProcedureIEN
 │   ├ExpandOrderObjects
 │   │ ├TdmodShared.BoilerplateOK
 │   │ │ ├ErrCount
 │   │ │ ├AddErr
 │   │ │ └TdmodShared.LoadTIUObjects
 │   │ │   └GetObjectList
 │   │ └GetTemplateText
 │   │   └TEncounter.GetVisitStr
 │   │     └TEncounter.GetVisitCategory
 │   ├SetTemplateDialogCanceled
 │   ├CheckBoilerplate4Fields
 │   ├ExecuteTemplateOrBoilerPlate
 │   └WasTemplateDialogCanceled
 ├TfrmODDiet.DietCheckForNPO
 ├TfrmODDiet.DietCheckForTF
 │ └TextForOrder
 └TfrmODDiet.DietChange
   ├TResponses.Clear
   ├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


TfrmODDiet.SetValuesFromResponsesDO
           TfrmODDiet.SetupDialog┤ 
TfrmODDiet.cboDietAvailMouseClick┘ 
    TfrmODDiet.cboDietAvailExit┘   

Calls

Name Declaration Comments
DietAttributes function DietAttributes(OI: Integer): string; -
TfrmODDiet.DietChange procedure DietChange(Sender: TObject); -
TfrmODDiet.DietCheckForNPO procedure DietCheckForNPO; -
TfrmODDiet.DietCheckForTF procedure DietCheckForTF; -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TResponses.NextInstance function NextInstance(const APromptID: string; LastInstance: Integer): Integer; -
TfrmODDiet.ResetControlsDO procedure ResetControlsDO; -
TResponses.SetControl procedure SetControl(AControl: TControl; const APromptID: string; AnInstance: Integer); -

Called-By

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


Source

1019  procedure TfrmODDiet.SetValuesFromResponsesDO;
1020  var
1021    AnInstance: Integer;
1022    AResponse: TResponse;
1023    ADiet: string;
1024  begin
1025    Changing := True;                                        // Changing set!!
1026    ResetControlsDO;
1027    with Responses do
1028    begin
1029      AnInstance := NextInstance('ORDERABLE', 0);
1030      while AnInstance > 0 do
1031      begin
1032        AResponse := FindResponseByName('ORDERABLE', AnInstance);
1033        if AResponse <> nil then
1034        begin
1035          ADiet := DietAttributes(StrToIntDef(AResponse.IValue,0));
1036          if Piece(ADiet,'^',1)='0' then
1037          begin
1038            InfoBox(Piece(ADiet,'^',2), TC_DIET_ERR, MB_OK);
1039            cboDietAvail.ItemIndex := -1;
1040            Changing := False;
1041            Exit;
1042          end;
1043          lstDietSelect.Items.Add(ADiet);
1044        end;
1045        AnInstance := NextInstance('ORDERABLE', AnInstance);
1046      end; {while AnInstance - ORDERABLE}
1047      SetControl(calDietStart,   'START',    1);
1048      SetControl(calDietStop,    'STOP',     1);
1049      SetControl(cboDelivery,    'DELIVERY', 1);
1050      SetControl(txtDietComment, 'COMMENT',  1);
1051    end;
1052    DietCheckForNPO;
1053    DietCheckForTF;
1054    Changing := False;                                       // Changing reset
1055    DietChange(Self);
1056  end;