Class

TEncounter

Module

uCore

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Inherits from

TObject

Declaration


TEncounter = class(TObject, IORNotifier)
private
  FChanged:       Boolean;                     // one or more visit fields have changed
  FDateTime:      TFMDateTime;                 // date/time of encounter (appt, admission)
  FInpatient:     Boolean;                     // true if this is an inpatient encounter
  FLocation:      Integer;                     // IEN in Hospital Location file
  FLocationName:  string;                      // Name in Hospital Location file
  FLocationText:  string;                      // Name + Date/Time or Name + RoomBed
  FProvider:      Int64  ;                     // IEN in New Person file
  FProviderName:  string;                      // Name in New Person file
  FVisitCategory: Char;                        // A=ambulatory,T=Telephone,H=inpt,E=historic
  FStandAlone:    Boolean;                     // true if visit not related to appointment
  FNotifier:      IORNotifier;                 // Event handlers for location changes
  FICD10ImplDate:  TFMDateTime;                 // ICD-10-CM Activation Date
  function GetLocationName: string;
  function GetLocationText: string;
  function GetProviderName: string;
  function GetVisitCategory: Char;
  function GetVisitStr: string;
  procedure SetDateTime(Value: TFMDateTime);
  procedure SetInpatient(Value: Boolean);
  procedure SetLocation(Value: Integer);
  procedure SetProvider(Value: Int64);
  procedure SetStandAlone(Value: Boolean);
  procedure SetVisitCategory(Value: Char);
  procedure UpdateText;
public
  constructor Create;
  destructor Destroy; override;
  procedure Clear;
  procedure EncounterSwitch(Loc: integer; LocName, LocText: string; DT: TFMDateTime; vCat: Char);
  procedure SwitchToSaved(ShowInfoBox: boolean);
  procedure EmptySaved();
  procedure CreateSaved(Reason: string);
  function GetICDVersion: String;
  function NeedVisit: Boolean;
  property DateTime:        TFMDateTime read FDateTime  write SetDateTime;
  property Inpatient:       Boolean     read FInpatient write SetInpatient;
  property Location:        Integer     read FLocation  write SetLocation;
  property LocationName:    string      read GetLocationName write FLocationName;
  property LocationText:    string      read GetLocationText write FLocationText;
  property Provider:        Int64       read FProvider  write SetProvider;
  property ProviderName:    string      read GetProviderName;
  property StandAlone:      Boolean     read FStandAlone write SetStandAlone;
  property VisitCategory:   Char        read GetVisitCategory write SetVisitCategory;
  property VisitStr:        string      read GetVisitStr;
  property Notifier:        IORNotifier read FNotifier implements IORNotifier;
  property ICD10ImplDate: TFMDateTime read FICD10ImplDate;
end;

Class Hierarchy


TObject
 └TEncounter

Class Fields

Name Type Scope Comments
FChanged Boolean Private One or more visit fields have changed
FDateTime TFMDateTime Private Date/time of encounter (appt, admission)
FICD10ImplDate TFMDateTime Private ICD-10-CM Activation Date
FInpatient Boolean Private True if this is an inpatient encounter
FLocation Integer Private IEN in Hospital Location file
FLocationName UnicodeString Private Name in Hospital Location file
FLocationText UnicodeString Private Name + Date/Time or Name + RoomBed
FNotifier IORNotifier Private Event handlers for location changes
FProvider Int64 Private IEN in New Person file
FProviderName UnicodeString Private Name in New Person file
FStandAlone Boolean Private True if visit not related to appointment
FVisitCategory Char Private A=ambulatory,T=Telephone,H=inpt,E=historic

Properties

Name Type Scope Comments
DateTime TFMDateTime Public -
ICD10ImplDate TFMDateTime Public -
Inpatient Boolean Public -
Location Integer Public -
LocationName UnicodeString Public -
LocationText UnicodeString Public -
Notifier IORNotifier Public -
Provider Int64 Public -
ProviderName UnicodeString Public -
StandAlone Boolean Public -
VisitCategory Char Public -
VisitStr UnicodeString Public -

Constructors

Name Declaration Scope Comments
Create constructor Create; Public TEncounter -------------------------------------------------------------------------------

Destructors

Name Declaration Scope Comments
Destroy destructor Destroy; override; Public -

Methods

Name Declaration Scope Comments
Clear procedure Clear; Public Clears all the fields of an Encounter (usually done upon patient selection
CreateSaved procedure CreateSaved(Reason: string); Public -
EmptySaved procedure EmptySaved(); procedure CreateSaved(Reason: string); function GetICDVersion: String; function NeedVisit: Boolean; property DateTime: TFMDateTime read FDateTime write SetDateTime; property Inpatient: Boolean read FInpatient write SetInpatient; property Location: Integer read FLocation write SetLocation; property LocationName: string read GetLocationName write FLocationName; property LocationText: string read GetLocationText write FLocationText; property Provider: Int64 read FProvider write SetProvider; property ProviderName: string read GetProviderName; property StandAlone: Boolean read FStandAlone write SetStandAlone; property VisitCategory: Char read GetVisitCategory write SetVisitCategory; property VisitStr: string read GetVisitStr; property Notifier: IORNotifier read FNotifier implements IORNotifier; property ICD10ImplDate: TFMDateTime read FICD10ImplDate; end; TChangeItem = class private FItemType: Integer; FID: String; FText: String; FGroupName: String; FSignState: Integer; FParentID: String; FUser: Int64; FOrderDG: String; FDCOrder: Boolean; FDelay: Boolean; constructor Create(AnItemType: Integer; const AnID, AText, AGroupName: string; ASignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: string = ''; DCOrder: Boolean = False; Delay: Boolean = False); public property ItemType: Integer read FItemType; property ID: string read FID; property Text: string read FText; property GroupName: string read FGroupName; property SignState: Integer read FSignState write FSignState; property ParentID : string read FParentID; property User: Int64 read FUser write FUser; property OrderDG: string read FOrderDG write FOrderDG; property DCOrder: boolean read FDCOrder write FDCOrder; property Delay: boolean read FDelay write FDelay; function CSValue(): Boolean; end; TORRemoveChangesEvent = procedure(Sender: TObject; ChangeItem: TChangeItem) of object; {**RV**} TChanges = class private FCount: Integer; FDocuments: TList; fOrders: TList; FOrderGrp: TStringList; FPCE: TList; FPCEGrp: TStringList; FOnRemove: TORRemoveChangesEvent; {**RV**} FRefreshCoverPL: Boolean; FRefreshProblemList: Boolean; private procedure AddUnsignedToChanges; public constructor Create; destructor Destroy; override; procedure Add(ItemType: Integer; const AnID, ItemText, GroupName: string; SignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: String = ''; DCOrder: Boolean = False; Delay: Boolean = False; ProblemAdded: Boolean = False); procedure Clear; function CanSign: Boolean; function Exist(ItemType: Integer; const AnID: string): Boolean; function ExistForOrder(const AnID: string): Boolean; function Locate(ItemType: Integer; const AnID: string): TChangeItem; procedure Remove(ItemType: Integer; const AnID: string); procedure ReplaceID(ItemType: Integer; const OldID, NewID: string); procedure ReplaceSignState(ItemType: Integer; const AnID: string; NewState: Integer); procedure ReplaceText(ItemType: Integer; const AnID, NewText: string); procedure ReplaceODGrpName(const AnODID, NewGrp: string); procedure ChangeOrderGrp(const oldGrpName,newGrpName: string); function RequireReview: Boolean; property Count: Integer read FCount; property Documents: TList read FDocuments; property OnRemove: TORRemoveChangesEvent read FOnRemove write FOnRemove; {**RV**} property Orders: TList read fOrders; property PCE: TList read FPCE; property OrderGrp: TStringList read FOrderGrp; property PCEGrp: TStringList read FPCEGrp; property RefreshCoverPL: Boolean read FRefreshCoverPL write FRefreshCoverPL; property RefreshProblemList: Boolean read FRefreshProblemList write FRefreshProblemList; end; TNotifyItem = class private DFN: string; FollowUp: Integer; Public
AlertData: string;
hds7591  Clinic/Ward movement.
AccessStatus: integer;
 put text in the global atom table
 broadcast 'VistA Domain Event - Clinical' to all main windows
SendMessage(HWND_BROADCAST, uVistaDomMsg, WPARAM(Application.MainForm.Handle), LPARAM(AnAtom));

Changed to SendMessageTimeout to prevent hang when other app unresponsive  (RV)
 researched
 after all windows have processed the message, remove the text from the table
 researched
 researched
 researched
 register the message with windows to get a unique message number (if not already registered)
 first send the domain version of the message
 for backward compatibility, send the message without the domain
 TUser methods ---------------------------------------------------------------------------- 
 create the User object for the currently logged in user 
 returns true if the current user has the given security key 
 TPatient methods ------------------------------------------------------------------------- 
 clears all fields in the Patient object 
 selects a patient and sets up the Patient object for the patient 
 TEncounter -------------------------------------------------------------------------------
EncounterSwitch procedure EncounterSwitch(Loc: integer; LocName, LocText: string; DT: TFMDateTime; vCat: Char); Public -
GetICDVersion function GetICDVersion: String; Public -
GetLocationName function GetLocationName: string; Private Returns external text value for hospital location
GetLocationText function GetLocationText: string; Private Returns abbreviated hospital location + room/bed (or date/time for appt)
GetProviderName function GetProviderName: string; Private Returns external text value for provider name
GetVisitCategory function GetVisitCategory: Char; Private -
GetVisitStr function GetVisitStr: string; Private -
NeedVisit function NeedVisit: Boolean; Public Returns true if required fields for visit creation are present
SetDateTime procedure SetDateTime(Value: TFMDateTime); Private Sets the date/time for the encounter - causes the visit to be reset
SetInpatient procedure SetInpatient(Value: Boolean); Private Sets the inpatient flag for the encounter - causes the visit to be reset
SetLocation procedure SetLocation(Value: Integer); Private Sets the location for the encounter - causes the visit to be reset
SetProvider procedure SetProvider(Value: Int64); Private Sets the provider for the encounter - causes the visit to be reset
SetStandAlone procedure SetStandAlone(Value: Boolean); Private StandAlone should be true if this encounter isn't related to an appointment
SetVisitCategory procedure SetVisitCategory(Value: Char); Private Sets the visit type for this encounter - causes to visit to be reset
SwitchToSaved procedure SwitchToSaved(ShowInfoBox: boolean); Public -
UpdateText procedure UpdateText; Private Retrieve external values for provider name, hospital location

Referenced By (4)

Module (line) Referrer Type
fFrame (853) - Read
uCore (394) EmptySaved Read
uCore (395) EmptySaved Read
uReminders (2024) - Read