Function

TfrmFrame.FindBestCCOWDFN

Module

fFrame

Last Modified

3/11/2015 8:41:44 AM

Comments

Function FindBestCCOWDFN(var APatientName: string): string;
function TfrmFrame.FindBestCCOWDFN(var APatientName: string): string;

Visibility

Private

Owner

TfrmFrame

Declaration

function FindBestCCOWDFN: string;

Calls Hierarchy


TfrmFrame.FindBestCCOWDFN
 ├TContextorControl.Get_CurrentContext
 │ └TContextorControl.GetControlInterface
 │   └TContextorControl.CreateControl
 │     └DoCreate
 ├TfrmFrame.HandleCCOWError
 ├TfrmFrame.HideEverything
 ├GetDFNFromICN
 └FindNextBestDFN

Called-By Hierarchy


                      TfrmFrame.FindBestCCOWDFN
                  TfrmFrame.UpdateCCOWContext┤ 
                 TfrmFrame.mnuFileOpenClick┤ │ 
                     TfrmFrame.UMInitiate┤ │ │ 
               TfrmFrame.mnuFileNextClick┤ │ │ 
          TfrmFrame.mnuFileOpenClick...┤ │ │ │ 
      TfrmFrame.mnuFileNotifRemoveClick┤ │ │ │ 
              TfrmFrame.NextButtonClick┘ │ │ │ 
            TfrmFrame.SetUpNextButton┘   │ │ │ 
      TfrmFrame.mnuFileOpenClick...┤     │ │ │ 
               TfrmFrame.FormResize┘     │ │ │ 
             TfrmFrame.ChangeFont┘       │ │ │ 
     TfrmFrame.LoadSizesForUser┤         │ │ │ 
TfrmFrame.LoadUserPreferences┘ │         │ │ │ 
       TfrmFrame.UMInitiate┘   │         │ │ │ 
     TfrmFrame.mnuFontSizeClick┘         │ │ │ 
            TfrmFrame.mnuFileRefreshClick┤ │ │ 
            TfrmOrders.CheckOrderStatus┤ │ │ │ 
        TfrmOrders.mnuActChgEvntClick┤ │ │ │ │ 
           TfrmOrders.mnuActHoldClick┤ │ │ │ │ 
         TfrmOrders.mnuActUnholdClick┤ │ │ │ │ 
          TfrmOrders.mnuActRenewClick┤ │ │ │ │ 
         TfrmOrders.mnuActChangeClick┤ │ │ │ │ 
           TfrmOrders.mnuActCopyClick┘ │ │ │ │ 
                 TfrmMeds.mnuActDCClick┤ │ │ │ 
                TfrmMeds.CheckMedStatus┘ │ │ │ 
             TfrmMeds.mnuActHoldClick┤   │ │ │ 
            TfrmMeds.mnuActRenewClick┤   │ │ │ 
           TfrmMeds.mnuActUnholdClick┤   │ │ │ 
           TfrmMeds.mnuActChangeClick┤   │ │ │ 
             TfrmMeds.mnuActCopyClick┤   │ │ │ 
           TfrmMeds.mnuActRefillClick┘   │ │ │ 
                       TfrmFrame.ViewInfo┘ │ │ 
                    TfrmDCSumm.ViewInfo┤   │ │ 
                  TfrmConsults.ViewInfo┤   │ │ 
          TfrmFrame.pnlRemindersMouseUp┤   │ │ 
           TfrmFrame.RemindersChanged┘ │   │ │ 
               TfrmFrame.FormCreate┘   │   │ │ 
                 TfrmFrame.pnlCIRNClick┤   │ │ 
           TfrmFrame.pnlVistaWebClick┤ │   │ │ 
                TfrmFrame.FormKeyDown┘ │   │ │ 
              TfrmFrame.pnlPatientClick┤   │ │ 
                TfrmFrame.pnlVisitClick┤   │ │ 
          TfrmFrame.pnlPrimaryCareClick┤   │ │ 
            TfrmFrame.pnlRemindersClick┤   │ │ 
             TfrmFrame.pnlPostingsClick┤   │ │ 
                 TfrmFrame.pnlFlagClick┤   │ │ 
                   TfrmFrame.laMHVClick┤   │ │ 
                  TfrmFrame.laVAA2Click┤   │ │ 
                    TfrmOrders.ViewInfo┤   │ │ 
                      TfrmMeds.ViewInfo┤   │ │ 
                   TfrmSurgery.ViewInfo┤   │ │ 
                     TfrmNotes.ViewInfo┤   │ │ 
                  TfrmProblems.ViewInfo┘   │ │ 
            TfrmFrame.ctxContextorCommitted┤ │ 
             TfrmFrame.StartCCOWContextor┘ │ │ 
                   TfrmFrame.FormCreate┘   │ │ 
     TfrmFrame.mnuFileResumeContextGetClick┘ │ 
           TfrmFrame.CheckForDifferentPatient┘ 
              TfrmFrame.ctxContextorPending┤   
          TfrmFrame.StartCCOWContextor...┘ │   
         TfrmFrame.ctxContextorCommitted...┘   

Calls

Name Declaration Comments
FindNextBestDFN procedure FindNextBestDFN; -
TContextorControl.Get_CurrentContext function Get_CurrentContext: IContextItemCollection; -
GetDFNFromICN function GetDFNFromICN(AnICN: string): string; -
TfrmFrame.HandleCCOWError procedure HandleCCOWError(AMessage: string); -
TfrmFrame.HideEverything procedure HideEverything(AMessage: string = 'No patient is currently selected.'); -

Called-By

Name Declaration Comments
TfrmFrame.CheckForDifferentPatient procedure CheckForDifferentPatient(aContextItemCollection: IDispatch; var PtChanged: boolean); -
TfrmFrame.UpdateCCOWContext procedure UpdateCCOWContext; -


Source

3945  function TfrmFrame.FindBestCCOWDFN: string;
3946  var
3947    data: IContextItemCollection;
3948    anItem: IContextItem;
3949    StationNumber, tempDFN: string;
3950    IsProdAcct:  Boolean;
3951  
3952    procedure FindNextBestDFN;
3953    begin
3954      StationNumber := User.StationNumber;
3955      if IsProdAcct then
3956        anItem := data.Present('Patient.id.MRN.DFN_' + StationNumber)
3957      else
3958        anItem := data.Present('Patient.id.MRN.DFN_' + StationNumber + '_TEST');
3959      if anItem <>  nil then tempDFN := anItem.Get_Value();
3960    end;
3961  
3962  begin
3963    if uCore.User = nil then
3964    begin
3965      Result := '';
3966      exit;
3967    end;
3968    IsProdAcct := User.IsProductionAccount;
3969    {$IFDEF CCOWBROKER}
3970    //IsProdAcct := RPCBrokerV.Login.IsProduction;  //not yet
3971    {$ENDIF}
3972    // Get an item collection of the current context
3973    FCCOWError := False;
3974    try
3975      data := ctxContextor.CurrentContext;
3976    except
3977      on E: Exception do HandleCCOWError(E.Message);
3978    end;
3979    if FCCOWError then
3980    begin
3981      HideEverything;
3982      Exit;
3983    end;
3984    // Retrieve the ContextItem name and value as strings
3985    if IsProdAcct then
3986      anItem := data.Present('Patient.id.MRN.NationalIDNumber')
3987    else
3988      anItem := data.Present('Patient.id.MRN.NationalIDNumber_TEST');
3989    if anItem <> nil then
3990      begin
3991        tempDFN := GetDFNFromICN(anItem.Get_Value());			 // "Public" RPC call
3992        if tempDFN = '-1' then FindNextBestDFN;
3993      end
3994    else
3995      FindNextBestDFN;
3996    Result := tempDFN;
3997  (*  anItem := data.Present('Patient.co.PatientName');
3998    if anItem <> nil then APatientName := anItem.Get_Value();*)
3999    data := nil;
4000    anItem := nil;
4001  end;