diff --git a/CPRS-Chart/rECS.pas b/CPRS-Chart/rECS.pas new file mode 100644 index 0000000..c083e51 --- /dev/null +++ b/CPRS-Chart/rECS.pas @@ -0,0 +1,148 @@ +unit rECS; + +interface + +uses SysUtils, Windows, Classes, Forms, ORFn, rCore, uConst, ORClasses, ORNet, uCore; + +type + TECSReport = Class(TObject) + private + FReportHandle: string; // PCE report or Patient Summary report + FReportType : string; // D: display P: print + FPrintDEV : string; // if Print, the print device IEN + FReportStart : string; // Start Date + FReportEnd : string; // End Date + FNeedReason : string; // Need procedure reason ? + FECSPermit : boolean; // Authorized use of ECS + public + constructor Create; + property ReportHandle: string read FReportHandle write FReportHandle; + property ReportType : string read FReportType write FReportType; + property ReportStart : string read FReportStart write FReportStart; + property ReportEnd : string read FReportEnd write FReportEnd; + property PrintDEV : string read FPrintDEV write FPrintDEV; + property NeedReason : string read FNeedReason write FNeedReason; + property ECSPermit : boolean read FECSPermit write FECSPermit; + end; + +function GetVisitID: string; +function GetDivisionID: string; +function IsESSOInstalled: boolean; +procedure SaveUserPath(APathInfo: string; var CurPath: string); +procedure FormatECSDate(ADTStr: string; var AnECSRpt: TECSReport); +procedure LoadECSReportText(Dest: TStrings; AnECSRpt: TECSReport); +procedure PrintECSReportToDevice(AnECSRpt: TECSReport); + +implementation +uses TRPCB; + +constructor TECSReport.Create; +begin + ReportHandle := ''; + ReportType := ''; + ReportStart := ''; + ReportEnd := ''; + PrintDEV := ''; + FNeedReason := ''; + ECSPermit := False; +end; + +function IsESSOInstalled: boolean; +var + rtn: integer; +begin + Result := False; + rtn := StrToIntDef(SCallV('ORECS01 CHKESSO',[nil]),0); + if rtn > 0 then + Result := True; +end; + +function GetVisitID: string; +var + vsitStr: string; +begin + vsitStr := Encounter.VisitStr + ';' + Patient.DFN; + Result := SCallV('ORECS01 VSITID',[vsitStr]); +end; + +function GetDivisionID: string; +var + divID: string; +begin + divID := SCallV('ORECS01 GETDIV',[nil]); + Result := divID; +end; + +procedure SaveUserPath(APathInfo: string; var CurPath: string); +begin + CurPath := SCallV('ORECS01 SAVPATH',[APathInfo]); +end; + +procedure FormatECSDate(ADTStr: string; var AnECSRpt: TECSReport); +var + x,DaysBack :string; + Alpha, Omega: double; +begin + Alpha := 0; + Omega := 0; + if CharAt(ADTStr, 1) = 'T' then + begin + Alpha := StrToFMDateTime(Piece(ADTStr,';',1)); + Omega := StrToFMDateTime(Piece(ADTStr,';',2)); + end; + if CharAt(ADTStr, 1) = 'd' then + begin + x := Piece(ADTStr,';',1); + DaysBack := Copy(x, 2, Length(x)); + Alpha := StrToFMDateTime('T-' + DaysBack); + Omega := StrToFMDateTime('T'); + end; + AnECSRpt.ReportStart := FloatToStr(Alpha); + AnECSRpt.ReportEnd := FloatToStr(Omega); +end; + +procedure LoadECSReportText(Dest: TStrings; AnECSRpt: TECSReport); +var + userid: string; +begin + with RPCBrokerv do + begin + ClearParameters := True; + RemoteProcedure := 'ORECS01 ECRPT'; + Param[0].PType := list; + Param[0].Mult['"ECHNDL"'] := AnECSRpt.ReportHandle; + Param[0].Mult['"ECPTYP"'] := AnECSRpt.ReportType; + Param[0].Mult['"ECDEV"'] := AnECSRpt.PrintDEV; + Param[0].Mult['"ECDFN"'] := Patient.DFN; + Param[0].Mult['"ECSD"'] := AnECSRpt.ReportStart; + Param[0].Mult['"ECED"'] := AnECSRpt.ReportEnd; + Param[0].Mult['"ECRY"'] := AnECSRpt.NeedReason; + Param[0].Mult['"ECDUZ"'] := userid; + CallBroker; + end; + QuickCopy(RPCBrokerV.Results,Dest); +end; + +procedure PrintECSReportToDevice(AnECSRpt: TECSReport); +var + userid: string; +begin + userid := IntToStr(User.DUZ); + with RPCBrokerV do + begin + clearParameters := True; + RemoteProcedure := 'ORECS01 ECPRINT'; + Param[0].PType := List; + Param[0].Mult['"ECHNDL"'] := AnECSRpt.ReportHandle; + Param[0].Mult['"ECPTYP"'] := AnECSRpt.ReportType; + Param[0].Mult['"ECDEV"'] := AnECSRpt.PrintDEV; + Param[0].Mult['"ECDFN"'] := Patient.DFN; + Param[0].Mult['"ECSD"'] := AnECSRpt.ReportStart; + Param[0].Mult['"ECED"'] := AnECSRpt.ReportEnd; + Param[0].Mult['"ECRY"'] := AnECSRpt.NeedReason; + Param[0].Mult['"ECDUZ"'] := userid; + CallBroker; + end; +end; + +end. diff --git a/CPRS-Chart/rEventHooks.pas b/CPRS-Chart/rEventHooks.pas new file mode 100644 index 0000000..f850d35 --- /dev/null +++ b/CPRS-Chart/rEventHooks.pas @@ -0,0 +1,36 @@ +unit rEventHooks; + +interface + +uses + Classes, ORNet; + +function GetPatientChangeGUIDs: string; +function GetOrderAcceptGUIDs(DisplayGroup: integer): string; +function GetAllActiveCOMObjects: TStrings; +function GetCOMObjectDetails(IEN: integer): string; + +implementation + +function GetPatientChangeGUIDs: string; +begin + Result := sCallV('ORWCOM PTOBJ', []); +end; + +function GetOrderAcceptGUIDs(DisplayGroup: integer): string; +begin + Result := sCallV('ORWCOM ORDEROBJ', [DisplayGroup]); +end; + +function GetAllActiveCOMObjects: TStrings; +begin + CallV('ORWCOM GETOBJS', []); + Result := RPCBrokerV.Results; +end; + +function GetCOMObjectDetails(IEN: integer): string; +begin + Result := sCallV('ORWCOM DETAILS', [IEN]); +end; + +end. diff --git a/CPRS-Chart/rProbs.pas b/CPRS-Chart/rProbs.pas new file mode 100644 index 0000000..87684ec --- /dev/null +++ b/CPRS-Chart/rProbs.pas @@ -0,0 +1,201 @@ +unit rProbs; + +interface + +uses SysUtils, Classes, ORNet, ORFn, uCore; + +function AddSave(PatientInfo: string; ProviderID: int64; ptVAMC: string; + ProbFile: TStringList): TStrings ; +function AuditHistory(ProblemIFN: string): TStrings ; +function ClinicFilterList(LocList: TStringList): TStrings ; +function ClinicSearch(DummyArg:string): TStrings ; +function ProblemDelete(ProblemIFN: string; ProviderID: int64; ptVAMC, Comment: string): TStrings ; +{function ProblemDetail} +function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; +function EditSave(ProblemIFN: string; ProviderID: int64; ptVAMC, PrimUser: string; + ProbFile: TStringList): TStrings ; +function InitPt(const PatientDFN: string): TStrings ; //*DFN* +function InitUser(ProviderID: int64): TStrings ; +function PatientProviders(const PatientDFN: string): TStrings ; //*DFN* +function ProblemList(const PatientDFN: string; Status:string): TStrings ; //*DFN* +function OldProblemLexiconSearch(SearchFor: string; Matches: integer; ADate: TFMDateTime = 0): TStrings ; +function ProblemLexiconCodeSearch(LexIEN: string; CodeType: string; ADate: TFMDateTime = 0): string ; +function ProblemLexiconSearch(SearchFor: string; View: string; ADate: TFMDateTime = 0): TStrings ; +function ProviderFilterList(ProvList: TStringList): TStrings ; +function ProviderList(Flag:string; Number:integer; From,Part: string): TStrings ; +function ProblemReplace(ProblemIFN: string): TStrings ; +function ServiceFilterList(LocList: TStringList): TStrings ; +function ServiceSearch(const StartFrom: string; Direction: Integer; All: boolean = FALSE): TStrings; +function ProblemUpdate(AltProbFile: TStringList): TStrings ; +function UserProblemCategories(Provider: int64; Location: integer): TStrings ; +function UserProblemList(CategoryIEN: string): TStrings ; +function ProblemVerify(ProblemIFN: string): TStrings ; +function GetProblemComments(ProblemIFN: string): TStrings; +procedure SaveViewPreferences(ViewPref: string); +function CheckForDuplicateProblem(TermIEN, TermText: string): string; + +implementation + +function AddSave(PatientInfo: string; ProviderID: int64; ptVAMC: string; + ProbFile: TStringList): TStrings ; +begin + CallV('ORQQPL ADD SAVE',[PatientInfo, ProviderID, ptVAMC, ProbFile]); + Result := RPCBrokerV.Results ; +end ; + +function AuditHistory(ProblemIFN: string): TStrings ; +begin + CallV('ORQQPL AUDIT HIST',[ProblemIFN]); + Result := RPCBrokerV.Results ; +end ; + +function ClinicFilterList(LocList: TStringList): TStrings ; +begin + CallV('ORQQPL CLIN FILTER LIST',[LocList]); + MixedCaseList(RPCBrokerV.Results) ; + Result := RPCBrokerV.Results; +end ; + +function ClinicSearch(DummyArg:string): TStrings ; +begin + CallV('ORQQPL CLIN SRCH',[DummyArg]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemDelete(ProblemIFN: string; ProviderID: int64; ptVAMC, Comment: string): TStrings ; +begin + CallV('ORQQPL DELETE',[ProblemIFN, ProviderID, ptVAMC, Comment]); + Result := RPCBrokerV.Results ; +end ; + +function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; +begin + CallV('ORQQPL EDIT LOAD',[ProblemIFN, ProviderID, ptVAMC]); + Result := RPCBrokerV.Results ; +end ; + +function EditSave(ProblemIFN: string; ProviderID: int64; ptVAMC, PrimUser: string; + ProbFile: TStringList): TStrings ; +begin + CallV('ORQQPL EDIT SAVE',[ProblemIFN, ProviderID, ptVAMC, PrimUser, ProbFile]); + Result := RPCBrokerV.Results ; +end ; + +function InitPt(const PatientDFN: string): TStrings ; //*DFN* +begin + CallV('ORQQPL INIT PT',[PatientDFN]); + Result := RPCBrokerV.Results ; +end ; + +function InitUser(ProviderID: int64): TStrings ; +begin + CallV('ORQQPL INIT USER',[ProviderID]); + Result := RPCBrokerV.Results ; +end ; + +function PatientProviders(const PatientDFN: string): TStrings ; //*DFN* +begin + CallV('ORQPT PATIENT TEAM PROVIDERS',[PatientDFN]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemLexiconSearch(SearchFor: string; View: string; ADate: TFMDateTime = 0): TStrings ; +begin + CallV('ORWPCE LEX',[SearchFor,View, ADate]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemLexiconCodeSearch(LexIEN: string; CodeType: string; ADate: TFMDateTime = 0): string ; +begin + CallV('ORWPCE LEXCODE',[LexIEN, CodeType, ADate]); + Result := RPCBrokerV.Results[0] ; +end ; + +function OldProblemLexiconSearch(SearchFor: string; Matches: integer; ADate: TFMDateTime = 0): TStrings ; +const + VIEW = ''; +begin + CallV('ORQQPL PROBLEM LEX SEARCH',[SearchFor, Matches, VIEW, ADate]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemList(const PatientDFN: string; Status:string): TStrings ; //*DFN* +begin + CallV('ORQQPL PROBLEM LIST',[PatientDFN, status]); + Result := RPCBrokerV.Results ; +end ; + +function ProviderFilterList(ProvList: TStringList): TStrings ; +begin + CallV('ORQQPL PROV FILTER LIST',[ProvList]); + Result := RPCBrokerV.Results ; +end ; + +function ProviderList(Flag:string; Number:integer; From,Part: string): TStrings ; +begin + CallV('ORQQPL PROVIDER LIST',[Flag,Number,From,Part]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemReplace(ProblemIFN: string): TStrings ; +begin + CallV('ORQQPL REPLACE',[ProblemIFN]); + Result := RPCBrokerV.Results ; +end ; + +function ServiceFilterList(LocList: TStringList): TStrings ; +begin + CallV('ORQQPL SERV FILTER LIST',[LocList]); + MixedCaseList(RPCBrokerV.Results) ; + Result := RPCBrokerV.Results; +end ; + +function ServiceSearch(const StartFrom: string; Direction: Integer; All: boolean = FALSE): TStrings; +begin + CallV('ORQQPL SRVC SRCH',[StartFrom, Direction, BoolChar[All]]); + MixedCaseList(RPCBrokerV.Results) ; + Result := RPCBrokerV.Results ; +end ; + +function ProblemUpdate(AltProbFile: TStringList): TStrings ; +begin + CallV('ORQQPL UPDATE',[AltProbFile]); + Result := RPCBrokerV.Results ; +end ; + +function ProblemVerify(ProblemIFN: string): TStrings ; +begin + CallV('ORQQPL VERIFY',[ProblemIFN]); + Result := RPCBrokerV.Results ; +end ; + +function UserProblemCategories(Provider: int64; Location: integer): TStrings ; +begin + CallV('ORQQPL USER PROB CATS',[Provider, Location]); + Result := RPCBrokerV.Results ; +end ; + +function UserProblemList(CategoryIEN: string): TStrings ; +begin + CallV('ORQQPL USER PROB LIST',[CategoryIEN]); + Result := RPCBrokerV.Results ; +end ; + +function GetProblemComments(ProblemIFN: string): TStrings; +begin + CallV('ORQQPL PROB COMMENTS',[ProblemIFN]); + Result := RPCBrokerV.Results ; +end; + +procedure SaveViewPreferences(ViewPref: string); +begin + CallV('ORQQPL SAVEVIEW',[ViewPref]); +end; + +function CheckForDuplicateProblem(TermIEN, TermText: string): string; +begin + CallV('ORQQPL CHECK DUP',[Patient.DFN, TermIEN, TermText]); + Result := RPCBrokerV.Results[0]; +end; + +end. diff --git a/CPRS-Chart/sBitmaps.res b/CPRS-Chart/sBitmaps.res new file mode 100644 index 0000000..4ca89c5 Binary files /dev/null and b/CPRS-Chart/sBitmaps.res differ diff --git a/CPRS-Chart/sRemSrch.avi b/CPRS-Chart/sRemSrch.avi new file mode 100644 index 0000000..11476a7 Binary files /dev/null and b/CPRS-Chart/sRemSrch.avi differ diff --git a/CPRS-Chart/sRemSrch.rc b/CPRS-Chart/sRemSrch.rc new file mode 100644 index 0000000..24cb753 --- /dev/null +++ b/CPRS-Chart/sRemSrch.rc @@ -0,0 +1 @@ +REMSEARCHAVI AVI "RemSrch.avi" diff --git a/CPRS-Chart/sRemSrch.res b/CPRS-Chart/sRemSrch.res new file mode 100644 index 0000000..86ba2f7 Binary files /dev/null and b/CPRS-Chart/sRemSrch.res differ