Procedure

TfrmODBase.Validate

Directives

Virtual

Module

fODBase

Last Modified

7/15/2014 3:26:40 PM

Visibility

Protected

Overridden by

TfrmODAllergy.Validate
TfrmODAuto.Validate
TfrmODBBank.Validate
TfrmODCslt.Validate
TfrmODDiet.Validate
TfrmODGen.Validate
TfrmODLab.Validate
TfrmODMedIn.Validate
TfrmODMedIV.Validate
TfrmODMedNVA.Validate
TfrmODMedOut.Validate
TfrmODMeds.Validate
TfrmODMisc.Validate
TfrmODProc.Validate
TfrmODRad.Validate
TfrmODText.Validate
TfrmODVitals.Validate

Owner

TfrmODBase

Declaration

procedure Validate(var AnErrMsg: string); virtual;

Calls Hierarchy


TfrmODBase.Validate
 ├TResponses.IValueFor
 ├StrToFMDateTime
 ├FMToday
 │ └FMNow
 ├PersonHasKey
 ├IsPFSSActive
 ├TResponses.PromptExists
 ├TResponses.Update
 │ ├TResponses.FindResponseByName
 │ └TResponses.IENForPrompt
 └TEncounter.GetVisitStr
   └TEncounter.GetVisitCategory

Called-By Hierarchy


                                         TfrmODBase.Validate
                                      TfrmODBase.ValidSave┘ 
                               TfrmODBase.cmdAcceptClick┤   
                                   ActivateOrderDialog┘ │   
                           TfrmRemDlg.btnFinishClick┤   │   
           TfrmConsults.mnuActNewConsultRequestClick┤   │   
                   TfrmConsults.cmdNewConsultClick┘ │   │   
                TfrmConsults.mnuActNewProcedureClick┤   │   
                      TfrmConsults.cmdNewProcClick┘ │   │   
                                        ChangeOrders┤   │   
                      TfrmOrders.mnuActChangeClick┤ │   │   
                        TfrmMeds.mnuActChangeClick┘ │   │   
                                     ChangeOrdersEvt┤   │   
                                          CopyOrders┤   │   
                        TfrmOrders.mnuActCopyClick┤ │   │   
                          TfrmMeds.mnuActCopyClick┤ │   │   
                           TfrmODActive.btnOKClick┘ │   │   
                                      TransferOrders┤   │   
                        TfrmOrders.mnuActCopyClick┤ │   │   
                          TfrmMeds.mnuActCopyClick┤ │   │   
                           TfrmODActive.btnOKClick┘ │   │   
                            TfrmOrders.lstWriteClick┤   │   
               TfrmOrders.PlaceOrderForDefaultDialog┤   │   
                  TfrmOrders.DisplayDefaultDlgList┤ │   │   
                       TfrmOrders.ResetOrderPage┘ │ │   │   
               TfrmOrders.btnDelayedOrderClick┘   │ │   │   
                                 DisplayEvntDialog┤ │   │   
                             SetDelayEventForMed┘ │ │   │   
                      TfrmMeds.mnuActCopyClick┘   │ │   │   
                                 DisplayEvntDialog┤ │   │   
                                  SetViewForCopy┘ │ │   │   
                    TfrmOrders.mnuActCopyClick┘   │ │   │   
                                 DisplayEvntDialog┘ │   │   
                                ExecuteChangeEvt┘   │   │   
                 TfrmOrders.mnuActChgEvntClick┘     │   │   
                             TfrmMeds.mnuActNewClick┤   │   
                           TfrmOMNavA.ActivateDialog┤   │   
                         TfrmOMNavA.grdMenuKeyDown┤ │   │   
                         TfrmOMNavA.grdMenuMouseUp┘ │   │   
                                TfrmOMSet.DoNextItem┘   │   
                              TfrmOMSet.InsertList┤     │   
                               ActivateOrderList┘ │     │   
                     TfrmRemDlg.btnFinishClick┤   │     │   
                             ActivateOrderHTML┤   │     │   
                    TfrmOrders.lstWriteClick┤ │   │     │   
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │     │   
                              ActivateOrderSet┤   │     │   
                   TfrmRemDlg.btnFinishClick┤ │   │     │   
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │     │   
     TfrmConsults.mnuActNewProcedureClick...┤ │   │     │   
                    TfrmOrders.lstWriteClick┤ │   │     │   
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │     │   
                     TfrmMeds.mnuActNewClick┤ │   │     │   
                TfrmOMNavA.ActivateDialog...┤ │   │     │   
                     TfrmOMSet.DoNextItem...┘ │   │     │   
                       TfrmOMNavA.DoSelectList┘   │     │   
                     TfrmOMNavA.grdMenuKeyUp┤     │     │   
                   TfrmOMNavA.grdMenuMouseUp┘     │     │   
                                        SkipToNext┤     │   
                         TfrmOMSet.DoNextItem...┘ │     │   
                            TfrmOMSet.UMDelayEvent┘     │   
                               TfrmODBase.FormCloseQuery┤   
                                     TfrmODBase.TabClose┤   
                            TfrmODAllergy.cmdAcceptClick┘   

Calls

Name Declaration Comments
FMToday function FMToday: TFMDateTime; -
TEncounter.GetVisitStr function GetVisitStr: string; -
IsPFSSActive function IsPFSSActive: boolean; -
TResponses.IValueFor function IValueFor(const APromptID: string; AnInstance: Integer): string; -
PersonHasKey function PersonHasKey(APerson: Int64; const AKey: string): Boolean; -
TResponses.PromptExists function PromptExists(const APromptID: string):boolean; -
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -
TResponses.Update procedure Update(const APromptID: string; AnInstance: Integer; const AnIValue, AnEValue: string); -

Called-By

Name Declaration Comments
TfrmODBase.ValidSave function ValidSave: Boolean; -


Source

1386  procedure TfrmODBase.Validate(var AnErrMsg: string);
1387  const
1388    TX_OR_DISABLED = 'Ordering has been disabled.  Press Quit.';
1389    TX_PAST_START  = 'The start date may not be earlier than the present.';
1390    TX_NO_LOCATION = 'A location must be identified.' + CRLF +
1391                     '(Select File | Update Provider/Location)';
1392    TX_NO_PROVIDER = 'A provider who is authorized to write orders must be indentified.' + CRLF +
1393                     '(Select File | Update Provider/Location)';
1394  var
1395    StartStr,x: string;
1396    StartDt: TFMDateTime;
1397  begin
1398    AnErrMsg := '';
1399    if User.NoOrdering then AnErrMsg := 'Ordering has been disabled.  Press Quit.';
1400    // take this out if we <don't> need to check for earlier start date/times
1401    // should this check be against FMNow??
1402    StartStr := Piece(Responses.IValueFor('START', 1), '.', 1);
1403    if not IsFMDateTime(StartStr)
1404      then StartDt := StrToFMDateTime(StartStr)
1405      else StartDt := StrToFloat(StartStr);
1406    if (StartDt > 0) and (StartDt < FMToday)
1407      then AnErrMsg := 'The start date may not be earlier than the present.';
1408    //frmFrame.UpdatePtInfoOnRefresh;
1409    if (not Patient.Inpatient) and (Responses.EventIFN > 0) then x := ''
1410    else
1411    begin
1412      if Encounter.Location = 0 then AnErrMsg := TX_NO_LOCATION;
1413    end;
1414    if (Encounter.Provider = 0) or (PersonHasKey(Encounter.Provider, 'PROVIDER') = False)
1415      then AnErrMsg := TX_NO_PROVIDER;
1416    if IsPFSSActive and Responses.PromptExists('VISITSTR') then
1417      Responses.Update('VISITSTR', 1, Encounter.VisitStr, Encounter.VisitStr);
1418  end;