Procedure

TfrmEncounterFrame.FormCloseQuery

Module

fEncounterFrame

Last Modified

7/15/2014 3:26:36 PM

Comments

//Name: procedure TfrmEncounterFrame.FormCloseQuery(Sender: TObject;
//Created: Jan 1999
//By: Robert Bott
//Location: ISL
//Description: Check to see if the Cancel button was pressed, if not, call
// procedure to send the data to the server.
///////////////////////////////////////////////////////////////////////////////

Visibility

Public/Published

Owner

TfrmEncounterFrame

Declaration

procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

Calls Hierarchy


TfrmEncounterFrame.FormCloseQuery
 ├TPCEProviderList.GetPrimaryIdx
 ├TPCEData.Create
 ├TPCEData.CopyPCEData
 │ ├TPCEData.Clear
 │ │ ├ClearList
 │ │ ├TPCEProc.Clear
 │ │ │ └TPCEItem.Clear
 │ │ │   └TPCEItem.SetComment
 │ │ └TPCEProviderList.Clear
 │ │   └TPCEProviderList.GetPrimaryIdx
 │ ├TPCEProc.CopyProc
 │ │ └TPCEItem.SetComment
 │ ├TPCEProviderList.Assign
 │ └TPCEData.CopyPCEItems
 │   └TPCEItem.Assign
 │     └TPCEItem.SetComment
 ├TfrmEncounterFrame.UpdateEncounter
 │ ├TfrmEncounterFrame.FormListContains
 │ ├TPCEData.SetVisitType
 │ │ ├TPCEItem.Match
 │ │ └TPCEProc.Assign
 │ │   └TPCEItem.Assign...
 │ ├TfraVisitRelated.GetRelated
 │ │ ├TPCEData.SetSCRelated
 │ │ ├TfraVisitRelated.GetCheckState
 │ │ ├TPCEData.SetAORelated
 │ │ ├TPCEData.SetIRRelated
 │ │ ├TPCEData.SetECRelated
 │ │ ├TPCEData.SetMSTRelated
 │ │ ├TPCEData.SetHNCRelated
 │ │ ├TPCEData.SetCVRelated
 │ │ └TPCEData.SetSHADRelated
 │ ├TPCEProviderList.Merge
 │ │ ├TPCEProviderList.IndexOfProvider
 │ │ └TPCEProviderList.Add
 │ │   ├TPCEProviderList.GetPrimaryIdx
 │ │   ├TPCEProviderList.IndexOfProvider
 │ │   └TPCEProviderList.SetPrimaryIdx
 │ │     ├TPCEProviderList.GetPrimaryIdx
 │ │     └TPCEProviderList.SetPrimary
 │ ├TPCEData.SetDiagnoses
 │ │ ├TPCEData.MarkDeletions
 │ │ │ ├TPCEItem.Match
 │ │ │ └TPCEItem.MatchProvider
 │ │ ├TPCEData.MatchItem
 │ │ │ ├TPCEItem.Match
 │ │ │ └TPCEItem.MatchProvider
 │ │ ├TPCEItem.SetComment
 │ │ └TPCEDiag.Assign
 │ │   └TPCEItem.Assign...
 │ ├TPCEData.SetProcedures
 │ │ ├TPCEData.MarkDeletions...
 │ │ ├TPCEData.MatchItem...
 │ │ ├TPCEProc.Assign...
 │ │ └TPCEItem.SetComment
 │ ├TPCEData.SetImmunizations
 │ │ ├TPCEData.MarkDeletions...
 │ │ ├TPCEData.MatchItem...
 │ │ ├TPCEItem.SetComment
 │ │ └TPCEImm.Assign
 │ │   └TPCEItem.Assign...
 │ ├TPCEData.SetSkinTests
 │ │ ├TPCEData.MarkDeletions...
 │ │ ├TPCEData.MatchItem...
 │ │ ├TPCEItem.SetComment
 │ │ └TPCESkin.Assign
 │ │   └TPCEItem.Assign...
 │ ├TPCEData.SetPatientEds
 │ │ ├TPCEData.MarkDeletions...
 │ │ ├TPCEData.MatchItem...
 │ │ ├TPCEItem.SetComment
 │ │ └TPCEPat.Assign
 │ │   └TPCEItem.Assign...
 │ ├TPCEData.SetHealthFactors
 │ │ ├TPCEData.MarkDeletions...
 │ │ ├TPCEData.MatchItem...
 │ │ ├TPCEItem.SetComment
 │ │ └TPCEHealth.Assign
 │ │   └TPCEItem.Assign...
 │ └TPCEData.SetExams
 │   ├TPCEData.MarkDeletions...
 │   ├TPCEData.MatchItem...
 │   ├TPCEItem.SetComment
 │   └TPCEExams.Assign
 │     └TPCEItem.Assign...
 ├TPCEData.NeedProviderInfo
 │ ├TPCEProviderList.GetPrimaryIdx
 │ ├AutoCheckout
 │ ├TPCEProviderList.GetProviderData
 │ ├TPCEData.GetHasCPTList
 │ │ └AddList
 │ │   └TPCEItem.HasCPTStr
 │ └DataHasCPTCodes
 ├NoPrimaryPCEProvider
 │ ├TPCEProviderList.GetPrimaryIdx
 │ ├SetDefaultProvider
 │ │ ├InvalidPCEProviderTxt
 │ │ │ ├CheckActivePerson
 │ │ │ └IsUserAProvider
 │ │ ├TPCEData.PersonClassDate
 │ │ │ └FMToday
 │ │ │   └FMNow
 │ │ ├TEncounter.GetProviderName
 │ │ │ └TEncounter.UpdateText
 │ │ │   └GetEncounterText
 │ │ ├DefaultProvider
 │ │ ├CheckActivePerson
 │ │ ├TIUSiteParams
 │ │ └TPCEProviderList.AddProvider
 │ │   └TPCEProviderList.Add...
 │ ├TfrmBase508Form.Create
 │ │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ │ ├UnfocusableControlEnter
 │ │ └AdjustControls
 │ │   ├TfrmBase508Form.ModifyUnfocusableControl
 │ │   └..(rec)..
 │ ├TPCEProviderList.PendingIEN
 │ ├TPCEProviderList.PendingName
 │ ├TfrmPCEProvider.AskUser
 │ │ └TfrmPCEProvider.btnSelectClick
 │ └TPCEProviderList.AddProvider...
 ├TPCEProviderList.PrimaryIEN
 │ └TPCEProviderList.GetPrimaryIdx
 ├TfrmEncounterFrame.FormListContains
 ├TfrmEncVitals.OK2SaveVitals
 │ ├TfrmEncVitals.HasData
 │ └TfrmEncVitals.ClearData
 ├TfrmProcedures.OK2SaveProcedures
 │ └TfrmProcedures.MissingProvider
 ├TfrmEncounterFrame.tabPageChange
 │ ├TfrmEncounterFrame.PageIDToTab
 │ ├TfrmEncounterFrame.PageIDToForm
 │ └TfrmEncounterFrame.SwitchToPage
 │   └TfrmPCEBase.DisplayPage
 ├TfrmEncounterFrame.SwitchToPage...
 ├TfrmEncounterFrame.PageIDToForm
 └TfrmEncounterFrame.SendData
   ├TfrmEncounterFrame.FormListContains
   ├TfrmEncVitals.HasData
   ├TfrmEncVitals.AssignVitals
   │ ├ValidVitalsDate
   │ │ ├FMNow
   │ │ └TfrmBase508Form.Create...
   │ ├AssignVitals2List
   │ │ ├GetVitalUser
   │ │ └AddVital
   │ │   └GetVitalStr
   │ │     └ConvertVital
   │ ├PCERPCEncLocation
   │ └TfrmEncVitals.GetVitHTRate
   │   └ConvertHeight2Inches
   ├ValAndStoreVitals
   ├TfrmGAF.GetGAFScore
   │ ├TfrmGAF.BADData
   │ │ ├ValidateGAFDate
   │ │ │ ├TPatient.GetDateDied
   │ │ │ │ └DateOfDeath
   │ │ │ └FMToday...
   │ │ ├TPCEProviderList.PCEProvider
   │ │ │ ├Check
   │ │ │ │ └TPCEProviderList.IndexOfProvider
   │ │ │ └TPCEProviderList.PrimaryIEN...
   │ │ └TPCEProviderList.PCEProviderName
   │ │   ├TPCEProviderList.PCEProvider...
   │ │   └ExternalName
   │ └ValidGAFData
   │   └TPatient.GetDateDied...
   ├SaveGAFScore
   │ └GAFOK
   ├TfrmEncounterFrame.UpdateEncounter...
   └TPCEData.Save
     ├TPCEData.IsSecondaryVisit
     ├GetLocSecondaryVisitCode
     ├GetVisitIEN
     ├TPCEDiag.DelimitedStr2
     ├TPCEProviderList.PCEProvider...
     ├TPCEDiag.DelimitedStr
     ├TPCEProc.DelimitedStr
     │ └ModifierCode
     │   └ModifierIdx
     │     ├TPCEData.VisitDateTime
     │     │ └TPCEData.IsSecondaryVisit
     │     ├FMToday...
     │     └MixedCaseModifier
     ├TPCEItem.DelimitedStr2
     ├TPCEImm.DelimitedStr
     ├TPCESkin.DelimitedStr
     ├TPCEPat.DelimitedStr
     ├TPCEHealth.DelimitedStr
     ├TPCEExams.DelimitedStr
     ├SavePCEData
     ├TPCEProviderList.GetProviderData
     ├TPCEProviderList.Delete
     ├TPCEProc.Clear...
     ├TPCEData.StrVisitType
     │ ├GetPCEDataText
     │ │ └GetDiagnosisText
     │ ├TPCEProc.ModText
     │ │ └ModifierName
     │ │   └ModifierIdx...
     │ └TPCEData.StrVisitType
     │   └AddTxt
     ├TChanges.Add
     │ └TChangeItem.Create
     ├TPCEData.StrProcedures
     │ ├GetPCEDataText...
     │ └TPCEProc.ModText...
     ├TPCEData.StrDiagnoses
     │ └GetPCEDataText...
     ├TPCEData.StrImmunizations
     │ └GetPCEDataText...
     ├TPCEData.StrSkinTests
     │ └GetPCEDataText...
     ├TPCEData.StrPatientEds
     │ └GetPCEDataText...
     ├TPCEData.StrHealthFactors
     │ └GetPCEDataText...
     └TPCEData.StrExams
       └GetPCEDataText...

Calls

Name Declaration Comments
TPCEData.CopyPCEData procedure CopyPCEData(Dest: TPCEData); -
TPCEData.Create constructor Create; -
TfrmEncounterFrame.FormListContains function FormListContains(item: string): Boolean; -
TPCEProviderList.GetPrimaryIdx function GetPrimaryIdx: integer; -
TPCEData.NeedProviderInfo function NeedProviderInfo: boolean; -
NoPrimaryPCEProvider function NoPrimaryPCEProvider(AProviders: TPCEProviderList; PCEData: TPCEData): boolean; -
TfrmProcedures.OK2SaveProcedures function OK2SaveProcedures: boolean; -
TfrmEncVitals.OK2SaveVitals function OK2SaveVitals: boolean; -
TfrmEncounterFrame.PageIDToForm function PageIDToForm(PageID: Integer): TfrmPCEBase; -
TPCEProviderList.PrimaryIEN function PrimaryIEN: int64; -
TfrmEncounterFrame.SendData procedure SendData; -
TfrmEncounterFrame.SwitchToPage procedure SwitchToPage(NewForm: TfrmPCEBase); -
TfrmEncounterFrame.tabPageChange procedure tabPageChange(Sender: TObject; NewTab: Integer; var AllowChange: Boolean); -
TfrmEncounterFrame.UpdateEncounter procedure UpdateEncounter(PCE: TPCEData); -


Source

624   procedure TfrmEncounterFrame.FormCloseQuery(Sender: TObject;
625     var CanClose: Boolean);
626   
627   const
628     TXT_SAVECHANGES = 'Save Changes?';
629   
630   var
631     TmpPCEData: TPCEData;
632     ask, ChangeOK: boolean;
633   
634   begin
635     CanClose := True;
636     if(FAbort) then
637       FCancel := (InfoBox(TXT_SAVECHANGES, TXT_SAVECHANGES, MB_YESNO) = ID_NO);
638     if FCancel then Exit;  //*KCM*
639   
640     if(uProviders.PrimaryIdx >= 0) then
641       ask := TRUE
642     else
643     begin
644       TmpPCEData := TPCEData.Create;
645       try
646         uEncPCEData.CopyPCEData(TmpPCEData);
647         UpdateEncounter(TmpPCEData);
648         ask := TmpPCEData.NeedProviderInfo;
649       finally
650         TmpPCEData.Free;
651       end;
652     end;
653     if ask and (NoPrimaryPCEProvider(uProviders, uEncPCEData)) then
654     begin
655       InfoBox(TX_PROV_REQ, TC_PROV_REQ, MB_OK or MB_ICONWARNING);
656       CanClose := False;
657       Exit;
658     end;
659   
660     uVisitType.Provider := uProviders.PrimaryIEN;  {RV - v20.1}
661   
662     if FormListContains(CT_VitNm) then
663       CanClose := frmEncVitals.OK2SaveVitals;
664   
665     if CanClose and FormListContains(CT_ProcNm) then  
666       begin
667         CanClose := frmProcedures.OK2SaveProcedures;
668         if not CanClose then
669           begin
670             tabPageChange(Self, FormList.IndexOf(CT_ProcNm), ChangeOK);
671             SwitchToPage(PageIDToForm(CT_PROCEDURES));
672             TabControl.TabIndex := FormList.IndexOf(CT_ProcNm);
673           end;
674       end;
675   
676     if CanClose then SendData;  //*KCM*
677   
678   end;