Produced by Araxis Merge on 1/31/2019 1:51:45 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | CPRS v31b Phase 2 T257 CiF Submission..zip\CPRS v31b Phase 2 T257 CiF Submission\OR_30_377V257_src | fFrame.pas | Thu Nov 15 18:27:48 2018 UTC |
| 2 | CPRS v31b Phase 2 T257 CiF Submission.zip\CPRS v31b Phase 2 T257 CiF Submission\OR_30_377V257_src | fFrame.pas | Tue Jan 29 15:28:16 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 10738 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | unit fFram e; | |
| 2 | { This is the main f orm for th e CPRS GUI . It prov ides a pat ient-encou nter-user framework | |
| 3 | which al l the othe r forms of the GUI u se. } | |
| 4 | ||
| 5 | {$OPTIMIZA TION OFF} / / REMOVE A FTER UNIT IS DEBUGGE D | |
| 6 | {$WARN SYM BOL_PLATFO RM OFF} | |
| 7 | {$DEFINE C COWBROKER} | |
| 8 | ||
| 9 | {$undef de bug} | |
| 10 | ||
| 11 | interface | |
| 12 | ||
| 13 | uses | |
| 14 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dia logs, Tabs , ComCtrls , | |
| 15 | ExtCtrls , Menus, S tdCtrls, B uttons, OR Fn, fPage, uConst, O RCtrls, Tr pcb, Contn rs, | |
| 16 | OleCtrls , VERGENCE CONTEXTORL ib_TLB, Co mObj, AppE vnts, fBas e508Form, oPKIEncryp tion, | |
| 17 | VA508Acc essibility Manager, R ichEdit, f DebugRepor t, StrUtil s, vcl.Act nList, | |
| 18 | System.S yncObjs, U _CPTAppMon itor, ORNe tIntf; | |
| 19 | ||
| 20 | type | |
| 21 | TfrmFram e = class( TfrmBase50 8Form) | |
| 22 | pnlToo lbar: TPan el; | |
| 23 | stsAre a: TStatus Bar; | |
| 24 | tabPag e: TTabCon trol; | |
| 25 | pnlPag e: TPanel; | |
| 26 | bvlPag eTop: TBev el; | |
| 27 | bvlToo lTop: TBev el; | |
| 28 | pnlPat ient: TKey ClickPanel ; | |
| 29 | lblPtN ame: TStat icText; | |
| 30 | lblPtS SN: TStati cText; | |
| 31 | lblPtA ge: TStati cText; | |
| 32 | pnlVis it: TKeyCl ickPanel; | |
| 33 | lblPtL ocation: T StaticText ; | |
| 34 | lblPtP rovider: T StaticText ; | |
| 35 | mnuFra me: TMainM enu; | |
| 36 | mnuFil e: TMenuIt em; | |
| 37 | mnuFil eExit: TMe nuItem; | |
| 38 | mnuFil eOpen: TMe nuItem; | |
| 39 | mnuFil eReview: T MenuItem; | |
| 40 | Z1: TM enuItem; | |
| 41 | mnuFil ePrint: TM enuItem; | |
| 42 | mnuEdi t: TMenuIt em; | |
| 43 | mnuEdi tUndo: TMe nuItem; | |
| 44 | Z3: TM enuItem; | |
| 45 | mnuEdi tCut: TMen uItem; | |
| 46 | mnuEdi tCopy: TMe nuItem; | |
| 47 | mnuEdi tPaste: TM enuItem; | |
| 48 | Z4: TM enuItem; | |
| 49 | mnuEdi tPref: TMe nuItem; | |
| 50 | Prefs1 : TMenuIte m; | |
| 51 | mnu14p t1: TMenuI tem; | |
| 52 | mnu12p t1: TMenuI tem; | |
| 53 | mnu10p t1: TMenuI tem; | |
| 54 | mnu8pt : TMenuIte m; | |
| 55 | mnuHel p: TMenuIt em; | |
| 56 | mnuHel pContents: TMenuItem ; | |
| 57 | mnuHel pTutor: TM enuItem; | |
| 58 | Z5: TM enuItem; | |
| 59 | mnuHel pAbout: TM enuItem; | |
| 60 | mnuToo ls: TMenuI tem; | |
| 61 | mnuVie w: TMenuIt em; | |
| 62 | mnuVie wChart: TM enuItem; | |
| 63 | mnuCha rtReports: TMenuItem ; | |
| 64 | mnuCha rtLabs: TM enuItem; | |
| 65 | mnuCha rtDCSumm: TMenuItem; | |
| 66 | mnuCha rtCslts: T MenuItem; | |
| 67 | mnuCha rtNotes: T MenuItem; | |
| 68 | mnuCha rtOrders: TMenuItem; | |
| 69 | mnuCha rtMeds: TM enuItem; | |
| 70 | mnuCha rtProbs: T MenuItem; | |
| 71 | mnuCha rtCover: T MenuItem; | |
| 72 | mnuHel pBroker: T MenuItem; | |
| 73 | mnuFil eEncounter : TMenuIte m; | |
| 74 | mnuVie wDemo: TMe nuItem; | |
| 75 | mnuVie wPostings: TMenuItem ; | |
| 76 | mnuHel pLists: TM enuItem; | |
| 77 | Z6: TM enuItem; | |
| 78 | mnuHel pSymbols: TMenuItem; | |
| 79 | mnuFil eNext: TMe nuItem; | |
| 80 | Z7: TM enuItem; | |
| 81 | mnuFil eRefresh: TMenuItem; | |
| 82 | pnlPri maryCare: TKeyClickP anel; | |
| 83 | lblPtC are: TStat icText; | |
| 84 | lblPtA ttending: TStaticTex t; | |
| 85 | pnlRem inders: TK eyClickPan el; | |
| 86 | imgRem inder: TIm age; | |
| 87 | mnuVie wReminders : TMenuIte m; | |
| 88 | anmtRe mSearch: T Animate; | |
| 89 | lstCIR NLocations : TORListB ox; | |
| 90 | popCIR N: TPopupM enu; | |
| 91 | popCIR NSelectAll : TMenuIte m; | |
| 92 | popCIR NSelectNon e: TMenuIt em; | |
| 93 | popCIR NClose: TM enuItem; | |
| 94 | mnuFil ePrintSetu p: TMenuIt em; | |
| 95 | LabInf o1: TMenuI tem; | |
| 96 | mnuFil eNotifRemo ve: TMenuI tem; | |
| 97 | Z8: TM enuItem; | |
| 98 | mnuToo lsOptions: TMenuItem ; | |
| 99 | mnuCha rtSurgery: TMenuItem ; | |
| 100 | OROpen Dlg: TOpen Dialog; | |
| 101 | mnuFil eResumeCon text: TMen uItem; | |
| 102 | mnuFil eResumeCon textSet: T MenuItem; | |
| 103 | Useexi stingconte xt1: TMenu Item; | |
| 104 | mnuFil eBreakCont ext: TMenu Item; | |
| 105 | pnlCCO W: TPanel; | |
| 106 | imgCCO W: TImage; | |
| 107 | pnlPat ientSelect ed: TPanel ; | |
| 108 | pnlNoP atientSele cted: TPan el; | |
| 109 | pnlPos tings: TKe yClickPane l; | |
| 110 | lblPtP ostings: T StaticText ; | |
| 111 | lblPtC WAD: TStat icText; | |
| 112 | mnuFil ePrintSele ctedItems: TMenuItem ; | |
| 113 | popAle rts: TPopu pMenu; | |
| 114 | mnuAle rtContinue : TMenuIte m; | |
| 115 | mnuAle rtForward: TMenuItem ; | |
| 116 | mnuAle rtRenew: T MenuItem; | |
| 117 | AppEve nts: TAppl icationEve nts; | |
| 118 | paVAA: TKeyClick Panel; | |
| 119 | mnuToo lsGraphing : TMenuIte m; | |
| 120 | laVAA2 : TButton; | |
| 121 | laMHV: TButton; | |
| 122 | mnuVie wInformati on: TMenuI tem; | |
| 123 | mnuVie wVisits: T MenuItem; | |
| 124 | mnuVie wPrimaryCa re: TMenuI tem; | |
| 125 | mnuVie wMyHealthe Vet: TMenu Item; | |
| 126 | mnuIns urance: TM enuItem; | |
| 127 | mnuVie wFlags: TM enuItem; | |
| 128 | mnuVie wRemoteDat a: TMenuIt em; | |
| 129 | compAc cessTabPag e: TVA508C omponentAc cessibilit y; | |
| 130 | pnlCVn Flag: TPan el; | |
| 131 | btnCom batVet: TB utton; | |
| 132 | pnlFla g: TKeyCli ckPanel; | |
| 133 | lblFla g: TLabel; | |
| 134 | pnlRem oteData: T KeyClickPa nel; | |
| 135 | pnlVis taWeb: TKe yClickPane l; | |
| 136 | lblVis taWeb: TLa bel; | |
| 137 | pnlCIR N: TKeyCli ckPanel; | |
| 138 | lblCIR N: TLabel; | |
| 139 | mnuEdi tRedo: TMe nuItem; | |
| 140 | lblPtM HTC: TStat icText; | |
| 141 | Digita lSigningSe tup1: TMen uItem; | |
| 142 | mnuFoc usChanges: TMenuItem ; | |
| 143 | txtCmd Flags: TVA 508StaticT ext; | |
| 144 | mnuFil eViewNotif ications: TMenuItem; | |
| 145 | CPAppM on: TCopyA pplication Monitor; | |
| 146 | pnlOTH D: TKeyCli ckPanel; | |
| 147 | lblOTH D: TStatic Text; | |
| 148 | lblOTH DTitle: TS taticText; // rpk 1 1/28/2017 | |
| 149 | proced ure tabPag eChange(Se nder: TObj ect); | |
| 150 | proced ure FormCr eate(Sende r: TObject ); | |
| 151 | proced ure FormRe size(Sende r: TObject ); | |
| 152 | proced ure pnlPat ientMouseD own(Sender : TObject; Button: T MouseButto n; | |
| 153 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 154 | proced ure pnlPat ientMouseU p(Sender: TObject; B utton: TMo useButton; | |
| 155 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 156 | proced ure pnlVis itMouseDow n(Sender: TObject; B utton: TMo useButton; | |
| 157 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 158 | proced ure pnlVis itMouseUp( Sender: TO bject; But ton: TMous eButton; | |
| 159 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 160 | proced ure mnuFil eExitClick (Sender: T Object); | |
| 161 | proced ure pnlPos tingsMouse Down(Sende r: TObject ; Button: TMouseButt on; | |
| 162 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 163 | proced ure pnlPos tingsMouse Up(Sender: TObject; Button: TM ouseButton ; | |
| 164 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 165 | proced ure mnuFon tSizeClick (Sender: T Object); | |
| 166 | proced ure mnuCha rtTabClick (Sender: T Object); | |
| 167 | proced ure FormDe stroy(Send er: TObjec t); | |
| 168 | proced ure mnuFil eOpenClick (Sender: T Object); | |
| 169 | proced ure mnuHel pBrokerCli ck(Sender: TObject); | |
| 170 | proced ure mnuFil eEncounter Click(Send er: TObjec t); | |
| 171 | proced ure mnuVie wPostingsC lick(Sende r: TObject ); | |
| 172 | proced ure mnuHel pAboutClic k(Sender: TObject); | |
| 173 | proced ure mnuFil eReviewCli ck(Sender: TObject); | |
| 174 | proced ure FormCl oseQuery(S ender: TOb ject; var CanClose: Boolean); | |
| 175 | proced ure mnuHel pListsClic k(Sender: TObject); | |
| 176 | proced ure ToolCl ick(Sender : TObject) ; | |
| 177 | proced ure mnuEdi tClick(Sen der: TObje ct); | |
| 178 | proced ure mnuEdi tUndoClick (Sender: T Object); | |
| 179 | proced ure mnuEdi tCutClick( Sender: TO bject); | |
| 180 | proced ure mnuEdi tCopyClick (Sender: T Object); | |
| 181 | proced ure mnuEdi tPasteClic k(Sender: TObject); | |
| 182 | proced ure mnuHel pSymbolsCl ick(Sender : TObject) ; | |
| 183 | proced ure FormCl ose(Sender : TObject; var Actio n: TCloseA ction); | |
| 184 | proced ure mnuFil ePrintClic k(Sender: TObject); | |
| 185 | proced ure mnuGEC StatusClic k(Sender: TObject); | |
| 186 | proced ure mnuFil eNextClick (Sender: T Object); | |
| 187 | proced ure pnlPri maryCareMo useDown(Se nder: TObj ect; | |
| 188 | Butt on: TMouse Button; Sh ift: TShif tState; X, Y: Intege r); | |
| 189 | proced ure pnlPri maryCareMo useUp(Send er: TObjec t; Button: TMouseBut ton; | |
| 190 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 191 | proced ure pnlRem indersMous eDown(Send er: TObjec t; Button: TMouseBut ton; | |
| 192 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 193 | proced ure pnlRem indersMous eUp(Sender : TObject; Button: T MouseButto n; | |
| 194 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 195 | proced ure pnlCIR NClick(Sen der: TObje ct); | |
| 196 | proced ure lstCIR NLocations Click(Send er: TObjec t); | |
| 197 | proced ure popCIR NCloseClic k(Sender: TObject); | |
| 198 | proced ure popCIR NSelectAll Click(Send er: TObjec t); | |
| 199 | proced ure popCIR NSelectNon eClick(Sen der: TObje ct); | |
| 200 | proced ure mnuFil ePrintSetu pClick(Sen der: TObje ct); | |
| 201 | proced ure LabInf o1Click(Se nder: TObj ect); | |
| 202 | proced ure mnuFil eNotifRemo veClick(Se nder: TObj ect); | |
| 203 | proced ure mnuToo lsOptionsC lick(Sende r: TObject ); | |
| 204 | proced ure mnuFil eRefreshCl ick(Sender : TObject) ; | |
| 205 | proced ure FormKe yDown(Send er: TObjec t; var Key : Word; | |
| 206 | Shif t: TShiftS tate); | |
| 207 | proced ure FormAc tivate(Sen der: TObje ct); | |
| 208 | proced ure pnlPri maryCareEn ter(Sender : TObject) ; | |
| 209 | proced ure pnlPri maryCareEx it(Sender: TObject); | |
| 210 | proced ure pnlPat ientClick( Sender: TO bject); | |
| 211 | proced ure pnlVis itClick(Se nder: TObj ect); | |
| 212 | proced ure pnlPri maryCareCl ick(Sender : TObject) ; | |
| 213 | proced ure pnlRem indersClic k(Sender: TObject); | |
| 214 | proced ure pnlPos tingsClick (Sender: T Object); | |
| 215 | proced ure ctxCon textorCanc eled(Sende r: TObject ); | |
| 216 | proced ure ctxCon textorComm itted(Send er: TObjec t); | |
| 217 | proced ure ctxCon textorPend ing(Sender : TObject; | |
| 218 | cons t aContext ItemCollec tion: IDis patch); | |
| 219 | proced ure mnuDeb ugReportCl ick(Sender : TObject) ; | |
| 220 | proced ure mnuFil eBreakCont extClick(S ender: TOb ject); | |
| 221 | proced ure mnuFil eResumeCon textGetCli ck(Sender: TObject); | |
| 222 | proced ure mnuFil eResumeCon textSetCli ck(Sender: TObject); | |
| 223 | proced ure pnlFla gMouseDown (Sender: T Object; Bu tton: TMou seButton; | |
| 224 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 225 | proced ure pnlFla gMouseUp(S ender: TOb ject; Butt on: TMouse Button; | |
| 226 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 227 | proced ure pnlFla gClick(Sen der: TObje ct); | |
| 228 | proced ure mnuFil ePrintSele ctedItemsC lick(Sende r: TObject ); | |
| 229 | proced ure mnuAle rtRenewCli ck(Sender: TObject); | |
| 230 | proced ure mnuAle rtForwardC lick(Sende r: TObject ); | |
| 231 | proced ure pnlFla gEnter(Sen der: TObje ct); | |
| 232 | proced ure pnlFla gExit(Send er: TObjec t); | |
| 233 | proced ure tabPag eMouseUp(S ender: TOb ject; Butt on: TMouse Button; | |
| 234 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 235 | proced ure lstCIR NLocations Exit(Sende r: TObject ); | |
| 236 | proced ure AppEve ntsActivat e(Sender: TObject); | |
| 237 | proced ure Screen ActiveForm Change(Sen der: TObje ct); | |
| 238 | proced ure AppEve ntsShortCu t(var Msg: TWMKey; v ar Handled : Boolean) ; | |
| 239 | proced ure mnuToo lsGraphing Click(Send er: TObjec t); | |
| 240 | proced ure pnlCIR NMouseDown (Sender: T Object; Bu tton: TMou seButton; | |
| 241 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 242 | proced ure pnlCIR NMouseUp(S ender: TOb ject; Butt on: TMouse Button; | |
| 243 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 244 | proced ure laMHVC lick(Sende r: TObject ); | |
| 245 | proced ure laVAA2 Click(Send er: TObjec t); | |
| 246 | proced ure ViewIn fo(Sender: TObject); | |
| 247 | proced ure mnuVie wInformati onClick(Se nder: TObj ect); | |
| 248 | proced ure compAc cessTabPag eCaptionQu ery(Sender : TObject; | |
| 249 | var Text: stri ng); | |
| 250 | proced ure btnCom batVetClic k(Sender: TObject); | |
| 251 | proced ure pnlVis taWebClick (Sender: T Object); | |
| 252 | proced ure pnlVis taWebMouse Up(Sender: TObject; Button: TM ouseButton ; | |
| 253 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 254 | proced ure pnlVis taWebMouse Down(Sende r: TObject ; Button: TMouseButt on; | |
| 255 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 256 | proced ure mnuEdi tRedoClick (Sender: T Object); | |
| 257 | proced ure tabPag eMouseDown (Sender: T Object; Bu tton: TMou seButton; | |
| 258 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 259 | proced ure Digita lSigningSe tup1Click( Sender: TO bject); | |
| 260 | proced ure mnuFoc usChangesC lick(Sende r: TObject ); | |
| 261 | proced ure AppEve ntsMessage (var Msg: tagMSG; va r Handled: Boolean); | |
| 262 | proced ure mnuFil eViewNotif icationsCl ick(Sender : TObject) ; | |
| 263 | proced ure paVAAR esize(Send er: TObjec t); | |
| 264 | proced ure LoadBu ffer(Sende r: TObject ; LoadList : TStrings ; var Proc essLoad: B oolean); | |
| 265 | proced ure LoadPr operties(S ender: TOb ject); | |
| 266 | proced ure SaveBu ffer(Sende r: TObject ; SaveList : TStringL ist; var R eturnList: TStringLi st); | |
| 267 | proced ure StartP ollBuff(Se nder: TObj ect; var E rror: Bool ean); | |
| 268 | proced ure StopPo llBuff(Sen der: TObje ct; var Er ror: Boole an); | |
| 269 | proced ure pnlOTH DEnter(Sen der: TObje ct); // rp k 1/5/2018 | |
| 270 | proced ure pnlOTH DExit(Send er: TObjec t); // rp k 1/5/2018 | |
| 271 | proced ure pnlOTH DClick(Sen der: TObje ct); // r pk 1/5/201 8 | |
| 272 | proced ure lblOTH DClick(Sen der: TObje ct); // rpk 1/5/20 18 | |
| 273 | proced ure lblOTH DTitleClic k(Sender: TObject); | |
| 274 | private | |
| 275 | FProcc essingNext Click : bo olean; | |
| 276 | FJustE nteredApp : boolean; | |
| 277 | FCCOWI nstalled: boolean; | |
| 278 | FCCOWC ontextChan ging: bool ean; | |
| 279 | FCCOWI conName: s tring; | |
| 280 | FCCOWD rivedChang e: boolean ; | |
| 281 | FCCOWB usy: boole an; | |
| 282 | FCCOWE rror: bool ean; | |
| 283 | FCCOWJ ustJoined: boolean; | |
| 284 | FNoPat ientSelect ed: boolea n; | |
| 285 | FRefre shing: boo lean; | |
| 286 | FClosi ng: boolea n; | |
| 287 | FConte xtChanging : Boolean; | |
| 288 | FChang eSource: I nteger; | |
| 289 | FCreat eProgress: Integer; | |
| 290 | FEditC trl: TCust omEdit; | |
| 291 | FLastP age: TForm ; | |
| 292 | FNextB uttonL: In teger; | |
| 293 | FNextB uttonR: In teger; | |
| 294 | FNextB uttonActiv e: Boolean ; | |
| 295 | FNextB uttonBitma p: TBitmap ; | |
| 296 | FNextB utton: TBi tBtn; | |
| 297 | FTermi nate: Bool ean; | |
| 298 | FTabCh anged: TNo tifyEvent; | |
| 299 | FOldAc tivate: TN otifyEvent ; | |
| 300 | FOldAc tiveFormCh ange: TNot ifyEvent; | |
| 301 | FECSAu thUser: Bo olean; | |
| 302 | FFixed StatusWidt h: integer ; | |
| 303 | FPrevI nPatient: Boolean; | |
| 304 | FFirst Load: B oolean; | |
| 305 | FFlagL ist: TStri ngList; | |
| 306 | FPrevP tID: strin g; | |
| 307 | FGraph FloatActiv e: boolean ; | |
| 308 | FGraph Context: s tring; | |
| 309 | FDoNot ChangeEncW indow: boo lean; | |
| 310 | FOrder PrintForm: boolean; | |
| 311 | FRevie wclick: bo olean; | |
| 312 | FCtrlT abUsed: bo olean; | |
| 313 | proced ure Refres hFixedStat usWidth; | |
| 314 | proced ure FocusA pplication TopForm; | |
| 315 | proced ure AppAct ivated(Sen der: TObje ct); | |
| 316 | proced ure AppDeA ctivated(S ender: TOb ject); | |
| 317 | proced ure AppExc eption(Sen der: TObje ct; E: Exc eption); | |
| 318 | functi on AllowCo ntextChang eAll(var R eason: str ing): Boo lean; | |
| 319 | proced ure ClearP atient; | |
| 320 | proced ure Change Font(NewFo ntSize: In teger); | |
| 321 | proced ure Create Tab(ATabID : integer; ALabel: s tring); | |
| 322 | proced ure Determ ineNextTab ; | |
| 323 | functi on ExpandC ommand(x: string): s tring; | |
| 324 | proced ure FitToo lbar; | |
| 325 | proced ure LoadSi zesForUser ; | |
| 326 | proced ure SaveSi zesForUser ; | |
| 327 | proced ure LoadUs erPreferen ces; | |
| 328 | proced ure SaveUs erPreferen ces; | |
| 329 | proced ure Switch ToPage(New Form: TFor m); | |
| 330 | functi on TabToPa geID(Tab: Integer): Integer; | |
| 331 | functi on Timeout Condition: boolean; | |
| 332 | functi on GetTime dOut: bool ean; | |
| 333 | proced ure TimeOu tAction; | |
| 334 | proced ure SetUse rTools; | |
| 335 | proced ure SetDeb ugMenu; | |
| 336 | proced ure SetupP atient(AFl aggedList : TStringL ist = nil) ; | |
| 337 | proced ure Remind ersChanged (Sender: T Object); | |
| 338 | proced ure Report sOnlyDispl ay; | |
| 339 | proced ure UMInit iate(var M essage: TM essage); message U M_INITIATE ; | |
| 340 | proced ure UMNewO rder(var M essage: TM essage); message U M_NEWORDER ; | |
| 341 | proced ure UMRemi nders(var Message: T Message); message U M_REMINDER S; | |
| 342 | proced ure UMStat usText(var Message: TMessage); message U M_STATUSTE XT; | |
| 343 | proced ure UMShow Page(var M essage: TM essage); message U M_SHOWPAGE ; | |
| 344 | proced ure WMSetF ocus(var M essage: TM essage); message W M_SETFOCUS ; | |
| 345 | proced ure WMSysC ommand(var Message: TMessage); message W M_SYSCOMMA ND; | |
| 346 | proced ure Update ECSParamet er(var Cmd Parameter: string); | |
| 347 | functi on ValidE CSUser: bo olean; | |
| 348 | proced ure StartC COWContext or; | |
| 349 | functi on AllowC COWContext Change(var CCOWRespo nse: UserR esponse; N ewDFN: str ing): bool ean; | |
| 350 | proced ure Update CCOWContex t; | |
| 351 | proced ure CheckH yperlinkRe sponse(aCo ntextItemC ollection: IDispatch ; var Hype rlinkReaso n: string) ; | |
| 352 | proced ure CheckF orDifferen tPatient(a ContextIte mCollectio n: IDispat ch; var Pt Changed: b oolean); | |
| 353 | {$IFDEF CC OWBROKER} | |
| 354 | proced ure CheckF orDifferen tUser(aCon textItemCo llection: IDispatch; var UserC hanged: bo olean); | |
| 355 | {$ENDIF} | |
| 356 | proced ure HideEv erything(A Message: s tring = 'N o patient is current ly selecte d.'); | |
| 357 | proced ure ShowEv erything; | |
| 358 | functi on FindBes tCCOWDFN: string; | |
| 359 | proced ure Handle CCOWError( AMessage: string); | |
| 360 | proced ure SetUpN extButton; | |
| 361 | proced ure NextBu ttonClick( Sender: TO bject); | |
| 362 | proced ure NextBu ttonMouseD own(Sender : TObject; Button: T MouseButto n; | |
| 363 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 364 | proced ure ModalE nd(Sender: TObject); | |
| 365 | Proced ure GetExc ludedFromM ixed(); | |
| 366 | public | |
| 367 | Enduri ngPtSelSpl itterPos, frmFrameHe ight, pnlP atientSele ctedHeight : integer; | |
| 368 | Enduri ngPtSelCol umns: stri ng; | |
| 369 | proced ure SetBAD xList; | |
| 370 | proced ure SetAct iveTab(Pag eID: Integ er); | |
| 371 | proced ure Refres hCWAD(Send er: TObjec t); // TDr ugs Patch OR*3*377 a nd WV*1*24 - DanP@SL C 11-20-20 15 | |
| 372 | proced ure Update VAAMHVButt ons(Sender : TObject) ; // TDrug s Patch OR *3*377 and WV*1*24 - DanP@SLC 01-02-2016 | |
| 373 | ||
| 374 | functi on PageIDT oTab(PageI D: Integer ): Integer ; | |
| 375 | proced ure ShowHi deChartTab Menus(AMen uItem: TMe nuItem); | |
| 376 | proced ure Update PtInfoOnRe fresh; | |
| 377 | functi on TabExi sts(ATabID : integer) : boolean; | |
| 378 | proced ure Displa yEncounter Text; | |
| 379 | functi on DLLActi ve: boolea n; | |
| 380 | proper ty ChangeS ource: Integer re ad FChange Source; | |
| 381 | proper ty CCOWCon textChangi ng: Boolea n read FCC OWContextC hanging; | |
| 382 | proper ty CCOWDri vedChange: Boolean read FCCOW DrivedChan ge; | |
| 383 | proper ty CCOWBus y: Boolean read F CCOWBusy write FCCO WBusy; | |
| 384 | proper ty Context Changing: Boolean re ad FContex tChanging; | |
| 385 | proper ty TimedOu t: Boolean re ad GetTime dOut; | |
| 386 | proper ty Closing : Boolean re ad FClosin g; | |
| 387 | proper ty OnTabCh anged: TNotifyEve nt read FT abChanged write FTab Changed; | |
| 388 | proper ty GraphFl oatActive: boolean r ead FGraph FloatActiv e write FG raphFloatA ctive; | |
| 389 | proper ty GraphCo ntext: str ing read F GraphConte xt write F GraphConte xt; | |
| 390 | proced ure Toggle MenuItemCh ecked(Send er: TObjec t); | |
| 391 | proced ure SetUpC IRN; | |
| 392 | proper ty DoNotCh angeEncWin dow: boole an read FD oNotChange EncWindow write FDoN otChangeEn cWindow; | |
| 393 | proper ty OrderPr intForm: b oolean rea d FOrderPr intForm wr ite FOrder PrintForm; | |
| 394 | end; | |
| 395 | ||
| 396 | TRpcReco rd = recor d | |
| 397 | RpcNam e: String; | |
| 398 | UCallL istIndex: Integer; | |
| 399 | Result ListIndex: Integer; | |
| 400 | Search Index: Int eger; | |
| 401 | RPCTex t: TString List; | |
| 402 | RPCRun Time: stri ng; | |
| 403 | end; | |
| 404 | ||
| 405 | var | |
| 406 | frmFrame : TfrmFram e; | |
| 407 | uTabList : TStringL ist; | |
| 408 | uLabRemo teType, uR emoteType, uReportID , uLabRepI D : string ; | |
| 409 | FlaggedP TList: TSt ringList; | |
| 410 | ctxConte xtor : TCo ntextorCon trol; | |
| 411 | NextTab, LastTab, ChangingTa b: Integer ; | |
| 412 | uUseVist aWeb: bool ean; | |
| 413 | PTSwitch Refresh: b oolean = F alse; //f lag for pa tient refr esh or swi tch of pat ients | |
| 414 | ProbTabC licked: bo olean = FA LSE; | |
| 415 | TabCtrlC licked: Bo olean = FA LSE; | |
| 416 | DEAConte xt: Boolea n = False; | |
| 417 | DelayRev iewChanges : Boolean = False; | |
| 418 | WatchArr ay: Array of TRpcRec ord; | |
| 419 | ||
| 420 | const | |
| 421 | PASSCODE = '_gghwn 7pghCrOJvO V61PtPvgde EU2u5cRsGv pkVDjKT_H7 SdKE_hqFYW sUIVT1H7Jw T6Yz8oCtd2 u2PALqWxib NXx3Yo8GPc TYsNaxW' + 'ZFo8OgT1 1D5TIvpu3c DQuZd3Yh_n V9jhkvb0ZB GdO9n-uNXP PEK7xfYWCI 2Wp3Dsu9YD Sd_EM34nvr gy64cqu9_j FJKJnGiXY9 6Lf1ecLiv4 LT9qtmJ-Ba wYt7O9JZGA swi344BmmC bNxfgvgf0g fGZea'; | |
| 422 | EM_SETZO OM = (WM_U SER + 225) ; | |
| 423 | implementa tion | |
| 424 | ||
| 425 | {$R *.DFM} | |
| 426 | {$R sBitma ps} | |
| 427 | {$R sRemSr ch} | |
| 428 | ||
| 429 | uses | |
| 430 | ORNet, r Core, fPtS elMsg, fPt Sel, fCove rSheet, fP robs, fMed s, fOrders , rOrders, fNotes, f Consults, fDCSumm, | |
| 431 | rMisc, C lipbrd, fL abs, fRepo rts, rRepo rts, fPtDe mo, fEncnt , fPtCWAD, uCore, fA bout, fRev iew, fxBro ker, | |
| 432 | fxLists, fxServer, ORSystem, fRptBox, fSplash, r ODAllergy, uInit, fL abTests, f LabInfo, u GlobalVar, | |
| 433 | uReminde rs, fRemin derTree, O RClasses, fDeviceSel ect, fDraw ers, fRemi nderDialog , ShellAPI , rVitals, | |
| 434 | fOptions , fGraphs, fGraphDat a, rTempla tes, fSurg ery, rSurg ery, uEven tHooks, uS ignItems, | |
| 435 | fDefault Event, rEC S, fIconLe gend, uOrd ers, fPtSe lOptns, Da teUtils, u Spell, uOr Ptf, fPati entFlagMul ti, | |
| 436 | fAlertFo rward, UBA Globals, f BAOptionsD iagnoses, UBACore, f OrdersSign , uVitals, fOrdersRe new, fMHTe st, uFormM onitor | |
| 437 | {$IFDEF CCOWBROKER } | |
| 438 | , CCOW_c onst | |
| 439 | {$ENDIF} | |
| 440 | , VA508A ccessibili tyRouter, fOtherSche dule, VAUt ils, uVA50 8CPRSCompa tibility, fIVRoutes, | |
| 441 | fPrintLo cation, fT emplateEdi tor, fTemp lateDialog , fCombatV et, fFocus edControls , | |
| 442 | fViewNot ifications , iCoverSh eetIntf, A VCatcher, System.Ini Files; | |
| 443 | ||
| 444 | var | |
| 445 | IsRunExe cuted: Boo lean = FAL SE; | |
| 446 | GraphFlo at: TfrmGr aphs; | |
| 447 | OTHDShor tStr, | |
| 448 | OTHDLong Str1, OTHD LongStr2, | |
| 449 | OTHDLoca lMsg: Stri ng; // rpk 2/28/2018 | |
| 450 | const | |
| 451 | FCP_UPDA TE = 10; // form crea te about t o check au to-update | |
| 452 | FCP_SETH OOK = 20; // form crea te about t o set time out hooks | |
| 453 | FCP_SERV ER = 30; // form crea te about t o connect to server | |
| 454 | FCP_CHKV ER = 40; // form crea te about t o check ve rsion | |
| 455 | FCP_OBJE CTS = 50; // form crea te about t o create c ore object s | |
| 456 | FCP_FORM S = 60; // form crea te about t o create c hild forms | |
| 457 | FCP_PTSE L = 70; // form crea te about t o select p atient | |
| 458 | FCP_FINI SH = 99; // form crea te finishe d successf ully | |
| 459 | ||
| 460 | TX_IN_US E = 'V istA CPRS in use by: '; // use same as with CP RSInstance s in fTime out | |
| 461 | TX_OPTIO N = 'O R CPRS GUI CHART'; | |
| 462 | TX_ECSOP T = 'E C GUI CONT EXT'; | |
| 463 | TX_PTINQ = 'R etrieving demographi c informat ion...'; | |
| 464 | TX_NOTIF _STOP = 'S top proces sing notif ications?' ; | |
| 465 | TC_NOTIF _STOP = 'C urrently P rocessing Notificati ons'; | |
| 466 | TX_UNK_N OTIF = 'U nable to p rocess the follow up action fo r this not ification' ; | |
| 467 | TC_UNK_N OTIF = 'F ollow Up A ction Not Implemente d'; | |
| 468 | TX_NO_SU RG_NOTIF = 'This not ification must be pr ocessed us ing the Su rgery tab, ' + CRLF + | |
| 469 | 'which is not curre ntly avail able to yo u.'; | |
| 470 | TC_NO_SU RG_NOTIF = 'Surgery Tab Not Av ailable'; | |
| 471 | TX_VER1 = 'T his is ver sion '; | |
| 472 | TX_VER2 = ' of CPRSCha rt.exe.'; | |
| 473 | TX_VER3 = CR LF + 'The running se rver versi on is '; | |
| 474 | TX_VER_R EQ = ' version se rver is re quired.'; | |
| 475 | TX_VER_O LD = CR LF + 'It i s strongly recommend ed that yo u upgrade. '; | |
| 476 | TX_VER_O LD2 = CR LF + 'The program ca nnot be ru n until th e client i s upgraded .'; | |
| 477 | TX_VER_N EW = CR LF + 'The program ca nnot be ru n until th e server i s upgraded .'; | |
| 478 | TC_VER = 'S erver/Clie nt Incompa tibility'; | |
| 479 | TC_CLIER R = 'C lient Spec ifications Mismatch' ; | |
| 480 | ||
| 481 | SHOW_NOT IFICATIONS = True; | |
| 482 | ||
| 483 | TC_DGSR_ ERR = ' Remote Dat a Error'; | |
| 484 | TC_DGSR_ SHOW = ' Restricted Remote Re cord'; | |
| 485 | TC_DGSR_ DENY = ' Remote Acc ess Denied '; | |
| 486 | TX_DGSR_ YESNO = C RLF + 'Do you want t o continue accessing this remo te patient record?'; | |
| 487 | ||
| 488 | TX_CCOW_ LINKED = 'Clinical Link On'; | |
| 489 | TX_CCOW_ CHANGING = 'Clinical link chan ging'; | |
| 490 | TX_CCOW_ BROKEN = 'Clinical link brok en'; | |
| 491 | TX_CCOW_ ERROR = 'CPRS was unable to communica te with th e CCOW Con text Vault ' + CRLF + | |
| 492 | 'CCOW pat ient synch ronization will be u navailable for the r emainder o f this ses sion.'; | |
| 493 | TC_CCOW_ ERROR = 'CCOW Err or'; | |
| 494 | ||
| 495 | function T frmFrame.T imeoutCond ition: boo lean; | |
| 496 | begin | |
| 497 | Result : = (FCreate Progress < FCP_PTSEL ); | |
| 498 | end; | |
| 499 | ||
| 500 | function T frmFrame.G etTimedOut : boolean; | |
| 501 | begin | |
| 502 | Result : = uInit.Ti medOut; | |
| 503 | end; | |
| 504 | ||
| 505 | procedure TfrmFrame. TimeOutAct ion; | |
| 506 | var | |
| 507 | ClosingC PRS: boole an; | |
| 508 | ||
| 509 | procedur e CloseCPR S; | |
| 510 | begin | |
| 511 | if Clo singCPRS t hen | |
| 512 | halt ; | |
| 513 | try | |
| 514 | Clos ingCPRS := TRUE; | |
| 515 | Clos e; | |
| 516 | except | |
| 517 | halt ; | |
| 518 | end; | |
| 519 | end; | |
| 520 | ||
| 521 | begin | |
| 522 | ClosingC PRS := FAL SE; | |
| 523 | try | |
| 524 | if ass igned(frmO therSchedu le) then f rmOtherSch edule.Clos e; | |
| 525 | if ass igned (frm IVRoutes) then frmIV Routes.Clo se; | |
| 526 | if frm Frame.DLLA ctive then | |
| 527 | begin | |
| 528 | Clo seVitalsDL L(); | |
| 529 | Clo seMHDLL(); | |
| 530 | end; | |
| 531 | CloseC PRS; | |
| 532 | except | |
| 533 | CloseC PRS; | |
| 534 | end; | |
| 535 | end; | |
| 536 | ||
| 537 | { General Functions and Proced ures } | |
| 538 | ||
| 539 | ||
| 540 | // NAME: OROTHCL G ET | |
| 541 | // ROUTINE: GET^OROTH CL | |
| 542 | //RETURN V ALUE TYPE: SINGLE VA LUE | |
| 543 | // AVA ILABILITY: SUBSCRIPT ION | |
| 544 | // DE SCRIPTION: | |
| 545 | //The Othe r Than Hon orable Dis charge ini tiative al low for ce rtain pati ents to | |
| 546 | // have li mited ment al health access. T hese indiv iduals are entitled to two 90 | |
| 547 | // day ter ms of care in a 365 day period . This RP C returns the status of the cl ock | |
| 548 | // for an applicatio n to displ ay as it s ees fit. | |
| 549 | // | |
| 550 | // INPUT PARAMETER : DFN | |
| 551 | // PAR AMETER TYP E: LITERAL | |
| 552 | //MAXIMUM DATA LENGT H: 100 n eed to edi t this to a lower va lue, say 1 2 | |
| 553 | // REQUIRE D: YES | |
| 554 | // SEQU ENCE NUMBE R: 1 | |
| 555 | // D ESCRIPTION : This is a pointer to the PAT IENT file. | |
| 556 | // | |
| 557 | //RETURN P ARAMETER D ESCRIPTION : | |
| 558 | //This ret urn parame ter should contain a ll the inf ormation t he client needs to | |
| 559 | // display informati on about t he OTHD cl ock withou t the clie nt having to do any | |
| 560 | // calcula tions. Th e return s tring is o f the foll owing form at: | |
| 561 | // | |
| 562 | //If some kind of er ror condit ion is enc ountered, return | |
| 563 | // -1^e rror messa ge | |
| 564 | // -2^O TH functio nality is not availa ble (DG AP I is not a vailable) | |
| 565 | //Else ret urn p1^p2^ p3^p4^p5^p 6^p7^p8 wh ere | |
| 566 | // | |
| 567 | //Type <En ter> to co ntinue or '^' to exi t: | |
| 568 | // p1 = status code of 0, 1,2,or 3 | |
| 569 | // 0 means pati ent is not OTHD elig ible | |
| 570 | // 1 if the pat ient is in the first 90 day pe riod | |
| 571 | // 2 if the pat ient is in the secon d 90 day p eriod | |
| 572 | // 3 if the pat ient has u sed all 18 0 days in a 365 day period | |
| 573 | // p2 = FM date for the s tart of th e clock fo r the firs t 90 day p eriod | |
| 574 | // p3 = FM date for the e nd of the clock for the first 90 day per iod | |
| 575 | // p4 = the num ber of day s left in the first 90 day per iod | |
| 576 | // p5 = FM date for the s tart of th e clock fo r the seco nd 90 day period | |
| 577 | // p6 = FM date for the e nd of the clock for the second 90 day pe riod | |
| 578 | // p7 = the num ber of day s left in the second 90 day pe riod | |
| 579 | // p8 = FM date of the au thorizatio n for the 2nd period (null if no authori zation) | |
| 580 | ||
| 581 | // The Res ults array contains one or mor e rows: | |
| 582 | // First r ow contain s a counte r of the n umber of r ows availa ble starti ng with th e second r ow | |
| 583 | // If avai lable, the second ro w contains pieces 1 through 8 starting w ith the st atus code | |
| 584 | // If avai lable, the third row contains a message defined lo cally at t he divisio n | |
| 585 | ||
| 586 | function g etOTHD(DFN Str, NameS tr: String ; out Shor tStr, Long Str1, Long Str2, Loca lMsg: Stri ng): Boole an; // rpk 3/6/2018 | |
| 587 | const | |
| 588 | OTHRPC = 'OROTHCL GET'; | |
| 589 | OTHDMIND AYS = 7; | |
| 590 | var | |
| 591 | i, p1day sleft, p2d aysleft, i cnt, rcnt: Integer; | |
| 592 | tmpstr, p1, p2, p3 , p4, p5, p6, p7, p8 , row2, rs tr: String ; | |
| 593 | p5datest r: String; | |
| 594 | dt: TDat eTime; | |
| 595 | FMdt: TF MDateTime; | |
| 596 | DOS: Str ing; | |
| 597 | mindayss tr: String ; | |
| 598 | ||
| 599 | begin | |
| 600 | tmpstr : = ''; | |
| 601 | p1 := '' ; | |
| 602 | ShortStr := ''; | |
| 603 | LongStr1 := ''; | |
| 604 | LongStr2 := ''; | |
| 605 | LocalMsg := ''; | |
| 606 | row2 := ''; | |
| 607 | Result : = False; | |
| 608 | rcnt := 0; | |
| 609 | dt := to day; | |
| 610 | FMdt := DateTimeTo FMDateTime (dt); | |
| 611 | DOS := F ormatFMDat eTime('mmm dd, yyyy' , FMdt); | |
| 612 | mindayss tr := IntT oStr(OTHDM INDAYS); | |
| 613 | ||
| 614 | CallV(OT HRPC, [DFN Str, DOS]) ; // rpk 3/27/2018 | |
| 615 | icnt := RPCBrokerV .Results.C ount; | |
| 616 | if (icnt > 0) then begin // rpk 5/5/2 018 | |
| 617 | tmpstr := RPCBro kerV.Resul ts[0]; | |
| 618 | tmpstr := Trim(t mpstr); | |
| 619 | rcnt : = StrToInt Def(tmpstr , -3); | |
| 620 | if rcn t <> (icnt - 1) then begin | |
| 621 | // a dd loop wh ich displa ys raw res ults in me ssage afte r counts; rpk 5/7/20 18 | |
| 622 | rstr := tmpstr ; | |
| 623 | for I := 1 to icnt - 1 d o | |
| 624 | rs tr := rstr + CRLF + RPCBrokerV .Results[i ]; | |
| 625 | Show Msg('getOT HD: Result s.Count=' + IntToStr (icnt) + ' , Results[ 0]='+ IntT oStr(rcnt) + | |
| 626 | ', Results=' + CRLF + rstr); | |
| 627 | end; | |
| 628 | end; | |
| 629 | ||
| 630 | if icnt > 1 then b egin // r pk 5/3/201 8 | |
| 631 | tmpstr := RPCBro kerV.Resul ts[1]; | |
| 632 | tmpstr := Trim(t mpstr); | |
| 633 | end; | |
| 634 | if Lengt h(tmpstr) = 0 then | |
| 635 | exit; | |
| 636 | p1 := Pi ece(tmpstr , U, 1); | |
| 637 | i := Str ToIntDef(p 1, -3); | |
| 638 | if i <= 0 then | |
| 639 | exit; | |
| 640 | ||
| 641 | p2 := pi ece(tmpstr , U, 2); | |
| 642 | p3 := pi ece(tmpstr , U, 3); | |
| 643 | p4 := pi ece(tmpstr , U, 4); | |
| 644 | p4 := tr im(p4); | |
| 645 | p1daysle ft := StrT oIntDef(p4 , -1); // rpk 4/12/ 2018 | |
| 646 | p5 := pi ece(tmpstr , U, 5); | |
| 647 | p5 := tr im(p5); | |
| 648 | p6 := pi ece(tmpstr , U, 6); | |
| 649 | p7 := pi ece(tmpstr , U, 7); | |
| 650 | p7 := tr im(p7); | |
| 651 | p2daysle ft := StrT oIntDef(p7 , -1); // rpk 4/12/ 2018 | |
| 652 | p8 := pi ece(tmpstr , U, 8); | |
| 653 | p8 := tr im(p8); | |
| 654 | if p5 > '' then | |
| 655 | p5date str := For matFMDateT imeStr('mm m dd, yyyy ', p5) | |
| 656 | else | |
| 657 | p5date str := ''; | |
| 658 | ||
| 659 | if icnt > 2 then b egin | |
| 660 | row2 : = RPCBroke rV.Results [2]; | |
| 661 | row2 : = Trim(row 2); | |
| 662 | end; | |
| 663 | ||
| 664 | case i o f | |
| 665 | 1: beg in | |
| 666 | // s how warnin g only if p1 days is less than 7 and | |
| 667 | // t here is no authoriza tion for t he second period | |
| 668 | if ( p1daysleft < OTHDMIN DAYS) and (p8 = '') then // r pk 4/26/20 18 | |
| 669 | Sh owMsg('WAR NING: Othe r Than Hon orable Sta tus' + CRL F + | |
| 670 | 'L ess than ' + mindays str + ' da ys left in the 1st 9 0 Day Peri od.'); | |
| 671 | ||
| 672 | Shor tstr := p4 + 'D,P1'; // first period | |
| 673 | Long Str1 := '1 st 90 Day Period: ' + p4 + ' D ay(s) Rema ining'; / / rpk 4/12 /2018 | |
| 674 | if L ength(p8) > 0 then b egin | |
| 675 | // first per iod and se cond perio d are auth orized | |
| 676 | if (p5 > '') and (p7 > '') then | |
| 677 | LongStr2 : = '2nd 90 Day Period : ' + p7 + ' Day(s) are author ized start ing on ' + p5datestr + '.' | |
| 678 | el se | |
| 679 | // no star t date for second pe riod | |
| 680 | LongStr2 : = '2nd 90 Day Period : has been authorize d without a starting date.'; | |
| 681 | end | |
| 682 | else begin // in first p eriod, sec ond period has not b een author ized yet | |
| 683 | if p1dayslef t = 0 then begin // zero days left in f irst perio d, 2nd per iod not au thorized; rpk 5/8/20 18 | |
| 684 | LongStr1 : = 'Patient is NOT el igible for care at t his time.' ; | |
| 685 | LongStr2 : = 'Authori zation is required f or further care.'; | |
| 686 | en d | |
| 687 | el se | |
| 688 | LongStr2 : = '2nd 90 Day Period : Authoriz ation Requ ired'; | |
| 689 | end; | |
| 690 | end; // 1 | |
| 691 | 2: beg in | |
| 692 | if ( p2daysleft < OTHDMIN DAYS) then | |
| 693 | Sh owMsg('WAR NING: Othe r Than Hon orable Sta tus' + CRL F + | |
| 694 | 'L ess than ' + mindays str + ' da ys left in the 2nd 9 0 Day Peri od.'); | |
| 695 | ||
| 696 | Shor tStr := p7 + 'D,P2'; // second period | |
| 697 | Long str1 := '2 nd 90 Day Period: ' + p7 + ' D ay(s) Rema ining'; | |
| 698 | if L ength(p8) = 0 then | |
| 699 | // second pe riod has n ot been au thorized y et | |
| 700 | Lo ngStr2 := 'WARNING: Authorizat ion for th e 2nd peri od is requ ired!'; | |
| 701 | end; // 2 | |
| 702 | 3: beg in | |
| 703 | Shor tstr := '0 D,P2'; // 365 day p eriod expi red; rpk 1 /10/2018 | |
| 704 | Long str1 := 'B oth 90 day periods h ave expire d in this 365 day pe riod.'; / / 365 day period exp ired | |
| 705 | Long Str2 := 'P atient is NOT eligib le for car e at this time.'; | |
| 706 | end; / / 3 | |
| 707 | end; // case i | |
| 708 | ||
| 709 | if row2 > '' then | |
| 710 | LocalM sg := row2 ; | |
| 711 | ||
| 712 | Result : = True; | |
| 713 | end; // g etOTHD | |
| 714 | ||
| 715 | procedure TfrmFrame. AppExcepti on(Sender: TObject; E: Excepti on); | |
| 716 | const | |
| 717 | XWB_M_REJ ECT = 2000 0 + 2; // M error | |
| 718 | var | |
| 719 | AnAddr: Pointer; | |
| 720 | ErrMsg: string; | |
| 721 | ||
| 722 | begin | |
| 723 | Applicat ion.Normal izeTopMost s; | |
| 724 | if (E is EIntError ) then | |
| 725 | begin | |
| 726 | ErrMsg := E.Mess age + CRLF + | |
| 727 | 'Creat eProgress: ' + IntTo Str(FCreat eProgress) + CRLF + | |
| 728 | 'RPC I nfo: ' + R PCLastCall ; | |
| 729 | if EEx ternal(E). ExceptionR ecord <> n il then | |
| 730 | begin | |
| 731 | AnAd dr := EExt ernal(E).E xceptionRe cord^.Exce ptionAddre ss; | |
| 732 | ErrM sg := ErrM sg + CRLF + 'Address was ' + I ntToStr(In teger(AnAd dr)); | |
| 733 | end; | |
| 734 | //Pass this mess age up | |
| 735 | E.Mess age := Err Msg; | |
| 736 | end; | |
| 737 | ||
| 738 | if (E is EBrokerEr ror) or (E is EOleEx ception) t hen | |
| 739 | begin | |
| 740 | FCreat eProgress := FCP_FOR MS; | |
| 741 | ||
| 742 | //Opt ion for cu stom actio n | |
| 743 | { | |
| 744 | if (E is EBroke rError) th en | |
| 745 | begin | |
| 746 | if EBrokerErr or(E).Code = XWB_M_R EJECT then | |
| 747 | beg in | |
| 748 | Ex ceptionLog .CustomBut tonCaption := 'Debug '; | |
| 749 | Ex ceptionLog .OnCustomM ethod := m nuDebugRep ortClick; | |
| 750 | end ; | |
| 751 | end; | |
| 752 | } | |
| 753 | ||
| 754 | //Tell the excep tion logge r that we can't cont inue | |
| 755 | Except ionLog.Ter minateApp := true; | |
| 756 | end; | |
| 757 | Applicat ion.Restor eTopMosts; | |
| 758 | end; | |
| 759 | ||
| 760 | procedure TfrmFrame. btnCombatV etClick(Se nder: TObj ect); | |
| 761 | begin | |
| 762 | inherite d; | |
| 763 | frmComba tVet := Tf rmCombatVe t.Create(f rmFrame); | |
| 764 | frmComba tVet.ShowM odal; | |
| 765 | frmComba tVet.Free; | |
| 766 | end; | |
| 767 | ||
| 768 | function T frmFrame.A llowContex tChangeAll (var Reaso n: string) : Boolean; | |
| 769 | var | |
| 770 | Silent: Boolean; | |
| 771 | begin | |
| 772 | if pnlNo PatientSel ected.Visi ble then | |
| 773 | begin | |
| 774 | Result := True; | |
| 775 | exit; | |
| 776 | end; | |
| 777 | FContext Changing : = True; | |
| 778 | Result : = True; | |
| 779 | if COMOb jectActive or SpellC heckInProg ress or DL LActive th en | |
| 780 | begin | |
| 781 | Reas on := 'COM _OBJECT_AC TIVE'; | |
| 782 | Resu lt:= False ; | |
| 783 | end; | |
| 784 | // frmCo verSheet w ill always AllowCont extChange | |
| 785 | if Resul t then Res ult := frm Problems.A llowContex tChange(Re ason); | |
| 786 | if Resul t then Res ult := frm Meds.Allow ContextCha nge(Reason ); | |
| 787 | if Resul t then Res ult := frm Orders.All owContextC hange(Reas on); | |
| 788 | if Resul t then Res ult := frm Notes.Allo wContextCh ange(Reaso n); | |
| 789 | if Resul t then Res ult := frm Consults.A llowContex tChange(Re ason); | |
| 790 | if Resul t then Res ult := frm DCSumm.All owContextC hange(Reas on); | |
| 791 | if Resul t then | |
| 792 | if Ass igned(frmS urgery) th en Result := frmSurg ery.AllowC ontextChan ge(Reason) ;; | |
| 793 | if Resul t then Res ult := frm Labs.Allow ContextCha nge(Reason );; | |
| 794 | if Resul t then Res ult := frm Reports.Al lowContext Change(Rea son); | |
| 795 | if Resul t then Res ult := frm GraphData. AllowConte xtChange(R eason); | |
| 796 | if (not User.IsRep ortsOnly) then | |
| 797 | if Res ult and Ch anges.Requ ireReview then //Res ult := Rev iewChanges (TimedOut) ; | |
| 798 | case BOOLCHAR[ FCCOWConte xtChanging ] of | |
| 799 | '1 ': begin | |
| 800 | if Ch anges.Requ ireReview then | |
| 801 | beg in | |
| 802 | R eason := ' Items will be left u nsigned.'; | |
| 803 | R esult := F alse; | |
| 804 | end | |
| 805 | else | |
| 806 | Res ult := Tru e; | |
| 807 | end; | |
| 808 | '0 ': begin | |
| 809 | Silen t := (Time dOut) or ( Reason = ' COMMIT'); | |
| 810 | Resul t := Revie wChanges(S ilent); | |
| 811 | end; | |
| 812 | end; | |
| 813 | FContext Changing : = False; | |
| 814 | end; | |
| 815 | ||
| 816 | // TDrugs Patch OR*3 *377 and W V*1*24 - D anP@SLC 11 -20-2015 | |
| 817 | // Added s o the cove rsheet had a quick w ay to upda te. | |
| 818 | procedure TfrmFrame. RefreshCWA D(Sender: TObject); | |
| 819 | begin | |
| 820 | lblPtCWA D.Caption := GetCWAD Info(Patie nt.DFN); | |
| 821 | if Lengt h(lblPtCWA D.Caption) > 0 then | |
| 822 | lblPtP ostings.Ca ption := ' Postings' | |
| 823 | else | |
| 824 | lblPtP ostings.Ca ption := ' No Posting s'; | |
| 825 | pnlPosti ngs.Captio n := lblPt Postings.C aption + ' ' + lblPt CWAD.Capti on; | |
| 826 | end; | |
| 827 | ||
| 828 | procedure TfrmFrame. ClearPatie nt; | |
| 829 | { call all pages to make sure patient re lated info rmation is cleared ( when switc hing patie nts) } | |
| 830 | var | |
| 831 | aCPRSTab : ICPRSTab ; | |
| 832 | begin | |
| 833 | //if frm Frame.Time dout then Exit; // a dded to co rrect Acce ss Violati on when "R efresh Pat ient Infor mation" se lected | |
| 834 | lblPtNam e.Caption := ''; | |
| 835 | lblPtSSN .Caption := ''; | |
| 836 | lblPtAge .Caption := ''; | |
| 837 | pnlPatie nt.Caption := ''; | |
| 838 | lblPtCWA D.Caption := ''; | |
| 839 | lblOTHD. Caption := ''; // rpk 1 2/5/2017 | |
| 840 | pnlOTHD. Hide; // rpk 1 2/6/2017 | |
| 841 | pnlOTHD. Enabled := Fal se; // rpk 12/6/2017 | |
| 842 | lblOTHD. Enabled := Fal se; // rpk 4/6/2018 | |
| 843 | lblOTHDT itle.Enabl ed := Fal se; // rpk 12/6/2017 | |
| 844 | OTHDShor tStr := ''; // rpk 1 /5/2018 | |
| 845 | OTHDLong Str1 := ''; // rpk 1 /5/2018 | |
| 846 | OTHDLong Str2 := ''; // rpk 1 /5/2018 | |
| 847 | OTHDLoca lMsg := ''; // rpk 2 /28/2018 | |
| 848 | ||
| 849 | if DoNot ChangeEncW indow = fa lse then | |
| 850 | begin | |
| 851 | lblP tLocation. Caption := 'Visit No t Selected '; | |
| 852 | lblP tProvider. Caption := 'Current Provider N ot Selecte d'; | |
| 853 | pnlV isit.Capti on := lblPtLoca tion.Capti on + CRLF + lblPtPro vider.Capt ion; | |
| 854 | end; | |
| 855 | lblPtCar e.Caption := 'Pr imary Care Team Unas signed'; | |
| 856 | lblPtAtt ending.Cap tion := '' ; | |
| 857 | lblPtMHT C.Caption := ''; | |
| 858 | pnlPrima ryCare.Cap tion := lb lPtCare.Ca ption + ' ' + lblPtA ttending.C aption + ' ' + lblPt MHTC.Capti on; | |
| 859 | if Suppo rts(frmCov erSheet, I CPRSTab, a CPRSTab) t hen | |
| 860 | aCPRST ab.OnClear PtData(Sel f); | |
| 861 | frmProbl ems.ClearP tData; | |
| 862 | frmMeds. ClearPtDat a; | |
| 863 | frmOrder s.ClearPtD ata; | |
| 864 | frmNotes .ClearPtDa ta; | |
| 865 | frmConsu lts.ClearP tData; | |
| 866 | frmDCSum m.ClearPtD ata; | |
| 867 | if Assig ned(frmSur gery) then frmSurger y.ClearPtD ata; | |
| 868 | frmLabs. ClearPtDat a; | |
| 869 | frmGraph Data.Clear PtData; | |
| 870 | frmRepor ts.ClearPt Data; | |
| 871 | tabPage. TabIndex : = PageIDTo Tab(CT_NOP AGE); // to ma ke sure Di splayPage gets calle d | |
| 872 | tabPageC hange(tabP age); | |
| 873 | ClearRem inderData; | |
| 874 | SigItems .Clear; | |
| 875 | Changes. Clear; | |
| 876 | lstCIRNL ocations.C lear; | |
| 877 | ClearFla g; | |
| 878 | if Assig ned(FlagLi st) then F lagList.Cl ear; | |
| 879 | HasFlag := False; | |
| 880 | HidePati entSelectM essages; | |
| 881 | if (Grap hFloat <> nil) and G raphFloatA ctive then | |
| 882 | with Gra phFloat do | |
| 883 | begin | |
| 884 | Initia lize; | |
| 885 | Displa yData('top '); | |
| 886 | Displa yData('bot tom'); | |
| 887 | Captio n := 'CPRS Graphing - Patient: ' + Mixed Case(Patie nt.Name); | |
| 888 | end; | |
| 889 | if frmFr ame.TimedO ut then | |
| 890 | begin | |
| 891 | infoBo x('CPRS ha s encounte red a seri ous proble m and is u nable to d isplay the selected patient''s data. ' | |
| 892 | + 'To pr event pati ent safety issues, C PRS is shu tting down . Shutting down and then resta rting CPRS will corr ect the pr oblem, and you may c ontinue wo rking in C PRS.' | |
| 893 | + CRLF + CRLF + ' Please rep ort all oc currences of this pr oblem by c ontacting your CPRS Help Desk. ', 'CPRS E rror', MB_ OK); | |
| 894 | frmFra me.Close; | |
| 895 | end; | |
| 896 | end; | |
| 897 | ||
| 898 | procedure TfrmFrame. DigitalSig ningSetup1 Click(Send er: TObjec t); | |
| 899 | var | |
| 900 | aPKIEncr yptionEngi ne: IPKIEn cryptionEn gine; | |
| 901 | aDefault Msg: strin g; | |
| 902 | aSuccess Msg: strin g; | |
| 903 | aResults : TStringL ist; | |
| 904 | begin | |
| 905 | try | |
| 906 | // get PKI engin e componen ts ready | |
| 907 | NewPKI Encryption Engine(RPC BrokerV, a PKIEncrypt ionEngine) ; | |
| 908 | ||
| 909 | aResul ts := TStr ingList.Cr eate; | |
| 910 | try | |
| 911 | Call VistA('ORD EA LNKMSG' , [], aRes ults); | |
| 912 | aSuc cessMsg := aResults. Text; | |
| 913 | finall y | |
| 914 | Free AndNil(aRe sults); | |
| 915 | end; | |
| 916 | ||
| 917 | if not IsDigital SignatureA vailable(a PKIEncrypt ionEngine, aDefaultM sg, aSucce ssMsg) the n | |
| 918 | Show Msg('There was a pro blem linki ng your PI V card. Ei ther the ' | |
| 919 | + 'PIV card name does NOT match your VistA account n ame or the PIV card is already ' | |
| 920 | + 'linked to another V istA accou nt. Ensur e that the correct P IV card ha s ' | |
| 921 | + 'been inse rted for y our VistA account. P lease cont act your P IV Card Co ordinator ' | |
| 922 | + 'if you co ntinue to have probl ems.'); | |
| 923 | except | |
| 924 | on E: Exception do | |
| 925 | Show Msg('Probl em during digital si gning setu p: ' + E.M essage); | |
| 926 | end; | |
| 927 | end; | |
| 928 | ||
| 929 | procedure TfrmFrame. DisplayEnc ounterText ; | |
| 930 | { updates the displa y in the h eader bar of encount er related informati on (locati on & provi der) } | |
| 931 | begin | |
| 932 | if DoNot ChangeEncW indow = tr ue then ex it; | |
| 933 | with Enc ounter do | |
| 934 | begin | |
| 935 | if Len gth(Locati onText) > 0 | |
| 936 | then lblPtLoca tion.Capti on := Loca tionText | |
| 937 | else lblPtLoca tion.Capti on := 'Vis it Not Sel ected'; | |
| 938 | if Len gth(Provid erName) > 0 | |
| 939 | then lblPtProv ider.Capti on := 'Pro vider: ' + Provider Name | |
| 940 | else lblPtProv ider.Capti on := 'Cur rent Provi der Not Se lected'; | |
| 941 | end; | |
| 942 | pnlVisit .Caption : = lblPtLoc ation.Capt ion + CRLF + lblPtPr ovider.Cap tion; | |
| 943 | FitToolB ar; | |
| 944 | end; | |
| 945 | ||
| 946 | function T frmFrame.D LLActive: boolean; | |
| 947 | begin | |
| 948 | Result : = (VitalsD LLHandle < > 0) or (M HDLLHandle <> 0); | |
| 949 | end; | |
| 950 | ||
| 951 | { Form Eve nts (Creat e, Destroy ) -------- ---------- ---------- ---------- ---------- ---------- - } | |
| 952 | ||
| 953 | ||
| 954 | procedure TfrmFrame. RefreshFix edStatusWi dth; | |
| 955 | begin | |
| 956 | with sts Area do | |
| 957 | FFixed StatusWidt h := Panel s[0].Width + Panels[ 2].Width + Panels[3] .Width + P anels[4].W idth; | |
| 958 | end; | |
| 959 | ||
| 960 | procedure TfrmFrame. FormCreate (Sender: T Object); | |
| 961 | { connect to server, create ta b pages, s elect a pa tient, & i nitialize core objec ts } | |
| 962 | var | |
| 963 | ClientVe r, ServerV er, Server Req, SAN: string; | |
| 964 | ||
| 965 | Procedur e LoadExce ptionLogge r; | |
| 966 | var | |
| 967 | TmpLst: TStringLi st; | |
| 968 | TmpStr: String; | |
| 969 | begin | |
| 970 | TmpLst := TStrin gList.Crea te; | |
| 971 | try | |
| 972 | Except ionLog.Day sToPurge : = StrToInt Def(GetUse rParam('OR CPRS EXCE PTION PURG E'), 60); | |
| 973 | Except ionLog.Ena bled := St rToBoolDef (GetUserPa ram('OR CP RS EXCEPTI ON LOGGER' ), false); | |
| 974 | GetUse rListParam (TmpLst, ' OR CPRS EX CEPTION EM AIL'); | |
| 975 | for Tm pStr in Tm pLst do | |
| 976 | Excep tionLog.Em ailTo.Add( Piece(TmpS tr, U, 2)) ; | |
| 977 | Except ionLog.OnA ppExceptio n := AppEx ception; | |
| 978 | finall y | |
| 979 | TmpL st.Free; | |
| 980 | end; | |
| 981 | end; | |
| 982 | ||
| 983 | begin | |
| 984 | FJustEnt eredApp := false; | |
| 985 | SizeHold er := TSiz eHolder.Cr eate; | |
| 986 | FOldActi veFormChan ge := Scre en.OnActiv eFormChang e; | |
| 987 | Screen.O nActiveFor mChange := ScreenAct iveFormCha nge; | |
| 988 | FCCOWJus tJoined := False; | |
| 989 | if not ( ParamSearc h('CCOW')= 'DISABLE') then | |
| 990 | try | |
| 991 | Star tCCOWConte xtor; | |
| 992 | FCCO WJustJoine d := True; | |
| 993 | except | |
| 994 | IsRu nExecuted := False; | |
| 995 | FCCO WInstalled := False; | |
| 996 | pnlC COW.Visibl e := False ; | |
| 997 | mnuF ileResumeC ontext.Vis ible := Fa lse; | |
| 998 | mnuF ileBreakCo ntext.Visi ble := Fal se; | |
| 999 | end | |
| 1000 | else | |
| 1001 | begin | |
| 1002 | IsRu nExecuted := False; | |
| 1003 | FCCO WInstalled := False; | |
| 1004 | pnlC COW.Visibl e := False ; | |
| 1005 | mnuF ileResumeC ontext.Vis ible := Fa lse; | |
| 1006 | mnuF ileBreakCo ntext.Visi ble := Fal se; | |
| 1007 | end; | |
| 1008 | ||
| 1009 | RefreshF ixedStatus Width; | |
| 1010 | FTermina te := Fals e; | |
| 1011 | ||
| 1012 | FFlagLis t := TStri ngList.Cre ate; | |
| 1013 | ||
| 1014 | // setup initial t imeout her e so can t imeout log on | |
| 1015 | FCreateP rogress := FCP_SETHO OK; | |
| 1016 | InitTime Out(Timeou tCondition , TimeOutA ction); | |
| 1017 | ||
| 1018 | // conne ct to the server and create an option co ntext | |
| 1019 | FCreateP rogress := FCP_SERVE R; | |
| 1020 | ||
| 1021 | {$IFDEF CC OWBROKER} | |
| 1022 | EnsureBr oker; | |
| 1023 | if ctxCo ntextor <> nil then | |
| 1024 | begin | |
| 1025 | if Par amSearch(' CCOW') = ' PATIENTONL Y' then | |
| 1026 | RPCB rokerV.Con textor := nil | |
| 1027 | else | |
| 1028 | RPCB rokerV.Con textor := ctxContext or; | |
| 1029 | end | |
| 1030 | else | |
| 1031 | RPCBro kerV.Conte xtor := ni l; | |
| 1032 | {$ENDIF} | |
| 1033 | ||
| 1034 | if not C onnectToSe rver(TX_OP TION) then | |
| 1035 | begin | |
| 1036 | if Ass igned(RPCB rokerV) th en | |
| 1037 | Info Box(RPCBro kerV.RPCBE rror, 'Err or', MB_OK or MB_ICO NERROR); | |
| 1038 | Close; | |
| 1039 | Exit; | |
| 1040 | end; | |
| 1041 | ||
| 1042 | if ctxCo ntextor <> nil then | |
| 1043 | begin | |
| 1044 | if not (ParamSea rch('CCOW' ) = 'PATIE NTONLY') t hen | |
| 1045 | ctxC ontextor.N otificatio nFilter := ctxContex tor.Notifi cationFilt er + ';Use r'; | |
| 1046 | end; | |
| 1047 | ||
| 1048 | FECSAuth User := Va lidECSUser ; | |
| 1049 | uECSRepo rt := TECS Report.Cre ate; | |
| 1050 | uECSRepo rt.ECSPerm it := FECS AuthUser; | |
| 1051 | RPCBroke rV.CreateC ontext(TX_ OPTION); | |
| 1052 | // Applic ation.OnEx ception := AppExcept ion; | |
| 1053 | LoadExce ptionLogge r; | |
| 1054 | FOldActi vate := Ap plication. OnActivate ; | |
| 1055 | Applicat ion.OnActi vate := Ap pActivated ; | |
| 1056 | Applicat ion.OnDeAc tivate := AppDeActiv ated; | |
| 1057 | ||
| 1058 | // creat e initial core objec ts | |
| 1059 | FCreateP rogress := FCP_OBJEC TS; | |
| 1060 | User := TUser.Crea te; | |
| 1061 | ||
| 1062 | // make sure we're using the matching server ver sion | |
| 1063 | FCreateP rogress := FCP_CHKVE R; | |
| 1064 | ClientVe r := Clien tVersion(A pplication .ExeName); | |
| 1065 | ServerVe r := Serve rVersion(T X_OPTION, ClientVer) ; | |
| 1066 | if (Serv erVer = '0 .0.0.0') t hen | |
| 1067 | begin | |
| 1068 | InfoBo x('Unable to determi ne current version o f server.' , TX_OPTIO N, MB_OK); | |
| 1069 | Close; | |
| 1070 | Exit; | |
| 1071 | end; | |
| 1072 | ServerRe q := Piece (FileVersi onValue(Ap plication. ExeName, F ILE_VER_IN TERNALNAME ), ' ', 1) ; | |
| 1073 | if (Clie ntVer <> S erverReq) then | |
| 1074 | begin | |
| 1075 | InfoBo x('Client "version" does not m atch clien t "require d" server. ', TC_CLIE RR, MB_OK) ; | |
| 1076 | Close; | |
| 1077 | Exit; | |
| 1078 | end; | |
| 1079 | SAN := s CallV('XUS PKI GET U PN', []); | |
| 1080 | if SAN=' ' then Dig italSignin gSetup1.Vi sible := T rue | |
| 1081 | else Dig italSignin gSetup1.Vi sible := F alse; | |
| 1082 | if (Comp areVersion (ServerVer , ServerRe q) <> 0) t hen | |
| 1083 | begin | |
| 1084 | if (sC allV('ORWU DEFAULT D IVISION', [nil]) = ' 1') then | |
| 1085 | begin | |
| 1086 | if ( InfoBox('P roceed wit h mismatch ed Client and Server versions? ', TC_CLIE RR, MB_YES NO) = ID_N O) then | |
| 1087 | begi n | |
| 1088 | Cl ose; | |
| 1089 | Ex it; | |
| 1090 | end; | |
| 1091 | end | |
| 1092 | else | |
| 1093 | begin | |
| 1094 | if ( CompareVer sion(Serve rVer, Serv erReq) > 0 ) then // Server new er than Re quired | |
| 1095 | begi n | |
| 1096 | // NEXT LINE COMMENTED OUT - CHA NGED FOR V ERSION 19. 16, PATCH OR*3*155: | |
| 1097 | // if G etUserPara m('ORWOR R EQUIRE CUR RENT CLIEN T') = '1' then | |
| 1098 | if (true) th en // "Tru e" stateme nt guarant ees "requi red" curre nt version client. | |
| 1099 | be gin | |
| 1100 | InfoBox(TX _VER1 + Cl ientVer + TX_VER2 + CRLF + Ser verReq + T X_VER_REQ + TX_VER3 + ServerVe r + '.' + TX_VER_OLD 2, TC_VER, MB_OK); | |
| 1101 | Close; | |
| 1102 | Exit; | |
| 1103 | en d; | |
| 1104 | end | |
| 1105 | else InfoBox(T X_VER1 + C lientVer + TX_VER2 + CRLF + Se rverReq + TX_VER_REQ + TX_VER3 + ServerV er + '.' + TX_VER_OL D, TC_VER, MB_OK); | |
| 1106 | end; | |
| 1107 | if (Co mpareVersi on(ServerV er, Server Req) < 0) then // Se rver older then Requ ired | |
| 1108 | begin | |
| 1109 | Info Box(TX_VER 1 + Client Ver + TX_V ER2 + CRLF + ServerR eq + TX_VE R_REQ + TX _VER3 + Se rverVer + '.' + TX_V ER_NEW, TC _VER, MB_O K); | |
| 1110 | Clos e; | |
| 1111 | Exit ; | |
| 1112 | end; | |
| 1113 | end; | |
| 1114 | ||
| 1115 | // Add f uture tabs here as t hey are cr eated/impl emented: | |
| 1116 | if ( | |
| 1117 | (not User.HasCo rTabs) and | |
| 1118 | (not User.HasRp tTab) | |
| 1119 | ) | |
| 1120 | then | |
| 1121 | begin | |
| 1122 | InfoBo x('No vali d tabs ass igned', 'T ab Access Problem', MB_OK); | |
| 1123 | Close; | |
| 1124 | Exit; | |
| 1125 | end; | |
| 1126 | // Globa l flags se t by serve r | |
| 1127 | IsLeJeun eActive := ServerHas Patch(Camp LejeunePat ch); | |
| 1128 | SpansInt lDateLine := SiteSpa nsIntlDate Line; | |
| 1129 | ||
| 1130 | // creat e creating core obje cts | |
| 1131 | Patient := TPatien t.Create; | |
| 1132 | Encounte r := TEnco unter.Crea te; | |
| 1133 | Changes := TChange s.Create; | |
| 1134 | Notifica tions := T Notificati ons.Create ; | |
| 1135 | RemoteSi tes := TRe moteSiteLi st.Create; | |
| 1136 | RemoteRe ports := T RemoteRepo rtList.Cre ate; | |
| 1137 | uTabList := TStrin gList.Crea te; | |
| 1138 | FlaggedP TList := T StringList .Create; | |
| 1139 | HasFlag := False; | |
| 1140 | FlagList := TStrin gList.Crea te; | |
| 1141 | ||
| 1142 | //Set th e mix case exclusion event | |
| 1143 | GetExclu dedFromMix ed; | |
| 1144 | ||
| 1145 | // set u p structur es specifi c to the u ser | |
| 1146 | Caption := TX_IN_U SE + Mixed Case(User. Name) + ' (' + Stri ng(RPCBrok erV.Server ) + ')'; | |
| 1147 | SetDebug Menu; | |
| 1148 | if Inter activeRemi ndersActiv e then | |
| 1149 | Notify WhenRemind ersChange( RemindersC hanged); | |
| 1150 | // load all the ta b pages | |
| 1151 | FCreateP rogress := FCP_FORMS ; | |
| 1152 | //Create Tab(TObjec t(frmProbl ems), Tfrm Problems, CT_PROBLEM S, 'Proble ms'); | |
| 1153 | CreateTa b(CT_PROBL EMS, 'Prob lems'); | |
| 1154 | CreateTa b(CT_MEDS, 'Meds '); | |
| 1155 | CreateTa b(CT_ORDER S, 'Orde rs'); | |
| 1156 | CreateTa b(CT_NOTES , 'Note s'); | |
| 1157 | CreateTa b(CT_CONSU LTS, 'Cons ults'); | |
| 1158 | if ShowS urgeryTab then Creat eTab(CT_SU RGERY, 'S urgery'); | |
| 1159 | CreateTa b(CT_DCSUM M, 'D/C Summ'); | |
| 1160 | CreateTa b(CT_LABS, 'Labs '); | |
| 1161 | CreateTa b(CT_REPOR TS, 'Repo rts'); | |
| 1162 | CreateTa b(CT_COVER , 'Cove r Sheet'); | |
| 1163 | ShowHide ChartTabMe nus(mnuVie wChart); | |
| 1164 | // We d efer calli ng LoadUse rPreferenc es to UMIn itiate, so that the font sizin g | |
| 1165 | // routi nes recogn ize this a s the appl ication's main form (this hasn 't been | |
| 1166 | // set y et). | |
| 1167 | FNextBut tonBitmap := TBitmap .Create; | |
| 1168 | FNextBut tonBitmap. LoadFromRe sourceName (hInstance , 'BMP_HAN DRIGHT'); | |
| 1169 | // set t he timeout to DTIME now that t here is a connection | |
| 1170 | UpdateTi meOutInter val(User.D TIME * 100 0); // DT IME * 1000 mSec | |
| 1171 | // get a patient | |
| 1172 | HandleNe eded; // ma ke sure ha ndle is th ere for OR WPT SHARE call | |
| 1173 | FCreateP rogress := FCP_PTSEL ; | |
| 1174 | Enabled := False; | |
| 1175 | FFirstLo ad := True ; // Fir st time to initializ e the fFra me | |
| 1176 | FCreateP rogress := FCP_FINIS H; | |
| 1177 | pnlRemin ders.Visib le := Inte ractiveRem indersActi ve; | |
| 1178 | GraphFlo atActive : = false; | |
| 1179 | GraphCon text := '' ; | |
| 1180 | frmGraph Data := Tf rmGraphDat a.Create(s elf); // form is only v isible for testing | |
| 1181 | GraphDat aOnUser; | |
| 1182 | uRemoteT ype := ''; | |
| 1183 | uLabRemo teType := ''; | |
| 1184 | uReportI D := ''; | |
| 1185 | uLabRepI D := ''; | |
| 1186 | FPrevPtI D := ''; | |
| 1187 | SetUserT ools; | |
| 1188 | Enduring PtSelSplit terPos := 0; | |
| 1189 | Enduring PtSelColum ns := ''; | |
| 1190 | if User. IsReportsO nly then / / Reports Only tab. | |
| 1191 | Report sOnlyDispl ay; // Cal ls procedu re to hide all compo nents/menu s not need ed. | |
| 1192 | InitialO rderVariab les; | |
| 1193 | ||
| 1194 | PostMess age(Handle , UM_INITI ATE, 0, 0) ; // se lect patie nt after m ain form i s created | |
| 1195 | SetFormM onitoring( true); | |
| 1196 | //Will l oad the co py/paste b uffer | |
| 1197 | CPAppMon .LoadTheBu ffer; | |
| 1198 | CPAppMon .LoadThePr operties; | |
| 1199 | end; | |
| 1200 | ||
| 1201 | procedure TfrmFrame. StartCCOWC ontextor; | |
| 1202 | begin | |
| 1203 | try | |
| 1204 | ctxCon textor := TContextor Control.Cr eate(Self) ; | |
| 1205 | with c txContexto r do | |
| 1206 | begi n | |
| 1207 | On Pending := ctxContex torPending ; | |
| 1208 | On Committed := ctxCont extorCommi tted; | |
| 1209 | On Canceled : = ctxConte xtorCancel ed; | |
| 1210 | end; | |
| 1211 | FCCOWB usy := Fal se; | |
| 1212 | FCCOWI nstalled : = True; | |
| 1213 | FCCOWD rivedChang e := False ; | |
| 1214 | ctxCon textor.Run ('CPRSChar t', '', TR UE, 'Patie nt'); | |
| 1215 | IsRunE xecuted := True; | |
| 1216 | except | |
| 1217 | on exc : EOleExc eption do | |
| 1218 | begin | |
| 1219 | IsRu nExecuted := False; | |
| 1220 | Free AndNil(ctx Contextor) ; | |
| 1221 | try | |
| 1222 | ct xContextor := TConte xtorContro l.Create(S elf); | |
| 1223 | wi th ctxCont extor do | |
| 1224 | begin | |
| 1225 | OnPendin g := ctxCo ntextorPen ding; | |
| 1226 | OnCommit ted := ctx ContextorC ommitted; | |
| 1227 | OnCancel ed := ctxC ontextorCa nceled; | |
| 1228 | end; | |
| 1229 | FC COWBusy := False; | |
| 1230 | FC COWInstall ed := True ; | |
| 1231 | FC COWDrivedC hange := F alse; | |
| 1232 | ct xContextor .Run('CPRS Chart' + ' #', '', TR UE, 'Patie nt'); | |
| 1233 | Is RunExecute d := True; | |
| 1234 | if ParamSear ch('CCOW') = 'FORCE' then | |
| 1235 | be gin | |
| 1236 | mnuFileRes umeContext .Enabled : = False; | |
| 1237 | mnuFileBre akContext. Visible := True; | |
| 1238 | mnuFileBre akContext. Enabled := True; | |
| 1239 | en d | |
| 1240 | el se | |
| 1241 | be gin | |
| 1242 | ctxContext or.Suspend ; | |
| 1243 | mnuFileRes umeContext .Visible : = True; | |
| 1244 | mnuFileBre akContext. Visible := True; | |
| 1245 | mnuFileBre akContext. Enabled := False; | |
| 1246 | en d; | |
| 1247 | exce pt | |
| 1248 | Is RunExecute d := False ; | |
| 1249 | FC COWInstall ed := Fals e; | |
| 1250 | Fr eeAndNil(c txContexto r); | |
| 1251 | pn lCCOW.Visi ble := Fal se; | |
| 1252 | mn uFileResum eContext.V isible := False; | |
| 1253 | mn uFileBreak Context.Vi sible := F alse; | |
| 1254 | end; | |
| 1255 | end; | |
| 1256 | end | |
| 1257 | end; | |
| 1258 | ||
| 1259 | procedure TfrmFrame. UMInitiate (var Messa ge: TMessa ge); | |
| 1260 | begin | |
| 1261 | NotifyOt herApps(NA E_OPEN, In tToStr(Use r.DUZ)); | |
| 1262 | LoadUser Preference s; | |
| 1263 | GetBASta tus(User.D UZ,Patient .DFN); | |
| 1264 | mnuFileO penClick(S elf); | |
| 1265 | Enabled := True; | |
| 1266 | // If Ti medOut, Cl ose has al ready been called. | |
| 1267 | if not T imedOut an d (Patient .DFN = '') then Clos e; | |
| 1268 | end; | |
| 1269 | ||
| 1270 | procedure TfrmFrame. FormDestro y(Sender: TObject); | |
| 1271 | { free cor e objects used by CP RS } | |
| 1272 | Var | |
| 1273 | I:integer ; | |
| 1274 | begin | |
| 1275 | Applicat ion.OnActi vate := FO ldActivate ; | |
| 1276 | Screen.O nActiveFor mChange := FOldActiv eFormChang e; | |
| 1277 | FNextBut tonBitmap. Free; | |
| 1278 | if FNext Button <> nil then F NextButton .Free; | |
| 1279 | uTabList .Free; | |
| 1280 | FlaggedP TList.Free ; | |
| 1281 | RemoteSi tes.Free; | |
| 1282 | RemoteRe ports.Free ; | |
| 1283 | Notifica tions.Free ; | |
| 1284 | Changes. Free; | |
| 1285 | Encounte r.Free; | |
| 1286 | Patient. Free; | |
| 1287 | User.Fre e; | |
| 1288 | SizeHold er.Free; | |
| 1289 | ctxConte xtor.Free; | |
| 1290 | frmDebug Report.Fre e; | |
| 1291 | ||
| 1292 | for I := high(Watc hArray) do wnto low(W atchArray) do | |
| 1293 | WatchA rray[I].RP CText.Free ; | |
| 1294 | SetLengt h(WatchArr ay, 0); | |
| 1295 | end; | |
| 1296 | ||
| 1297 | procedure TfrmFrame. ModalEnd(S ender: TOb ject); | |
| 1298 | begin | |
| 1299 | Halt; | |
| 1300 | end; | |
| 1301 | ||
| 1302 | procedure TfrmFrame. FormCloseQ uery(Sende r: TObject ; var CanC lose: Bool ean); | |
| 1303 | { cancels close if t he user ca ncels the ReviewChan ges screen } | |
| 1304 | var | |
| 1305 | Reason: string; | |
| 1306 | I: integ er; | |
| 1307 | SystemMo dal: Boole an; | |
| 1308 | begin | |
| 1309 | //check f or modal w indows and close any that may exist | |
| 1310 | if Applic ation.Moda lLevel > 0 then | |
| 1311 | begin | |
| 1312 | SystemMo dal := tru e; | |
| 1313 | // Scree n.ActiveFo rm.Close() ; | |
| 1314 | for i := Screen.Fo rmCount - 1 downto 1 do begin | |
| 1315 | if (fsM odal in Sc reen.Forms [i].FormSt ate) and ( Screen.For ms[i] <> A pplication .MainForm) then | |
| 1316 | begin | |
| 1317 | Scree n.Forms[i] .Close(); | |
| 1318 | Syste mModal := False; | |
| 1319 | end; | |
| 1320 | end; | |
| 1321 | ||
| 1322 | if Syste mModal the n | |
| 1323 | Applica tion.OnMod alEnd := M odalEnd; | |
| 1324 | end; | |
| 1325 | ||
| 1326 | if (FCre ateProgres s < FCP_FI NISH) then Exit; | |
| 1327 | if User. IsReportsO nly then / / Reports Only tab. | |
| 1328 | exit; | |
| 1329 | if Timed Out then | |
| 1330 | begin | |
| 1331 | if C hanges.Req uireReview then Revi ewChanges( TimedOut); | |
| 1332 | Exit ; | |
| 1333 | end; | |
| 1334 | if not A llowContex tChangeAll (Reason) t hen CanClo se := Fals e; | |
| 1335 | end; | |
| 1336 | ||
| 1337 | procedure TfrmFrame. SetUserToo ls; | |
| 1338 | var | |
| 1339 | item, pa rent: TToo lMenuItem; | |
| 1340 | ok: bool ean; | |
| 1341 | index, i , idx, cou nt: Intege r; | |
| 1342 | UserTool : TMenuIte m; | |
| 1343 | Menus: T StringList ; | |
| 1344 | begin | |
| 1345 | if User. IsReportsO nly then / / Reports Only tab. | |
| 1346 | begin | |
| 1347 | mnuToo ls.Clear; // Remove all curren t items. | |
| 1348 | UserTo ol := TMen uItem.Crea te(Self); | |
| 1349 | UserTo ol.Caption := 'Optio ns...'; | |
| 1350 | UserTo ol.Hint := 'Options' ; | |
| 1351 | UserTo ol.OnClick := mnuToo lsOptionsC lick; | |
| 1352 | mnuToo ls.Add(Use rTool); // Add back the "Optio ns" menu. | |
| 1353 | exit; | |
| 1354 | end; | |
| 1355 | if User. GECStatus then | |
| 1356 | begin | |
| 1357 | UserTo ol := TMen uItem.Crea te(self); | |
| 1358 | UserTo ol.Caption := 'GEC R eferral St atus Displ ay'; | |
| 1359 | UserTo ol.Hint := 'GEC Refe rral Statu s Display' ; | |
| 1360 | UserTo ol.OnClick := mnuGEC StatusClic k; | |
| 1361 | mnuToo ls.Add(Use rTool); // Add back the "Optio ns" menu. | |
| 1362 | end; | |
| 1363 | GetToolM enu; // Fo r all othe r users, p roceed nor mally with creation of Tools m enu: | |
| 1364 | for i := uToolMenu Items.Coun t-1 downto 0 do | |
| 1365 | begin | |
| 1366 | item : = TToolMen uItem(uToo lMenuItems [i]); | |
| 1367 | if (An siCompareT ext(item.C aption, 'E vent Captu re Interfa ce') = 0 ) and | |
| 1368 | (no t uECSRepo rt.ECSPerm it) then | |
| 1369 | begin | |
| 1370 | uToo lMenuItems .Delete(i) ; | |
| 1371 | Brea k; | |
| 1372 | end; | |
| 1373 | end; | |
| 1374 | Menus := TStringLi st.Create; | |
| 1375 | try | |
| 1376 | count := 0; | |
| 1377 | idx := 0; | |
| 1378 | index := 0; | |
| 1379 | while count < uT oolMenuIte ms.Count d o | |
| 1380 | begin | |
| 1381 | for I := 0 to uToolMenuI tems.Count - 1 do | |
| 1382 | begi n | |
| 1383 | it em := TToo lMenuItem( uToolMenuI tems[i]); | |
| 1384 | if assigned( item.MenuI tem) then continue; | |
| 1385 | if item.SubM enuID = '' then | |
| 1386 | ok := True | |
| 1387 | el se | |
| 1388 | be gin | |
| 1389 | idx := Men us.IndexOf (item.SubM enuID); | |
| 1390 | ok := (idx >= 0); | |
| 1391 | en d; | |
| 1392 | if ok then | |
| 1393 | be gin | |
| 1394 | inc(count) ; | |
| 1395 | UserTool : = TMenuIte m.Create(S elf); | |
| 1396 | UserTool.C aption := Item.Capti on; | |
| 1397 | if Item.Ac tion <> '' then | |
| 1398 | begin | |
| 1399 | UserTool .Hint := I tem.Action ; | |
| 1400 | UserTool .OnClick : = ToolClic k; | |
| 1401 | end; | |
| 1402 | Item.MenuI tem := Use rTool; | |
| 1403 | if item.Su bMenuID = '' then | |
| 1404 | begin | |
| 1405 | mnuTools .Insert(In dex,UserTo ol); | |
| 1406 | inc(Inde x); | |
| 1407 | end | |
| 1408 | else | |
| 1409 | begin | |
| 1410 | parent : = TToolMen uItem(Menu s.Objects[ idx]); | |
| 1411 | parent.M enuItem.Ad d(UserTool ); | |
| 1412 | end; | |
| 1413 | if item.Me nuID <> '' then | |
| 1414 | Menus.Ad dObject(it em.MenuID, item); | |
| 1415 | en d; | |
| 1416 | end; | |
| 1417 | end; | |
| 1418 | finally | |
| 1419 | Menus. Free; | |
| 1420 | end; | |
| 1421 | FreeAndN il(uToolMe nuItems); | |
| 1422 | end; | |
| 1423 | ||
| 1424 | procedure TfrmFrame. UpdateECSP arameter(v ar CmdPara meter: str ing); //E CS | |
| 1425 | var | |
| 1426 | vstID,Ac cVer,Svr,S vrPort,VUs er: string ; | |
| 1427 | begin | |
| 1428 | AccVer := ''; | |
| 1429 | Svr := ''; | |
| 1430 | SvrPort := ''; | |
| 1431 | VUser := ''; | |
| 1432 | if RPCBr okerV <> n il then | |
| 1433 | begin | |
| 1434 | AccVer := Strin g(RPCBroke rV.AccessV erifyCodes ); | |
| 1435 | Svr := Strin g(RPCBroke rV.Server) ; | |
| 1436 | SvrPor t := IntTo Str(RPCBro kerV.Liste nerPort); | |
| 1437 | VUser := RPCBr okerV.User .DUZ; | |
| 1438 | end; | |
| 1439 | vstID := GetVisitI D; | |
| 1440 | CmdParam eter :=' S vr=' +Svr | |
| 1441 | +' SvrPort='+ SvrPort | |
| 1442 | +' VUser='+ V User | |
| 1443 | +' PtIEN='+ P atient.DFN | |
| 1444 | +' PdIEN='+In tToStr(Enc ounter.Pro vider) | |
| 1445 | +' vstIEN='+v stID | |
| 1446 | +' locIEN='+I ntToStr(En counter.Lo cation) | |
| 1447 | +' Date=0' | |
| 1448 | +' Division=' +GetDivisi onID; | |
| 1449 | ||
| 1450 | end; | |
| 1451 | ||
| 1452 | procedure TfrmFrame. compAccess TabPageCap tionQuery( Sender: TO bject; | |
| 1453 | var Text : string); | |
| 1454 | begin | |
| 1455 | Text := GetTabText ; | |
| 1456 | end; | |
| 1457 | ||
| 1458 | function T frmFrame.V alidECSUse r: boolean ; //ECS | |
| 1459 | var | |
| 1460 | isTrue: boolean; | |
| 1461 | begin | |
| 1462 | Result : = True; | |
| 1463 | with RPC BrokerV do | |
| 1464 | begin | |
| 1465 | ShowEr rorMsgs := semQuiet; | |
| 1466 | Connec ted := True; | |
| 1467 | try | |
| 1468 | isTr ue := Crea teContext( TX_ECSOPT) ; | |
| 1469 | if n ot isTrue then | |
| 1470 | Re sult := Fa lse; | |
| 1471 | Show ErrorMsgs := semRais e; | |
| 1472 | except | |
| 1473 | on E : Exceptio n do | |
| 1474 | begi n | |
| 1475 | Sh owErrorMsg s := semRa ise; | |
| 1476 | Re sult := Fa lse; | |
| 1477 | end; | |
| 1478 | end; | |
| 1479 | end; | |
| 1480 | end; | |
| 1481 | ||
| 1482 | procedure TfrmFrame. FormClose( Sender: TO bject; var Action: T CloseActio n); | |
| 1483 | begin | |
| 1484 | FClosing := TRUE; | |
| 1485 | SetFormM onitoring( false); | |
| 1486 | If Assig ned(Patien t) then | |
| 1487 | CPAppMo n.SaveTheB uffer; //s ave the bu ffer | |
| 1488 | ||
| 1489 | ||
| 1490 | if FCrea teProgress < FCP_FIN ISH then F Terminate := True; | |
| 1491 | ||
| 1492 | FlushNot ifierBuffe r; | |
| 1493 | if FCrea teProgress = FCP_FIN ISH then N otifyOther Apps(NAE_C LOSE, ''); | |
| 1494 | Terminat eOtherAppN otificatio n; | |
| 1495 | ||
| 1496 | if Graph Float <> n il then | |
| 1497 | begin | |
| 1498 | if frm Frame.Grap hFloatActi ve then | |
| 1499 | Grap hFloat.Clo se; | |
| 1500 | GraphF loat.Relea se; | |
| 1501 | end; | |
| 1502 | ||
| 1503 | // unhoo k the time out hooks | |
| 1504 | ShutDown TimeOut; | |
| 1505 | // clear ing change s will unl ock notes | |
| 1506 | if FCrea teProgress = FCP_FIN ISH then C hanges.Cle ar; | |
| 1507 | // clear server si de flag gl obal tmp | |
| 1508 | if FCrea teProgress = FCP_FIN ISH then C learFlag; | |
| 1509 | // save user prefe rences | |
| 1510 | if FCrea teProgress = FCP_FIN ISH then S aveUserPre ferences; | |
| 1511 | // call close for each page in case th ere is any special p rocessing | |
| 1512 | if FCrea teProgress > FCP_FOR MS then | |
| 1513 | begin | |
| 1514 | mnuFra me.Merge(n il); | |
| 1515 | frmCov erSheet.Cl ose; | |
| 1516 | frmPro blems.Clos e; //frm Problems.R elease; | |
| 1517 | frmMed s.Close; //frm Meds.Relea se; | |
| 1518 | frmOrd ers.Close; //frm Orders.Rel ease; | |
| 1519 | frmNot es.Close; //frm Notes.Rele ase; | |
| 1520 | frmCon sults.Clos e; //frm Consults.R elease; | |
| 1521 | frmDCS umm.Close; //frm DCSumm.Rel ease; | |
| 1522 | if Ass igned(frmS urgery) th en frmSurg ery.Close; //frmS urgery.Rel ease; | |
| 1523 | frmLab s.Close; //frm Labs.Relea se; | |
| 1524 | frmRep orts.Close ; //frm Reports.Re lease; | |
| 1525 | frmGra phData.Clo se; //frm GraphData. Release; | |
| 1526 | ||
| 1527 | end; | |
| 1528 | // if < FCP_FINISH we came h ere from i nside Form Create, so need to c all termin ate | |
| 1529 | if FCrea teProgress < FCP_FIN ISH then A pplication .Terminate ; | |
| 1530 | end; | |
| 1531 | ||
| 1532 | procedure TfrmFrame. SetDebugMe nu; | |
| 1533 | var | |
| 1534 | IsProgra mmer: Bool ean; | |
| 1535 | begin | |
| 1536 | IsProgra mmer := Us er.HasKey( 'XUPROGMOD E') or (Sh owRPCList = True); | |
| 1537 | mnuHelpB roker.Visi ble := I sProgramme r; | |
| 1538 | mnuHelpL ists.Visib le := I sProgramme r; | |
| 1539 | mnuHelpS ymbols.Vis ible := I sProgramme r; | |
| 1540 | mnuFocus Changes.Vi sible := I sProgramme r; {added 10 May 20 12 dlp se e fFocusCo ntrols } | |
| 1541 | Z6.Visib le := I sProgramme r; | |
| 1542 | end; | |
| 1543 | ||
| 1544 | { Updates posted to MainForm - ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 1545 | ||
| 1546 | procedure TfrmFrame. UMNewOrder (var Messa ge: TMessa ge); | |
| 1547 | { post a n otice of c hange in o rders to a ll TPages, wParam=Or derAction, lParam=TO rder } | |
| 1548 | var | |
| 1549 | OrderAct : string; | |
| 1550 | begin | |
| 1551 | with Mes sage do | |
| 1552 | begin | |
| 1553 | CoverS heet.OnRef reshPanel( Self, CV_C PRS_ALLG); | |
| 1554 | CoverS heet.OnRef reshPanel( Self, CV_C PRS_POST); | |
| 1555 | frmPro blems.Noti fyOrder(WP aram, TOrd er(LParam) ); | |
| 1556 | frmMed s.NotifyOr der(WParam , TOrder(L Param)); | |
| 1557 | frmOrd ers.Notify Order(WPar am, TOrder (LParam)); | |
| 1558 | frmNot es.NotifyO rder(WPara m, TOrder( LParam)); | |
| 1559 | frmCon sults.Noti fyOrder(WP aram, TOrd er(LParam) ); | |
| 1560 | frmDCS umm.Notify Order(WPar am, TOrder (LParam)); | |
| 1561 | if Ass igned(frmS urgery) th en frmSurg ery.Notify Order(WPar am, TOrder (LParam)); | |
| 1562 | frmLab s.NotifyOr der(WParam , TOrder(L Param)); | |
| 1563 | frmRep orts.Notif yOrder(WPa ram, TOrde r(LParam)) ; | |
| 1564 | lblPtC WAD.Captio n := GetCW ADInfo(Pat ient.DFN); | |
| 1565 | if Len gth(lblPtC WAD.Captio n) > 0 the n | |
| 1566 | lblP tPostings. Caption := 'Postings ' | |
| 1567 | else | |
| 1568 | lblP tPostings. Caption := 'No Posti ngs'; | |
| 1569 | pnlPos tings.Capt ion := lbl PtPostings .Caption + ' ' + lbl PtCWAD.Cap tion; | |
| 1570 | OrderA ct := ''; | |
| 1571 | case W Param of | |
| 1572 | ORDE R_NEW: O rderAct := 'NW'; | |
| 1573 | ORDE R_DC: O rderAct := 'DC'; | |
| 1574 | ORDE R_RENEW: O rderAct := 'RN'; | |
| 1575 | ORDE R_HOLD: O rderAct := 'HD'; | |
| 1576 | ORDE R_EDIT: O rderAct := 'XX'; | |
| 1577 | ORDE R_ACT: O rderAct := 'AC'; | |
| 1578 | end; | |
| 1579 | if Len gth(OrderA ct) > 0 th en NotifyO therApps(N AE_ORDER, OrderAct + U + TOrde r(LParam). ID); // a dd FillerI D | |
| 1580 | end; | |
| 1581 | end; | |
| 1582 | ||
| 1583 | procedure TfrmFrame. UMReminder s(var Mess age: TMess age); | |
| 1584 | begin | |
| 1585 | CoverShe et.OnRefre shPanel(Se lf, CV_CPR S_WVHT); | |
| 1586 | CoverShe et.OnRefre shPanel(Se lf, CV_CPR S_POST); | |
| 1587 | CoverShe et.onRefre shPanel(Se lf, CV_CPR S_RMND); | |
| 1588 | // CoverS heet.OnRef reshCWAD(S elf); | |
| 1589 | lblPtCWA D.Caption := GetCWAD Info(Patie nt.DFN); | |
| 1590 | if Lengt h(lblPtCWA D.Caption) > 0 then | |
| 1591 | lblPtP ostings.Ca ption := ' Postings' | |
| 1592 | else | |
| 1593 | lblPtP ostings.Ca ption := ' No Posting s'; | |
| 1594 | pnlPosti ngs.Captio n := lblPt Postings.C aption + ' ' + lblPt CWAD.Capti on; | |
| 1595 | end; | |
| 1596 | ||
| 1597 | { Tab Sele ction (nav igate betw een pages) --------- ---------- ---------- ---------- ---------- -- } | |
| 1598 | ||
| 1599 | procedure TfrmFrame. WMSetFocus (var Messa ge: TMessa ge); | |
| 1600 | var | |
| 1601 | aCPRS508 : ICPRS508 ; | |
| 1602 | begin | |
| 1603 | if (FLas tPage <> n il) and (n ot TimedOu t) and | |
| 1604 | (not (csDestroy ing in FLa stPage.Com ponentStat e)) and FL astPage.Vi sible then | |
| 1605 | if FL astPage.In heritsFrom (TfrmPage) then | |
| 1606 | Tfr mPage(FLas tPage).Foc usFirstCon trol | |
| 1607 | else if Support s(fLastPag e, ICPRS50 8, aCPRS50 8) then | |
| 1608 | aCP RS508.OnFo cusFirstCo ntrol(Self ); | |
| 1609 | end; | |
| 1610 | ||
| 1611 | procedure TfrmFrame. UMShowPage (var Messa ge: TMessa ge); | |
| 1612 | { shows a page when the UM_SHO WPAGE mess age is rec eived } | |
| 1613 | var | |
| 1614 | aCPRSTab : ICPRSTab ; | |
| 1615 | begin | |
| 1616 | if FCCOW DrivedChan ge then FC COWDrivedC hange := F alse; | |
| 1617 | ||
| 1618 | if FLast Page <> ni l then | |
| 1619 | if FLa stPage.Inh eritsFrom( TfrmPage) then | |
| 1620 | Tfrm Page(FLast Page).Disp layPage | |
| 1621 | else i f Supports (fLastPage , ICPRSTab , aCPRSTab ) then | |
| 1622 | aCPR STab.OnDis playPage(S elf, CC_CL ICK); | |
| 1623 | ||
| 1624 | FChangeS ource := C C_CLICK; // reset t o click so we're onl y dealing with excep tions to c lick | |
| 1625 | if assig ned(FTabCh anged) the n | |
| 1626 | FTabCh anged(Self ); | |
| 1627 | end; | |
| 1628 | ||
| 1629 | procedure TfrmFrame. SwitchToPa ge(NewForm : TForm); | |
| 1630 | { unmerge/ merge menu s, bring p age to top of z-orde r, call fo rm-specifi c OnDispla y code } | |
| 1631 | begin | |
| 1632 | if FLast Page = New Form then | |
| 1633 | begin | |
| 1634 | if N otificatio ns.Active and Assign ed(NewForm ) then Pos tMessage(H andle, UM_ SHOWPAGE, 0, 0); | |
| 1635 | Exit ; | |
| 1636 | end; | |
| 1637 | if (FLas tPage <> n il) then | |
| 1638 | begin | |
| 1639 | mnuFra me.Unmerge (FLastPage .Menu); | |
| 1640 | FLastP age.Hide; | |
| 1641 | end; | |
| 1642 | if Assig ned(NewFor m) then be gin | |
| 1643 | mnuFra me.Merge(N ewForm.Men u); | |
| 1644 | NewFor m.Show; | |
| 1645 | end; | |
| 1646 | lstCIRNL ocations.V isible := False; | |
| 1647 | pnlCIRN. BevelOuter := bvRais ed; | |
| 1648 | lstCIRNL ocations.S endToBack; | |
| 1649 | mnuFileP rint.Enabl ed := Fals e; // let individual page enab le this | |
| 1650 | mnuFileP rintSetup. Enabled := False; // let individual page enab le this | |
| 1651 | mnuFileP rintSelect edItems.En abled := F alse; | |
| 1652 | FLastPag e := NewFo rm; | |
| 1653 | if NewFo rm <> nil then | |
| 1654 | begin | |
| 1655 | if New Form.Name = frmNotes .Name then frmNotes. Align := a lClient | |
| 1656 | else frmNotes. Align := a lNone; | |
| 1657 | if New Form.Name = frmConsu lts.Name t hen frmCon sults.Alig n := alCli ent | |
| 1658 | else frmConsul ts.Align : = alNone; | |
| 1659 | if New Form.Name = frmRepor ts.Name th en frmRepo rts.Align := alClien t | |
| 1660 | else frmReport s.Align := alNone; | |
| 1661 | if New Form.Name = frmDCSum m.Name the n frmDCSum m.Align := alClient | |
| 1662 | else frmDCSumm .Align := alNone; | |
| 1663 | if Ass igned(frmS urgery) th en | |
| 1664 | if N ewForm.Nam e = frmSur gery.Name then frmSu rgery.Alig n := alcli ent | |
| 1665 | el se frmSurg ery.Align := alNone; | |
| 1666 | NewFor m.BringToF ront; // to cause tab switch to happen im mediately | |
| 1667 | Applic ation.Proc essMessage s; | |
| 1668 | PostMe ssage(Hand le, UM_SHO WPAGE, 0, 0); // th is calls D isplayPage for the f orm | |
| 1669 | end; | |
| 1670 | end; | |
| 1671 | ||
| 1672 | procedure TfrmFrame. mnuDebugRe portClick( Sender: TO bject); | |
| 1673 | begin | |
| 1674 | inherite d; | |
| 1675 | if not A ssigned(fr mDebugRepo rt) then f rmDebugRep ort := Tfr mDebugRepo rt.Create( self); | |
| 1676 | frmDebu gReport.Sh ow; | |
| 1677 | end; | |
| 1678 | ||
| 1679 | procedure TfrmFrame. mnuChartTa bClick(Sen der: TObje ct); | |
| 1680 | { use the Tag proper ty of the menu item to switch to proper page } | |
| 1681 | begin | |
| 1682 | with Sen der as TMe nuItem do tabPage.Ta bIndex := PageIDToTa b(Tag); | |
| 1683 | LastTab := TabToPa geID(tabPa ge.TabInde x) ; | |
| 1684 | tabPageC hange(tabP age); | |
| 1685 | end; | |
| 1686 | ||
| 1687 | procedure TfrmFrame. tabPageCha nge(Sender : TObject) ; | |
| 1688 | { switches to form l inked to N ewTab } | |
| 1689 | var | |
| 1690 | PageID : integer; | |
| 1691 | begin | |
| 1692 | PageID : = TabToPag eID((sende r as TTabC ontrol).Ta bIndex); | |
| 1693 | if (Page ID <> CT_N OPAGE) and (TabPage. CanFocus) and Assign ed(FLastPa ge) and | |
| 1694 | (not TabPage.Fo cused) the n | |
| 1695 | TabPag e.SetFocus ; //CQ: 1 4854 | |
| 1696 | if (not User.IsRep ortsOnly) then | |
| 1697 | begin | |
| 1698 | case P ageID of | |
| 1699 | CT_N OPAGE: S witchToPag e(nil); | |
| 1700 | CT_C OVER: S witchToPag e(frmCover Sheet); | |
| 1701 | CT_P ROBLEMS: S witchToPag e(frmProbl ems); | |
| 1702 | CT_M EDS: S witchToPag e(frmMeds) ; | |
| 1703 | CT_O RDERS: S witchToPag e(frmOrder s); | |
| 1704 | CT_N OTES: S witchToPag e(frmNotes ); | |
| 1705 | CT_C ONSULTS: S witchToPag e(frmConsu lts); | |
| 1706 | CT_D CSUMM: S witchToPag e(frmDCSum m); | |
| 1707 | CT_S URGERY: S witchToPag e(frmSurge ry); | |
| 1708 | CT_L ABS: S witchToPag e(frmLabs) ; | |
| 1709 | CT_R EPORTS: S witchToPag e(frmRepor ts); | |
| 1710 | end; { case} | |
| 1711 | end | |
| 1712 | else // Reports On ly tab. | |
| 1713 | Switch ToPage(frm Reports); | |
| 1714 | if Scree nReaderSys temActive and FCtrlT abUsed the n | |
| 1715 | SpeakP atient; | |
| 1716 | Changing Tab := Pag eID; | |
| 1717 | end; | |
| 1718 | ||
| 1719 | function T frmFrame.P ageIDToTab (PageID: I nteger): I nteger; | |
| 1720 | { returns the tab in dex that c orresponds to a give n PageID } | |
| 1721 | VAR | |
| 1722 | i: integ er; | |
| 1723 | begin | |
| 1724 | i := uT abList.Ind exOf(IntTo Str(PageID )); | |
| 1725 | Result : = i; | |
| 1726 | end; | |
| 1727 | ||
| 1728 | function T frmFrame.T abToPageID (Tab: Inte ger): Inte ger; | |
| 1729 | { returns the consta nt that id entifies t he page gi ven a TabI ndex } | |
| 1730 | begin | |
| 1731 | if (Tab > -1) and (Tab < uTa bList.Coun t) then | |
| 1732 | Result := StrToI ntDef(uTab List[Tab], CT_UNKNOW N) | |
| 1733 | else | |
| 1734 | Result := CT_NOP AGE; | |
| 1735 | end; | |
| 1736 | ||
| 1737 | { File Men u Events - ---------- ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 1738 | ||
| 1739 | procedure TfrmFrame. SetupPatie nt(AFlagge dList : TS tringList) ; | |
| 1740 | var | |
| 1741 | AMsg, Se lectMsg: s tring; | |
| 1742 | ShortStr , | |
| 1743 | LongStr1 , LongStr2 , | |
| 1744 | LocalMsg : String; // rpk 2/ 28/2018 | |
| 1745 | begin | |
| 1746 | with Pat ient do | |
| 1747 | begin | |
| 1748 | ClearP atient; / / must be called to avoid leav ing previo us patient 's informa tion visib le! | |
| 1749 | btnCom batVet.Cap tion := 'C V '+ Comba tVet.Expir ationDate; | |
| 1750 | btnCom batVet.Vis ible := Pa tient.Comb atVet.IsEl igible; | |
| 1751 | Visibl e := True; | |
| 1752 | Applic ation.Proc essMessage s; | |
| 1753 | lblPtN ame.Captio n := Name + Status; //CQ #1749 1: Allow f or the dis play of th e patient status ind icator in header bar . | |
| 1754 | lblPtS SN.Caption := SSN; | |
| 1755 | lblPtA ge.Caption := Format FMDateTime ('mmm dd,y yyy', DOB) + ' (' + IntToStr(A ge) + ')'; | |
| 1756 | pnlPat ient.Capti on := lblP tName.Capt ion + ' ' + lblPtSSN .Caption + ' ' + lbl PtAge.Capt ion; | |
| 1757 | ||
| 1758 | if get OTHD(Patie nt.DFN, Pa tient.Name , ShortStr , Longstr1 , LongStr2 , LocalMsg ) then beg in // rpk 1/2/2018 | |
| 1759 | pnlO THD.Show; // rpk 12/ 6/2017 | |
| 1760 | pnlO THD.Enable d := True; // rpk 12 /6/2017 | |
| 1761 | pnlO THD.TabSto p := True; // rpk 1/ 18/2018 | |
| 1762 | lblO THD.Enable d := True; // rpk 1/ 2/2018 | |
| 1763 | lblO THDTitle.E nabled := True; // rpk 12/6/2 017 | |
| 1764 | pnlO THD.Hint : = 'Other t han Honora ble: ' + L ongStr1 + CRLF + Lon gStr2; | |
| 1765 | if L ocalMsg > '' then | |
| 1766 | pn lOTHD.Hint := pnlOTH D.Hint + C RLF + Loca lMsg; // rpk 2/28/2 018 | |
| 1767 | OTHD ShortStr : = ShortStr ; | |
| 1768 | OTHD LongStr1 : = LongStr1 ; | |
| 1769 | OTHD LongStr2 : = LongStr2 ; | |
| 1770 | OTHD LocalMsg : = LocalMsg ; // rpk 2/28/2018 | |
| 1771 | if S creenReade rActive th en begin // rpk 1/2 /2018 | |
| 1772 | lb lOTHD.Capt ion := Lon gStr1 + ' ' + LongSt r2; | |
| 1773 | end | |
| 1774 | else begin | |
| 1775 | lb lOTHD.TabS top := Fal se; | |
| 1776 | lb lOTHD.Capt ion := Sho rtstr; // rpk 12/6/2 017 | |
| 1777 | lb lOTHD.Hint := LongSt r1 + CRLF + LongStr2 ; | |
| 1778 | end; | |
| 1779 | end; / / rpk 1/2/ 2018 | |
| 1780 | ||
| 1781 | if Len gth(CWAD) > 0 | |
| 1782 | then lblPtPost ings.Capti on := 'Pos tings' | |
| 1783 | else lblPtPost ings.Capti on := 'No Postings'; | |
| 1784 | lblPtC WAD.Captio n := CWAD; | |
| 1785 | pnlPos tings.Capt ion := lbl PtPostings .Caption + ' ' + lbl PtCWAD.Cap tion; | |
| 1786 | if (Le ngth(Prima ryTeam) > 0) or (Len gth(Primar yProvider) > 0) then begin | |
| 1787 | lblP tCare.Capt ion := Pri maryTeam; | |
| 1788 | if P rimaryProv ider <> '' then lblP tCare.Capt ion := lbl PtCare.Cap tion + ' / ' + Mixed Case(Prima ryProvider ); | |
| 1789 | if L ength(Asso ciate)>0 t hen lblPtC are.Captio n := lblP tCare.Capt ion + ' / ' + MixedC ase(Associ ate); | |
| 1790 | end; | |
| 1791 | if Len gth(Attend ing) > 0 t hen lblPtA ttending.C aption := '(Inpatien t) Attendi ng: ' + M ixedCase(A ttending); | |
| 1792 | pnlPri maryCare.C aption := lblPtCare. Caption + ' ' + lblP tAttending .Caption; | |
| 1793 | if Len gth(InProv ider) > 0 then lblP tAttending .Caption : = lblPtAtt ending.Cap tion + ' - (Inpatien t) Provide r: ' + Mix edCase(InP rovider); | |
| 1794 | if Len gth(MHTC) > 0 then l blPtMHTC.C aption := 'MH Treatm ent Coordi nator: ' + MixedCase (MHTC); | |
| 1795 | if (Le ngth(MHTC) = 0) and (Inpatient = True) a nd (Specia ltySvc = ' P') then | |
| 1796 | lblP tMHTC.Capt ion := 'MH Treatment Coordinat or Unassig ned'; | |
| 1797 | pnlPri maryCare.C aption := lblPtCare. Caption + ' ' + lblP tAttending .Caption + ' ' + lbl PtMHTC.Cap tion; | |
| 1798 | SetUpC IRN; | |
| 1799 | Displa yEncounter Text; | |
| 1800 | SetSha reNode(DFN , Handle); | |
| 1801 | with P atient do | |
| 1802 | Noti fyOtherApp s(NAE_NEWP T, SSN + U + FloatTo Str(DOB) + U + Name) ; | |
| 1803 | Select Msg := ''; | |
| 1804 | if Mea nsTestRequ ired(Patie nt.DFN, AM sg) then S electMsg : = AMsg; | |
| 1805 | if Has LegacyData (Patient.D FN, AMsg) then S electMsg : = SelectMs g + CRLF + AMsg; | |
| 1806 | ||
| 1807 | HasAct iveFlg(Fla gList, Has Flag, Pati ent.DFN); | |
| 1808 | if Has Flag then begin | |
| 1809 | txtC mdFlags.Vi sible := f alse; | |
| 1810 | pnlF lag.Enable d := True; | |
| 1811 | lblF lag.Font.C olor := Ge t508Compli antColor(c lMaroon); | |
| 1812 | lblF lag.Enable d := True; | |
| 1813 | if ( not FReFre shing) and (TriggerP RFPopUp(Pa tient.DFN) ) then | |
| 1814 | Sh owFlags; | |
| 1815 | end el se begin | |
| 1816 | txtC mdFlags.Vi sible := S creenReade rSystemAct ive; | |
| 1817 | pnlF lag.Enable d := False ; | |
| 1818 | lblF lag.Font.C olor := cl BtnFace; | |
| 1819 | lblF lag.Enable d := False ; | |
| 1820 | end; | |
| 1821 | FPrevP tID := pat ient.DFN; | |
| 1822 | { frmC over.Updat eVAAButton ; //VAA CQ 7525 (mov ed here in v26.30 (R V))} | |
| 1823 | Update VAAMHVButt ons(nil); | |
| 1824 | pnlOTH D.Left := paVAA.Left - pnlOTHD .Width; / / reset OT H button t o left of VAA, rpk 8 /3/2018 | |
| 1825 | Proces sPatientCh angeEventH ook; | |
| 1826 | if Len gth(Select Msg) > 0 t hen ShowPa tientSelec tMessages( SelectMsg) ; | |
| 1827 | end; | |
| 1828 | end; // S etupPatien t | |
| 1829 | ||
| 1830 | procedure TfrmFrame. mnuFileNex tClick(Sen der: TObje ct); | |
| 1831 | var | |
| 1832 | SaveDFN, NewDFN: s tring; // *DFN* | |
| 1833 | NextInde x: Integer ; | |
| 1834 | Reason: string; | |
| 1835 | CCOWResp onse: User Response; | |
| 1836 | AccessSt atus: inte ger; | |
| 1837 | ||
| 1838 | proced ure Update PatientInf oForAlert; | |
| 1839 | begin | |
| 1840 | if P atient.Inp atient the n begin | |
| 1841 | En counter.In patient := True; | |
| 1842 | En counter.Lo cation := Patient.Lo cation; | |
| 1843 | En counter.Da teTime := Patient.Ad mitTime; | |
| 1844 | En counter.Vi sitCategor y := 'H'; | |
| 1845 | end; | |
| 1846 | if U ser.IsProv ider then Encounter. Provider : = User.DUZ ; | |
| 1847 | Setu pPatient(F laggedPTLi st); | |
| 1848 | if ( FlaggedPTL ist.IndexO f(Patient. DFN) < 0) then | |
| 1849 | Fl aggedPTLis t.Add(Pati ent.DFN); | |
| 1850 | end; | |
| 1851 | ||
| 1852 | begin | |
| 1853 | DoNotCha ngeEncWind ow := Fals e; | |
| 1854 | OrderPri ntForm := False; | |
| 1855 | mnuFile. Tag := 0; | |
| 1856 | SaveDFN := Patient .DFN; | |
| 1857 | Notifica tions.Next ; | |
| 1858 | if Notif ications.A ctive then | |
| 1859 | begin | |
| 1860 | NewDFN := Notifi cations.DF N; | |
| 1861 | if Sav eDFN <> Ne wDFN then | |
| 1862 | begin | |
| 1863 | // n ewdfn does not have new patien t.co infor mation for CCOW call | |
| 1864 | if ( (Sender = mnuFileOpe n) or (All owContextC hangeAll(R eason))) | |
| 1865 | and AllowA ccessToSen sitivePati ent(NewDFN , AccessSt atus) then | |
| 1866 | begi n | |
| 1867 | Re mindersSta rted := FA LSE; | |
| 1868 | Pa tient.DFN := NewDFN; | |
| 1869 | En counter.Cl ear; | |
| 1870 | Ch anges.Clea r; | |
| 1871 | if Assigned( FlagList) then | |
| 1872 | be gin | |
| 1873 | F lagList.Cl ear; | |
| 1874 | H asFlag := False; | |
| 1875 | H asActiveFl g(FlagList , HasFlag, NewDFN); | |
| 1876 | en d; | |
| 1877 | if FCCOWInst alled and (ctxContex tor.State = csPartic ipating) t hen | |
| 1878 | begin | |
| 1879 | if (Allo wCCOWConte xtChange(C COWRespons e, Patient .DFN)) the n | |
| 1880 | Update PatientInf oForAlert | |
| 1881 | else | |
| 1882 | begin | |
| 1883 | case CCOWRespo nse of | |
| 1884 | ur Cancel: | |
| 1885 | begin | |
| 1886 | Patient. DFN := Sav eDFN; | |
| 1887 | Notifica tions.Prio r; | |
| 1888 | Exit; | |
| 1889 | end; | |
| 1890 | ur Break: | |
| 1891 | begin | |
| 1892 | // do no t revert t o old DFN if context was manua lly broken by user - v26 (RV) | |
| 1893 | if (ctxC ontextor.S tate = csP articipati ng) then P atient.DFN := SaveDF N; | |
| 1894 | UpdatePa tientInfoF orAlert; | |
| 1895 | end; | |
| 1896 | el se | |
| 1897 | UpdatePati entInfoFor Alert; | |
| 1898 | end; | |
| 1899 | end; | |
| 1900 | end | |
| 1901 | el se | |
| 1902 | UpdatePati entInfoFor Alert | |
| 1903 | end else | |
| 1904 | begi n | |
| 1905 | if AccessSta tus in [DG SR_ASK, DG SR_DENY] t hen | |
| 1906 | be gin | |
| 1907 | Notificati ons.Clear; | |
| 1908 | // hide th e 'next no tification ' button | |
| 1909 | FNextButto nActive := False; | |
| 1910 | FNextButto n.Free; | |
| 1911 | FNextButto n := nil; | |
| 1912 | mnuFileNex t.Enabled := False; | |
| 1913 | mnuFileNot ifRemove.E nabled := False; | |
| 1914 | Patient.DF N := ''; | |
| 1915 | mnuFileOpe nClick(mnu FileNext); | |
| 1916 | exit; | |
| 1917 | en d | |
| 1918 | el se | |
| 1919 | if SaveDFN < > '' then | |
| 1920 | be gin | |
| 1921 | Patient.DF N := SaveD FN; | |
| 1922 | Notificati ons.Prior; | |
| 1923 | Exit; | |
| 1924 | en d | |
| 1925 | el se | |
| 1926 | be gin | |
| 1927 | Notificati ons.Clear; | |
| 1928 | Patient.DF N := ''; | |
| 1929 | mnuFileOpe nClick(mnu FileNext); | |
| 1930 | exit; | |
| 1931 | en d; | |
| 1932 | end; | |
| 1933 | end; | |
| 1934 | stsAre a.Panels.I tems[1].Te xt := Noti fications. Text; | |
| 1935 | FChang eSource := CC_NOTIFI CATION; | |
| 1936 | NextIn dex := Pag eIDToTab(C T_COVER); | |
| 1937 | tabPag e.TabIndex := CT_NOP AGE; | |
| 1938 | tabPag eChange(ta bPage); | |
| 1939 | mnuFil eNotifRemo ve.Enabled := Notifi cations.Fo llowup in [NF_FLAGGE D_ORDERS, | |
| 1940 | NF_ORDER_ REQUIRES_E LEC_SIGNAT URE, | |
| 1941 | NF_MEDICA TIONS_EXPI RING_INPT, | |
| 1942 | NF_MEDICA TIONS_EXPI RING_OUTPT , | |
| 1943 | NF_UNVERI FIED_MEDIC ATION_ORDE R, | |
| 1944 | NF_UNVERI FIED_ORDER , | |
| 1945 | NF_FLAGGE D_OI_EXP_I NPT, | |
| 1946 | NF_FLAGGE D_OI_EXP_O UTPT]; | |
| 1947 | case N otificatio ns.FollowU p of | |
| 1948 | NF_L AB_RESULTS : NextIndex := PageID ToTab(CT_L ABS); | |
| 1949 | NF_F LAGGED_ORD ERS : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1950 | NF_O RDER_REQUI RES_ELEC_S IGNATURE : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1951 | NF_A BNORMAL_LA B_RESULTS : NextIndex := PageID ToTab(CT_L ABS); | |
| 1952 | NF_I MAGING_RES ULTS : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 1953 | NF_C ONSULT_REQ UEST_RESOL UTION : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1954 | NF_A BNORMAL_IM AGING_RESU LTS : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 1955 | NF_I MAGING_REQ UEST_CANCE L_HELD : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1956 | NF_N EW_SERVICE _CONSULT_R EQUEST : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1957 | NF_C ONSULT_REQ UEST_CANCE L_HOLD : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1958 | NF_S ITE_FLAGGE D_RESULTS : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1959 | NF_O RDERER_FLA GGED_RESUL TS : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1960 | NF_O RDER_REQUI RES_COSIGN ATURE : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1961 | NF_L AB_ORDER_C ANCELED : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1962 | NF_S TAT_RESULT S : | |
| 1963 | if Piece(Pie ce(Notific ations.Ale rtData, '| ', 2), '@' , 2) = 'LR CH' then | |
| 1964 | NextIndex := PageIDT oTab(CT_LA BS) | |
| 1965 | el se if Piec e(Piece(No tification s.AlertDat a, '|', 2) , '@', 2) = 'GMRC' t hen | |
| 1966 | NextIndex := PageIDT oTab(CT_CO NSULTS) | |
| 1967 | el se if Piec e(Piece(No tification s.AlertDat a, '|', 2) , '@', 2) = 'RA' the n | |
| 1968 | NextIndex := PageIDT oTab(CT_RE PORTS); | |
| 1969 | NF_D NR_EXPIRIN G : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1970 | NF_M EDICATIONS _EXPIRING_ INPT : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1971 | NF_M EDICATIONS _EXPIRING_ OUTPT : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1972 | NF_U NVERIFIED_ MEDICATION _ORDER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1973 | NF_R X_RENEWAL_ REQUEST : | |
| 1974 | be gin | |
| 1975 | if (Notifi cations.Al ertData = '') then | |
| 1976 | begin | |
| 1977 | Notifica tions.Dele te; | |
| 1978 | end; | |
| 1979 | NextIndex := PageIDT oTab(CT_OR DERS); | |
| 1980 | en d; | |
| 1981 | NF_L APSED_ORDE R : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1982 | NF_H IRISK_ORDE R : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1983 | NF_N EW_ORDER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1984 | NF_I MAGING_RES ULTS_AMEND ED : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 1985 | NF_C RITICAL_LA B_RESULTS : NextIndex := PageID ToTab(CT_L ABS); | |
| 1986 | NF_U NVERIFIED_ ORDER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1987 | NF_F LAGGED_OI_ RESULTS : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1988 | NF_F LAGGED_OI_ ORDER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1989 | NF_D C_ORDER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1990 | NF_D EA_AUTO_DC _CS_MED_OR DER : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1991 | NF_D EA_CERT_RE VOKED : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1992 | NF_C ONSULT_UNS IGNED_NOTE : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1993 | NF_D CSUMM_UNSI GNED_NOTE : NextIndex := PageID ToTab(CT_D CSUMM); | |
| 1994 | NF_N OTES_UNSIG NED_NOTE : NextIndex := PageID ToTab(CT_N OTES); | |
| 1995 | NF_C ONSULT_REQ UEST_UPDAT ED : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1996 | NF_F LAGGED_OI_ EXP_INPT : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1997 | NF_F LAGGED_OI_ EXP_OUTPT : NextIndex := PageID ToTab(CT_O RDERS); | |
| 1998 | NF_C ONSULT_PRO C_INTERPRE TATION : NextIndex := PageID ToTab(CT_C ONSULTS); | |
| 1999 | NF_I MAGING_REQ UEST_CHANG ED : | |
| 2000 | be gin | |
| 2001 | ReportBox( GetNotific ationFollo wUpText(Pa tient.DFN, Notificat ions.Follo wUp, Notif ications.A lertData), Pieces(Pi ece(Notifi cations.Re cordID, U, 1), ':', 2, 3), Tru e); | |
| 2002 | Notificati ons.Delete ; | |
| 2003 | en d; | |
| 2004 | NF_L AB_THRESHO LD_EXCEEDE D : NextIndex := PageID ToTab(CT_L ABS); | |
| 2005 | NF_M AMMOGRAM_R ESULTS : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 2006 | NF_P AP_SMEAR_R ESULTS : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 2007 | NF_A NATOMIC_PA THOLOGY_RE SULTS : NextIndex := PageID ToTab(CT_R EPORTS); | |
| 2008 | NF_S URGERY_UNS IGNED_NOTE : if TabExi sts(CT_SUR GERY) then | |
| 2009 | NextInd ex := Page IDToTab(CT _SURGERY) | |
| 2010 | else | |
| 2011 | InfoBox (TX_NO_SUR G_NOTIF, T C_NO_SURG_ NOTIF, MB_ OK); | |
| 2012 | ||
| 2013 | else | |
| 2014 | begin | |
| 2015 | if I sSmartAler t(Notifica tions.Foll owUp) then NextIndex := PageID ToTab(CT_N OTES) | |
| 2016 | else InfoBox(T X_UNK_NOTI F, TC_UNK_ NOTIF, MB_ OK); | |
| 2017 | end; | |
| 2018 | end; / /case | |
| 2019 | ||
| 2020 | tabPag e.TabIndex := NextIn dex; | |
| 2021 | tabPag eChange(ta bPage); | |
| 2022 | ||
| 2023 | end | |
| 2024 | else mnu FileOpenCl ick(mnuFil eNext); // case else | |
| 2025 | end; | |
| 2026 | ||
| 2027 | procedure TfrmFrame. SetBADxLis t; | |
| 2028 | var | |
| 2029 | i: small int; | |
| 2030 | begin | |
| 2031 | if not A ssigned(UB AGlobals.t empDxList) then | |
| 2032 | begin | |
| 2033 | UBAGl obals.temp DxList := TList.Crea te; | |
| 2034 | UBAGl obals.temp DxList.Cou nt := 0; | |
| 2035 | Appli cation.Pro cessMessag es; | |
| 2036 | end | |
| 2037 | else | |
| 2038 | begin | |
| 2039 | //Kil l the old Dx list | |
| 2040 | for i := 0 to p red(UBAGlo bals.tempD xList.Coun t) do | |
| 2041 | TO bject(UBAG lobals.tem pDxList[i] ).Free; | |
| 2042 | ||
| 2043 | UBAGl obals.temp DxList.Cle ar; | |
| 2044 | Appli cation.Pro cessMessag es; | |
| 2045 | ||
| 2046 | //Cre ate new Dx list for newly sele cted patie nt | |
| 2047 | if n ot Assigne d(UBAGloba ls.tempDxL ist) then | |
| 2048 | b egin | |
| 2049 | U BAGlobals. tempDxList := TList. Create; | |
| 2050 | U BAGlobals. tempDxList .Count := 0; | |
| 2051 | A pplication .ProcessMe ssages; | |
| 2052 | e nd; | |
| 2053 | end; | |
| 2054 | end; | |
| 2055 | ||
| 2056 | procedure TfrmFrame. mnuFileOpe nClick(Sen der: TObje ct); | |
| 2057 | { select a new patie nt & updat e the head er display s (patient id, encou nter, post ings) } | |
| 2058 | var | |
| 2059 | SaveDFN, Reason: s tring; | |
| 2060 | ok, OldR emindersSt arted, PtS elCancelle d: Boolean ; | |
| 2061 | CCOWResp onse: User Response; | |
| 2062 | ThisSess ionChanges : TChanges ; | |
| 2063 | i: Integ er; | |
| 2064 | begin | |
| 2065 | pnlPatie nt.Enabled := FALSE; | |
| 2066 | if (Send er = mnuFi leOpen) or (FRefresh ing) then | |
| 2067 | PTSwit chRefresh := True | |
| 2068 | else | |
| 2069 | PTSwit chRefresh := FALSE; // part of a change to CQ #115 29 | |
| 2070 | PtSelCan celled := FALSE; | |
| 2071 | if not F Refreshing then | |
| 2072 | mnuFil e.Tag := 0 | |
| 2073 | else | |
| 2074 | mnuFil e.Tag := 1 ; | |
| 2075 | Determin eNextTab; | |
| 2076 | // if Se nder <> mn uFileNext then //CQ 162 73 & 16419 - Missing Review/Si gn Changes dialog wh en clickin g 'Next' b utton. | |
| 2077 | ThisSess ionChanges := TChang es.Create; | |
| 2078 | try | |
| 2079 | // Loo p through and add in the docum ents | |
| 2080 | for i := 0 to Ch anges.Docu ments.Coun t - 1 do | |
| 2081 | begi n | |
| 2082 | Th isSessionC hanges.Add (CH_DOC, | |
| 2083 | TChangeIte m(Changes. Documents. Items[i]). ID, | |
| 2084 | TChangeIte m(Changes. Documents. Items[i]). Text, | |
| 2085 | TChangeIte m(Changes. Documents. Items[i]). GroupName, | |
| 2086 | TChangeIte m(Changes. Documents. Items[i]). SignState, | |
| 2087 | TChangeIte m(Changes. Documents. Items[i]). ParentID, | |
| 2088 | TChangeIte m(Changes. Documents. Items[i]). User, | |
| 2089 | TChangeIte m(Changes. Documents. Items[i]). OrderDG, | |
| 2090 | TChangeIte m(Changes. Documents. Items[i]). DCOrder, | |
| 2091 | TChangeIte m(Changes. Documents. Items[i]). Delay); | |
| 2092 | end; | |
| 2093 | // Loo p through and add in the order s | |
| 2094 | for i := 0 to Ch anges.Orde rs.Count - 1 do | |
| 2095 | begi n | |
| 2096 | Th isSessionC hanges.Add (CH_ORD, | |
| 2097 | TChangeIte m(Changes. Orders.Ite ms[i]).ID, | |
| 2098 | TChangeIte m(Changes. Orders.Ite ms[i]).Tex t, | |
| 2099 | TChangeIte m(Changes. Orders.Ite ms[i]).Gro upName, | |
| 2100 | TChangeIte m(Changes. Orders.Ite ms[i]).Sig nState, | |
| 2101 | TChangeIte m(Changes. Orders.Ite ms[i]).Par entID, | |
| 2102 | TChangeIte m(Changes. Orders.Ite ms[i]).Use r, | |
| 2103 | TChangeIte m(Changes. Orders.Ite ms[i]).Ord erDG, | |
| 2104 | TChangeIte m(Changes. Orders.Ite ms[i]).DCO rder, | |
| 2105 | TChangeIte m(Changes. Orders.Ite ms[i]).Del ay); | |
| 2106 | end; | |
| 2107 | // Loo p through and add in PCE | |
| 2108 | for i := 0 to Ch anges.PCE. Count - 1 do | |
| 2109 | begi n | |
| 2110 | Th isSessionC hanges.Add (CH_PCE, | |
| 2111 | TChangeIte m(Changes. PCE.Items[ i]).ID, | |
| 2112 | TChangeIte m(Changes. PCE.Items[ i]).Text, | |
| 2113 | TChangeIte m(Changes. PCE.Items[ i]).GroupN ame, | |
| 2114 | TChangeIte m(Changes. PCE.Items[ i]).SignSt ate, | |
| 2115 | TChangeIte m(Changes. PCE.Items[ i]).Parent ID, | |
| 2116 | TChangeIte m(Changes. PCE.Items[ i]).User, | |
| 2117 | TChangeIte m(Changes. PCE.Items[ i]).OrderD G, | |
| 2118 | TChangeIte m(Changes. PCE.Items[ i]).DCOrde r, | |
| 2119 | TChangeIte m(Changes. PCE.Items[ i]).Delay) ; | |
| 2120 | end; | |
| 2121 | if not AllowCont extChangeA ll(Reason) then | |
| 2122 | begi n | |
| 2123 | pn lPatient.E nabled := True; | |
| 2124 | // If this i s cancelle d then rel oad this s essions ch anges. | |
| 2125 | Ch anges.Clea r; | |
| 2126 | // Loop thro ugh and ad d in the d ocuments | |
| 2127 | fo r i := 0 t o ThisSess ionChanges .Documents .Count - 1 do | |
| 2128 | begin | |
| 2129 | Changes. Add(CH_DOC , | |
| 2130 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).ID, | |
| 2131 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).Text, | |
| 2132 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).Group Name, | |
| 2133 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).SignS tate, | |
| 2134 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).Paren tID, | |
| 2135 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).User, | |
| 2136 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).Order DG, | |
| 2137 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).DCOrd er, | |
| 2138 | TChang eItem(This SessionCha nges.Docum ents.Items [i]).Delay ); | |
| 2139 | end; | |
| 2140 | // Loop thro ugh and ad d in the o rders | |
| 2141 | fo r i := 0 t o ThisSess ionChanges .Orders.Co unt - 1 do | |
| 2142 | begin | |
| 2143 | Changes. Add(CH_ORD , TChangeI tem(ThisSe ssionChang es.Orders. Items[i]). ID, | |
| 2144 | TChang eItem(This SessionCha nges.Order s.Items[i] ).Text, | |
| 2145 | TChang eItem(This SessionCha nges.Order s.Items[i] ).GroupNam e, | |
| 2146 | TChang eItem(This SessionCha nges.Order s.Items[i] ).SignStat e, | |
| 2147 | TChang eItem(This SessionCha nges.Order s.Items[i] ).ParentID , | |
| 2148 | TChang eItem(This SessionCha nges.Order s.Items[i] ).User, | |
| 2149 | TChang eItem(This SessionCha nges.Order s.Items[i] ).OrderDG, | |
| 2150 | TChang eItem(This SessionCha nges.Order s.Items[i] ).DCOrder, | |
| 2151 | TChang eItem(This SessionCha nges.Order s.Items[i] ).Delay); | |
| 2152 | end; | |
| 2153 | // Loop thro ugh and ad d in PCE | |
| 2154 | fo r i := 0 t o ThisSess ionChanges .PCE.Count - 1 do | |
| 2155 | begin | |
| 2156 | Changes. Add(CH_PCE , TChangeI tem(ThisSe ssionChang es.PCE.Ite ms[i]).ID, | |
| 2157 | TChang eItem(This SessionCha nges.PCE.I tems[i]).T ext, | |
| 2158 | TChang eItem(This SessionCha nges.PCE.I tems[i]).G roupName, | |
| 2159 | TChang eItem(This SessionCha nges.PCE.I tems[i]).S ignState, | |
| 2160 | TChang eItem(This SessionCha nges.PCE.I tems[i]).P arentID, | |
| 2161 | TChang eItem(This SessionCha nges.PCE.I tems[i]).U ser, | |
| 2162 | TChang eItem(This SessionCha nges.PCE.I tems[i]).O rderDG, | |
| 2163 | TChang eItem(This SessionCha nges.PCE.I tems[i]).D COrder, | |
| 2164 | TChang eItem(This SessionCha nges.PCE.I tems[i]).D elay); | |
| 2165 | end; | |
| 2166 | ex it; | |
| 2167 | end; | |
| 2168 | finally | |
| 2169 | ThisSe ssionChang es.Clear; | |
| 2170 | ThisSe ssionChang es.Free; | |
| 2171 | end; | |
| 2172 | // updat e status t ext here | |
| 2173 | stsArea. Panels.Ite ms[1].Text := ''; | |
| 2174 | if (not User.IsRep ortsOnly) then | |
| 2175 | begin | |
| 2176 | if n ot FRefres hing then | |
| 2177 | be gin | |
| 2178 | Notificati ons.Next; // avoid p rompt if n o more ale rts select ed to proc ess {v14a RV} | |
| 2179 | if Notific ations.Act ive then | |
| 2180 | begin | |
| 2181 | if (in foBox(TX_N OTIF_STOP, TC_NOTIF_ STOP, MB_Y ESNO) = ID _NO) then | |
| 2182 | begi n | |
| 2183 | No tification s.Prior; | |
| 2184 | pn lPatient.E nabled := True; | |
| 2185 | ex it; | |
| 2186 | end; | |
| 2187 | end; | |
| 2188 | if Notific ations.Act ive then | |
| 2189 | Notifica tions.Prio r; | |
| 2190 | en d; | |
| 2191 | end; | |
| 2192 | ||
| 2193 | if FNoPa tientSelec ted then | |
| 2194 | SaveDF N := '' | |
| 2195 | else | |
| 2196 | SaveDF N := Patie nt.DFN; | |
| 2197 | ||
| 2198 | OldRemin dersStarte d := Remin dersStarte d; | |
| 2199 | Reminder sStarted : = FALSE; | |
| 2200 | try | |
| 2201 | if FRe freshing t hen | |
| 2202 | begi n | |
| 2203 | Up datePtInfo OnRefresh; | |
| 2204 | ok := True; | |
| 2205 | end | |
| 2206 | else | |
| 2207 | begi n | |
| 2208 | ok := FALSE; | |
| 2209 | if (not User .IsReports Only) then | |
| 2210 | begin | |
| 2211 | if FCCOW Installed and (ctxCo ntextor.St ate = csPa rticipatin g) then | |
| 2212 | begin | |
| 2213 | Upda teCCOWCont ext; | |
| 2214 | if n ot FCCOWEr ror then | |
| 2215 | be gin | |
| 2216 | FCCOWIconN ame := 'BM P_CCOW_LIN KED'; | |
| 2217 | pnlCCOW.Hi nt := TX_C COW_LINKED ; | |
| 2218 | imgCCOW.Pi cture.Bitm ap.LoadFro mResourceN ame(hInsta nce, FCCOW IconName); | |
| 2219 | en d; | |
| 2220 | end | |
| 2221 | else | |
| 2222 | begin | |
| 2223 | FCCO WIconName := 'BMP_CC OW_BROKEN' ; | |
| 2224 | pnlC COW.Hint : = TX_CCOW_ BROKEN; | |
| 2225 | imgC COW.Pictur e.Bitmap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 2226 | end; | |
| 2227 | if (Pati ent.DFN = '') or (Se nder = mnu FileOpen) or (Sender = mnuFile Next) or ( Sender = m nuViewDemo ) then | |
| 2228 | Select Patient(SH OW_NOTIFIC ATIONS, Fo nt.Size, P tSelCancel led); | |
| 2229 | if PtSel Cancelled then | |
| 2230 | begin | |
| 2231 | pnlP atient.Ena bled := Tr ue; | |
| 2232 | exit ; | |
| 2233 | end; | |
| 2234 | ShowEver ything; | |
| 2235 | // HideE verything( 'Retrievin g informat ion - plea se wait... .'); //v2 7 (pending ) RV | |
| 2236 | DisplayE ncounterTe xt; | |
| 2237 | FPrevInP atient := Patient.In patient; | |
| 2238 | if Notif ications.A ctive then | |
| 2239 | begin | |
| 2240 | // d isplay 'ne xt notific ation' but ton | |
| 2241 | SetU pNextButto n; | |
| 2242 | FNex tButtonAct ive := Tru e; | |
| 2243 | mnuF ileNext.En abled := T rue; | |
| 2244 | mnuF ileNextCli ck(mnuFile Open); | |
| 2245 | end | |
| 2246 | else | |
| 2247 | begin | |
| 2248 | // h ide the 'n ext notifi cation' bu tton | |
| 2249 | FNex tButtonAct ive := FAL SE; | |
| 2250 | FNex tButton.Fr ee; | |
| 2251 | FNex tButton := nil; | |
| 2252 | mnuF ileNext.En abled := F ALSE; | |
| 2253 | mnuF ileNotifRe move.Enabl ed := FALS E; | |
| 2254 | //if Patient.D FN <> Save DFN then | |
| 2255 | // r emoved, to o many thi ngs happen ing, just refresh th e patient. | |
| 2256 | ok : = True; | |
| 2257 | end | |
| 2258 | end | |
| 2259 | el se | |
| 2260 | begin | |
| 2261 | Notifica tions.Clea r; | |
| 2262 | SelectPa tient(FALS E, Font.Si ze, PtSelC ancelled); // Call P t. Sel. w/ o notifica tions. | |
| 2263 | if PtSel Cancelled then | |
| 2264 | exit; | |
| 2265 | ShowEver ything; | |
| 2266 | DisplayE ncounterTe xt; | |
| 2267 | FPrevInP atient := Patient.In patient; | |
| 2268 | ok := Tr ue; | |
| 2269 | end; | |
| 2270 | end; | |
| 2271 | if ok then | |
| 2272 | begi n | |
| 2273 | if FCCOWInst alled and (ctxContex tor.State = csPartic ipating) a nd (not FR efreshing) and (not FCCOWJustJ oined) the n | |
| 2274 | begin | |
| 2275 | if (Allo wCCOWConte xtChange(C COWRespons e, Patient .DFN)) the n | |
| 2276 | begin | |
| 2277 | Setu pPatient; | |
| 2278 | tabP age.TabInd ex := Page IDToTab(Ne xtTab); | |
| 2279 | tabP ageChange( tabPage); | |
| 2280 | end | |
| 2281 | else | |
| 2282 | begin | |
| 2283 | case CCOWRespo nse of | |
| 2284 | ur Cancel: | |
| 2285 | UpdateCCOW Context; | |
| 2286 | ur Break: | |
| 2287 | begin | |
| 2288 | // do no t revert t o old DFN if context was manua lly broken by user - v26 (RV) | |
| 2289 | if (ctxC ontextor.S tate = csP articipati ng) then | |
| 2290 | Patien t.DFN := S aveDFN; | |
| 2291 | SetupPat ient; | |
| 2292 | tabPage. TabIndex : = PageIDTo Tab(NextTa b); | |
| 2293 | tabPageC hange(tabP age); | |
| 2294 | end; | |
| 2295 | else | |
| 2296 | be gin | |
| 2297 | SetupPatie nt; | |
| 2298 | tabPage.Ta bIndex := PageIDToTa b(NextTab) ; | |
| 2299 | tabPageCha nge(tabPag e); | |
| 2300 | en d; | |
| 2301 | end; | |
| 2302 | end; | |
| 2303 | end | |
| 2304 | el se | |
| 2305 | begin | |
| 2306 | SetupPat ient; | |
| 2307 | tabPage. TabIndex : = PageIDTo Tab(NextTa b); | |
| 2308 | tabPageC hange(tabP age); | |
| 2309 | FCCOWJus tJoined := FALSE; | |
| 2310 | end; | |
| 2311 | end; | |
| 2312 | finally | |
| 2313 | if (no t FRefresh ing) and ( Patient.DF N = SaveDF N) then | |
| 2314 | Remi ndersStart ed := OldR emindersSt arted; | |
| 2315 | FFirst Load := FA LSE; | |
| 2316 | end; | |
| 2317 | { Begin BillingAwa re } | |
| 2318 | if BILLI NG_AWARE t hen | |
| 2319 | frmFra me.SetBADx List; // e nd IsBilli ngAware | |
| 2320 | { End Bi llingAware } | |
| 2321 | if not F Refreshing then | |
| 2322 | begin | |
| 2323 | DoNo tChangeEnc Window := FALSE; | |
| 2324 | Orde rPrintForm := FALSE; | |
| 2325 | uCor e.TempEnco unterLoc : = 0; | |
| 2326 | uCor e.TempEnco unterLocNa me := ''; | |
| 2327 | end; | |
| 2328 | pnlPatie nt.Enabled := True; | |
| 2329 | end; | |
| 2330 | ||
| 2331 | procedure TfrmFrame. DetermineN extTab; | |
| 2332 | begin | |
| 2333 | if (FRef reshing or User.UseL astTab) an d (not FFi rstLoad) t hen | |
| 2334 | begin | |
| 2335 | if ( tabPage.Ta bIndex < 0 ) then | |
| 2336 | Ne xtTab := L astTab | |
| 2337 | else | |
| 2338 | Ne xtTab := T abToPageID (tabPage.T abIndex); | |
| 2339 | end | |
| 2340 | else | |
| 2341 | NextTa b := User. InitialTab ; | |
| 2342 | if NextT ab = CT_NO PAGE then | |
| 2343 | NextTa b := User. InitialTab ; | |
| 2344 | if User. IsReportsO nly then / / Reports Only tab. | |
| 2345 | NextTa b := CT_RE PORTS; // Only one t ab should exist by t his point in "REPORT S ONLY" mo de. | |
| 2346 | if not T abExists(N extTab) th en | |
| 2347 | NextTa b := CT_CO VER; | |
| 2348 | if NextT ab = CT_NO PAGE then | |
| 2349 | NextTa b := User. InitialTab ; | |
| 2350 | if NextT ab = CT_OR DERS then | |
| 2351 | if frm Orders <> nil then | |
| 2352 | with frmOrders do | |
| 2353 | be gin | |
| 2354 | if (lstShe ets.ItemIn dex > -1) and (TheCu rrentView <> nil) an d (TheCurr entView.Ev entDelay.P tEventIFN > 0) then | |
| 2355 | PtEvtCom pleted(The CurrentVie w.EventDel ay.PtEvent IFN, TheCu rrentView. EventDelay .EventName ); | |
| 2356 | en d; | |
| 2357 | end; | |
| 2358 | ||
| 2359 | procedure TfrmFrame. mnuFileEnc ounterClic k(Sender: TObject); | |
| 2360 | { displays encounter window an d updates encounter display in case enco unter was updated } | |
| 2361 | begin | |
| 2362 | UpdateEn counter(NP F_ALL); {* KCM*} | |
| 2363 | DisplayE ncounterTe xt; | |
| 2364 | end; | |
| 2365 | ||
| 2366 | procedure TfrmFrame. mnuFileRev iewClick(S ender: TOb ject); | |
| 2367 | { displays the Revie w Changes window (wh ich resets the Encou nter objec t) } | |
| 2368 | var | |
| 2369 | EventCha nges: bool ean; | |
| 2370 | NameNeed Look: stri ng; | |
| 2371 | begin | |
| 2372 | FReviewC lick := Tr ue; | |
| 2373 | mnuFile. Tag := 1; | |
| 2374 | EventCha nges := Fa lse; | |
| 2375 | NameNeed Look := '' ; | |
| 2376 | //Update PtInfoOnRe fresh; | |
| 2377 | if Chang es.Count > 0 then | |
| 2378 | begin | |
| 2379 | if (frm Orders <> nil) and ( frmOrders. TheCurrent View <> ni l) and ( f rmOrders.T heCurrentV iew.EventD elay.Event IFN>0) the n | |
| 2380 | begin | |
| 2381 | Event Changes := True; | |
| 2382 | NameN eedLook := frmOrders .TheCurren tView.View Name; | |
| 2383 | frmOr ders.PtEvt Completed( frmOrders. TheCurrent View.Event Delay.PtEv entIFN, fr mOrders.Th eCurrentVi ew.EventDe lay.EventN ame); | |
| 2384 | end; | |
| 2385 | ReviewC hanges(Tim edOut, Eve ntChanges) ; | |
| 2386 | if TabT oPageID(ta bPage.TabI ndex)= CT_ MEDS then | |
| 2387 | begin | |
| 2388 | frmOr ders.InitO rderSheets 2(NameNeed Look); | |
| 2389 | end; | |
| 2390 | end | |
| 2391 | else Inf oBox('No n ew changes to review /sign.', ' Review Cha nges', MB_ OK); | |
| 2392 | //CQ #17 491: Moved UpdatePtI nfoOnRefre sh here to allow for the updat ing of the patient s tatus indi cator | |
| 2393 | //in the header ba r (after t he Review Changes di alog close s) if the patient be comes admi tted/disch arged. | |
| 2394 | UpdatePt InfoOnRefr esh; | |
| 2395 | FOrderPr intForm := false; | |
| 2396 | FReviewC lick := fa lse; | |
| 2397 | end; | |
| 2398 | ||
| 2399 | procedure TfrmFrame. mnuFileExi tClick(Sen der: TObje ct); | |
| 2400 | { see the CloseQuery event } | |
| 2401 | var | |
| 2402 | i: small int; | |
| 2403 | begin | |
| 2404 | try | |
| 2405 | if B ILLING_AWA RE then | |
| 2406 | b egin | |
| 2407 | i f Assigned (tempDxLis t) then | |
| 2408 | for i := 0 to pred (UBAGlobal s.tempDxLi st.Count) do | |
| 2409 | TObje ct(UBAGlob als.tempDx List[i]).F ree; | |
| 2410 | ||
| 2411 | U BAGlobals. tempDxList .Clear; | |
| 2412 | A pplication .ProcessMe ssages; | |
| 2413 | e nd; //end IsBillingA ware | |
| 2414 | except | |
| 2415 | on EA ccessViola tion do | |
| 2416 | be gin | |
| 2417 | {$ ifdef debu g}Show508M essage('Ac cess Viola tion in pr ocedure Tf rmFrame.mn uFileExitC lick()');{ $endif} | |
| 2418 | ra ise; | |
| 2419 | en d; | |
| 2420 | on E: Exception do | |
| 2421 | be gin | |
| 2422 | {$ ifdef debu g}Show508M essage('Un handled ex ception in procedure TfrmFrame .mnuFileEx itClick()' );{$endif} | |
| 2423 | ra ise; | |
| 2424 | en d; | |
| 2425 | end; | |
| 2426 | ||
| 2427 | Close; | |
| 2428 | end; | |
| 2429 | ||
| 2430 | { View Men u Events - ---------- ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 2431 | ||
| 2432 | procedure TfrmFrame. mnuViewPos tingsClick (Sender: T Object); | |
| 2433 | begin | |
| 2434 | end; | |
| 2435 | ||
| 2436 | { Tool Men u Events - ---------- ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 2437 | ||
| 2438 | function T frmFrame.E xpandComma nd(x: stri ng): strin g; | |
| 2439 | { look for 'macros' on the com mand line and expand them usin g current context } | |
| 2440 | ||
| 2441 | procedur e Substitu te(const K ey, Data: string); | |
| 2442 | var | |
| 2443 | Stop, Start: Int eger; | |
| 2444 | begin | |
| 2445 | Stop := Pos(Key , x) - 1; | |
| 2446 | Start := Stop + Length(Key ) + 1; | |
| 2447 | x := C opy(x, 1, Stop) + Da ta + Copy( x, Start, Length(x)) ; | |
| 2448 | end; | |
| 2449 | ||
| 2450 | begin | |
| 2451 | if Pos(' %MREF', x) > 0 then Substitute ('%MREF', | |
| 2452 | '^TMP( ''ORWCHART '',' + Use r.JobNumbe r + ',''' + DottedIP Str + ''', ' + IntToH ex(Handle, 8) + ')') ; | |
| 2453 | if Pos(' %SRV', x) > 0 then Substitute ('%SRV', String(RPC BrokerV.Se rver)); | |
| 2454 | if Pos(' %PORT', x) > 0 then Substitute ('%PORT', IntToStr(R PCBrokerV. ListenerPo rt)); | |
| 2455 | if Pos(' %DFN', x) > 0 then Substitute ('%DFN', Patient.DF N); //*DF N* | |
| 2456 | if Pos(' %DUZ', x) > 0 then Substitute ('%DUZ', IntToStr(U ser.DUZ)); | |
| 2457 | if Pos(' %H', x) > 0 then Su bstitute(' %H', Strin g(RPCBroke rV.LogIn.L ogInHandle )); | |
| 2458 | Result : = x; | |
| 2459 | end; | |
| 2460 | ||
| 2461 | procedure TfrmFrame. ToolClick( Sender: TO bject); | |
| 2462 | { executes the progr am associa ted with a n item on the Tools menu, the command li ne is stor ed | |
| 2463 | in the i tem's hint property } | |
| 2464 | const | |
| 2465 | TXT_ECS_ NOTFOUND = 'The ECS applicatio n is not f ound at th e default directory, ' + #13 + 'would you like manu ally searc h it?'; | |
| 2466 | TC_ECS_N OTFOUND = 'Applicati on Not Fou nd'; | |
| 2467 | var | |
| 2468 | x, AFile , Param, M enuCommand , ECSAppen d, CapNm, curPath : string; | |
| 2469 | IsECSInt erface: bo olean; | |
| 2470 | ||
| 2471 | function TakeOutAm ps(AString : string): string; | |
| 2472 | var | |
| 2473 | S1,S2: string; | |
| 2474 | begin | |
| 2475 | if Pos ('&',AStri ng)=0 then | |
| 2476 | begin | |
| 2477 | Resu lt := AStr ing; | |
| 2478 | Exit ; | |
| 2479 | end; | |
| 2480 | S1 := Piece(AStr ing,'&',1) ; | |
| 2481 | S2 := Piece(AStr ing,'&',2) ; | |
| 2482 | Result := S1 + S 2; | |
| 2483 | end; | |
| 2484 | ||
| 2485 | function ExcuteEC( AFile,APar a: string) : boolean; | |
| 2486 | begin | |
| 2487 | if (Sh ellExecute (Handle, ' open', PCh ar(AFile), PChar(Par am), '', S W_NORMAL) > 32 ) the n Result : = True | |
| 2488 | else | |
| 2489 | begin | |
| 2490 | if I nfoBox(TXT _ECS_NOTFO UND, TC_EC S_NOTFOUND , MB_YESNO or MB_ICO NERROR) = IDYES then | |
| 2491 | begi n | |
| 2492 | if OROpenDlg .Execute t hen | |
| 2493 | be gin | |
| 2494 | AFile := OROpenDlg. FileName; | |
| 2495 | if Pos('e cs gui.exe ',lowerCas e(AFile))< 1 then | |
| 2496 | begin | |
| 2497 | ShowMsg ('This is not a vali d ECS appl ication.') ; | |
| 2498 | Result := True; | |
| 2499 | end else | |
| 2500 | begin | |
| 2501 | if (She llExecute( Handle, 'o pen', PCha r(AFile), PChar(Para m), '', SW _NORMAL)<3 2) then Re sult := Fa lse | |
| 2502 | else Re sult := Tr ue; | |
| 2503 | end; | |
| 2504 | en d | |
| 2505 | el se Result := True; | |
| 2506 | end else Resul t := True; | |
| 2507 | end; | |
| 2508 | end; | |
| 2509 | ||
| 2510 | function ExcuteECS (AFile, AP ara: strin g; var cur rPath: str ing): bool ean; | |
| 2511 | var | |
| 2512 | comman dline,RPCH andle: str ing; | |
| 2513 | Startu pInfo: TSt artupInfo; | |
| 2514 | Proces sInfo: TPr ocessInfor mation; | |
| 2515 | begin | |
| 2516 | FillCh ar(Startup Info, Size Of(TStartu pInfo), 0) ; | |
| 2517 | with S tartupInfo do | |
| 2518 | begin | |
| 2519 | cb : = SizeOf(T StartupInf o); | |
| 2520 | dwFl ags := STA RTF_USESHO WWINDOW; | |
| 2521 | wSho wWindow := SW_SHOWNO RMAL; | |
| 2522 | end; | |
| 2523 | comman dline := A File + Par am; | |
| 2524 | RPCHan dle := Get AppHandle( RPCBrokerV ); | |
| 2525 | comman dline := c ommandline + ' H=' + RPCHandle ; | |
| 2526 | if Cre ateProcess (nil, PCha r(commandl ine), nil, nil, Fals e, | |
| 2527 | NORM AL_PRIORIT Y_CLASS, n il, nil, S tartupInfo , ProcessI nfo) then Result := True | |
| 2528 | else | |
| 2529 | begin | |
| 2530 | if I nfoBox(TXT _ECS_NOTFO UND, TC_EC S_NOTFOUND , MB_YESNO or MB_ICO NERROR) = IDYES then | |
| 2531 | begi n | |
| 2532 | if OROpenDlg .Execute t hen | |
| 2533 | be gin | |
| 2534 | AFile := OROpenDlg. FileName; | |
| 2535 | if Pos('e cs gui.exe ',lowerCas e(AFile))< 1 then | |
| 2536 | begin | |
| 2537 | ShowMsg ('This is not a vali d ECS appl ication.') ; | |
| 2538 | Result := True; | |
| 2539 | end else | |
| 2540 | begin | |
| 2541 | SaveUse rPath('Eve nt Capture Interface ='+AFile, currPath); | |
| 2542 | FillCha r(StartupI nfo, SizeO f(TStartup Info), 0); | |
| 2543 | with St artupInfo do | |
| 2544 | begin | |
| 2545 | cb := SizeOf(TS tartupInfo ); | |
| 2546 | dwFla gs := STAR TF_USESHOW WINDOW; | |
| 2547 | wShow Window := SW_SHOWNOR MAL; | |
| 2548 | end; | |
| 2549 | command line := AF ile + Para m; | |
| 2550 | RPCHand le := GetA ppHandle(R PCBrokerV) ; | |
| 2551 | command line := co mmandline + ' H=' + RPCHandle; | |
| 2552 | if not CreateProc ess(nil, P Char(comma ndline), n il, nil, F alse, | |
| 2553 | NORM AL_PRIORIT Y_CLASS, n il, nil,St artupInfo, ProcessInf o) then Re sult := Fa lse | |
| 2554 | else Re sult := Tr ue; | |
| 2555 | end; | |
| 2556 | en d | |
| 2557 | el se Result := True; | |
| 2558 | end else Resul t := True; | |
| 2559 | end; | |
| 2560 | end; | |
| 2561 | ||
| 2562 | begin | |
| 2563 | MenuComm and := ''; | |
| 2564 | ECSAppen d := ''; | |
| 2565 | IsECSInt erface := False; | |
| 2566 | curPath := ''; | |
| 2567 | CapNm := LowerCase (TMenuItem (Sender).C aption); | |
| 2568 | CapNm := TakeOutAm ps(CapNm); | |
| 2569 | if AnsiC ompareText ('event ca pture inte rface',Cap Nm)=0 then | |
| 2570 | begin | |
| 2571 | IsECSI nterface : = True; | |
| 2572 | if FEC SAuthUser then Updat eECSParame ter(ECSApp end) | |
| 2573 | else b egin | |
| 2574 | Show Msg('You d on''t have permissio n to use E CS.'); | |
| 2575 | exit ; | |
| 2576 | end; | |
| 2577 | end; | |
| 2578 | MenuComm and := TMe nuItem(Sen der).Hint + ECSAppen d; | |
| 2579 | x := Exp andCommand (MenuComma nd); | |
| 2580 | if CharA t(x, 1) = '"' then | |
| 2581 | begin | |
| 2582 | x := Copy(x, 2, Length (x)); | |
| 2583 | AFile := Copy(x, 1, Pos('" ',x)-1); | |
| 2584 | Param := Copy(x, Pos('"',x )+1, Lengt h(x)); | |
| 2585 | end else | |
| 2586 | begin | |
| 2587 | AFile := Piece(x , ' ', 1); | |
| 2588 | Param := Copy(x, Length(AF ile)+1, Le ngth(x)); | |
| 2589 | end; | |
| 2590 | if IsECS Interface then | |
| 2591 | begin | |
| 2592 | if not ExcuteECS (AFile,Par am,curPath ) then | |
| 2593 | Excu teECS(AFil e,Param,cu rPath); | |
| 2594 | if Len gth(curPat h)>0 then | |
| 2595 | TMen uItem(Send er).Hint : = curPath; | |
| 2596 | end | |
| 2597 | else if (Pos('ecs' ,LowerCase (AFile))>0 ) and (not IsECSInte rface) the n | |
| 2598 | begin | |
| 2599 | if not ExcuteEC( AFile,Para m) then | |
| 2600 | Excu teEC(AFile ,Param); | |
| 2601 | end else | |
| 2602 | begin | |
| 2603 | ShellE xecute(Han dle, 'open ', PChar(A File), PCh ar(Param), '', SW_NO RMAL); | |
| 2604 | end; | |
| 2605 | end; | |
| 2606 | ||
| 2607 | { Help Men u Events - ---------- ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 2608 | ||
| 2609 | procedure TfrmFrame. mnuHelpBro kerClick(S ender: TOb ject); | |
| 2610 | { used for debugging - shows l ast n brok er calls } | |
| 2611 | begin | |
| 2612 | ShowBrok er; | |
| 2613 | end; | |
| 2614 | ||
| 2615 | procedure TfrmFrame. mnuHelpLis tsClick(Se nder: TObj ect); | |
| 2616 | { used for debugging - shows i nternal co ntents of TORListBox } | |
| 2617 | begin | |
| 2618 | if Scree n.ActiveCo ntrol is T ListBox | |
| 2619 | then D ebugListIt ems(TListB ox(Screen. ActiveCont rol)) | |
| 2620 | else I nfoBox('Fo cus contro l is not a listbox', 'ListBox Data', MB_ OK); | |
| 2621 | end; | |
| 2622 | ||
| 2623 | procedure TfrmFrame. mnuHelpSym bolsClick( Sender: TO bject); | |
| 2624 | { used for debugging - shows c urrent sym bol table } | |
| 2625 | begin | |
| 2626 | DebugSho wServer; | |
| 2627 | end; | |
| 2628 | ||
| 2629 | procedure TfrmFrame. mnuHelpAbo utClick(Se nder: TObj ect); | |
| 2630 | { displays the about screen } | |
| 2631 | begin | |
| 2632 | ShowAbou t; | |
| 2633 | end; | |
| 2634 | ||
| 2635 | { Status B ar Methods } | |
| 2636 | ||
| 2637 | procedure TfrmFrame. UMStatusTe xt(var Mes sage: TMes sage); | |
| 2638 | { displays status ba r text (us ing the po inter to a text buff er passed in LParam) } | |
| 2639 | begin | |
| 2640 | stsArea. Panels.Ite ms[0].Text := StrPas (PChar(Mes sage.LPara m)); | |
| 2641 | stsArea. Refresh; | |
| 2642 | end; | |
| 2643 | ||
| 2644 | { Toolbar Methods (m ake panels act like buttons) - ---------- ---------- ---------- ---------- -- } | |
| 2645 | ||
| 2646 | procedure TfrmFrame. pnlPatient MouseDown( Sender: TO bject; But ton: TMous eButton; | |
| 2647 | Shift: T ShiftState ; X, Y: In teger); | |
| 2648 | { emulate a button p ress in th e patient identifica tion panel } | |
| 2649 | begin | |
| 2650 | if pnlPa tient.Beve lOuter = b vLowered t hen exit; | |
| 2651 | pnlPatie nt.BevelOu ter := bvL owered; | |
| 2652 | with lbl PtName do SetBounds( Left+2, To p+2, Width , Height); | |
| 2653 | with lbl PtSSN do SetBounds( Left+2, To p+2, Width , Height); | |
| 2654 | with lbl PtAge do SetBounds( Left+2, To p+2, Width , Height); | |
| 2655 | end; | |
| 2656 | ||
| 2657 | procedure TfrmFrame. pnlPatient MouseUp(Se nder: TObj ect; Butto n: TMouseB utton; | |
| 2658 | Shift: T ShiftState ; X, Y: In teger); | |
| 2659 | { emulate the button raising i n the pati ent identi fication p anel & cal l Patient Inquiry } | |
| 2660 | begin | |
| 2661 | if pnlPa tient.Beve lOuter = b vRaised th en exit; | |
| 2662 | pnlPatie nt.BevelOu ter := bvR aised; | |
| 2663 | with lbl PtName do SetBounds( Left-2, To p-2, Width , Height); | |
| 2664 | with lbl PtSSN do SetBounds( Left-2, To p-2, Width , Height); | |
| 2665 | with lbl PtAge do SetBounds( Left-2, To p-2, Width , Height); | |
| 2666 | end; | |
| 2667 | ||
| 2668 | procedure TfrmFrame. pnlVisitMo useDown(Se nder: TObj ect; Butto n: TMouseB utton; | |
| 2669 | Shift: T ShiftState ; X, Y: In teger); | |
| 2670 | { emulate a button p ress in th e encounte r panel } | |
| 2671 | begin | |
| 2672 | if User. IsReportsO nly then | |
| 2673 | exit; | |
| 2674 | if pnlVi sit.BevelO uter = bvL owered the n exit; | |
| 2675 | pnlVisit .BevelOute r := bvLow ered; | |
| 2676 | with lbl PtLocation do SetBou nds(Left+2 , Top+2, W idth, Heig ht); | |
| 2677 | with lbl PtProvider do SetBou nds(Left+2 , Top+2, W idth, Heig ht); | |
| 2678 | end; | |
| 2679 | ||
| 2680 | procedure TfrmFrame. pnlVisitMo useUp(Send er: TObjec t; Button: TMouseBut ton; | |
| 2681 | Shift: T ShiftState ; X, Y: In teger); | |
| 2682 | { emulate a button r aising in the encoun ter panel and call U pdate Prov ider/Locat ion } | |
| 2683 | begin | |
| 2684 | if User. IsReportsO nly then | |
| 2685 | exit; | |
| 2686 | if pnlVi sit.BevelO uter = bvR aised then exit; | |
| 2687 | pnlVisit .BevelOute r := bvRai sed; | |
| 2688 | with lbl PtLocation do SetBou nds(Left-2 , Top-2, W idth, Heig ht); | |
| 2689 | with lbl PtProvider do SetBou nds(Left-2 , Top-2, W idth, Heig ht); | |
| 2690 | end; | |
| 2691 | ||
| 2692 | procedure TfrmFrame. pnlVistaWe bClick(Sen der: TObje ct); | |
| 2693 | begin | |
| 2694 | inherite d; | |
| 2695 | uUseVist aWeb := tr ue; | |
| 2696 | pnlVista Web.BevelO uter := bv Lowered; | |
| 2697 | pnlCIRNC lick(self) ; | |
| 2698 | uUseVist aWeb := fa lse; | |
| 2699 | end; | |
| 2700 | ||
| 2701 | procedure TfrmFrame. pnlVistaWe bMouseDown (Sender: T Object; Bu tton: TMou seButton; | |
| 2702 | Shift: T ShiftState ; X, Y: In teger); | |
| 2703 | begin | |
| 2704 | inherite d; | |
| 2705 | pnlVista Web.BevelO uter := bv Lowered; | |
| 2706 | end; | |
| 2707 | ||
| 2708 | procedure TfrmFrame. pnlVistaWe bMouseUp(S ender: TOb ject; Butt on: TMouse Button; | |
| 2709 | Shift: T ShiftState ; X, Y: In teger); | |
| 2710 | begin | |
| 2711 | inherite d; | |
| 2712 | pnlVista Web.BevelO uter := bv Raised; | |
| 2713 | end; | |
| 2714 | ||
| 2715 | procedure TfrmFrame. pnlPrimary CareMouseD own(Sender : TObject; | |
| 2716 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 2717 | begin | |
| 2718 | if pnlPr imaryCare. BevelOuter = bvLower ed then ex it; | |
| 2719 | pnlPrima ryCare.Bev elOuter := bvLowered ; | |
| 2720 | with lbl PtCare do SetBo unds(Left+ 2, Top+2, Width, Hei ght); | |
| 2721 | with lbl PtAttendin g do SetBo unds(Left+ 2, Top+2, Width, Hei ght); | |
| 2722 | with lbl PtMHTC do SetBounds( Left+2, To p+2, Width , Height); | |
| 2723 | end; | |
| 2724 | ||
| 2725 | procedure TfrmFrame. pnlPrimary CareMouseU p(Sender: TObject; | |
| 2726 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 2727 | begin | |
| 2728 | if pnlPr imaryCare. BevelOuter = bvRaise d then exi t; | |
| 2729 | pnlPrima ryCare.Bev elOuter := bvRaised; | |
| 2730 | with lbl PtCare do SetBo unds(Left- 2, Top-2, Width, Hei ght); | |
| 2731 | with lbl PtAttendin g do SetBo unds(Left- 2, Top-2, Width, Hei ght); | |
| 2732 | with lbl PtMHTC do SetBo unds(Left- 2, Top-2, Width, Hei ght); | |
| 2733 | end; | |
| 2734 | ||
| 2735 | procedure TfrmFrame. pnlPosting sMouseDown (Sender: T Object; | |
| 2736 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 2737 | { emulate a button p ress in th e postings panel } | |
| 2738 | begin | |
| 2739 | if pnlPo stings.Bev elOuter = bvLowered then exit; | |
| 2740 | pnlPosti ngs.BevelO uter := bv Lowered; | |
| 2741 | with lbl PtPostings do SetBou nds(Left+2 , Top+2, W idth, Heig ht); | |
| 2742 | with lbl PtCWAD do SetBou nds(Left+2 , Top+2, W idth, Heig ht); | |
| 2743 | end; | |
| 2744 | ||
| 2745 | procedure TfrmFrame. pnlPosting sMouseUp(S ender: TOb ject; | |
| 2746 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 2747 | { emulate a button r aising in the postin g panel an d call Pos tings } | |
| 2748 | begin | |
| 2749 | if pnlPo stings.Bev elOuter = bvRaised t hen exit; | |
| 2750 | pnlPosti ngs.BevelO uter := bv Raised; | |
| 2751 | with lbl PtPostings do SetBou nds(Left-2 , Top-2, W idth, Heig ht); | |
| 2752 | with lbl PtCWAD do SetBou nds(Left-2 , Top-2, W idth, Heig ht); | |
| 2753 | end; | |
| 2754 | ||
| 2755 | { Resize a nd Font-Ch ange proce dures ---- ---------- ---------- ---------- ---------- ---------- -- } | |
| 2756 | ||
| 2757 | procedure TfrmFrame. LoadSizesF orUser; | |
| 2758 | var | |
| 2759 | s1, s2, s3, s4, Du mmy: integ er; | |
| 2760 | panelBot tom, panel MedIn, Res toreWidth, MinCnst : integer; | |
| 2761 | ||
| 2762 | procedur e GetMinCo ntraint(aC ontrol: TW inControl; var LastM inWidth: I nteger); | |
| 2763 | var | |
| 2764 | I: inte ger; | |
| 2765 | begin | |
| 2766 | if aCon trol.Const raints.Min Width > La stMinWidth then | |
| 2767 | LastM inWidth := aControl. Constraint s.MinWidth ; | |
| 2768 | ||
| 2769 | for I : = 0 to aCo ntrol.Cont rolCount - 1 do | |
| 2770 | begin | |
| 2771 | if aC ontrol.Con trols[i] i s TWinCont rol then | |
| 2772 | GetM inContrain t(TWinCont rol(aContr ol.Control s[i]), Las tMinWidth) ; | |
| 2773 | end; | |
| 2774 | ||
| 2775 | end; | |
| 2776 | ||
| 2777 | begin | |
| 2778 | ChangeFo nt(UserFon tSize); | |
| 2779 | CoverShe et.OnSetFo ntSize(Sel f, UserFon tSize); | |
| 2780 | CoverShe et.OnSetSc reenReader Status(Sel f, ScreenR eaderSyste mActive); | |
| 2781 | SetUserB ounds(TCon trol(frmFr ame)); | |
| 2782 | SetUserW idths(TCon trol(frmPr oblems.pnl Left)); | |
| 2783 | SetUserW idths(TCon trol(frmOr ders.pnlLe ft)); | |
| 2784 | RestoreW idth := fr mNotes.pnl Left.Width ; | |
| 2785 | SetUserW idths(TCon trol(frmNo tes.pnlLef t)); | |
| 2786 | MinCnst := 0; | |
| 2787 | GetMinCo ntraint(fr mNotes.pnl Left, MinC nst); | |
| 2788 | if frmNo tes.pnlLef t.Width < MinCnst th en | |
| 2789 | frmNote s.pnlLeft. Width := R estoreWidt h; | |
| 2790 | ||
| 2791 | frmNotes .splHorz.L eft := frm Notes.pnlL eft.left + 1; | |
| 2792 | SetUserW idths(TCon trol(frmCo nsults.pnl Left)); | |
| 2793 | SetUserW idths(TCon trol(frmDC Summ.pnlLe ft)); | |
| 2794 | if Assig ned(frmSur gery) then SetUserWi dths(TCont rol(frmSur gery.pnlLe ft)); | |
| 2795 | SetUserW idths(TCon trol(frmLa bs.pnlLeft )); | |
| 2796 | SetUserW idths(TCon trol(frmRe ports.pnlL eft)); | |
| 2797 | SetUserC olumns(TCo ntrol(frmO rders.hdrO rders)); | |
| 2798 | SetUserC olumns(TCo ntrol(frmM eds.hdrMed sIn)); // still nee d conversi on | |
| 2799 | SetUserC olumns(TCo ntrol(frmM eds.hdrMed sOut)); | |
| 2800 | SetUserS tring('frm PtSel.lstv Alerts',En duringPtSe lColumns); | |
| 2801 | SetUserS tring(Spel lCheckerSe ttingName, SpellChec kerSetting s); | |
| 2802 | SetUserB ounds2(Tem plateEdito rSplitters , tmplEdit orSplitter Middle, | |
| 2803 | tmp lEditorSpl itterPrope rties, tmp lEditorSpl itterMain, tmplEdito rSplitterB oil); | |
| 2804 | SetUserB ounds2(Tem plateEdito rSplitters 2, tmplEdi torSplitte rNotes, Du mmy, Dummy , Dummy); | |
| 2805 | SetUserB ounds2(Rem inderTreeN ame, RemTr eeDlgLeft, RemTreeDl gTop, RemT reeDlgWidt h, RemTree DlgHeight) ; | |
| 2806 | SetUserB ounds2(Rem DlgName, R emDlgLeft, RemDlgTop , RemDlgWi dth, RemDl gHeight); | |
| 2807 | SetUserB ounds2(Rem DlgSplitte rs, RemDlg Spltr1, Re mDlgSpltr2 , Dummy ,D ummy); | |
| 2808 | SetUserB ounds2(Dra werSplitte rs,s1, s2, s3, S4); | |
| 2809 | frmNotes .Drawers.L astOpenSiz e := s1; | |
| 2810 | frmConsu lts.Drawer s.LastOpen Size := s2 ; | |
| 2811 | frmDCSum m.Drawers. LastOpenSi ze := s3; | |
| 2812 | if Assig ned(frmSur gery) then frmSurger y.Drawers. LastOpenSi ze := S4; //CQ7315 | |
| 2813 | ||
| 2814 | SetUserB ounds2(Not eSplitters ,s1, s2, s 3, s4); | |
| 2815 | frmNotes .LoadUserS plitterSet tings(s1, s2, s3, s4 ); | |
| 2816 | ||
| 2817 | SetUserB ounds2(Lab Splitters, s1, s2, s3 , s4); | |
| 2818 | frmLabs. LoadUserSe ttings(s1, s2, s3, s 4); | |
| 2819 | ||
| 2820 | with frm Meds do | |
| 2821 | begin | |
| 2822 | SetUs erBounds2( frmMeds.Na me+'Split' , panelBot tom, panel MedIn, Dum my, Dummy) ; | |
| 2823 | if (p anelBottom > frmMeds .Height-50 ) then pan elBottom : = frmMeds. Height-50; | |
| 2824 | if (p anelMedIn > panelBot tom-50) th en panelMe dIn := pan elBottom-5 0; | |
| 2825 | frmMe ds.gdpOut. Height := panelBotto m; | |
| 2826 | frmMe ds.gdpIn.H eight := p anelMedIn; | |
| 2827 | //Med s Tab Non- VA meds co lumns | |
| 2828 | SetUs erColumns( TControl(h drMedsNonV A)); //CQ7 314 | |
| 2829 | end; | |
| 2830 | ||
| 2831 | if Param Search('re z') = '640 ' then Set Bounds(Lef t, Top, 64 8, 488); // for tes ting | |
| 2832 | ||
| 2833 | end; | |
| 2834 | ||
| 2835 | procedure TfrmFrame. SaveSizesF orUser; | |
| 2836 | var | |
| 2837 | SizeList : TStringL ist; | |
| 2838 | SurgTemp Ht: intege r; | |
| 2839 | s1, s2, s3, s4: in teger; | |
| 2840 | begin | |
| 2841 | SaveUser FontSize(M ainFontSiz e); | |
| 2842 | SizeList := TStrin gList.Crea te; | |
| 2843 | try | |
| 2844 | with S izeList do | |
| 2845 | begin | |
| 2846 | Add( StrUserBou nds(frmFra me)); | |
| 2847 | Add( StrUserWid th(frmProb lems.pnlLe ft)); | |
| 2848 | Add( StrUserWid th(frmOrde rs.pnlLeft )); | |
| 2849 | Add( StrUserWid th(frmNote s.pnlLeft) ); | |
| 2850 | Add( StrUserWid th(frmCons ults.pnlLe ft)); | |
| 2851 | Add( StrUserWid th(frmDCSu mm.pnlLeft )); | |
| 2852 | if A ssigned(fr mSurgery) then Add(S trUserWidt h(frmSurge ry.pnlLeft )); | |
| 2853 | Add( StrUserWid th(frmLabs .pnlLeft)) ; | |
| 2854 | Add( StrUserWid th(frmRepo rts.pnlLef t)); | |
| 2855 | Add( StrUserCol umns(frmOr ders.hdrOr ders)); | |
| 2856 | Add( StrUserCol umns(frmMe ds.hdrMeds In)); | |
| 2857 | Add( StrUserCol umns(frmMe ds.hdrMeds Out)); | |
| 2858 | Add( StrUserStr ing(SpellC heckerSett ingName, S pellChecke rSettings) ); | |
| 2859 | Add( StrUserBou nds2(Templ ateEditorS plitters, tmplEditor SplitterMi ddle, | |
| 2860 | tmplEd itorSplitt erProperti es, tmplEd itorSplitt erMain, tm plEditorSp litterBoil )); | |
| 2861 | Add( StrUserBou nds2(Templ ateEditorS plitters2, tmplEdito rSplitterN otes, 0, 0 , 0)); | |
| 2862 | Add( StrUserBou nds2(Remin derTreeNam e, RemTree DlgLeft, R emTreeDlgT op, RemTre eDlgWidth, RemTreeDl gHeight)); | |
| 2863 | Add( StrUserBou nds2(RemDl gName, Rem DlgLeft, R emDlgTop, RemDlgWidt h, RemDlgH eight)); | |
| 2864 | Add( StrUserBou nds2(RemDl gSplitters , RemDlgSp ltr1, RemD lgSpltr2, 0 ,0)); | |
| 2865 | ||
| 2866 | //v2 6.47 - RV - access v iolation i f Surgery Tab not en abled. Se t to desig ner height as defaul t. | |
| 2867 | if A ssigned(fr mSurgery) then SurgT empHt := f rmSurgery. Drawers.pn lTemplates .Height el se SurgTem pHt := 85; | |
| 2868 | Add( StrUserBou nds2(Drawe rSplitters , frmNotes .Drawers.L astOpenSiz e, | |
| 2869 | frmCo nsults.Dra wers.LastO penSize, | |
| 2870 | frmDC Summ.Drawe rs.LastOpe nSize, | |
| 2871 | SurgT empHt)); / / last par ameter = C Q7315 | |
| 2872 | Add( StrUserBou nds2(Drawe rSplitters , frmNotes .Drawers.L astOpenSiz e, | |
| 2873 | frmCo nsults.Dra wers.LastO penSize, | |
| 2874 | frmDC Summ.Drawe rs.LastOpe nSize, | |
| 2875 | SurgT empHt)); | |
| 2876 | ||
| 2877 | frmN otes.SaveU serSplitte rSettings( s1, s2, s3 , s4); | |
| 2878 | Add( StrUserBou nds2(NoteS plitters, s1, s2, s3 , s4)); | |
| 2879 | ||
| 2880 | frmL abs.SaveUs erSettings (s1, s2, s 3, s4); | |
| 2881 | Add( StrUserBou nds2(LabSp litters, s 1, s2, s3, s4)); | |
| 2882 | ||
| 2883 | //Me ds Tab Spl itters | |
| 2884 | Add( StrUserBou nds2(frmMe ds.Name+'S plit',frmM eds.gdpOut .Height,fr mMeds.gdpI n.Height,0 ,0)); | |
| 2885 | ||
| 2886 | //Me ds Tab Non -VA meds c olumns | |
| 2887 | Add( StrUserCol umns(fMeds .frmMeds.h drMedsNonV A)); //CQ7 314 | |
| 2888 | ||
| 2889 | //Or ders Tab c olumns | |
| 2890 | Add( StrUserCol umns(fOrde rs.frmOrde rs.hdrOrde rs)); //CQ 6328 | |
| 2891 | ||
| 2892 | if E nduringPtS elSplitter Pos <> 0 t hen | |
| 2893 | Ad d(StrUserB ounds2('fr mPtSel.spt Vert', End uringPtSel SplitterPo s, 0, 0, 0 )); | |
| 2894 | if E nduringPtS elColumns <> '' then | |
| 2895 | Ad d('C^frmPt Sel.lstvAl erts^' + E nduringPtS elColumns) ; | |
| 2896 | ||
| 2897 | //** ** Copy/Pa ste | |
| 2898 | // Ad d(StrUserB ounds2('fr mNotes.Rea dOnlyEditM onitor', f rmNotes.Re adOnlyEdit Monitor.He ight, 0, 0 , 0)); // Notes savi ng is done on the no tes form. | |
| 2899 | end; | |
| 2900 | //Add sizes for forms that used Save UserBounds () to save thier pos itions | |
| 2901 | SizeHo lder.AddSi zesToStrLi st(SizeLis t); | |
| 2902 | //Send the SizeL ist to the Database | |
| 2903 | SaveUs erSizes(Si zeList); | |
| 2904 | finally | |
| 2905 | SizeLi st.Free; | |
| 2906 | end; | |
| 2907 | end; | |
| 2908 | ||
| 2909 | procedure TfrmFrame. FormResize (Sender: T Object); | |
| 2910 | { need to resize tab forms spe cifically since they don't inh erit resiz e event (b ecause the y | |
| 2911 | are deri ved from T Form itsel f) } | |
| 2912 | begin | |
| 2913 | if FTerm inate or F Closing th en Exit; | |
| 2914 | if csDes troying in Component State then Exit; | |
| 2915 | // These MoveWindo w methods can be pha sed out. T Form now h as TAlign property t hat set to | |
| 2916 | // alCli ent works perfectly well. Tfrm CoverSheet update no longer us es it. | |
| 2917 | //MoveWi ndow(frmCo ver.Handle , 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2918 | MoveWind ow(frmProb lems.Handl e, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2919 | MoveWind ow(frmMeds .Handle, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2920 | MoveWind ow(frmOrde rs.Handle, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2921 | MoveWind ow(frmNote s.Handle, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2922 | MoveWind ow(frmCons ults.Handl e, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2923 | MoveWind ow(frmDCSu mm.Handle, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2924 | if Assig ned(frmSur gery) then MoveWindo w(frmSurge ry.Handle, 0, 0, pnlPage.C lientWidth , pnlPage. ClientHeig ht, True); | |
| 2925 | MoveWind ow(frmLabs .Handle, 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2926 | MoveWind ow(frmRepo rts.Handle , 0, 0, p nlPage.Cli entWidth, pnlPage.Cl ientHeight , True); | |
| 2927 | with sts Area do | |
| 2928 | begin | |
| 2929 | Panels [1].Width := stsArea .Width - F FixedStatu sWidth; | |
| 2930 | FNextB uttonL := Panels[0]. Width + Pa nels[1].Wi dth; | |
| 2931 | FNextB uttonR := FNextButto nL + Panel s[2].Width ; | |
| 2932 | end; | |
| 2933 | if Notif ications.A ctive then SetUpNext Button; | |
| 2934 | lstCIRNL ocations.L eft := FN extButtonL - ScrollB arWidth - 100; | |
| 2935 | lstCIRNL ocations.W idth := Cl ientWidth - lstCIRNL ocations.L eft; | |
| 2936 | //cq: 15 641 | |
| 2937 | if frmFr ame.FNextB uttonActiv e then // keeps butt on aligned if cancel is presse d | |
| 2938 | begin | |
| 2939 | FNextB utton.Left := FNextB uttonL; | |
| 2940 | FNextB utton.Top := stsArea .Top; | |
| 2941 | end; | |
| 2942 | Self.Rep aint; | |
| 2943 | end; | |
| 2944 | ||
| 2945 | procedure TfrmFrame. ChangeFont (NewFontSi ze: Intege r); | |
| 2946 | { Makes ch anges in a ll compone nts whenev er the fon t size is changed. This is ha rdcoded an d | |
| 2947 | based on MS Sans S erif for n ow, as onl y the font size may be selecte d. Courier New is us ed | |
| 2948 | wherever non-propo rtional fo nts are re quired. } | |
| 2949 | const | |
| 2950 | TAB_VOFF SET = 7; | |
| 2951 | var | |
| 2952 | OldFont: TFont; | |
| 2953 | begin | |
| 2954 | // Ho ho! ResizeAnc horedFormT oFont(self ) doesn't work here because th e | |
| 2955 | // Form si ze is alia sed with M ainFormSiz e. | |
| 2956 | OldFont := TFont.C reate; | |
| 2957 | try | |
| 2958 | Disabl eAlign; | |
| 2959 | try | |
| 2960 | OldF ont.Assign (Font); | |
| 2961 | with Self do Fo nt.Size := NewFontSi ze; | |
| 2962 | with lblPtName do Fo nt.Size := NewFontSi ze; // m ust change BOLDED la bels by ha nd | |
| 2963 | with lblPtSSN do Fo nt.Size := NewFontSi ze; | |
| 2964 | with lblPtAge do Fo nt.Size := NewFontSi ze; | |
| 2965 | with lblOTHDTi tle do Fo nt.Size := NewFontSi ze; // rp k 11/28/20 17 | |
| 2966 | with lblOTHD do Fo nt.Size := NewFontSi ze; // rp k 11/28/20 17 | |
| 2967 | with lblPtLoca tion do Fo nt.Size := NewFontSi ze; | |
| 2968 | with lblPtProv ider do Fo nt.Size := NewFontSi ze; | |
| 2969 | with lblPtPost ings do Fo nt.Size := NewFontSi ze; | |
| 2970 | with lblPtCare do Fo nt.Size := NewFontSi ze; | |
| 2971 | with lblPtAtte nding do F ont.Size : = NewFontS ize; | |
| 2972 | with lblPtMHTC do F ont.Size : = NewFontS ize; | |
| 2973 | with lblFlag do Fo nt.Size := NewFontSi ze; | |
| 2974 | with lblPtCWAD do Fo nt.Size := NewFontSi ze; | |
| 2975 | with lblCIRN do Fo nt.Size := NewFontSi ze; | |
| 2976 | with lblVistaW eb do Fo nt.Size := NewFontSi ze; | |
| 2977 | with lstCIRNLo cations do | |
| 2978 | be gin | |
| 2979 | Font.Size := NewFont Size; | |
| 2980 | ItemHeight := NewFon tSize + 6; | |
| 2981 | en d; | |
| 2982 | with tabPage do Fo nt.Size := NewFontSi ze; | |
| 2983 | with laMHV do Fo nt.Size := NewFontSi ze; //VAA | |
| 2984 | with laVAA2 do Fo nt.Size := NewFontSi ze; //VAA | |
| 2985 | ||
| 2986 | frmF rameHeight := frmFra me.Height; | |
| 2987 | pnlP atientSele ctedHeight := pnlPat ientSelect ed.Height; | |
| 2988 | tabP age.Height := MainFo ntHeight + TAB_VOFFS ET; // r esize tab selector | |
| 2989 | FitT oolbar; // r esize tool bar | |
| 2990 | stsA rea.Font.S ize := New FontSize; | |
| 2991 | stsA rea.Height := MainFo ntHeight + TAB_VOFFS ET; | |
| 2992 | stsA rea.Panels [0].Width := ResizeW idth( OldF ont, Font, stsArea.P anels[0].W idth); | |
| 2993 | stsA rea.Panels [2].Width := ResizeW idth( OldF ont, Font, stsArea.P anels[2].W idth); | |
| 2994 | ||
| 2995 | Refr eshFixedSt atusWidth; | |
| 2996 | Form Resize( se lf ); | |
| 2997 | finall y | |
| 2998 | Enab leAlign; | |
| 2999 | end; | |
| 3000 | finally | |
| 3001 | OldFon t.Free; | |
| 3002 | end; | |
| 3003 | ||
| 3004 | case (Ne wFontSize) of | |
| 3005 | 8: mnu8 pt.Checked := true; | |
| 3006 | 10: mnu1 0pt1.Check ed := true ; | |
| 3007 | 12: mnu1 2pt1.Check ed := true ; | |
| 3008 | 14: mnu1 4pt1.Check ed := true ; | |
| 3009 | //18: mn u18pt1.Che cked := tr ue; | |
| 3010 | end; | |
| 3011 | ||
| 3012 | //Now th at the for m elements are resiz ed, the pa ges will k now what s ize to tak e. | |
| 3013 | ||
| 3014 | //frmCov erSheet.Fo nt.Size := NewFontSi ze; | |
| 3015 | CoverShe et.OnSetFo ntSize(Sel f, NewFont Size); | |
| 3016 | frmProbl ems.SetFon tSize(NewF ontSize); | |
| 3017 | frmMeds. SetFontSiz e(NewFontS ize); | |
| 3018 | frmOrder s.SetFontS ize(NewFon tSize); | |
| 3019 | frmNotes .SetFontSi ze(NewFont Size); | |
| 3020 | frmConsu lts.SetFon tSize(NewF ontSize); | |
| 3021 | frmDCSum m.SetFontS ize(NewFon tSize); | |
| 3022 | if Assig ned(frmSur gery) then frmSurger y.SetFontS ize(NewFon tSize); | |
| 3023 | frmLabs. SetFontSiz e(NewFontS ize); | |
| 3024 | frmRepor ts.SetFont Size(NewFo ntSize); | |
| 3025 | TfrmIcon Legend.Set FontSize(N ewFontSize ); | |
| 3026 | uOrders. SetFontSiz e(NewFontS ize); | |
| 3027 | if Assig ned(frmRem Dlg) then frmRemDlg. SetFontSiz e; | |
| 3028 | //if (Tf rmRemDlg.G etInstance <> nil) t hen TfrmRe mDlg.GetIn stance.Set FontSize; | |
| 3029 | if Assig ned(frmRem inderTree) then frmR eminderTre e.SetFontS ize(NewFon tSize); | |
| 3030 | if Graph Float <> n il then Re sizeAnchor edFormToFo nt(GraphFl oat); | |
| 3031 | end; | |
| 3032 | ||
| 3033 | procedure TfrmFrame. FitToolBar ; | |
| 3034 | { resizes and reposi tions the panels & l abels used in the to olbar } | |
| 3035 | const | |
| 3036 | PATIENT_ WIDTH = 29 ; | |
| 3037 | VISIT_WI DTH = 36 ; | |
| 3038 | POSTING_ WIDTH = 11 .5; | |
| 3039 | FLAG_WID TH = 5; | |
| 3040 | CV_WIDTH = 15 ; //14; WA T | |
| 3041 | CIRN_WID TH = 11 ; | |
| 3042 | MHV_WIDT H = 6; | |
| 3043 | LINES_HI GH2 = 2 ; | |
| 3044 | LINES_HI GH3 = 3 ; //lbl PtMHTC lin e change | |
| 3045 | M_HORIZ = 4; | |
| 3046 | M_MIDDLE = 2; | |
| 3047 | M_NVERT = 4; | |
| 3048 | M_WVERT = 6; | |
| 3049 | TINY_MAR GIN = 2; | |
| 3050 | begin | |
| 3051 | if lblPt MHTC.capti on = '' th en | |
| 3052 | begin | |
| 3053 | lblPtM HTC.Visibl e := false ; | |
| 3054 | pnlToo lbar.Heigh t := (LIN ES_HIGH2 * lblPtName .Height) + M_HORIZ + M_MIDDLE + M_HORIZ + M_MIDDLE | |
| 3055 | end | |
| 3056 | else | |
| 3057 | begin | |
| 3058 | if (lb lPtAttendi ng.Caption <> '') an d (lblPtAt tending.Ca ption <> l blPtMHTC.C aption) th en | |
| 3059 | begin | |
| 3060 | lblP tMHTC.Visi ble := tru e; | |
| 3061 | pnlT oolbar.Hei ght := (L INES_HIGH3 * lblPtNa me.Height) + M_HORIZ + M_MIDDL E + M_HORI Z + M_HORI Z; | |
| 3062 | end; | |
| 3063 | if lbl PtAttendin g.Caption = '' then | |
| 3064 | begin | |
| 3065 | lblP tAttending .Caption : = lblPtMHT C.Caption; | |
| 3066 | lblP tMHTC.Visi ble := fal se; | |
| 3067 | pnlT oolbar.Hei ght := (L INES_HIGH2 * lblPtNa me.Height) + M_HORIZ + M_MIDDL E + M_HORI Z + M_MIDD LE; | |
| 3068 | end; | |
| 3069 | end; | |
| 3070 | pnlPatie nt.Width := Higher Of(PATIENT _WIDTH * M ainFontWid th, lblPtN ame.Width + (M_WVERT * 2)); | |
| 3071 | lblPtSSN .Top := M_HORI Z + lblPtN ame.Height + M_MIDDL E; | |
| 3072 | lblPtAge .Top := lblPtS SN.Top; | |
| 3073 | lblPtAge .Left := pnlPat ient.Width - lblPtAg e.Width - M_WVERT; | |
| 3074 | ||
| 3075 | lblOTHD. Top := lblPtS SN.Top; // rpk 12/6/ 2017 | |
| 3076 | pnlOTHD. Width := Higher Of( (lblOT HDTitle.Wi dth + (M_W VERT * 2)) , | |
| 3077 | (lbl OTHD.Width + (M_WVER T * 2)) ); // rpk 1 2/6/2017 | |
| 3078 | lblOTHD. Left := M_WVER T; // al ign in mid dle of but ton, rpk 7 /31/2018 | |
| 3079 | ||
| 3080 | pnlVisit .Width := Higher Of(LowerOf (VISIT_WID TH * MainF ontWidth, | |
| 3081 | HigherOf( lblPtProvi der.Width + (M_WVERT * 2), | |
| 3082 | lblPtLocat ion.Width + (M_WVERT * 2))), | |
| 3083 | PATIENT _WIDTH * M ainFontWid th); | |
| 3084 | lblPtPro vider.Top := lblPtS SN.Top; | |
| 3085 | lblPtAtt ending.Top := lblPtS SN.Top; | |
| 3086 | lblPtMHT C.Top := M_MID DLE + lblP tSSN.Heigh t + lblPtS SN.Top; | |
| 3087 | pnlPosti ngs.Width := Round( POSTING_WI DTH * Main FontWidth) ; | |
| 3088 | if btnCo mbatVet.Vi sible then | |
| 3089 | begin | |
| 3090 | pnlCVn Flag.Width := Roun d(CV_WIDTH * MainFon tWidth); | |
| 3091 | pnlFla g.Width := Roun d(CV_WIDTH * MainFon tWidth); | |
| 3092 | btnCom batVet.Hei ght := Rou nd(pnlCVnF lag.Height div 2); | |
| 3093 | end | |
| 3094 | else | |
| 3095 | begin | |
| 3096 | pnlCVn Flag.Width := Roun d(FLAG_WID TH * MainF ontWidth); | |
| 3097 | pnlFla g.Width := Roun d(FLAG_WID TH * MainF ontWidth); | |
| 3098 | end; | |
| 3099 | pnlRemot eData.Widt h := Round (CIRN_WIDT H * MainFo ntWidth) + M_WVERT; | |
| 3100 | pnlVista Web.Height := pnlRem oteData.He ight div 2 ; | |
| 3101 | paVAA.Wi dth := Round( MHV_WIDTH * MainFont Width) + M _WVERT + 2 ; | |
| 3102 | pnlOTHD. Left := paVAA. Left - pnl OTHD.Width ; // posi tion OTHD panel to l eft of VAA panel, rp k 3/30/201 8 | |
| 3103 | ||
| 3104 | with lbl PtPostings do | |
| 3105 | SetBou nds(M_WVER T, M_HORIZ , pnlPosti ngs.Width- M_WVERT-M_ WVERT, lbl PtName.Hei ght); | |
| 3106 | with lbl PtCWAD do | |
| 3107 | SetBou nds(M_WVER T, lblPtSS N.Top, lbl PtPostings .Width, lb lPtName.He ight); | |
| 3108 | //Low re solution h andling: F irst, try to fit eve rything on by shrink ing fields | |
| 3109 | if pnlPr imaryCare. Width < Hi gherOf( lb lPtCare.Le ft + lblPt Care.Width , HigherOf (lblPtAtte nding.Left + lblPtAt tending.Wi dth,lblPtM HTC.Left + lblPtMHTC .Width)) + TINY_MARG IN then | |
| 3110 | //if pnl PrimaryCar e.Width < HigherOf( lblPtCare. Left + lbl PtCare.Wid th, lblPtA ttending.L eft + lblP tAttending .Width) + TINY_MARGI N then | |
| 3111 | begin | |
| 3112 | lblPtA ge.Left := lblPtAge. Left - (lb lPtName.Le ft - TINY_ MARGIN); | |
| 3113 | lblPtN ame.Left : = TINY_MAR GIN; | |
| 3114 | lblPTS SN.Left := TINY_MARG IN; | |
| 3115 | pnlPat ient.Width := Higher Of( lblPtN ame.Left + lblPtName .Width, lb lPtAge.Lef t + lblPtA ge.Width)+ TINY_MARG IN; | |
| 3116 | lblPtL ocation.Le ft := TINY _MARGIN; | |
| 3117 | lblPtP rovider.Le ft := TINY _MARGIN; | |
| 3118 | pnlVis it.Width : = HigherOf ( lblPtLoc ation.Left + lblPtLo cation.Wid th, lblPtP rovider.Le ft + lblPt Provider.W idth)+ TIN Y_MARGIN; | |
| 3119 | end; | |
| 3120 | HorzScro llBar.Rang e := 0; | |
| 3121 | ||
| 3122 | end; | |
| 3123 | ||
| 3124 | { Temporar y Calls -- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -- } | |
| 3125 | ||
| 3126 | procedure TfrmFrame. ToggleMenu ItemChecke d(Sender: TObject); | |
| 3127 | begin | |
| 3128 | TMenuIte m(Sender). Checked := not TMenu Item(Sende r).Checked ; | |
| 3129 | end; | |
| 3130 | ||
| 3131 | {--------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------} | |
| 3132 | { mnuFocu sChangesCl ick - togg les the Fo cused Cont rols windo w for form s that sup port it } | |
| 3133 | {--------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------} | |
| 3134 | procedure TfrmFrame. mnuFocusCh angesClick (Sender: T Object); | |
| 3135 | begin | |
| 3136 | inherite d; | |
| 3137 | ShowFocu sedControl Dialog := mnuFocusCh anges.Chec ked; | |
| 3138 | end; | |
| 3139 | ||
| 3140 | procedure TfrmFrame. mnuFontSiz eClick(Sen der: TObje ct); | |
| 3141 | begin | |
| 3142 | if (frmR emDlg <> n il) then | |
| 3143 | ShowMs g('Please close the reminder d ialog befo re changin g font siz es.') | |
| 3144 | else if (dlgProbs <> nil) th en | |
| 3145 | ShowMs g('Font si ze cannot be changed while add ing or edi ting a pro blem.') | |
| 3146 | else beg in | |
| 3147 | with ( Sender as TMenuItem) do begin | |
| 3148 | Togg leMenuItem Checked(Se nder); | |
| 3149 | fMed s.oldFont := MainFon tSize; //C Q9182 | |
| 3150 | Chan geFont(Tag ); | |
| 3151 | end; | |
| 3152 | end; | |
| 3153 | end; | |
| 3154 | ||
| 3155 | procedure TfrmFrame. mnuEditCli ck(Sender: TObject); | |
| 3156 | var | |
| 3157 | IsReadOn ly: Boolea n; | |
| 3158 | begin | |
| 3159 | FEditCtr l := nil; | |
| 3160 | if Scree n.ActiveCo ntrol is T CustomEdit then FEdi tCtrl := T CustomEdit (Screen.Ac tiveContro l); | |
| 3161 | if FEdit Ctrl <> ni l then beg in | |
| 3162 | if FEditCtr l is TMemo then IsReadOnly := TMemo( FEditCtrl) .ReadOnly | |
| 3163 | else i f FEditCtr l is TEdit then IsReadOnly := TEdit( FEditCtrl) .ReadOnly | |
| 3164 | else i f FEditCtr l is TRich Edit then IsReadOnly := TRichE dit(FEditC trl).ReadO nly | |
| 3165 | else I sReadOnly := True; | |
| 3166 | ||
| 3167 | mnuEdi tRedo.Enab led := FEd itCtrl.Per form(EM_CA NREDO, 0, 0) <> 0; | |
| 3168 | mnuEdi tUndo.Enab led := (FE ditCtrl.Pe rform(EM_C ANUNDO, 0, 0) <> 0) and (FEdit Ctrl.Perfo rm(EM_CANR EDO, 0, 0) = 0); | |
| 3169 | ||
| 3170 | mnuEdi tCut.Enabl ed := FEdi tCtrl.SelL ength > 0; | |
| 3171 | mnuEdi tCopy.Enab led := mnu EditCut.En abled; | |
| 3172 | mnuEdi tPaste.Ena bled := (I sReadOnly = False) a nd Clipboa rd.HasForm at(CF_TEXT ); | |
| 3173 | end else begin | |
| 3174 | mnuEdi tUndo.Enab led := Fa lse; | |
| 3175 | mnuEdi tCut.Enabl ed := Fa lse; | |
| 3176 | mnuEdi tCopy.Enab led := Fa lse; | |
| 3177 | mnuEdi tPaste.Ena bled := Fa lse; | |
| 3178 | end; | |
| 3179 | end; | |
| 3180 | ||
| 3181 | procedure TfrmFrame. mnuEditUnd oClick(Sen der: TObje ct); | |
| 3182 | begin | |
| 3183 | FEditCtr l.Perform( EM_UNDO, 0 , 0); | |
| 3184 | end; | |
| 3185 | ||
| 3186 | procedure TfrmFrame. mnuEditRed oClick(Sen der: TObje ct); | |
| 3187 | begin | |
| 3188 | FEditCtr l.Perform( EM_REDO, 0 , 0); | |
| 3189 | end; | |
| 3190 | ||
| 3191 | ||
| 3192 | procedure TfrmFrame. mnuEditCut Click(Send er: TObjec t); | |
| 3193 | begin | |
| 3194 | FEditCtr l.CutToCli pboard; | |
| 3195 | end; | |
| 3196 | ||
| 3197 | procedure TfrmFrame. mnuEditCop yClick(Sen der: TObje ct); | |
| 3198 | begin | |
| 3199 | FEditCtr l.CopyToCl ipboard; | |
| 3200 | end; | |
| 3201 | ||
| 3202 | procedure TfrmFrame. mnuEditPas teClick(Se nder: TObj ect); | |
| 3203 | begin | |
| 3204 | FEditCtr l.PasteFro mClipboard ; // use AsText to prevent fo rmatting f rom being pasted | |
| 3205 | end; | |
| 3206 | ||
| 3207 | procedure TfrmFrame. mnuFilePri ntClick(Se nder: TObj ect); | |
| 3208 | begin | |
| 3209 | case mnu FilePrint. Tag of | |
| 3210 | CT_NOTES : frmNo tes.Reques tPrint; | |
| 3211 | CT_CONSU LTS: frmCo nsults.Req uestPrint; | |
| 3212 | CT_DCSUM M: frmDC Summ.Reque stPrint; | |
| 3213 | CT_REPOR TS: frmRe ports.Requ estPrint; | |
| 3214 | CT_LABS: frmLa bs.Request Print; | |
| 3215 | CT_ORDER S: frmOr ders.Reque stPrint; | |
| 3216 | CT_PROBL EMS: frmPr oblems.Req uestPrint; | |
| 3217 | CT_SURGE RY: if As signed(frm Surgery) t hen frmSur gery.Reque stPrint; | |
| 3218 | end; | |
| 3219 | end; | |
| 3220 | ||
| 3221 | procedure TfrmFrame. WMSysComma nd(var Mes sage: TMes sage); | |
| 3222 | begin | |
| 3223 | case Tab ToPageID(t abPage.Tab Index) of | |
| 3224 | CT_NOT ES: | |
| 3225 | if Assigned( Screen.Act iveControl .Parent) a nd (Screen .ActiveCon trol.Paren t.Name = ' cboCosigne r') then | |
| 3226 | with Messa ge do | |
| 3227 | begin | |
| 3228 | SendMe ssage(frmN otes.Handl e, Msg, WP aram, LPar am); | |
| 3229 | Result := 0; | |
| 3230 | end | |
| 3231 | el se | |
| 3232 | inherited; | |
| 3233 | CT_DCS UMM: | |
| 3234 | if Assigned( Screen.Act iveControl .Parent) a nd (Screen .ActiveCon trol.Paren t.Name = ' cboAttendi ng') then | |
| 3235 | with Messa ge do | |
| 3236 | begin | |
| 3237 | SendMe ssage(frmD CSumm.Hand le, Msg, W Param, lPa ram); | |
| 3238 | Result := 0; | |
| 3239 | end | |
| 3240 | el se | |
| 3241 | inherited; | |
| 3242 | CT_CON SULTS: | |
| 3243 | if Assigned( Screen.Act iveControl .Parent) a nd (Screen .ActiveCon trol.Paren t.Name = ' cboCosigne r') then | |
| 3244 | with Messa ge do | |
| 3245 | begin | |
| 3246 | SendMe ssage(frmC onsults.Ha ndle, Msg, WParam, l Param); | |
| 3247 | Result := 0; | |
| 3248 | end | |
| 3249 | el se | |
| 3250 | inherited; | |
| 3251 | else | |
| 3252 | inheri ted; | |
| 3253 | end; | |
| 3254 | if Messa ge.WParam = SC_MAXIM IZE then | |
| 3255 | begin | |
| 3256 | // for m becomes maximized; | |
| 3257 | frmOrd ers.mnuOpt imizeField sClick(sel f); | |
| 3258 | frmPro blems.mnuO ptimizeFie ldsClick(s elf); | |
| 3259 | frmMed s.mnuOptim izeFieldsC lick(self) ; | |
| 3260 | end | |
| 3261 | else if Message.WP aram = SC_ MINIMIZE t hen | |
| 3262 | begin | |
| 3263 | // for m becomes maximized; | |
| 3264 | end | |
| 3265 | else if Message.WP aram = SC_ RESTORE th en | |
| 3266 | begin | |
| 3267 | // for m is resto red (from maximized) ; | |
| 3268 | frmOrd ers.mnuOpt imizeField sClick(sel f); | |
| 3269 | frmPro blems.mnuO ptimizeFie ldsClick(s elf); | |
| 3270 | frmMed s.mnuOptim izeFieldsC lick(self) ; | |
| 3271 | end; | |
| 3272 | end; | |
| 3273 | ||
| 3274 | procedure TfrmFrame. RemindersC hanged(Sen der: TObje ct); | |
| 3275 | var | |
| 3276 | ImgName: string; | |
| 3277 | begin | |
| 3278 | pnlRemin ders.tag : = HAVE_REM INDERS; | |
| 3279 | pnlRemin ders.Hint := 'Click to display reminders '; | |
| 3280 | case Get ReminderSt atus of | |
| 3281 | rsUnkn own: | |
| 3282 | begi n | |
| 3283 | Im gName := ' BMP_REMIND ERS_UNKNOW N'; | |
| 3284 | pn lReminders .Caption : = 'Reminde rs'; | |
| 3285 | end; | |
| 3286 | rsDue: | |
| 3287 | begi n | |
| 3288 | Im gName := ' BMP_REMIND ERS_DUE'; | |
| 3289 | pn lReminders .Caption : = 'Due Rem inders'; | |
| 3290 | end; | |
| 3291 | rsAppl icable: | |
| 3292 | begi n | |
| 3293 | Im gName := ' BMP_REMIND ERS_APPLIC ABLE'; | |
| 3294 | pn lReminders .Caption : = 'Applica ble Remind ers'; | |
| 3295 | end; | |
| 3296 | rsNotA pplicable: | |
| 3297 | begi n | |
| 3298 | Im gName := ' BMP_REMIND ERS_OTHER' ; | |
| 3299 | pn lReminders .Caption : = 'Other R eminders'; | |
| 3300 | end; | |
| 3301 | else | |
| 3302 | begi n | |
| 3303 | Im gName := ' BMP_REMIND ERS_NONE'; | |
| 3304 | pn lReminders .Hint := ' There are currently no reminde rs availab le'; | |
| 3305 | pn lReminders .Caption : = pnlRemin ders.Hint; | |
| 3306 | pn lReminders .tag := NO _REMINDERS ; | |
| 3307 | end; | |
| 3308 | end; | |
| 3309 | if(Remin dersEvalua tingInBack ground) th en | |
| 3310 | begin | |
| 3311 | if(anm tRemSearch .ResName = '') then | |
| 3312 | begin | |
| 3313 | TORE xposedAnim ate(anmtRe mSearch).O nMouseDown := pnlRem indersMous eDown; | |
| 3314 | TORE xposedAnim ate(anmtRe mSearch).O nMouseUp := pnlRem indersMous eUp; | |
| 3315 | anmt RemSearch. ResHandle := 0; | |
| 3316 | anmt RemSearch. ResName := 'REMSEARC HAVI'; | |
| 3317 | end; | |
| 3318 | imgRem inder.Visi ble := FAL SE; | |
| 3319 | anmtRe mSearch.Ac tive := TR UE; | |
| 3320 | anmtRe mSearch.Vi sible := T RUE; | |
| 3321 | if(pnl Reminders. Hint <> '' ) then | |
| 3322 | pnlR eminders.H int := CRL F + pnlRem inders.Hin t + '.'; | |
| 3323 | pnlRem inders.Hin t := 'Eval uating Rem inders... ' + pnlRe minders.Hi nt; | |
| 3324 | pnlRem inders.Cap tion := pn lReminders .Hint; | |
| 3325 | end | |
| 3326 | else | |
| 3327 | begin | |
| 3328 | anmtRe mSearch.Vi sible := F ALSE; | |
| 3329 | imgRem inder.Visi ble := TRU E; | |
| 3330 | imgRem inder.Pict ure.Bitmap .LoadFromR esourceNam e(hInstanc e, ImgName ); | |
| 3331 | anmtRe mSearch.Ac tive := FA LSE; | |
| 3332 | end; | |
| 3333 | mnuViewR eminders.E nabled := (pnlRemind ers.tag = HAVE_REMIN DERS); | |
| 3334 | end; | |
| 3335 | ||
| 3336 | procedure TfrmFrame. pnlReminde rsMouseDow n(Sender: TObject; | |
| 3337 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 3338 | begin | |
| 3339 | if(not I nitialRemi ndersLoade d) then | |
| 3340 | Startu pReminders ; | |
| 3341 | if(pnlRe minders.ta g = HAVE_R EMINDERS) then | |
| 3342 | pnlRem inders.Bev elOuter := bvLowered ; | |
| 3343 | end; | |
| 3344 | ||
| 3345 | procedure TfrmFrame. pnlReminde rsMouseUp( Sender: TO bject; | |
| 3346 | Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 3347 | begin | |
| 3348 | pnlRemin ders.Bevel Outer := b vRaised; | |
| 3349 | if(pnlRe minders.ta g = HAVE_R EMINDERS) then | |
| 3350 | ViewIn fo(mnuView Reminders) ; | |
| 3351 | end; | |
| 3352 | ||
| 3353 | //-------- ---------- --- CIRN-r elated pro cedures -- ---------- ---------- ---------- | |
| 3354 | ||
| 3355 | procedure TfrmFrame. SetUpCIRN; | |
| 3356 | var | |
| 3357 | i: integ er; | |
| 3358 | iNwHIN, iRDVOnly: integer; | |
| 3359 | aAutoQue ry,aVistaW ebLabel: s tring; | |
| 3360 | ASite: T RemoteSite ; | |
| 3361 | item: TV A508Access ibilityIte m; | |
| 3362 | id: inte ger; | |
| 3363 | begin | |
| 3364 | uUseVist aWeb := fa lse; | |
| 3365 | with Rem oteSites d o | |
| 3366 | begin | |
| 3367 | Change Patient(Pa tient.DFN) ; | |
| 3368 | lblCIR N.Caption := ' Remot e Data'; | |
| 3369 | lblCIR N.Alignmen t := taCen ter; | |
| 3370 | aVista WebLabel : = GetVista Web_JLV_La belName; | |
| 3371 | if aVi staWebLabe l = '' the n aVistaWe bLabel := 'VistAWeb' ; | |
| 3372 | lblVis taWeb.Capt ion := aVi staWebLabe l; | |
| 3373 | pnlVis taWeb.Beve lOuter := bvRaised; | |
| 3374 | iNwHIN := 0; | |
| 3375 | iRDVOn ly := 0; | |
| 3376 | for i := 0 to Re moteSites. Count - 1 do | |
| 3377 | begi n | |
| 3378 | if not(LeftS tr(TRemote Site(Remot eSites.Sit eList.Item s[i]).Site ID, 4) = ' 200N') the n | |
| 3379 | begin | |
| 3380 | iRDVOnly := 1; | |
| 3381 | continue ; | |
| 3382 | end | |
| 3383 | el se | |
| 3384 | iNwHIN := 1; | |
| 3385 | end; | |
| 3386 | ||
| 3387 | if Rem oteDataExi sts and (( iRDVOnly = 1) or (iN wHIN = 1)) and (Remo teSites.Co unt > 0) t hen | |
| 3388 | begi n | |
| 3389 | if ScreenRea derSystemA ctive then | |
| 3390 | be gin | |
| 3391 | i tem := amg rMain.Acce ssData.Fin dItem(pnlR emoteData, False); | |
| 3392 | i d:= item.I NDEX; | |
| 3393 | a mgrMain.Ac cessData[i d].AccessT ext := ''; | |
| 3394 | en d; | |
| 3395 | lb lCIRN.Enab led := True; | |
| 3396 | pn lCIRN.TabS top := True; | |
| 3397 | lb lCIRN.Font .Color := Get508Com pliantColo r(clBlue); | |
| 3398 | ls tCIRNLocat ions.Font. Color := Get508Comp liantColor (clBlue); | |
| 3399 | lb lCIRN.Capt ion := 'Re mote Data' ; | |
| 3400 | pn lCIRN.Hint := 'Click to displa y other fa cilities h aving data for this patient.'; | |
| 3401 | lb lVistaWeb. Font.Color := Get508 CompliantC olor(clBlu e); | |
| 3402 | pn lVistaWeb. Hint := 'C lick to go to ' + aV istaWebLab el + ' to see data f rom other facilities for this patient.'; | |
| 3403 | if RemoteSit es.Count > 0 then | |
| 3404 | lstCIRNLoc ations.Ite ms.Add('0' + U + 'Al l Availabl e Sites'); | |
| 3405 | fo r i := 0 t o RemoteSi tes.Count - 1 do | |
| 3406 | begin | |
| 3407 | ASite := TRemoteSi te(SiteLis t[i]); | |
| 3408 | lstCIRNL ocations.I tems.Add(A Site.SiteI D + U + AS ite.SiteNa me + U + | |
| 3409 | Format FMDateTime ('mmm dd y yyy hh:nn' , ASite.La stDate)); | |
| 3410 | end; | |
| 3411 | end | |
| 3412 | else | |
| 3413 | begi n | |
| 3414 | if ScreenRea derSystemA ctive then | |
| 3415 | be gin | |
| 3416 | i tem := amg rMain.Acce ssData.Fin dItem(pnlR emoteData, False); | |
| 3417 | i d:= item.I NDEX; | |
| 3418 | a mgrMain.Ac cessData[i d].AccessT ext := 'No remote da ta availab le'; | |
| 3419 | en d; | |
| 3420 | lb lCIRN.Font .Color := clWindowT ext; | |
| 3421 | lb lVistaWeb. Font.Color := clWind owText; | |
| 3422 | lb lCIRN.Enab led := False; | |
| 3423 | pn lCIRN.TabS top := False; | |
| 3424 | pn lCIRN.Hint := NoData Reason; | |
| 3425 | if (iNwHIN = 1) and (i RDVOnly = 0) then | |
| 3426 | begin | |
| 3427 | lblVistaW eb.Font.Co lor := Get 508Complia ntColor(cl Blue); | |
| 3428 | pnlVistaW eb.Hint := 'Click to go to ' + aVistaWeb Label + ' to see dat a from oth er facilit ies for th is patient (includes Non-VA da ta).'; | |
| 3429 | end; | |
| 3430 | end; | |
| 3431 | aAutoQ uery := Au toRDV; //Chec k to see i f Remote Q ueries sho uld be use d for all available sites | |
| 3432 | if (aA utoQuery = '1') and (lstCIRNLo cations.Co unt > 0) t hen | |
| 3433 | begi n | |
| 3434 | ls tCIRNLocat ions.ItemI ndex := 0; | |
| 3435 | ls tCIRNLocat ions.Check ed[0] := t rue; | |
| 3436 | ls tCIRNLocat ionsClick( self); | |
| 3437 | end; | |
| 3438 | end; | |
| 3439 | end; | |
| 3440 | ||
| 3441 | procedure TfrmFrame. paVAAResiz e(Sender: TObject); | |
| 3442 | begin | |
| 3443 | laMHV.He ight := pa VAA.Client Height div 2; | |
| 3444 | end; | |
| 3445 | ||
| 3446 | procedure TfrmFrame. pnlCIRNCli ck(Sender: TObject); | |
| 3447 | begin | |
| 3448 | ViewInfo (mnuViewRe moteData); | |
| 3449 | end; | |
| 3450 | ||
| 3451 | procedure TfrmFrame. lstCIRNLoc ationsClic k(Sender: TObject); | |
| 3452 | var | |
| 3453 | iIndex,j ,iAll,iCur : integer; | |
| 3454 | aMsg,s: string; | |
| 3455 | AccessSt atus: inte ger; | |
| 3456 | begin | |
| 3457 | iAll := 1; | |
| 3458 | AccessSt atus := 0; | |
| 3459 | iIndex : = lstCIRNL ocations.I temIndex; | |
| 3460 | if not C heckHL7TCP Link then | |
| 3461 | begin | |
| 3462 | Info Box('Local HL7 TCP L ink is dow n.' + CRLF + 'Unable to retrie ve remote data.', TC _DGSR_ERR, MB_OK); | |
| 3463 | lstC IRNLocatio ns.Checked [iIndex] : = false; | |
| 3464 | Exit ; | |
| 3465 | end; | |
| 3466 | if lstCI RNLocation s.Items.Co unt > 1 th en | |
| 3467 | if pie ce(lstCIRN Locations. Items[1],' ^',1) = '0 ' then | |
| 3468 | iAll := 2; | |
| 3469 | with frm Reports do | |
| 3470 | if pie ce(uRemote Type,'^',2 ) = 'V' th en | |
| 3471 | begi n | |
| 3472 | lv Reports.It ems.BeginU pdate; | |
| 3473 | lv Reports.It ems.Clear; | |
| 3474 | lv Reports.Co lumns.Clea r; | |
| 3475 | lv Reports.It ems.EndUpd ate; | |
| 3476 | end; | |
| 3477 | uReportI nstruction := ''; | |
| 3478 | frmRepor ts.TabCont rol1.Tabs. Clear; | |
| 3479 | frmLabs. TabControl 1.Tabs.Cle ar; | |
| 3480 | frmRepor ts.TabCont rol1.Tabs. AddObject( 'Local',ni l); | |
| 3481 | frmLabs. TabControl 1.Tabs.Add Object('Lo cal',nil); | |
| 3482 | StatusTe xt('Checki ng Remote Sites...') ; | |
| 3483 | if piece (lstCIRNLo cations.It ems[iIndex ],'^',1) = '0' then // All sit es have be en clicked | |
| 3484 | if lst CIRNLocati ons.Checke d[iIndex] = false th en // All selection is being t urned off | |
| 3485 | begi n | |
| 3486 | wi th RemoteS ites.SiteL ist do | |
| 3487 | fo r j := 0 t o Count - 1 do | |
| 3488 | if lstCIRN Locations. Checked[j+ 1] = true then | |
| 3489 | begin | |
| 3490 | lstCIR NLocations .Checked[j +1] := fal se; | |
| 3491 | TRemot eSite(Remo teSites.Si teList[j]) .Selected := false; | |
| 3492 | TRemot eSite(Remo teSites.Si teList[j]) .ReportCle ar; | |
| 3493 | TRemot eSite(Remo teSites.Si teList[j]) .LabClear; | |
| 3494 | end; | |
| 3495 | end | |
| 3496 | else | |
| 3497 | begi n | |
| 3498 | wi th RemoteS ites.SiteL ist do | |
| 3499 | fo r j := 0 t o Count - 1 do | |
| 3500 | begin | |
| 3501 | Screen .Cursor := crHourGla ss; | |
| 3502 | Screen .Cursor := crDefault ; | |
| 3503 | aMsg : = aMsg + ' at site: ' + TRemot eSite(Item s[j]).Site Name; | |
| 3504 | s := l stCIRNLoca tions.Item s[j+1]; | |
| 3505 | lstCIR NLocations .Items[j+1 ] := piece s(s, '^', 1, 3); | |
| 3506 | case A ccessStatu s of | |
| 3507 | DGSR_F AIL: begin | |
| 3508 | if piece(aMsg ,':',1) = 'RPC name not found at site' t hen //Allo w for back ward compa tibility | |
| 3509 | b egin | |
| 3510 | lstCIRNLo cations.Ch ecked[j+1] := true; | |
| 3511 | TRemoteSi te(RemoteS ites.SiteL ist[j]).Re portClear; | |
| 3512 | TRemoteSi te(RemoteS ites.SiteL ist[j]).La bClear; | |
| 3513 | TRemoteSi te(Items[j ]).Selecte d := true; | |
| 3514 | e nd | |
| 3515 | els e | |
| 3516 | b egin | |
| 3517 | InfoBox(a Msg, TC_DG SR_ERR, MB _OK); | |
| 3518 | lstCIRNLo cations.Ch ecked[j+1] := false; | |
| 3519 | lstCIRNLo cations.It ems[j+1] : = pieces(s , '^', 1, 3) + '^' + TC_DGSR_E RR; | |
| 3520 | TRemoteSi te(Items[j ]).Selecte d := false ; | |
| 3521 | Continue; | |
| 3522 | e nd; | |
| 3523 | end; | |
| 3524 | DGSR_N ONE: begin | |
| 3525 | lst CIRNLocati ons.Checke d[j+1] := true; | |
| 3526 | TRe moteSite(R emoteSites .SiteList[ j]).Report Clear; | |
| 3527 | TRe moteSite(R emoteSites .SiteList[ j]).LabCle ar; | |
| 3528 | TRe moteSite(I tems[j]).S elected := true; | |
| 3529 | end; | |
| 3530 | DGSR_S HOW: begin | |
| 3531 | Inf oBox(AMsg, TC_DGSR_S HOW, MB_OK ); | |
| 3532 | lst CIRNLocati ons.Checke d[j+1] := true; | |
| 3533 | TRe moteSite(R emoteSites .SiteList[ j]).Report Clear; | |
| 3534 | TRe moteSite(R emoteSites .SiteList[ j]).LabCle ar; | |
| 3535 | TRe moteSite(I tems[j]).S elected := true; | |
| 3536 | end; | |
| 3537 | DGSR_A SK: if In foBox(AMsg + TX_DGSR _YESNO, TC _DGSR_SHOW , MB_YESNO or MB_ICO NWARNING o r | |
| 3538 | MB_ DEFBUTTON2 ) = IDYES then | |
| 3539 | beg in | |
| 3540 | l stCIRNLoca tions.Chec ked[j+1] : = true; | |
| 3541 | T RemoteSite (RemoteSit es.SiteLis t[j]).Repo rtClear; | |
| 3542 | T RemoteSite (RemoteSit es.SiteLis t[j]).LabC lear; | |
| 3543 | T RemoteSite (Items[j]) .Selected := true; | |
| 3544 | end | |
| 3545 | els e | |
| 3546 | b egin | |
| 3547 | lstCIRNLo cations.Ch ecked[j+1] := false; | |
| 3548 | lstCIRNLo cations.It ems[j+1] : = pieces(s , '^', 1, 3) + '^' + TC_DGSR_S HOW; | |
| 3549 | TRemoteSi te(Items[j ]).Selecte d := false ; | |
| 3550 | Continue; | |
| 3551 | e nd; | |
| 3552 | else begin | |
| 3553 | Inf oBox(AMsg, TC_DGSR_D ENY, MB_OK ); | |
| 3554 | lst CIRNLocati ons.Checke d[j+1] := false; | |
| 3555 | lst CIRNLocati ons.Items[ j+1] := pi eces(s, '^ ', 1, 3) + '^' + TC_ DGSR_DENY; | |
| 3556 | TRe moteSite(I tems[j]).S elected := false; | |
| 3557 | Con tinue; | |
| 3558 | end; | |
| 3559 | end; | |
| 3560 | end; | |
| 3561 | end | |
| 3562 | else | |
| 3563 | begin | |
| 3564 | if i Index > 0 then | |
| 3565 | be gin | |
| 3566 | iCur := iI ndex - iAl l; | |
| 3567 | TRemoteSit e(RemoteSi tes.SiteLi st[iCur]). Selected : = | |
| 3568 | lstCIRNL ocations.C hecked[iIn dex]; | |
| 3569 | if lstCIRN Locations. Checked[iI ndex] = tr ue then | |
| 3570 | with Rem oteSites.S iteList do | |
| 3571 | begin | |
| 3572 | Screen .Cursor := crHourGla ss; | |
| 3573 | Screen .Cursor := crDefault ; | |
| 3574 | aMsg : = aMsg + ' at site: ' + TRemot eSite(Item s[iCur]).S iteName; | |
| 3575 | s := l stCIRNLoca tions.Item s[iIndex]; | |
| 3576 | lstCIR NLocations .Items[iIn dex] := pi eces(s, '^ ', 1, 3); | |
| 3577 | case A ccessStatu s of | |
| 3578 | DGSR_F AIL: begin | |
| 3579 | if piece(aMsg ,':',1) = 'RPC name not found at site' t hen //Allo w for back ward compa tibility | |
| 3580 | b egin | |
| 3581 | lstCIRNLo cations.Ch ecked[iInd ex] := tru e; | |
| 3582 | TRemoteSi te(RemoteS ites.SiteL ist[iCur]) .ReportCle ar; | |
| 3583 | TRemoteSi te(RemoteS ites.SiteL ist[iCur]) .LabClear; | |
| 3584 | TRemoteSi te(Items[i Cur]).Sele cted := tr ue; | |
| 3585 | e nd | |
| 3586 | els e | |
| 3587 | b egin | |
| 3588 | InfoBox(a Msg, TC_DG SR_ERR, MB _OK); | |
| 3589 | lstCIRNLo cations.Ch ecked[iInd ex] := fal se; | |
| 3590 | lstCIRNLo cations.It ems[iIndex ] := piece s(s, '^', 1, 3) + '^ ' + TC_DGS R_ERR; | |
| 3591 | TRemoteSi te(Items[i Cur]).Sele cted := fa lse; | |
| 3592 | e nd; | |
| 3593 | end; | |
| 3594 | DGSR_N ONE: begin | |
| 3595 | lst CIRNLocati ons.Checke d[iIndex] := true; | |
| 3596 | TRe moteSite(R emoteSites .SiteList[ iCur]).Rep ortClear; | |
| 3597 | TRe moteSite(R emoteSites .SiteList[ iCur]).Lab Clear; | |
| 3598 | TRe moteSite(I tems[iCur] ).Selected := true; | |
| 3599 | end; | |
| 3600 | DGSR_S HOW: begin | |
| 3601 | Inf oBox(AMsg, TC_DGSR_S HOW, MB_OK ); | |
| 3602 | lst CIRNLocati ons.Checke d[iIndex] := true; | |
| 3603 | TRe moteSite(R emoteSites .SiteList[ iCur]).Rep ortClear; | |
| 3604 | TRe moteSite(R emoteSites .SiteList[ iCur]).Lab Clear; | |
| 3605 | TRe moteSite(I tems[iCur] ).Selected := true; | |
| 3606 | end; | |
| 3607 | DGSR_A SK: if In foBox(AMsg + TX_DGSR _YESNO, TC _DGSR_SHOW , MB_YESNO or MB_ICO NWARNING o r | |
| 3608 | MB_ DEFBUTTON2 ) = IDYES then | |
| 3609 | beg in | |
| 3610 | l stCIRNLoca tions.Chec ked[iIndex ] := true; | |
| 3611 | T RemoteSite (RemoteSit es.SiteLis t[iCur]).R eportClear ; | |
| 3612 | T RemoteSite (RemoteSit es.SiteLis t[iCur]).L abClear; | |
| 3613 | T RemoteSite (Items[iCu r]).Select ed := true ; | |
| 3614 | end | |
| 3615 | els e | |
| 3616 | b egin | |
| 3617 | lstCIRNLo cations.Ch ecked[iInd ex] := fal se; | |
| 3618 | lstCIRNLo cations.It ems[iIndex ] := piece s(s, '^', 1, 3) + '^ ' + TC_DGS R_SHOW; | |
| 3619 | e nd; | |
| 3620 | else begin | |
| 3621 | Inf oBox(AMsg, TC_DGSR_D ENY, MB_OK ); | |
| 3622 | lst CIRNLocati ons.Checke d[iIndex] := false; | |
| 3623 | lst CIRNLocati ons.Items[ iIndex] := pieces(s, '^', 1, 3 ) + '^' + TC_DGSR_DE NY; | |
| 3624 | TRe moteSite(I tems[iCur] ).Selected := false; | |
| 3625 | end; | |
| 3626 | end; | |
| 3627 | with f rmReports do | |
| 3628 | if p iece(uRemo teType,'^' ,1) = '1' then | |
| 3629 | if not(piece (uRemoteTy pe,'^',2) = 'V') the n | |
| 3630 | begin | |
| 3631 | TabContr ol1.Visibl e := true; | |
| 3632 | pnlRight Top.Height := lblTit le.Height + TabContr ol1.Height ; | |
| 3633 | end; | |
| 3634 | with f rmLabs do | |
| 3635 | if p iece(uLabR emoteType, '^',1) = ' 1' then | |
| 3636 | if not(piece (uLabRemot eType,'^', 2) = 'V') then | |
| 3637 | begin | |
| 3638 | TabContr ol1.Visibl e := true; | |
| 3639 | pnlRight Top.Height := lblTit le.Height + TabContr ol1.Height ; | |
| 3640 | end; | |
| 3641 | end; | |
| 3642 | en d; | |
| 3643 | end; | |
| 3644 | with Rem oteSites.S iteList do | |
| 3645 | for j := 0 to Co unt - 1 do | |
| 3646 | if T RemoteSite (Items[j]) .Selected | |
| 3647 | an d (not(Lef tStr(TRemo teSite(Ite ms[j]).Sit eID ,4) = '200N')) then | |
| 3648 | be gin | |
| 3649 | frmReports .TabContro l1.Tabs.Ad dObject(TR emoteSite( Items[j]). SiteName, | |
| 3650 | TRemoteS ite(Items[ j])); | |
| 3651 | frmLabs.Ta bControl1. Tabs.AddOb ject(TRemo teSite(Ite ms[j]).Sit eName, | |
| 3652 | TRemoteS ite(Items[ j])); | |
| 3653 | en d; | |
| 3654 | if not(P iece(uRepo rtID,':',1 ) = 'OR_VW AL') | |
| 3655 | and no t(Piece(uR eportID,': ',1) = 'OR _VWRX') | |
| 3656 | and no t(Piece(uR eportID,': ',1) = 'OR _VWVS') | |
| 3657 | and (f rmReports. tvReports. SelectionC ount > 0) then frmRe ports.tvRe portsClick (self); | |
| 3658 | if not(u LabRepID = '6:GRAPH' ) and not( uLabRepID = '5:WORKS HEET') | |
| 3659 | and no t(uLabRepI D = '4:SEL ECTED TEST S BY DATE' ) | |
| 3660 | and (f rmLabs.tvR eports.Sel ectionCoun t > 0) the n frmLabs. tvReportsC lick(self) ; | |
| 3661 | StatusTe xt(''); | |
| 3662 | end; | |
| 3663 | ||
| 3664 | procedure TfrmFrame. popCIRNClo seClick(Se nder: TObj ect); | |
| 3665 | begin | |
| 3666 | lstCIRNL ocations.V isible := False; | |
| 3667 | lstCirnL ocations.S endToBack; | |
| 3668 | pnlCIRN. BevelOuter := bvRais ed; | |
| 3669 | end; | |
| 3670 | ||
| 3671 | procedure TfrmFrame. popCIRNSel ectAllClic k(Sender: TObject); | |
| 3672 | ||
| 3673 | begin | |
| 3674 | lstCIRNL ocations.I temIndex : = 0; | |
| 3675 | lstCIRNL ocations.C hecked[0] := true; | |
| 3676 | lstCIRNL ocations.O nClick(Sel f); | |
| 3677 | end; | |
| 3678 | ||
| 3679 | procedure TfrmFrame. popCIRNSel ectNoneCli ck(Sender: TObject); | |
| 3680 | ||
| 3681 | begin | |
| 3682 | lstCIRNL ocations.I temIndex : = 0; | |
| 3683 | lstCIRNL ocations.C hecked[0] := false; | |
| 3684 | lstCIRNL ocations.O nClick(Sel f); | |
| 3685 | end; | |
| 3686 | ||
| 3687 | procedure TfrmFrame. mnuFilePri ntSetupCli ck(Sender: TObject); | |
| 3688 | var | |
| 3689 | CurrPrt: string; | |
| 3690 | begin | |
| 3691 | CurrPrt := SelectD evice(Self , Encounte r.Location , True, 'P rint Devic e Selectio n'); | |
| 3692 | User.Cur rentPrinte r := Piece (CurrPrt, U, 1); | |
| 3693 | end; | |
| 3694 | ||
| 3695 | procedure TfrmFrame. LabInfo1Cl ick(Sender : TObject) ; | |
| 3696 | begin | |
| 3697 | ExecuteL abInfo; | |
| 3698 | end; | |
| 3699 | ||
| 3700 | procedure TfrmFrame. mnuFileNot ifRemoveCl ick(Sender : TObject) ; | |
| 3701 | const | |
| 3702 | TC_REMOV E_ALERT = 'Remove C urrent Ale rt'; | |
| 3703 | TX_REMOV E_ALERT1 = 'This act ion will d elete the alert you are curren tly proces sing; the alert will ' + CRLF + | |
| 3704 | 'd isappear a utomatical ly when al l orders h ave been a cted on, b ut this ac tion may' + CRLF + | |
| 3705 | 'b e used to remove the alert if some order s are to b e left unc hanged.' + CRLF + CR LF + | |
| 3706 | 'Y our '; | |
| 3707 | TX_REMOV E_ALERT2 = ' alert f or '; | |
| 3708 | TX_REMOV E_ALERT3 = ' will be deleted!' + CRLF + CRLF + 'Ar e you sure ?'; | |
| 3709 | var | |
| 3710 | AlertMsg , AlertTyp e: string; | |
| 3711 | ||
| 3712 | procedur e StopProc essingNoti fs; | |
| 3713 | begin | |
| 3714 | Noti fications. Clear; | |
| 3715 | FNex tButtonAct ive := Fal se; | |
| 3716 | stsA rea.Panels [2].Bevel := pbLower ed; | |
| 3717 | mnuF ileNext.En abled := F alse; | |
| 3718 | mnuF ileNotifRe move.Enabl ed := Fals e; | |
| 3719 | end; | |
| 3720 | ||
| 3721 | begin | |
| 3722 | if not N otificatio ns.Active then Exit; | |
| 3723 | case Not ifications .Followup of | |
| 3724 | NF_MED ICATIONS_E XPIRING_IN PT : Al ertType := 'Expiring Medicatio ns'; | |
| 3725 | NF_MED ICATIONS_E XPIRING_OU TPT : Al ertType := 'Expiring Medicatio ns'; | |
| 3726 | NF_ORD ER_REQUIRE S_ELEC_SIG NATURE: Al ertType := 'Unsigned Orders'; | |
| 3727 | NF_FLA GGED_ORDER S : Al ertType := 'Flagged Orders (fo r clarific ation)'; | |
| 3728 | NF_UNV ERIFIED_ME DICATION_O RDER : Al ertType := 'Unverifi ed Medicat ion Order' ; | |
| 3729 | NF_UNV ERIFIED_OR DER : Al ertType := 'Unverifi ed Order'; | |
| 3730 | NF_FLA GGED_OI_EX P_INPT : Al ertType := 'Flagged Orderable Item (INPT )'; | |
| 3731 | NF_FLA GGED_OI_EX P_OUTPT : Al ertType := 'Flagged Orderable Item (OUTP T)'; | |
| 3732 | else | |
| 3733 | Exit; | |
| 3734 | end; | |
| 3735 | AlertMsg := TX_REM OVE_ALERT1 + AlertTy pe + TX_RE MOVE_ALERT 2 + Patien t.Name + T X_REMOVE_A LERT3; | |
| 3736 | if InfoB ox(AlertMs g, TC_REMO VE_ALERT, MB_YESNO) = ID_YES t hen | |
| 3737 | begin | |
| 3738 | Noti fications. DeleteForC urrentUser ; | |
| 3739 | Noti fications. Next; // avoid pro mpt if no more alert s selected to proces s {v14a R V} | |
| 3740 | if N otificatio ns.Active then | |
| 3741 | be gin | |
| 3742 | if (InfoBo x(TX_NOTIF _STOP, TC_ NOTIF_STOP , MB_YESNO ) = ID_NO) then | |
| 3743 | begin | |
| 3744 | Notifi cations.Pr ior; | |
| 3745 | mnuFil eNextClick (Self); | |
| 3746 | end | |
| 3747 | else | |
| 3748 | StopProc essingNoti fs; | |
| 3749 | en d | |
| 3750 | else | |
| 3751 | St opProcessi ngNotifs; | |
| 3752 | end; | |
| 3753 | end; | |
| 3754 | ||
| 3755 | procedure TfrmFrame. mnuToolsOp tionsClick (Sender: T Object); | |
| 3756 | // persona l preferen ces - chan ges may ne ed to be a pplied to chart | |
| 3757 | var | |
| 3758 | i: integ er; | |
| 3759 | begin | |
| 3760 | i := 0; | |
| 3761 | DialogOp tions(i); | |
| 3762 | end; | |
| 3763 | ||
| 3764 | procedure TfrmFrame. LoadUserPr eferences; | |
| 3765 | begin | |
| 3766 | LoadSize sForUser; | |
| 3767 | GetUserT emplateDef aults(TRUE ); | |
| 3768 | end; | |
| 3769 | ||
| 3770 | procedure TfrmFrame. SaveUserPr eferences; | |
| 3771 | begin | |
| 3772 | SaveSize sForUser; // position & size set tings | |
| 3773 | SaveUser TemplateDe faults; | |
| 3774 | end; | |
| 3775 | ||
| 3776 | procedure TfrmFrame. mnuFileRef reshClick( Sender: TO bject); | |
| 3777 | begin | |
| 3778 | FRefresh ing := TRU E; | |
| 3779 | try | |
| 3780 | mnuFil eOpenClick (Self); | |
| 3781 | finally | |
| 3782 | FRefre shing := F ALSE; | |
| 3783 | OrderP rintForm : = FALSE; | |
| 3784 | end; | |
| 3785 | end; | |
| 3786 | ||
| 3787 | procedure TfrmFrame. AppActivat ed(Sender: TObject); | |
| 3788 | begin | |
| 3789 | if assig ned(FOldAc tivate) th en | |
| 3790 | FOldAc tivate(Sen der); | |
| 3791 | SetActiv eWindow(Ap plication. Handle); | |
| 3792 | if Scree nReaderSys temActive and assign ed(Patient ) and (Pat ient.Name <> '') and (Patient. Status <> '') then | |
| 3793 | Spea kTabAndPat ient; | |
| 3794 | end; | |
| 3795 | ||
| 3796 | // close T reatment F actor hint window if alt-tab p ressed. | |
| 3797 | procedure TfrmFrame. AppDeActiv ated(Sende r: TObject ); | |
| 3798 | begin | |
| 3799 | if FRVTF hintWindow Active the n | |
| 3800 | begin | |
| 3801 | FRVTF HintWindow .ReleaseHa ndle; | |
| 3802 | FRVTF HintWindow Active := False; | |
| 3803 | end | |
| 3804 | else | |
| 3805 | if FOSTF HintWndAct ive then | |
| 3806 | begin | |
| 3807 | FOSTF hintWindow .ReleaseHa ndle; | |
| 3808 | FOSTF HintWndAct ive := Fal se ; | |
| 3809 | end; | |
| 3810 | if FHint WinActive then // graphing - hints on values | |
| 3811 | begin | |
| 3812 | FHintW in.Release Handle; | |
| 3813 | FHintW inActive : = false; | |
| 3814 | end; | |
| 3815 | end; | |
| 3816 | ||
| 3817 | procedure TfrmFrame. LoadBuffer (Sender: T Object; Lo adList: TS trings; va r ProcessL oad: Boole an); | |
| 3818 | Var | |
| 3819 | IPAddr: string; | |
| 3820 | begin | |
| 3821 | inherite d; | |
| 3822 | //Load the buffe r | |
| 3823 | CPAppMon. UserDuz := User.DUZ; //Current User's DU Z | |
| 3824 | IPAddr := DottedIPS tr; | |
| 3825 | CallVistA ('ORWTIU P OLL', [Use r.DUZ, IPA ddr, IntTo Hex(frmFra me.Handle, 8)], Load List); | |
| 3826 | if Piece( LoadList.V alues['(0, 0)'], '^', 1) = '-1' then | |
| 3827 | begin | |
| 3828 | ProcessL oad := fal se; | |
| 3829 | CPAppMon .StopTheBu ffer; | |
| 3830 | end else | |
| 3831 | ProcessL oad := tru e; | |
| 3832 | end; | |
| 3833 | ||
| 3834 | procedure TfrmFrame. LoadProper ties(Sende r: TObject ); | |
| 3835 | Var | |
| 3836 | SavedStyl es, DivID, WrdRet, T mp: String ; | |
| 3837 | begin | |
| 3838 | //Load t he paramet ers | |
| 3839 | with CPA ppMon do b egin | |
| 3840 | //Check if the bu ffer has a lread load ed | |
| 3841 | DivID : = GetDivis ionID; | |
| 3842 | CallVis tA('ORWTIU WRDCOPY', [DivID],W rdRet); | |
| 3843 | NumberO fWordsToBe gin := Str ToFloatDef (Piece(Wrd Ret, '^', 1), 0); | |
| 3844 | ||
| 3845 | CallVis tA('ORWTIU PCTCOPY', [DivID], Tmp); | |
| 3846 | Percent ToVerify : = (StrToFl oatDef(Tmp , 0) * 100 ); | |
| 3847 | ||
| 3848 | //Is su per user? | |
| 3849 | CallVis tA('ORWTIU VIEWCOPY' , [User.DU Z, 0, DivI d], Tmp); | |
| 3850 | SuperUs er := Trim (Tmp) = '2 '; | |
| 3851 | ||
| 3852 | //load the exlcud ed apps | |
| 3853 | GetUser ListParam( ExcludeApp s, 'ORQQTI U COPY/PAS TE EXCLUDE APP'); | |
| 3854 | ||
| 3855 | //load the match text prope rties | |
| 3856 | CallVis tA('ORWTIU LDCPIDNT' , [nil], S avedStyles ); | |
| 3857 | ||
| 3858 | Display Paste := T rim(SavedS tyles) <> '-1;Visual Disable O verride'; | |
| 3859 | CPAppMo n.Enabled := Trim(Sa vedStyles) <> '-2'; | |
| 3860 | ||
| 3861 | if Disp layPaste a nd CPAppMo n.Enabled then begin | |
| 3862 | if Sav edStyles < > '' then begin | |
| 3863 | if (P iece(Saved Styles, ', ', 1) = '1 ') then | |
| 3864 | Matc hStyle := MatchStyle + [fsBold ]; | |
| 3865 | if (P iece(Saved Styles, ', ', 2) = '1 ') then | |
| 3866 | Matc hStyle := MatchStyle + [fsItal ic]; | |
| 3867 | if (P iece(Saved Styles, ', ', 3) = '1 ') then | |
| 3868 | Matc hStyle := MatchStyle + [fsUnde rline]; | |
| 3869 | ||
| 3870 | Match Highlight := (Piece (SavedStyl es, ',', 4 ) = '1'); | |
| 3871 | Highl ightColor := StrToIn tDef(Piece (SavedStyl es, ',', 5 ), clYello w); | |
| 3872 | ||
| 3873 | //LCS | |
| 3874 | LCSTo ggle := (P iece(Saved Styles, ', ', 6) = '1 '); | |
| 3875 | if (P iece(Saved Styles, ', ', 7) = '1 ') then | |
| 3876 | LCST extStyle : = LCSTextS tyle + [fs Bold]; | |
| 3877 | if (P iece(Saved Styles, ', ', 8) = '1 ') then | |
| 3878 | LCST extStyle : = LCSTextS tyle + [fs Italic]; | |
| 3879 | if (P iece(Saved Styles, ', ', 9) = '1 ') then | |
| 3880 | LCST extStyle : = LCSTextS tyle + [fs Underline] ; | |
| 3881 | ||
| 3882 | LCSUs eColor := (Piece(Sa vedStyles, ',', 10) = '1'); | |
| 3883 | LCSTe xtColor := StrToIntD ef(Piece(S avedStyles , ',', 11) , clRed); | |
| 3884 | LCSCh arLimit := StrToIntD ef(Piece(S avedStyles , ',', 12) , 0) | |
| 3885 | end; | |
| 3886 | end; | |
| 3887 | ||
| 3888 | end; | |
| 3889 | end; | |
| 3890 | ||
| 3891 | procedure TfrmFrame. SaveBuffer (Sender: T Object; Sa veList: TS tringList; | |
| 3892 | var Retu rnList: TS tringList) ; | |
| 3893 | var | |
| 3894 | I, X, Z, TotalBuff er, LineCn t, SubLine Cnt: Integ er; | |
| 3895 | Division ID, aName, aValue: s tring; | |
| 3896 | aList: i ORNetMult; | |
| 3897 | LookUpLs t: THashed StringList ; | |
| 3898 | begin | |
| 3899 | inherite d; | |
| 3900 | TotalBuf fer := Str ToIntDef(S aveList.Va lues['Tota lBufferToS ave'], -1) ; | |
| 3901 | Division ID := GetD ivisionID; | |
| 3902 | If Total Buffer > - 1 then | |
| 3903 | begin | |
| 3904 | LookUp Lst := THa shedString List.Creat e; | |
| 3905 | try | |
| 3906 | Look UpLst.Begi nUpdate; | |
| 3907 | Look UpLst.Assi gn(SaveLis t); | |
| 3908 | Look UpLst.EndU pdate; | |
| 3909 | ||
| 3910 | newo rNetMult(a List); | |
| 3911 | ||
| 3912 | for I := 1 to TotalBuffe r do | |
| 3913 | begi n | |
| 3914 | aL ist.AddSub script([I, 0], LookU pLst.Value s[IntToStr (I) + ',0' ]); | |
| 3915 | ||
| 3916 | Li neCnt := S trToIntDef (LookUpLst .Values[In tToStr(I) + ',-1'], -1); | |
| 3917 | fo r X := 1 t o LineCnt - 1 do | |
| 3918 | be gin | |
| 3919 | SubLineCnt := | |
| 3920 | StrToInt Def(LookUp Lst.Values [IntToStr( I) + ',' + IntToStr( X + 1) + | |
| 3921 | ',-1'], -1); | |
| 3922 | if SubLine Cnt > -1 t hen | |
| 3923 | begin | |
| 3924 | for Z := 1 to SubL ineCnt - 1 do | |
| 3925 | begin | |
| 3926 | aName := IntToSt r(I) + ',' + IntToSt r(X) + ',' + | |
| 3927 | IntT oStr(Z); | |
| 3928 | aValue := Filter edString(L ookUpLst.V alues[aNam e]); | |
| 3929 | aList. AddSubscri pt([I,X,Z] , aValue); | |
| 3930 | end; | |
| 3931 | end | |
| 3932 | else | |
| 3933 | begin | |
| 3934 | aName := IntToStr( I) + ',' + IntToStr( X); | |
| 3935 | aValue : = Filtered String(Loo kUpLst.Val ues[aName] ); | |
| 3936 | aList.Ad dSubscript ([I,X], aV alue); | |
| 3937 | end; | |
| 3938 | en d; | |
| 3939 | end; | |
| 3940 | ||
| 3941 | Call VistA('ORW TIU SVCOPY ', [aList, DivisionI D], Return List); | |
| 3942 | finall y | |
| 3943 | Look UpLst.Free ; | |
| 3944 | end; | |
| 3945 | end; | |
| 3946 | end; | |
| 3947 | ||
| 3948 | procedure TfrmFrame. StartPollB uff(Sender : TObject; var Error : Boolean) ; | |
| 3949 | Var | |
| 3950 | DivID, IP Addr, TmpR tn: string ; | |
| 3951 | begin | |
| 3952 | inherite d; | |
| 3953 | DivID := GetDivisi onID; | |
| 3954 | IPAddr : = DottedIP Str; | |
| 3955 | CallVist A('ORWTIU START', [ User.DUZ, DivID, IPA ddr, IntTo Hex(frmFra me.Handle, 8)], TmpR tn); | |
| 3956 | Error := TmpRtn = '0'; | |
| 3957 | end; | |
| 3958 | ||
| 3959 | procedure TfrmFrame. StopPollBu ff(Sender: TObject; var Error: Boolean); | |
| 3960 | Var | |
| 3961 | IPAddr, T mpRtn: str ing; | |
| 3962 | begin | |
| 3963 | inherite d; | |
| 3964 | IPAddr : = DottedIP Str; | |
| 3965 | CallVist A('ORWTIU STOP', [Us er.DUZ, IP Addr, IntT oHex(frmFr ame.Handle , 8)], Tmp Rtn); | |
| 3966 | Error := TmpRtn = '0'; | |
| 3967 | end; | |
| 3968 | ||
| 3969 | procedure TfrmFrame. CreateTab( ATabID: in teger; ALa bel: strin g); | |
| 3970 | begin | |
| 3971 | // old comment - try making owner sel f (instead of applic ation) to see if sol ves TMenuI tem.Insert bug | |
| 3972 | case ATa bID of | |
| 3973 | CT_PRO BLEMS : be gin | |
| 3974 | frmProblem s := TfrmP roblems.Cr eate(Self) ; | |
| 3975 | frmProblem s.Parent : = pnlPage; | |
| 3976 | en d; | |
| 3977 | CT_MED S : be gin | |
| 3978 | frmMeds := TfrmMeds. Create(Sel f); | |
| 3979 | frmMeds.Pa rent := pn lPage; | |
| 3980 | frmMeds.In itfMedsSiz e; | |
| 3981 | en d; | |
| 3982 | CT_ORD ERS : be gin | |
| 3983 | frmOrders := TfrmOrd ers.Create (Self); | |
| 3984 | frmOrders. Parent := pnlPage; | |
| 3985 | en d; | |
| 3986 | CT_HP : be gin | |
| 3987 | // not yet | |
| 3988 | en d; | |
| 3989 | CT_NOT ES : be gin | |
| 3990 | frmNotes : = TfrmNote s.Create(S elf); | |
| 3991 | frmNotes.P arent := p nlPage; | |
| 3992 | en d; | |
| 3993 | CT_CON SULTS : be gin | |
| 3994 | frmConsult s := TfrmC onsults.Cr eate(Self) ; | |
| 3995 | frmConsult s.Parent : = pnlPage; | |
| 3996 | en d; | |
| 3997 | CT_DCS UMM : be gin | |
| 3998 | frmDCSumm := TfrmDCS umm.Create (Self); | |
| 3999 | frmDCSumm. Parent := pnlPage; | |
| 4000 | en d; | |
| 4001 | CT_LAB S : be gin | |
| 4002 | frmLabs := TfrmLabs. Create(Sel f); | |
| 4003 | frmLabs.Pa rent := pn lPage; | |
| 4004 | en d; | |
| 4005 | CT_REP ORTS : be gin | |
| 4006 | frmReports := TfrmRe ports.Crea te(Self); | |
| 4007 | frmReports .Parent := pnlPage; | |
| 4008 | en d; | |
| 4009 | CT_SUR GERY : be gin | |
| 4010 | frmSurgery := TfrmSu rgery.Crea te(Self); | |
| 4011 | frmSurgery .Parent := pnlPage; | |
| 4012 | en d; | |
| 4013 | CT_COV ER : be gin | |
| 4014 | frmCoverSh eet := Tfr mCoverShee t.Create(S elf); | |
| 4015 | frmCoverSh eet.Parent := pnlPag e; | |
| 4016 | CoverSheet .OnRefresh CWAD := Re freshCWAD; | |
| 4017 | CoverSheet .OnRefresh Reminders := Reminde rsChanged; | |
| 4018 | en d; | |
| 4019 | else | |
| 4020 | Exit; | |
| 4021 | end; | |
| 4022 | if ATabI D = CT_COV ER then | |
| 4023 | begin | |
| 4024 | uTab List.Inser t(0, IntTo Str(ATabID )); | |
| 4025 | tabP age.Tabs.I nsert(0, A Label); | |
| 4026 | tabP age.TabInd ex := 0; | |
| 4027 | end | |
| 4028 | else | |
| 4029 | begin | |
| 4030 | uTab List.Add(I ntToStr(AT abID)); | |
| 4031 | tabP age.Tabs.A dd(ALabel) ; | |
| 4032 | end; | |
| 4033 | end; | |
| 4034 | ||
| 4035 | procedure TfrmFrame. ShowHideCh artTabMenu s(AMenuIte m: TMenuIt em); | |
| 4036 | var | |
| 4037 | i: integ er; | |
| 4038 | begin | |
| 4039 | for i := 0 to AMen uItem.Coun t - 1 do | |
| 4040 | AMenuI tem.Items[ i].Visible := TabExi sts(AMenuI tem.Items[ i].Tag); | |
| 4041 | end; | |
| 4042 | ||
| 4043 | function T frmFrame.T abExists(A TabID: int eger): boo lean; | |
| 4044 | begin | |
| 4045 | Result : = (uTabLis t.IndexOf( IntToStr(A TabID)) > -1) | |
| 4046 | end; | |
| 4047 | ||
| 4048 | procedure TfrmFrame. ReportsOnl yDisplay; | |
| 4049 | begin | |
| 4050 | ||
| 4051 | // Configu re "Edit" menu: | |
| 4052 | menuHideAl lBut(mnuEd it, mnuEdi tPref); // Hide everything under Edi t menu exc ept Prefer ences. | |
| 4053 | menuHideAl lBut(mnuEd itPref, Pr efs1); // Hide every thing unde r Preferen ces menu e xcept Font s. | |
| 4054 | ||
| 4055 | // Remaini ng pull-do wn menus: | |
| 4056 | mnuView.vi sible := f alse; | |
| 4057 | mnuFileRef resh.visib le := fals e; | |
| 4058 | mnuFileEnc ounter.vis ible := fa lse; | |
| 4059 | mnuFileRev iew.visibl e := false ; | |
| 4060 | mnuFileNex t.visible := false; | |
| 4061 | mnuFileNot ifRemove.v isible := false; | |
| 4062 | mnuHelpBro ker.visibl e := false ; | |
| 4063 | mnuHelpLis ts.visible := false; | |
| 4064 | mnuHelpSym bols.visib le := fals e; | |
| 4065 | ||
| 4066 | // Top pan el compone nts: | |
| 4067 | pnlVisit.h int := 'Pr ovider/Loc ation'; | |
| 4068 | pnlVisit.o nMouseDown := nil; | |
| 4069 | pnlVisit.o nMouseUp : = nil; | |
| 4070 | ||
| 4071 | // Forms f or other t abs: | |
| 4072 | frmCoverSh eet.visibl e := false ; | |
| 4073 | frmProblem s.visible := false; | |
| 4074 | frmMeds.vi sible := f alse; | |
| 4075 | frmOrders. visible := false; | |
| 4076 | frmNotes.v isible := false; | |
| 4077 | frmConsult s.visible := false; | |
| 4078 | frmDCSumm. visible := false; | |
| 4079 | if Assigne d(frmSurge ry) then | |
| 4080 | frmSurge ry.visible := false; | |
| 4081 | frmLabs.vi sible := f alse; | |
| 4082 | ||
| 4083 | // Other t abs (so to speak): | |
| 4084 | tabPage.ta bs.clear; | |
| 4085 | tabPage.ta bs.add('Re ports'); | |
| 4086 | ||
| 4087 | end; | |
| 4088 | ||
| 4089 | procedure TfrmFrame. UpdatePtIn foOnRefres h; | |
| 4090 | var | |
| 4091 | tmpDFN: string; | |
| 4092 | begin | |
| 4093 | tmpDFN : = Patient. DFN; | |
| 4094 | Patient. Clear; | |
| 4095 | Patient. DFN := tmp DFN; | |
| 4096 | uCore.Te mpEncounte rLoc := 0; //hds759 1 Clinic/ Ward movem ent. | |
| 4097 | uCore.Te mpEncounte rLocName : = ''; //hd s7591 Cli nic/Ward m ovement. | |
| 4098 | uCore.Te mpEncounte rText := ' '; | |
| 4099 | uCore.Te mpEncounte rDateTime := 0; | |
| 4100 | uCore.Te mpEncounte rVistCat : = #0; | |
| 4101 | if (not FRefreshin g) and (FR eviewClick = false) then DoNot ChangeEncW indow := f alse; | |
| 4102 | if (FPre vInPatient and Patie nt.Inpatie nt) then //tran sfering in side hospi tal | |
| 4103 | begin | |
| 4104 | if FReview Click = Tr ue then | |
| 4105 | begin | |
| 4106 | ucore. TempEncoun terLoc := Encounter. Location; | |
| 4107 | uCore. TempEncoun terLocName := Encoun ter.Locati onName; | |
| 4108 | uCore. TempEncoun terText := Encounter .LocationT ext; | |
| 4109 | uCore. TempEncoun terDateTim e := Encou nter.DateT ime; | |
| 4110 | uCore. TempEncoun terVistCat := Encoun ter.VisitC ategory; | |
| 4111 | end | |
| 4112 | else if (p atient.Loc ation <> e ncounter.L ocation) a nd (OrderP rintForm = false) th en | |
| 4113 | begi n | |
| 4114 | fr mPrintLoca tion.Switc hEncounter Loction(En counter.Lo cation, En counter.lo cationName , Encounte r.Location Text, | |
| 4115 | En counter.Da teTime, En counter.Vi sitCategor y); | |
| 4116 | Di splayEncou nterText; | |
| 4117 | ex it; | |
| 4118 | end | |
| 4119 | else if (p atient.Loc ation <> e ncounter.L ocation) a nd (OrderP rintForm = True) the n | |
| 4120 | begin | |
| 4121 | OrderP rintForm : = false; | |
| 4122 | Exit; | |
| 4123 | end; | |
| 4124 | if orderpr intform = false then Encounter .Location := Patient .Location; | |
| 4125 | end | |
| 4126 | else if (FPrevInPa tient and (not Patie nt.Inpatie nt)) then //pati ent was di scharged | |
| 4127 | begin | |
| 4128 | Encoun ter.Inpati ent := Fal se; | |
| 4129 | Encoun ter.Locati on := 0; | |
| 4130 | FPrevI nPatient : = False; | |
| 4131 | lblPtN ame.Captio n := ''; | |
| 4132 | lblPtN ame.Captio n := Patie nt.Name + Patient.St atus; //CQ #17491: R efresh pat ient statu s indicato r in heade r bar on d ischarge. | |
| 4133 | end | |
| 4134 | else if ((not FPre vInPatient ) and Pati ent.Inpati ent) then //pati ent was ad mitted | |
| 4135 | begin | |
| 4136 | Encoun ter.Inpati ent := Tru e; | |
| 4137 | uCore. TempEncoun terLoc := Encounter. Location; //hds7591 Clinic/W ard moveme nt. | |
| 4138 | uCore. TempEncoun terLocName := Encoun ter.Locati onName; // hds7591 C linic/Ward movement. | |
| 4139 | uCore. TempEncoun terText := Encounter .LocationT ext; | |
| 4140 | uCore. TempEncoun terDateTim e := Encou nter.DateT ime; | |
| 4141 | uCore. TempEncoun terVistCat := Encoun ter.VisitC ategory; | |
| 4142 | lblPtN ame.Captio n := ''; | |
| 4143 | lblPtN ame.Captio n := Patie nt.Name + Patient.St atus; //CQ #17491: R efresh pat ient statu s indicato r in heade r bar on a dmission. | |
| 4144 | if (FR eviewClick = False) and (encou nter.Locat ion <> pat ient.Locat ion) and ( OrderPrint Form = fal se) then | |
| 4145 | be gin | |
| 4146 | frmPrintLo cation.Swi tchEncount erLoction( Encounter. Location, Encounter. locationNa me, Encoun ter.Locati onText, | |
| 4147 | En counter.Da teTime, En counter.Vi sitCategor y); | |
| 4148 | //agp valu es are res et dependi ng on the user proce ss | |
| 4149 | uCore.Temp EncounterL oc := 0; //hds7591 Clinic/Wa rd movemen t. | |
| 4150 | uCore.Temp EncounterL ocName := ''; //hds7 591 Clini c/Ward mov ement. | |
| 4151 | uCore.Temp EncounterT ext := ''; | |
| 4152 | uCore.Temp EncounterD ateTime := 0; | |
| 4153 | uCore.Temp EncounterV istCat := #0; | |
| 4154 | en d | |
| 4155 | else | |
| 4156 | if Ord erPrintFor m = false then | |
| 4157 | begi n | |
| 4158 | En counter.Lo cation := Patient.Lo cation; | |
| 4159 | En counter.Da teTime := Patient.Ad mitTime; | |
| 4160 | En counter.Vi sitCategor y := 'H'; | |
| 4161 | end; | |
| 4162 | FPrevI nPatient : = True; | |
| 4163 | end; | |
| 4164 | DisplayE ncounterTe xt; | |
| 4165 | end; | |
| 4166 | ||
| 4167 | procedure TfrmFrame. UpdateVAAM HVButtons( Sender: TO bject); | |
| 4168 | begin | |
| 4169 | Patient. RefreshVAA Status; | |
| 4170 | Patient. RefreshMHV Status; | |
| 4171 | ||
| 4172 | if Patie nt.PtIsVAA then | |
| 4173 | laVAA2 .Hint := ' Patient ha s active i nsurance' | |
| 4174 | else | |
| 4175 | laVAA2 .Hint := ' No active insurance' ; | |
| 4176 | ||
| 4177 | if Patie nt.PtIsMHV then | |
| 4178 | laMHV. Hint := 'P atient has data in M y HealtheV et' | |
| 4179 | else | |
| 4180 | laMHV. Hint := 'N o MyHealth yVet data' ; | |
| 4181 | ||
| 4182 | laMHV.Al ign := alT op; | |
| 4183 | laMHV.He ight := pa VAA.Client Height div 2; | |
| 4184 | laVAA2.A lign := al Client; | |
| 4185 | ||
| 4186 | laMHV.En abled := P atient.PtI sMHV; | |
| 4187 | laVAA2.E nabled := Patient.Pt IsVAA; | |
| 4188 | ||
| 4189 | paVAA.Vi sible := ( Patient.Pt IsVAA or P atient.PtI sMHV); | |
| 4190 | end; | |
| 4191 | ||
| 4192 | procedure TfrmFrame. FormKeyDow n(Sender: TObject; v ar Key: Wo rd; Shift: TShiftSta te); | |
| 4193 | var | |
| 4194 | NewTabIn dex: integ er; | |
| 4195 | begin | |
| 4196 | inherite d; | |
| 4197 | FCtrlTab Used := FA LSE; | |
| 4198 | //CQ2844 : Toggle R emote Data button us ing Alt+R | |
| 4199 | case Ke y of | |
| 4200 | 82,11 4: if (ss Alt in Shi ft) then | |
| 4201 | frm Frame.pnlC IRNClick(S ender); | |
| 4202 | end; | |
| 4203 | ||
| 4204 | if (Key = VK_TAB) then | |
| 4205 | begin | |
| 4206 | if (ss Ctrl in Sh ift) then | |
| 4207 | begin | |
| 4208 | FCtr lTabUsed : = TRUE; | |
| 4209 | if n ot (Active Control is TCustomMe mo) or not TMemo(Act iveControl ).WantTabs then begi n | |
| 4210 | Ne wTabIndex := tabPage .TabIndex; | |
| 4211 | if ssShift i n Shift th en | |
| 4212 | dec(NewTab Index) | |
| 4213 | el se | |
| 4214 | inc(NewTab Index); | |
| 4215 | if NewTabInd ex >= tabP age.Tabs.C ount then | |
| 4216 | dec(NewTab Index,tabP age.Tabs.C ount) | |
| 4217 | el se if NewT abIndex < 0 then | |
| 4218 | inc(NewTab Index,tabP age.Tabs.C ount); | |
| 4219 | ta bPage.TabI ndex := Ne wTabIndex; | |
| 4220 | ta bPageChang e(tabPage) ; | |
| 4221 | Ke y := 0; | |
| 4222 | end; | |
| 4223 | end; | |
| 4224 | end; | |
| 4225 | end; | |
| 4226 | ||
| 4227 | procedure TfrmFrame. FormActiva te(Sender: TObject); | |
| 4228 | var | |
| 4229 | aCPRS508 : ICPRS508 ; | |
| 4230 | begin | |
| 4231 | if Assig ned(FLastP age) then | |
| 4232 | if FLa stPage.Inh eritsFrom( TfrmPage) then | |
| 4233 | Tfrm Page(FLast Page).Focu sFirstCont rol | |
| 4234 | else i f Supports (fLastPage , ICPRS508 , aCPRS508 ) then | |
| 4235 | aCPR S508.OnFoc usFirstCon trol(Sende r);; | |
| 4236 | end; | |
| 4237 | ||
| 4238 | procedure TfrmFrame. pnlPrimary CareEnter( Sender: TO bject); | |
| 4239 | begin | |
| 4240 | with Sen der as TPa nel do | |
| 4241 | if (Co ntrolCount > 0) and (Controls[ 0] is TSpe edButton) and (TSpee dButton(Co ntrols[0]) .Down) | |
| 4242 | then | |
| 4243 | Beve lInner := bvLowered | |
| 4244 | else | |
| 4245 | Beve lInner := bvRaised; | |
| 4246 | end; | |
| 4247 | ||
| 4248 | procedure TfrmFrame. pnlPrimary CareExit(S ender: TOb ject); | |
| 4249 | var | |
| 4250 | ShiftIsD own,TabIsD own : bool ean; | |
| 4251 | begin | |
| 4252 | with Sen der as TPa nel do beg in | |
| 4253 | BevelI nner := bv None; | |
| 4254 | //Make the lstCI RNLocation s act as i f between pnlCIRN & pnlReminde rs | |
| 4255 | //in t he Tab Ord er | |
| 4256 | if (ls tCIRNLocat ions.CanFo cus) then | |
| 4257 | begin | |
| 4258 | Shif tIsDown := Boolean(H i(GetKeySt ate(VK_SHI FT))); | |
| 4259 | TabI sDown := B oolean(Hi( GetKeyStat e(VK_TAB)) ); | |
| 4260 | if T abIsDown t hen | |
| 4261 | if (ShiftIsD own) and ( Name = 'pn lReminders ') then | |
| 4262 | lstCIRNLoc ations.Set Focus | |
| 4263 | el se if Not (ShiftIsDo wn) and (N ame = 'pnl CIRN') the n | |
| 4264 | lstCIRNLoc ations.Set Focus; | |
| 4265 | end; | |
| 4266 | end; | |
| 4267 | end; | |
| 4268 | ||
| 4269 | procedure TfrmFrame. pnlPatient Click(Send er: TObjec t); | |
| 4270 | begin | |
| 4271 | Screen.C ursor := c rHourglass ; //wat cq 18425 add ed hourgla ss and dis abled mnuF ileOpen | |
| 4272 | mnuFileO pen.Enable d := False ; | |
| 4273 | try | |
| 4274 | pnlPatie nt.Enabled := false; | |
| 4275 | ViewInfo (mnuViewDe mo); | |
| 4276 | pnlPatie nt.Enabled := true; | |
| 4277 | finally | |
| 4278 | Screen .Cursor := crDefault ; | |
| 4279 | mnuFil eOpen.Enab led := Tru e; | |
| 4280 | end; | |
| 4281 | end; | |
| 4282 | ||
| 4283 | procedure TfrmFrame. pnlVisitCl ick(Sender : TObject) ; | |
| 4284 | begin | |
| 4285 | ViewInfo (mnuViewVi sits); | |
| 4286 | end; | |
| 4287 | ||
| 4288 | procedure TfrmFrame. pnlPrimary CareClick( Sender: TO bject); | |
| 4289 | begin | |
| 4290 | ViewInfo (mnuViewPr imaryCare) ; | |
| 4291 | end; | |
| 4292 | ||
| 4293 | procedure TfrmFrame. pnlReminde rsClick(Se nder: TObj ect); | |
| 4294 | begin | |
| 4295 | if(pnlRe minders.ta g = HAVE_R EMINDERS) then | |
| 4296 | View Info(mnuVi ewReminder s); | |
| 4297 | ||
| 4298 | end; | |
| 4299 | ||
| 4300 | procedure TfrmFrame. pnlPosting sClick(Sen der: TObje ct); | |
| 4301 | begin | |
| 4302 | ViewInfo (mnuViewPo stings); | |
| 4303 | end; | |
| 4304 | ||
| 4305 | //======== ========== ========= CCOW main changes == ========== ========== == | |
| 4306 | ||
| 4307 | procedure TfrmFrame. HandleCCOW Error(AMes sage: stri ng); | |
| 4308 | begin | |
| 4309 | {$ifdef DEBUG} | |
| 4310 | Show50 8Message(A Message); | |
| 4311 | {$endif} | |
| 4312 | InfoBox( TX_CCOW_ER ROR, TC_CC OW_ERROR, MB_ICONERR OR or MB_O K); | |
| 4313 | FCCOWIns talled := False; | |
| 4314 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, 'BM P_CCOW_BRO KEN'); | |
| 4315 | pnlCCOW. Hint := TX _CCOW_BROK EN; | |
| 4316 | mnuFileR esumeConte xt.Visible := True; | |
| 4317 | mnuFileR esumeConte xt.Enabled := False; | |
| 4318 | mnuFileB reakContex t.Visible := True; | |
| 4319 | mnuFileB reakContex t.Enabled := False; | |
| 4320 | FCCOWErr or := True ; | |
| 4321 | end; | |
| 4322 | ||
| 4323 | function T frmFrame.A llowCCOWCo ntextChang e(var CCOW Response: UserRespon se; NewDFN : string): boolean; | |
| 4324 | var | |
| 4325 | PtData : IContextI temCollect ion; | |
| 4326 | PtDataIt em2, PtDat aItem3, Pt DataItem4 : IContext Item; | |
| 4327 | response : UserRes ponse; | |
| 4328 | StationN umber: str ing; | |
| 4329 | IsProdAc ct: boolea n; | |
| 4330 | begin | |
| 4331 | Result : = False; | |
| 4332 | response := 0; | |
| 4333 | try | |
| 4334 | // Sta rt a conte xt change transactio n | |
| 4335 | if FCC OWInstalle d then | |
| 4336 | beg in | |
| 4337 | FCCOWJustJ oined := F alse; | |
| 4338 | FCCOWError := False; | |
| 4339 | imgCCOW.Pi cture.BitM ap.LoadFro mResourceN ame(hInsta nce, 'BMP_ CCOW_CHANG ING'); | |
| 4340 | pnlCCOW.Hi nt := TX_C COW_CHANGI NG; | |
| 4341 | try | |
| 4342 | ctxConte xtor.Start ContextCha nge(); | |
| 4343 | except | |
| 4344 | on E: Ex ception do HandleCCO WError(E.M essage); | |
| 4345 | end; | |
| 4346 | if FCCOWEr ror then | |
| 4347 | begin | |
| 4348 | Result : = False; | |
| 4349 | Exit; | |
| 4350 | end; | |
| 4351 | // Set the new propo sed contex t data. | |
| 4352 | PtData := CoContextI temCollect ion.Create (); | |
| 4353 | StationNum ber := Use r.StationN umber; | |
| 4354 | IsProdAcct := User.I sProductio nAccount; | |
| 4355 | ||
| 4356 | {$IFDEF CC OWBROKER} | |
| 4357 | //IsProdAc ct := RPCB rokerV.Log in.IsProdu ction; // not yet | |
| 4358 | {$ENDIF} | |
| 4359 | ||
| 4360 | PtDataItem 2 := CoCon textItem.C reate(); | |
| 4361 | PtDataItem 2.Set_Name ('Patient. co.Patient Name'); // Pati ent.Name | |
| 4362 | PtDataItem 2.Set_Valu e(Piece(Pa tient.Name , ',', 1) + U + Piec e(Patient. Name, ',', 2) + '^^^ ^'); | |
| 4363 | PtData.Add (PtDataIte m2); | |
| 4364 | ||
| 4365 | PtDataItem 3 := CoCon textItem.C reate(); | |
| 4366 | if not IsP rodAcct th en | |
| 4367 | PtDataIt em3.Set_Na me('Patien t.id.MRN.D FN_' + Sta tionNumber + '_TEST' ) // Pa tient.DFN | |
| 4368 | else | |
| 4369 | PtDataIt em3.Set_Na me('Patien t.id.MRN.D FN_' + Sta tionNumber ); // Pa tient.DFN | |
| 4370 | PtDataItem 3.Set_Valu e(Patient. DFN); | |
| 4371 | PtData.Add (PtDataIte m3); | |
| 4372 | ||
| 4373 | if Patient .ICN <> '' then | |
| 4374 | begin | |
| 4375 | PtData Item4 := C oContextIt em.Create( ); | |
| 4376 | if not IsProdAcc t then | |
| 4377 | PtDa taItem4.Se t_Name('Pa tient.id.M RN.Nationa lIDNumber_ TEST') / / Patient. ICN | |
| 4378 | else | |
| 4379 | PtDa taItem4.Se t_Name('Pa tient.id.M RN.Nationa lIDNumber' ); / / Patient. ICN | |
| 4380 | PtData Item4.Set_ Value(Pati ent.ICN); | |
| 4381 | PtData .Add(PtDat aItem4); | |
| 4382 | end; | |
| 4383 | ||
| 4384 | // End the context c hange tran saction. | |
| 4385 | FCCOWError := False; | |
| 4386 | try | |
| 4387 | response := ctxCon textor.End ContextCha nge(true, PtData); | |
| 4388 | except | |
| 4389 | on E: Ex ception do HandleCCO WError(E.M essage); | |
| 4390 | end; | |
| 4391 | if FCCOWEr ror then | |
| 4392 | begin | |
| 4393 | HideEver ything; | |
| 4394 | Result : = False; | |
| 4395 | Exit; | |
| 4396 | end; | |
| 4397 | end | |
| 4398 | else | |
| 4399 | begi n | |
| 4400 | Re sult := Tr ue; | |
| 4401 | Ex it; | |
| 4402 | end; | |
| 4403 | ||
| 4404 | CCOWRe sponse := response; | |
| 4405 | if (re sponse = U rCommit) t hen | |
| 4406 | begin | |
| 4407 | // N ew context is commit ted. | |
| 4408 | mnuF ileResumeC ontext.Ena bled := Fa lse; | |
| 4409 | mnuF ileBreakCo ntext.Enab led := Tru e; | |
| 4410 | FCCO WIconName := 'BMP_CC OW_LINKED' ; | |
| 4411 | pnlC COW.Hint : = TX_CCOW_ LINKED; | |
| 4412 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 4413 | Resu lt := True ; | |
| 4414 | end | |
| 4415 | else i f (respons e = UrCanc el) then | |
| 4416 | begin | |
| 4417 | // P roposed co ntext chan ge is canc eled. Retu rn to the current co ntext. | |
| 4418 | PtDa ta.RemoveA ll; | |
| 4419 | mnuF ileResumeC ontext.Ena bled := Fa lse; | |
| 4420 | mnuF ileBreakCo ntext.Enab led := Tru e; | |
| 4421 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 4422 | Resu lt := Fals e; | |
| 4423 | end | |
| 4424 | else i f (respons e = UrBrea k) then | |
| 4425 | begin | |
| 4426 | // T he context or has bro ken the li nk by susp ending. T his app sh ould | |
| 4427 | // u pdate the Clinical L ink icon, enable the Resume me nu item, a nd | |
| 4428 | // d isable the Suspend m enu item. | |
| 4429 | PtDa ta.RemoveA ll; | |
| 4430 | mnuF ileResumeC ontext.Ena bled := Tr ue; | |
| 4431 | mnuF ileBreakCo ntext.Enab led := Fal se; | |
| 4432 | FCCO WIconName := 'BMP_CC OW_BROKEN' ; | |
| 4433 | pnlC COW.Hint : = TX_CCOW_ BROKEN; | |
| 4434 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 4435 | if P atient.Inp atient the n | |
| 4436 | begi n | |
| 4437 | En counter.In patient := True; | |
| 4438 | En counter.Lo cation := Patient.Lo cation; | |
| 4439 | En counter.Da teTime := Patient.Ad mitTime; | |
| 4440 | En counter.Vi sitCategor y := 'H'; | |
| 4441 | end; | |
| 4442 | if U ser.IsProv ider then Encounter. Provider : = User.DUZ ; | |
| 4443 | Setu pPatient; | |
| 4444 | tabP age.TabInd ex := Page IDToTab(Us er.Initial Tab); | |
| 4445 | tabP ageChange( tabPage); | |
| 4446 | Resu lt := Fals e; | |
| 4447 | end; | |
| 4448 | except | |
| 4449 | on exc : EOleExc eption do | |
| 4450 | Show Msg('EOleE xception: ' + exc.Me ssage); | |
| 4451 | end; | |
| 4452 | end; | |
| 4453 | ||
| 4454 | procedure TfrmFrame. ctxContext orCanceled (Sender: T Object); | |
| 4455 | begin | |
| 4456 | // Appli cation sho uld mainta in its sta te as the current (e xisting) c ontext. | |
| 4457 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4458 | end; | |
| 4459 | ||
| 4460 | procedure TfrmFrame. ctxContext orPending( Sender: TO bject; | |
| 4461 | const aC ontextItem Collection : IDispatc h); | |
| 4462 | var | |
| 4463 | Reason, HyperLinkR eason: str ing; | |
| 4464 | PtChange d: boolean ; | |
| 4465 | {$IFDEF CC OWBROKER} | |
| 4466 | UserChan ged: boole an; | |
| 4467 | {$ENDIF} | |
| 4468 | begin | |
| 4469 | // If th e app woul d lose dat a, or have other pro blems chan ging conte xt at | |
| 4470 | // this time, it s hould retu rn a messa ge using S etSurveyRe ponse. Not e that the | |
| 4471 | // user may decide to commit the conte xt change anyway. | |
| 4472 | // | |
| 4473 | // if (c annot-chan ge-context -without-a -problem) then | |
| 4474 | // con textor.Set SurveyResp onse('Cond itional ac cept reaso n...'); | |
| 4475 | if FCCOW Busy then | |
| 4476 | begin | |
| 4477 | Sleep( 10000); | |
| 4478 | end; | |
| 4479 | ||
| 4480 | FCCOWErr or := Fals e; | |
| 4481 | try | |
| 4482 | CheckF orDifferen tPatient(a ContextIte mCollectio n, PtChang ed); | |
| 4483 | {$IFDEF CC OWBROKER} | |
| 4484 | CheckF orDifferen tUser(aCon textItemCo llection, UserChange d); | |
| 4485 | {$ENDIF} | |
| 4486 | except | |
| 4487 | on E: Exception do HandleC COWError(E .Message); | |
| 4488 | end; | |
| 4489 | if FCCOW Error then | |
| 4490 | begin | |
| 4491 | HideEv erything; | |
| 4492 | Exit; | |
| 4493 | end; | |
| 4494 | ||
| 4495 | {$IFDEF CC OWBROKER} | |
| 4496 | if PtCha nged or Us erChanged then | |
| 4497 | {$ELSE} | |
| 4498 | if PtCha nged then | |
| 4499 | {$ENDIF} | |
| 4500 | begin | |
| 4501 | FCCO WContextCh anging := True; | |
| 4502 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, 'BMP_CCOW _CHANGING' ); | |
| 4503 | pnlC COW.Hint : = TX_CCOW_ CHANGING; | |
| 4504 | Allo wContextCh angeAll(Re ason); | |
| 4505 | end; | |
| 4506 | CheckHyp erlinkResp onse(aCont extItemCol lection, H yperlinkRe ason); | |
| 4507 | Reason : = Hyperlin kReason + Reason; | |
| 4508 | if Pos(' COM_OBJECT _ACTIVE', Reason) > 0 then | |
| 4509 | Sleep( 12000) | |
| 4510 | else if Length(Rea son) > 0 t hen | |
| 4511 | ctxCon textor.Set SurveyResp onse(Reaso n) | |
| 4512 | else | |
| 4513 | begin | |
| 4514 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, 'BMP_CCOW _LINKED'); | |
| 4515 | pnlC COW.Hint : = TX_CCOW_ LINKED; | |
| 4516 | end; | |
| 4517 | FCCOWCon textChangi ng := Fals e; | |
| 4518 | end; | |
| 4519 | ||
| 4520 | procedure TfrmFrame. ctxContext orCommitte d(Sender: TObject); | |
| 4521 | var | |
| 4522 | Reason: string; | |
| 4523 | PtChange d: boolean ; | |
| 4524 | i: integ er; | |
| 4525 | begin | |
| 4526 | // Appli cation sho uld now ac cess the n ew context and updat e its stat e. | |
| 4527 | FCCOWErr or := Fals e; | |
| 4528 | try | |
| 4529 | {$IFDEF CCOWBROKER } | |
| 4530 | with R PCBrokerV do if (Was UserDefine d and IsUs erCleared and (ctxCo ntextor.Cu rrentConte xt.Present (CCOW_USER _NAME) = n il)) then // RV 0 5/11/04 | |
| 4531 | begin | |
| 4532 | Reas on := 'COM MIT'; | |
| 4533 | if A llowContex tChangeAll (Reason) t hen | |
| 4534 | begi n | |
| 4535 | Cl ose; | |
| 4536 | Ex it; | |
| 4537 | end; | |
| 4538 | end; | |
| 4539 | {$ENDIF} | |
| 4540 | CheckF orDifferen tPatient(c txContexto r.CurrentC ontext, Pt Changed); | |
| 4541 | except | |
| 4542 | on E: Exception do HandleC COWError(E .Message); | |
| 4543 | end; | |
| 4544 | if FCCOW Error then | |
| 4545 | begin | |
| 4546 | HideEv erything; | |
| 4547 | Exit; | |
| 4548 | end; | |
| 4549 | if not P tChanged t hen exit; | |
| 4550 | FCCOWDri vedChange := True; | |
| 4551 | i := 0; | |
| 4552 | while Le ngth(Scree n.Forms[i] .Name) > 0 do | |
| 4553 | begin | |
| 4554 | if fsM odal in Sc reen.Forms [i].FormSt ate then | |
| 4555 | begin | |
| 4556 | Scre en.Forms[i ].ModalRes ult := mrC ancel; | |
| 4557 | i := i + 1; | |
| 4558 | end el se // the fsModal f orms alway s sequence d prior to the none- fsModal fo rms | |
| 4559 | Brea k; | |
| 4560 | end; | |
| 4561 | Reason : = 'COMMIT' ; | |
| 4562 | if Allow ContextCha ngeAll(Rea son) then UpdateCCOW Context; | |
| 4563 | FCCOWIco nName := ' BMP_CCOW_L INKED'; | |
| 4564 | pnlCCOW. Hint := TX _CCOW_LINK ED; | |
| 4565 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4566 | end; | |
| 4567 | ||
| 4568 | function T frmFrame.F indBestCCO WDFN: stri ng; | |
| 4569 | var | |
| 4570 | data: IC ontextItem Collection ; | |
| 4571 | anItem: IContextIt em; | |
| 4572 | StationN umber, tem pDFN: stri ng; | |
| 4573 | IsProdAc ct: Boole an; | |
| 4574 | ||
| 4575 | procedur e FindNext BestDFN; | |
| 4576 | begin | |
| 4577 | Statio nNumber := User.Stat ionNumber; | |
| 4578 | if IsP rodAcct th en | |
| 4579 | anIt em := data .Present(' Patient.id .MRN.DFN_' + Station Number) | |
| 4580 | else | |
| 4581 | anIt em := data .Present(' Patient.id .MRN.DFN_' + Station Number + ' _TEST'); | |
| 4582 | if anI tem <> ni l then tem pDFN := an Item.Get_V alue(); | |
| 4583 | end; | |
| 4584 | ||
| 4585 | begin | |
| 4586 | if uCore .User = ni l then | |
| 4587 | begin | |
| 4588 | Result := ''; | |
| 4589 | exit; | |
| 4590 | end; | |
| 4591 | IsProdAc ct := User .IsProduct ionAccount ; | |
| 4592 | // Get a n item col lection of the curre nt context | |
| 4593 | FCCOWErr or := Fals e; | |
| 4594 | try | |
| 4595 | data : = ctxConte xtor.Curre ntContext; | |
| 4596 | except | |
| 4597 | on E: Exception do HandleC COWError(E .Message); | |
| 4598 | end; | |
| 4599 | if FCCOW Error then | |
| 4600 | begin | |
| 4601 | HideEv erything; | |
| 4602 | Exit; | |
| 4603 | end; | |
| 4604 | // Retri eve the Co ntextItem name and v alue as st rings | |
| 4605 | if IsPro dAcct then | |
| 4606 | anItem := data.P resent('Pa tient.id.M RN.Nationa lIDNumber' ) | |
| 4607 | else | |
| 4608 | anItem := data.P resent('Pa tient.id.M RN.Nationa lIDNumber_ TEST'); | |
| 4609 | if anIte m <> nil t hen | |
| 4610 | begin | |
| 4611 | temp DFN := Get DFNFromICN (anItem.Ge t_Value()) ; // "Pub lic" RPC c all | |
| 4612 | if t empDFN = ' -1' then F indNextBes tDFN; | |
| 4613 | end | |
| 4614 | else | |
| 4615 | FindNe xtBestDFN; | |
| 4616 | Result : = tempDFN; | |
| 4617 | data := nil; | |
| 4618 | anItem : = nil; | |
| 4619 | end; | |
| 4620 | ||
| 4621 | procedure TfrmFrame. UpdateCCOW Context; | |
| 4622 | var | |
| 4623 | PtDFN(*, PtName*): string; | |
| 4624 | begin | |
| 4625 | if not F CCOWInstal led then e xit; | |
| 4626 | DoNotCha ngeEncWind ow := fals e; | |
| 4627 | PtDFN := FindBestC COWDFN; | |
| 4628 | if StrTo Int64Def(P tDFN, 0) > 0 then | |
| 4629 | begin | |
| 4630 | // S elect new patient ba sed on con text value | |
| 4631 | if P atient.DFN = PtDFN t hen exit; | |
| 4632 | Pati ent.DFN := PtDFN; | |
| 4633 | if ( Patient.Na me = '-1') then | |
| 4634 | be gin | |
| 4635 | HideEveryt hing; | |
| 4636 | exit; | |
| 4637 | en d | |
| 4638 | else | |
| 4639 | Sh owEverythi ng; | |
| 4640 | Enco unter.Clea r; | |
| 4641 | if P atient.Inp atient the n | |
| 4642 | begi n | |
| 4643 | En counter.In patient := True; | |
| 4644 | En counter.Lo cation := Patient.Lo cation; | |
| 4645 | En counter.Da teTime := Patient.Ad mitTime; | |
| 4646 | En counter.Vi sitCategor y := 'H'; | |
| 4647 | end; | |
| 4648 | if U ser.IsProv ider then Encounter. Provider : = User.DUZ ; | |
| 4649 | if n ot FFirstL oad then S etupPatien t; | |
| 4650 | { fr mCover.Upd ateVAAButt on; //VAA} | |
| 4651 | Upda teVAAMHVBu ttons(nil) ; | |
| 4652 | Dete rmineNextT ab; | |
| 4653 | tabP age.TabInd ex := Page IDToTab(Ne xtTab); | |
| 4654 | tabP ageChange( tabPage); | |
| 4655 | end | |
| 4656 | else | |
| 4657 | HideEv erything; | |
| 4658 | end; | |
| 4659 | ||
| 4660 | procedure TfrmFrame. mnuFileBre akContextC lick(Sende r: TObject ); | |
| 4661 | begin | |
| 4662 | FCCOWErr or := Fals e; | |
| 4663 | FCCOWIco nName := ' BMP_CCOW_C HANGING'; | |
| 4664 | pnlCCOW. Hint := TX _CCOW_CHAN GING; | |
| 4665 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4666 | try | |
| 4667 | ctxCon textor.Sus pend; | |
| 4668 | except | |
| 4669 | on E: Exception do HandleC COWError(E .Message); | |
| 4670 | end; | |
| 4671 | if FCCOW Error then exit; | |
| 4672 | FCCOWIco nName := ' BMP_CCOW_B ROKEN'; | |
| 4673 | pnlCCOW. Hint := TX _CCOW_BROK EN; | |
| 4674 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4675 | mnuFileR esumeConte xt.Enabled := True; | |
| 4676 | mnuFileB reakContex t.Enabled := False; | |
| 4677 | end; | |
| 4678 | ||
| 4679 | procedure TfrmFrame. mnuFileRes umeContext GetClick(S ender: TOb ject); | |
| 4680 | var | |
| 4681 | Reason: string; | |
| 4682 | begin | |
| 4683 | Reason : = ''; | |
| 4684 | if not A llowContex tChangeAll (Reason) t hen exit; | |
| 4685 | FCCOWIco nName := ' BMP_CCOW_C HANGING'; | |
| 4686 | pnlCCOW. Hint := TX _CCOW_CHAN GING; | |
| 4687 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4688 | FCCOWErr or := Fals e; | |
| 4689 | try | |
| 4690 | ctxCon textor.Res ume; | |
| 4691 | except | |
| 4692 | on E: Exception do HandleC COWError(E .Message); | |
| 4693 | end; | |
| 4694 | if FCCOW Error then exit; | |
| 4695 | UpdateCC OWContext; | |
| 4696 | if not F NoPatientS elected th en | |
| 4697 | begin | |
| 4698 | FCCOWI conName := 'BMP_CCOW _LINKED'; | |
| 4699 | pnlCCO W.Hint := TX_CCOW_LI NKED; | |
| 4700 | imgCCO W.Picture. BitMap.Loa dFromResou rceName(hI nstance, F CCOWIconNa me); | |
| 4701 | mnuFil eResumeCon text.Enabl ed := Fals e; | |
| 4702 | mnuFil eBreakCont ext.Visibl e := True; | |
| 4703 | mnuFil eBreakCont ext.Enable d := True; | |
| 4704 | end; | |
| 4705 | end; | |
| 4706 | ||
| 4707 | procedure TfrmFrame. mnuFileRes umeContext SetClick(S ender: TOb ject); | |
| 4708 | var | |
| 4709 | CCOWResp onse: User Response; | |
| 4710 | Reason: string; | |
| 4711 | begin | |
| 4712 | Reason : = ''; | |
| 4713 | if not A llowContex tChangeAll (Reason) t hen exit; | |
| 4714 | FCCOWIco nName := ' BMP_CCOW_C HANGING'; | |
| 4715 | pnlCCOW. Hint := TX _CCOW_CHAN GING; | |
| 4716 | imgCCOW. Picture.Bi tMap.LoadF romResourc eName(hIns tance, FCC OWIconName ); | |
| 4717 | FCCOWErr or := Fals e; | |
| 4718 | try | |
| 4719 | ctxCon textor.Res ume; | |
| 4720 | except | |
| 4721 | on E: Exception do HandleC COWError(E .Message); | |
| 4722 | end; | |
| 4723 | if FCCOW Error then exit; | |
| 4724 | if (Allo wCCOWConte xtChange(C COWRespons e, Patient .DFN)) the n | |
| 4725 | begin | |
| 4726 | mnuF ileResumeC ontext.Ena bled := Fa lse; | |
| 4727 | mnuF ileBreakCo ntext.Visi ble := Tru e; | |
| 4728 | mnuF ileBreakCo ntext.Enab led := Tru e; | |
| 4729 | FCCO WIconName := 'BMP_CC OW_LINKED' ; | |
| 4730 | pnlC COW.Hint : = TX_CCOW_ LINKED; | |
| 4731 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 4732 | end | |
| 4733 | else | |
| 4734 | begin | |
| 4735 | mnuF ileResumeC ontext.Ena bled := Tr ue; | |
| 4736 | mnuF ileBreakCo ntext.Enab led := Fal se; | |
| 4737 | FCCO WIconName := 'BMP_CC OW_BROKEN' ; | |
| 4738 | pnlC COW.Hint : = TX_CCOW_ BROKEN; | |
| 4739 | imgC COW.Pictur e.BitMap.L oadFromRes ourceName( hInstance, FCCOWIcon Name); | |
| 4740 | try | |
| 4741 | if ctxContex tor.State in [csPart icipating] then ctxC ontextor.S uspend; | |
| 4742 | exce pt | |
| 4743 | on E: Except ion do Han dleCCOWErr or(E.Messa ge); | |
| 4744 | end; | |
| 4745 | end; | |
| 4746 | SetupPat ient; | |
| 4747 | tabPage. TabIndex : = PageIDTo Tab(User.I nitialTab) ; | |
| 4748 | tabPageC hange(tabP age); | |
| 4749 | end; | |
| 4750 | ||
| 4751 | procedure TfrmFrame. CheckForDi fferentPat ient(aCont extItemCol lection: I Dispatch; var PtChan ged: boole an); | |
| 4752 | var | |
| 4753 | data : I ContextIte mCollectio n; | |
| 4754 | anItem: IContextIt em; | |
| 4755 | PtDFN, P tName: str ing; | |
| 4756 | begin | |
| 4757 | if uCore .Patient = nil then | |
| 4758 | begin | |
| 4759 | PtChan ged := Fal se; | |
| 4760 | Exit; | |
| 4761 | end; | |
| 4762 | data := IContextIt emCollecti on(aContex tItemColle ction) ; | |
| 4763 | PtDFN := FindBestC COWDFN; | |
| 4764 | // Retri eve the Co ntextItem name and v alue as st rings | |
| 4765 | anItem : = data.Pre sent('Pati ent.co.Pat ientName') ; | |
| 4766 | if anIte m <> nil t hen PtName := anItem .Get_Value (); | |
| 4767 | PtChange d := not ( (PtDFN = P atient.DFN ) and (PtN ame = Piec e(Patient. Name, ',', 1) + U + Piece(Pati ent.Name, ',', 2) + '^^^^')); | |
| 4768 | end; | |
| 4769 | ||
| 4770 | {$IFDEF CC OWBROKER} | |
| 4771 | procedure TfrmFrame. CheckForDi fferentUse r(aContext ItemCollec tion: IDis patch; var UserChang ed: boolea n); | |
| 4772 | var | |
| 4773 | data : I ContextIte mCollectio n; | |
| 4774 | begin | |
| 4775 | if uCore .User = ni l then | |
| 4776 | begin | |
| 4777 | UserCh anged := F alse; | |
| 4778 | Exit; | |
| 4779 | end; | |
| 4780 | data := IContextIt emCollecti on(aContex tItemColle ction) ; | |
| 4781 | UserChan ged := RPC BrokerV.Is UserContex tPending(d ata); | |
| 4782 | end; | |
| 4783 | {$ENDIF} | |
| 4784 | ||
| 4785 | procedure TfrmFrame. CheckHyper linkRespon se(aContex tItemColle ction: IDi spatch; va r Hyperlin kReason: s tring); | |
| 4786 | var | |
| 4787 | data : I ContextIte mCollectio n; | |
| 4788 | anItem : IContextI tem; | |
| 4789 | itemvalu e: string; | |
| 4790 | PtSubjec t: string; | |
| 4791 | begin | |
| 4792 | data := IContextIt emCollecti on(aContex tItemColle ction) ; | |
| 4793 | anItem := data.Prese nt('[hds_m ed_ DNS ]request.i d.name'); | |
| 4794 | // Retri eve the Co ntextItem name and v alue as st rings | |
| 4795 | if anIte m <> nil t hen | |
| 4796 | begin | |
| 4797 | item Value := a nItem.Get_ Value(); | |
| 4798 | if i temValue = 'GetWindo wHandle' t hen | |
| 4799 | be gin | |
| 4800 | PtSubject := 'patien t.id.mrn.d fn_' + Use r.StationN umber; | |
| 4801 | if not Use r.IsProduc tionAccoun t then PtS ubject := PtSubject + '_test'; | |
| 4802 | if data.Pr esent(PtSu bject) <> nil then | |
| 4803 | Hyperlin kReason := '!@#$' + IntToStr(S elf.Handle ) + ':0:' | |
| 4804 | else | |
| 4805 | Hyperlin kReason := ''; | |
| 4806 | en d; | |
| 4807 | end; | |
| 4808 | end; | |
| 4809 | ||
| 4810 | procedure TfrmFrame. HideEveryt hing(AMess age: strin g = 'No pa tient is c urrently s elected.') ; | |
| 4811 | begin | |
| 4812 | FNoPatie ntSelected := TRUE; | |
| 4813 | pnlNoPat ientSelect ed.Caption := AMessa ge; | |
| 4814 | pnlNoPat ientSelect ed.Visible := True; | |
| 4815 | pnlNoPat ientSelect ed.BringTo Front; | |
| 4816 | mnuFileR eview.Enab led := Fal se; | |
| 4817 | mnuFileP rint.Enabl ed := Fals e; | |
| 4818 | mnuFileP rintSelect edItems.En abled := F alse; | |
| 4819 | mnuFileE ncounter.E nabled := False; | |
| 4820 | mnuFileN ext.Enable d := False ; | |
| 4821 | mnuFileR efresh.Ena bled := Fa lse; | |
| 4822 | mnuFileP rintSetup. Enabled := False; | |
| 4823 | mnuFileP rintSelect edItems.En abled := F alse; | |
| 4824 | mnuFileN otifRemove .Enabled : = False; | |
| 4825 | mnuFileR esumeConte xt.Enabled := False; | |
| 4826 | mnuFileB reakContex t.Enabled := False; | |
| 4827 | mnuEdit. Enabled := False; | |
| 4828 | mnuView. Enabled := False; | |
| 4829 | mnuTools .Enabled : = False; | |
| 4830 | if FNext ButtonActi ve then FN extButton. Visible := False; | |
| 4831 | end; | |
| 4832 | ||
| 4833 | procedure TfrmFrame. ShowEveryt hing; | |
| 4834 | begin | |
| 4835 | FNoPatie ntSelected := FALSE; | |
| 4836 | pnlNoPat ientSelect ed.Caption := ''; | |
| 4837 | pnlNoPat ientSelect ed.Visible := False; | |
| 4838 | pnlNoPat ientSelect ed.SendToB ack; | |
| 4839 | mnuFileR eview.Enab led := Tru e; | |
| 4840 | mnuFileP rint.Enabl ed := True ; | |
| 4841 | mnuFileE ncounter.E nabled := True; | |
| 4842 | mnuFileN ext.Enable d := True; | |
| 4843 | mnuFileR efresh.Ena bled := Tr ue; | |
| 4844 | mnuFileP rintSetup. Enabled := True; | |
| 4845 | mnuFileP rintSelect edItems.En abled := T rue; | |
| 4846 | mnuFileN otifRemove .Enabled : = True; | |
| 4847 | if not F CCOWError then | |
| 4848 | begin | |
| 4849 | if FCC OWIconName = 'BMP_CCO W_BROKEN' then | |
| 4850 | begin | |
| 4851 | mnuF ileResumeC ontext.Ena bled := Tr ue; | |
| 4852 | mnuF ileBreakCo ntext.Enab led := Fal se; | |
| 4853 | end el se | |
| 4854 | begin | |
| 4855 | mnuF ileResumeC ontext.Ena bled := Fa lse; | |
| 4856 | mnuF ileBreakCo ntext.Enab led := Tru e; | |
| 4857 | end; | |
| 4858 | end; | |
| 4859 | mnuEdit. Enabled := True; | |
| 4860 | mnuView. Enabled := True; | |
| 4861 | mnuTools .Enabled : = True; | |
| 4862 | if FNext ButtonActi ve then FN extButton. Visible := True; | |
| 4863 | end; | |
| 4864 | ||
| 4865 | ||
| 4866 | procedure TfrmFrame. pnlFlagMou seDown(Sen der: TObje ct; Button : TMouseBu tton; | |
| 4867 | Shift: T ShiftState ; X, Y: In teger); | |
| 4868 | begin | |
| 4869 | pnlFlag. BevelOuter := bvLowe red; | |
| 4870 | end; | |
| 4871 | ||
| 4872 | procedure TfrmFrame. pnlFlagMou seUp(Sende r: TObject ; Button: TMouseButt on; | |
| 4873 | Shift: T ShiftState ; X, Y: In teger); | |
| 4874 | begin | |
| 4875 | pnlFlag. BevelOuter := bvRais ed; | |
| 4876 | end; | |
| 4877 | ||
| 4878 | procedure TfrmFrame. pnlOTHDCli ck(Sender: TObject); // rpk 1/ 5/2018 | |
| 4879 | var | |
| 4880 | tmpstr: String; | |
| 4881 | begin | |
| 4882 | inherite d; | |
| 4883 | tmpstr : = 'Other T han Honora ble Status ' + CRLF + CRLF + | |
| 4884 | OTHDLo ngStr1; | |
| 4885 | if OTHDL ongStr2 > '' then | |
| 4886 | tmpstr := tmpstr + CRLF + OTHDLongSt r2; | |
| 4887 | if OTHDL ocalMsg > '' then | |
| 4888 | tmpstr := tmpstr + CRLF + CRLF + OTH DLocalMsg; | |
| 4889 | ShowMsg( tmpstr); // rpk 2/2 8/2018 | |
| 4890 | end; | |
| 4891 | ||
| 4892 | procedure TfrmFrame. pnlOTHDEnt er(Sender: TObject); // rpk 1 /5/2018 | |
| 4893 | const | |
| 4894 | M_WVERT = 6; | |
| 4895 | begin | |
| 4896 | inherite d; | |
| 4897 | lblOTHDT itle.Capti on := 'Oth er than Ho norable: ' + OTHDLoc alMsg; | |
| 4898 | lblOTHD. Caption := OTHDLongS tr1; | |
| 4899 | if OTHDL ongStr2 > '' then | |
| 4900 | lblOTH D.Caption := lblOTHD .Caption + ', ' + OT HDLongStr2 ; | |
| 4901 | pnlOTHD. Width := Highe rOf( (lblO THDTitle.W idth + (M_ WVERT * 2) ), | |
| 4902 | (lbl OTHD.Width + (M_WVER T * 2)) ); // rpk 1 2/6/2017 | |
| 4903 | pnlOTHD. Left := pa VAA.Left - pnlOTHD.W idth; // r pk 1/4/201 8 | |
| 4904 | with Sen der as TPa nel do | |
| 4905 | BevelI nner := bv Raised; | |
| 4906 | end; | |
| 4907 | ||
| 4908 | procedure TfrmFrame. pnlOTHDExi t(Sender: TObject); // rpk 1/ 5/2018 | |
| 4909 | const | |
| 4910 | M_WVERT = 6; | |
| 4911 | begin | |
| 4912 | inherite d; | |
| 4913 | with Sen der as TPa nel do | |
| 4914 | BevelI nner := bv None; | |
| 4915 | lblOTHDT itle.Capti on := 'OTH '; | |
| 4916 | lblOTHD. Caption := OTHDShort Str; | |
| 4917 | pnlOTHD. Width := Highe rOf( (lblO THDTitle.W idth + (M_ WVERT * 2) ), | |
| 4918 | (lbl OTHD.Width + (M_WVER T * 2)) ); // rpk 1 2/6/2017 | |
| 4919 | pnlOTHD. Left := pa VAA.Left - pnlOTHD.W idth; // r pk 1/4/201 8 | |
| 4920 | lblPtCar e.Refresh; | |
| 4921 | lblPtAtt ending.Ref resh; | |
| 4922 | lblPtMHT C.Refresh; | |
| 4923 | end; | |
| 4924 | ||
| 4925 | ||
| 4926 | procedure TfrmFrame. pnlFlagCli ck(Sender: TObject); | |
| 4927 | begin | |
| 4928 | ViewInfo (mnuViewFl ags); | |
| 4929 | end; | |
| 4930 | ||
| 4931 | procedure TfrmFrame. mnuFilePri ntSelected ItemsClick (Sender: T Object); | |
| 4932 | begin | |
| 4933 | case T abToPageID (tabPage.T abIndex) o f | |
| 4934 | CT_N OTES: f rmNotes.Ls tNotesToPr int; | |
| 4935 | CT_C ONSULTS: f rmConsults .LstConsul tsToPrint; | |
| 4936 | CT_D CSUMM: f rmDCSumm.L stSummsToP rint; | |
| 4937 | end; {cas e} | |
| 4938 | end; | |
| 4939 | ||
| 4940 | procedure TfrmFrame. mnuAlertRe newClick(S ender: TOb ject); | |
| 4941 | var XQAID: string; | |
| 4942 | begin | |
| 4943 | XQAID := Piece(Not ifications .RecordID, '^', 2); | |
| 4944 | RenewAle rt(XQAID); | |
| 4945 | end; | |
| 4946 | ||
| 4947 | procedure TfrmFrame. mnuFileVie wNotificat ionsClick( Sender: TO bject); | |
| 4948 | begin | |
| 4949 | ShowPati entNotific ations(mnu FileNextCl ick); | |
| 4950 | end; | |
| 4951 | ||
| 4952 | procedure TfrmFrame. mnuAlertFo rwardClick (Sender: T Object); | |
| 4953 | var | |
| 4954 | XQAID, A lertMsg: s tring; | |
| 4955 | begin | |
| 4956 | XQAID := Piece(Not ifications .RecordID, '^', 2); | |
| 4957 | AlertMsg := Piece( Notificati ons.Record ID, '^', 1 ); | |
| 4958 | RenewAle rt(XQAID); // must renew/rest ore an ale rt before it can be forwarded | |
| 4959 | ForwardA lertTo(XQA ID + '^' + AlertMsg) ; | |
| 4960 | end; | |
| 4961 | ||
| 4962 | procedure TfrmFrame. mnuGECStat usClick(Se nder: TObj ect); | |
| 4963 | var | |
| 4964 | ans, Resul t,str,str1 ,title: st ring; | |
| 4965 | cnt,i: int eger; | |
| 4966 | fin: boole an; | |
| 4967 | ||
| 4968 | begin | |
| 4969 | Result : = sCallV(' ORQQPXRM G EC STATUS PROMPT', [ Patient.DF N]); | |
| 4970 | if Piece (Result,U, 1) <> '0' then | |
| 4971 | begin | |
| 4972 | titl e := Piece (Result,U, 2); | |
| 4973 | if pos('~',P iece(Resul t,U,1))>0 then | |
| 4974 | begin | |
| 4975 | str:= ''; | |
| 4976 | str1 := Piece(R esult,U,1) ; | |
| 4977 | cnt : = DelimCou nt(str1, ' ~'); | |
| 4978 | for i :=1 to cnt +1 do | |
| 4979 | b egin | |
| 4980 | i f i = 1 th en str := Piece(str1 ,'~',i); | |
| 4981 | i f i > 1 th en str :=s tr+CRLF+Pi ece(str1,' ~',i); | |
| 4982 | e nd; | |
| 4983 | end | |
| 4984 | else st r := Piece (Result,U, 1); | |
| 4985 | if Piece(Res ult,U,3)=' 1' then | |
| 4986 | begin | |
| 4987 | fin := (InfoBox(s tr,title, MB_YESNO o r MB_DEFBU TTON2)=IDY ES); | |
| 4988 | if fin = true the n ans := ' 1'; | |
| 4989 | if fin = false th en ans := '0'; | |
| 4990 | CallV(' ORQQPXRM G EC FINISHE D?',[Patie nt.DFN,ans ]); | |
| 4991 | end | |
| 4992 | el se | |
| 4993 | In foBox(str, title, MB_ OK); | |
| 4994 | end; | |
| 4995 | end; | |
| 4996 | ||
| 4997 | procedure TfrmFrame. pnlFlagEnt er(Sender: TObject); | |
| 4998 | begin | |
| 4999 | pnlFlag. BevelInner := bvRais ed; | |
| 5000 | pnlFlag. BevelOuter := bvNone ; | |
| 5001 | pnlFlag. BevelWidth := 3; | |
| 5002 | end; | |
| 5003 | ||
| 5004 | procedure TfrmFrame. pnlFlagExi t(Sender: TObject); | |
| 5005 | begin | |
| 5006 | pnlFlag. BevelWidth := 2; | |
| 5007 | pnlFlag. BevelInner := bvNone ; | |
| 5008 | pnlFlag. BevelOuter := bvRais ed; | |
| 5009 | end; | |
| 5010 | ||
| 5011 | procedure TfrmFrame. tabPageMou seDown(Sen der: TObje ct; Button : TMouseBu tton; | |
| 5012 | Shift: T ShiftState ; X, Y: In teger); | |
| 5013 | begin | |
| 5014 | inherite d; | |
| 5015 | TabCtrlC licked := True; | |
| 5016 | end; | |
| 5017 | ||
| 5018 | procedure TfrmFrame. tabPageMou seUp(Sende r: TObject ; Button: TMouseButt on; | |
| 5019 | Shift: T ShiftState ; X, Y: In teger); | |
| 5020 | begin | |
| 5021 | LastTab := TabToPa geID((send er as TTab Control).T abIndex); | |
| 5022 | end; | |
| 5023 | ||
| 5024 | procedure TfrmFrame. lstCIRNLoc ationsExit (Sender: T Object); | |
| 5025 | begin | |
| 5026 | //Make the lstCI RNLocation s act as i f between pnlCIRN & pnlReminde rs | |
| 5027 | //in t he Tab Ord er | |
| 5028 | if Boole an(Hi(GetK eyState(VK _TAB))) th en | |
| 5029 | if Boo lean(Hi(Ge tKeyState( VK_SHIFT)) ) then | |
| 5030 | pnlC IRN.SetFoc us | |
| 5031 | else | |
| 5032 | pnlR eminders.S etFocus; | |
| 5033 | end; | |
| 5034 | ||
| 5035 | procedure TfrmFrame. AppEventsA ctivate(Se nder: TObj ect); | |
| 5036 | begin | |
| 5037 | FJustEnt eredApp := True; | |
| 5038 | end; | |
| 5039 | ||
| 5040 | procedure TfrmFrame. AppEventsM essage(var Msg: tagM SG; var Ha ndled: Boo lean); | |
| 5041 | var | |
| 5042 | Control: TComponen t; | |
| 5043 | begin | |
| 5044 | Handled := false; | |
| 5045 | if (Msg. message = WM_MOUSEWH EEL) and ( GetKeyStat e(VK_LBUTT ON) < 0) t hen begin | |
| 5046 | Contro l := FindC ontrol(Msg .hwnd); | |
| 5047 | if not Assigned( Control) t hen | |
| 5048 | Hand led := Tru e | |
| 5049 | else i f (Control is TRichE dit) then begin | |
| 5050 | Hand led := Tru e; | |
| 5051 | Send Message(se lf.Handle, EM_SETZOO M, 0, 0); | |
| 5052 | end; | |
| 5053 | end; | |
| 5054 | end; | |
| 5055 | ||
| 5056 | procedure TfrmFrame. ScreenActi veFormChan ge(Sender: TObject); | |
| 5057 | begin | |
| 5058 | if(assig ned(FOldAc tiveFormCh ange)) the n | |
| 5059 | FOldAc tiveFormCh ange(Sende r); | |
| 5060 | //Focus the Form t hat Stays on Top aft er the App lication R egains foc us. | |
| 5061 | if FJust EnteredApp then | |
| 5062 | FocusA pplication TopForm; | |
| 5063 | FJustEnt eredApp := false; | |
| 5064 | end; | |
| 5065 | ||
| 5066 | procedure TfrmFrame. FocusAppli cationTopF orm; | |
| 5067 | var | |
| 5068 | I : inte ger; | |
| 5069 | begin | |
| 5070 | for I := (Screen.F ormCount-1 ) downto 0 do //Set the last o ne opened last | |
| 5071 | begin | |
| 5072 | with S creen.Form s[I] do | |
| 5073 | if ( FormStyle = fsStayOn Top) and ( Enabled) a nd (Visibl e) then | |
| 5074 | Se tFocus; | |
| 5075 | end; | |
| 5076 | end; | |
| 5077 | ||
| 5078 | procedure TfrmFrame. AppEventsS hortCut(va r Msg: TWM Key; | |
| 5079 | var Hand led: Boole an); | |
| 5080 | begin | |
| 5081 | if ((Boo lean(Hi(Ge tKeyState( VK_MENU{AL T})))) and (Msg.Char Code = VK_ F1)) then | |
| 5082 | begin | |
| 5083 | FocusA pplication TopForm; | |
| 5084 | Handle d := True; | |
| 5085 | end; | |
| 5086 | end; | |
| 5087 | ||
| 5088 | procedure TfrmFrame. mnuToolsGr aphingClic k(Sender: TObject); | |
| 5089 | var | |
| 5090 | contexth int: strin g; | |
| 5091 | begin | |
| 5092 | Screen.C ursor := c rHourGlass ; | |
| 5093 | contexth int := mnu ToolsGraph ing.Hint; | |
| 5094 | if Graph Float = ni l then // new gra ph | |
| 5095 | begin | |
| 5096 | GraphF loat := Tf rmGraphs.C reate(self ); | |
| 5097 | try | |
| 5098 | with GraphFloa t do | |
| 5099 | begi n | |
| 5100 | if btnClose. Tag = 1 th en | |
| 5101 | be gin | |
| 5102 | Screen.Cur sor := crD efault; | |
| 5103 | exit; | |
| 5104 | en d; | |
| 5105 | In itialize; | |
| 5106 | Ca ption := ' CPRS Graph ing - Pati ent: ' + M ixedCase(P atient.Nam e); | |
| 5107 | Bo rderIcons := [biSyst emMenu, bi Maximize, biMinimize ]; | |
| 5108 | Bo rderStyle := bsSizea ble; | |
| 5109 | Bo rderWidth := 1; | |
| 5110 | // context s ensitive type (tabPage.T abIndex) & [item] | |
| 5111 | Re sizeAnchor edFormToFo nt(GraphFl oat); | |
| 5112 | Gr aphFloat.p nlFooter.H int := con texthint; // conte xt from la b most rec ent | |
| 5113 | Sh ow; | |
| 5114 | end; | |
| 5115 | finall y | |
| 5116 | if G raphFloat. btnClose.T ag = 1 the n | |
| 5117 | begi n | |
| 5118 | Gr aphFloatAc tive := fa lse; | |
| 5119 | Gr aphFloat.F ree; | |
| 5120 | Gr aphFloat : = nil; | |
| 5121 | end | |
| 5122 | else | |
| 5123 | Gr aphFloatAc tive := tr ue; | |
| 5124 | end; | |
| 5125 | end | |
| 5126 | else | |
| 5127 | begin | |
| 5128 | GraphF loat.Capti on := 'CPR S Graphing - Patient : ' + Mixe dCase(Pati ent.Name); | |
| 5129 | GraphF loat.pnlFo oter.Hint := context hint; // context f rom lab mo st recent | |
| 5130 | if Gra phFloat.bt nClose.Tag = 1 then | |
| 5131 | begin | |
| 5132 | Scre en.Cursor := crDefau lt; | |
| 5133 | exit ; | |
| 5134 | end | |
| 5135 | else i f GraphFlo atActive a nd (frmGra phData.pnl Data.Hint = Patient. DFN) then | |
| 5136 | begin | |
| 5137 | if l ength(Grap hFloat.pnl Footer.Hin t) > 1 the n | |
| 5138 | begi n | |
| 5139 | Gr aphFloat.C lose; | |
| 5140 | Gr aphFloatAc tive := tr ue; | |
| 5141 | Gr aphFloat.S how; | |
| 5142 | end; | |
| 5143 | Grap hFloat.Bri ngToFront; // grap h is activ e, same pa tient | |
| 5144 | end | |
| 5145 | else i f frmGraph Data.pnlDa ta.Hint = Patient.DF N then | |
| 5146 | begin // graph is not ac tive, same patient | |
| 5147 | // c ontext sen sitive | |
| 5148 | Grap hFloat.Sho w; | |
| 5149 | Grap hFloatActi ve := true ; | |
| 5150 | end | |
| 5151 | else | |
| 5152 | //with GraphFloa t do // new patient | |
| 5153 | begin | |
| 5154 | Grap hFloat.Ini tialRetain ; | |
| 5155 | Grap hFloatActi ve := fals e; | |
| 5156 | Grap hFloat.Fre e; | |
| 5157 | Grap hFloat := nil; | |
| 5158 | mnuT oolsGraphi ngClick(se lf); // del ete and re curse | |
| 5159 | end; | |
| 5160 | end; | |
| 5161 | mnuTools Graphing.H int := ''; | |
| 5162 | Screen.C ursor := c rDefault; | |
| 5163 | end; | |
| 5164 | ||
| 5165 | procedure TfrmFrame. pnlCIRNMou seDown(Sen der: TObje ct; Button : TMouseBu tton; Shif t: TShiftS tate; X, Y : Integer) ; | |
| 5166 | begin | |
| 5167 | pnlCIRN. BevelOuter := bvLowe red; | |
| 5168 | end; | |
| 5169 | ||
| 5170 | procedure TfrmFrame. pnlCIRNMou seUp(Sende r: TObject ; Button: TMouseButt on; Shift: TShiftSta te; X, Y: Integer); | |
| 5171 | begin | |
| 5172 | pnlCIRN. BevelOuter := bvRais ed; | |
| 5173 | end; | |
| 5174 | ||
| 5175 | procedure TfrmFrame. laMHVClick (Sender: T Object); | |
| 5176 | begin | |
| 5177 | ViewInfo (mnuViewMy HealtheVet ); | |
| 5178 | end; | |
| 5179 | ||
| 5180 | procedure TfrmFrame. laVAA2Clic k(Sender: TObject); | |
| 5181 | begin | |
| 5182 | ViewInfo (mnuInsura nce); | |
| 5183 | end; | |
| 5184 | ||
| 5185 | procedure TfrmFrame. lblOTHDCli ck(Sender: TObject); // rpk 1/ 5/2018 | |
| 5186 | begin | |
| 5187 | inherite d; | |
| 5188 | pnlOTHDC lick(lblOT HD); | |
| 5189 | end; | |
| 5190 | ||
| 5191 | procedure TfrmFrame. lblOTHDTit leClick(Se nder: TObj ect); // rpk 1/5/20 18 | |
| 5192 | begin | |
| 5193 | inherite d; | |
| 5194 | pnlOTHDC lick(lblOT HDTitle); | |
| 5195 | end; | |
| 5196 | ||
| 5197 | procedure TfrmFrame. ViewInfo(S ender: TOb ject); | |
| 5198 | var | |
| 5199 | SelectNe w: Boolean ; | |
| 5200 | { TODO 5 -oDanP -c New CoverS heet : Nee d to finis h the VAA button stu ff ASAP! } | |
| 5201 | aInsuran ceSubscrib erName: st ring; | |
| 5202 | aReportT ext: TStri ngList; | |
| 5203 | aAddress : string; | |
| 5204 | ID: inte ger; | |
| 5205 | aCPRS508 : ICPRS508 ; | |
| 5206 | begin | |
| 5207 | if Sende r is TMenu Item then begin | |
| 5208 | ID := TMenuItem( Sender).Ta g; | |
| 5209 | end else if Sender is TActio n then beg in | |
| 5210 | ID := TAction(Se nder).Tag; | |
| 5211 | end else begin | |
| 5212 | ID := -1; | |
| 5213 | end; | |
| 5214 | case ID of | |
| 5215 | 1:begi n { displa ys patient inquiry r eport (whi ch optiona lly allows new patie nt to be s elected) } | |
| 5216 | St atusText(T X_PTINQ); | |
| 5217 | Pa tientInqui ry(SelectN ew); | |
| 5218 | if Assigned( FLastPage) then | |
| 5219 | if FLastPa ge.Inherit sFrom(Tfrm Page) then | |
| 5220 | TfrmPage (FLastPage ).FocusFir stControl | |
| 5221 | else if Su pports(fLa stPage, IC PRS508, aC PRS508) th en | |
| 5222 | aCPRS508 .OnFocusFi rstControl (Sender); | |
| 5223 | St atusText(' '); | |
| 5224 | if SelectNew then mnuF ileOpenCli ck(mnuView Demo); | |
| 5225 | end; | |
| 5226 | 2:begi n | |
| 5227 | if (not User .IsReports Only) then // Report s Only tab . | |
| 5228 | mnuFileEnc ounterClic k(Self); | |
| 5229 | end; | |
| 5230 | 3:begi n | |
| 5231 | Re portBox(De tailPrimar yCare(Pati ent.DFN), 'Primary C are', True ); | |
| 5232 | end; | |
| 5233 | 4:begi n | |
| 5234 | if Patient.P tIsMHV the n | |
| 5235 | ShellExecu te(laMHV.H andle, 'op en', PChar ('http://w ww.myhealt h.va.gov/' ), '', '', SW_NORMAL ); | |
| 5236 | end; | |
| 5237 | 5:begi n | |
| 5238 | if Patient.Pt IsVAA then | |
| 5239 | t ry | |
| 5240 | aReportTe xt := TStr ingList.Cr eate; | |
| 5241 | Patient.G etVAAInfor mation(aIn suranceSub scriberNam e, aReport Text); | |
| 5242 | ReportBox (aReportTe xt, aInsur anceSubscr iberName, True); | |
| 5243 | f inally | |
| 5244 | FreeAndNi l(aReportT ext); | |
| 5245 | e nd; | |
| 5246 | end; | |
| 5247 | 6:begi n | |
| 5248 | Sh owFlags; | |
| 5249 | end; | |
| 5250 | 7:begi n | |
| 5251 | if uUseVista Web = true then | |
| 5252 | begin | |
| 5253 | lblCIRN. Alignment := taCente r; | |
| 5254 | lstCIRNL ocations.V isible := false; | |
| 5255 | lstCIRNL ocations.S endToBack; | |
| 5256 | aAddress := GetVis taWebAddre ss(Patient .DFN); | |
| 5257 | ShellExe cute(pnlCi rn.Handle, 'open', P Char(aAddr ess), PCha r(''), '', SW_NORMAL ); | |
| 5258 | pnlCIRN. BevelOuter := bvRais ed; | |
| 5259 | Exit; | |
| 5260 | end; | |
| 5261 | if not Remot eSites.Rem oteDataExi sts then E xit; | |
| 5262 | if (not lstC IRNLocatio ns.Visible ) then | |
| 5263 | begin | |
| 5264 | pnlCIRN. BevelOuter := bvLowe red; | |
| 5265 | lstCIRNL ocations.V isible := True; | |
| 5266 | lstCIRNL ocations.B ringToFron t; | |
| 5267 | lstCIRNL ocations.S etFocus; | |
| 5268 | pnlCIRN. Hint := 'C lick to cl ose list.' ; | |
| 5269 | end | |
| 5270 | el se | |
| 5271 | begin | |
| 5272 | pnlCIRN. BevelOuter := bvRais ed; | |
| 5273 | lstCIRNL ocations.V isible := False; | |
| 5274 | lstCIRNL ocations.S endToBack; | |
| 5275 | pnlCIRN. Hint := 'C lick to di splay othe r faciliti es having data for t his patien t.'; | |
| 5276 | end; | |
| 5277 | end; | |
| 5278 | 8:begi n | |
| 5279 | Vi ewReminder Tree; | |
| 5280 | end; | |
| 5281 | 9:begi n { displa ys the win dow that s hows crisi s notes, w arnings, a llergies, & advance directives } | |
| 5282 | Sh owCWAD; | |
| 5283 | end; | |
| 5284 | end; | |
| 5285 | end; | |
| 5286 | ||
| 5287 | procedure TfrmFrame. mnuViewInf ormationCl ick(Sender : TObject) ; | |
| 5288 | begin | |
| 5289 | mnuViewD emo.Enable d := frmFr ame.pnlPat ient.Enabl ed; | |
| 5290 | mnuViewV isits.Enab led := frm Frame.pnlV isit.Enabl ed; | |
| 5291 | mnuViewP rimaryCare .Enabled : = frmFrame .pnlPrimar yCare.Enab led; | |
| 5292 | mnuViewM yHealtheVe t.Enabled := not (Co py(frmFram e.laMHV.Hi nt, 1, 2) = 'No'); | |
| 5293 | mnuInsur ance.Enabl ed := not (Copy(frmF rame.laVAA 2.Hint, 1, 2) = 'No' ); | |
| 5294 | mnuViewF lags.Enabl ed := frmF rame.lblFl ag.Enabled ; | |
| 5295 | mnuViewR emoteData. Enabled := frmFrame. lblCirn.En abled; | |
| 5296 | mnuViewR eminders.E nabled := frmFrame.p nlReminder s.Enabled; | |
| 5297 | mnuViewP ostings.En abled := f rmFrame.pn lPostings. Enabled; | |
| 5298 | end; | |
| 5299 | ||
| 5300 | procedure TfrmFrame. SetActiveT ab(PageID: Integer); | |
| 5301 | begin | |
| 5302 | tabPage. TabIndex : = frmFrame .PageIDToT ab(PageID) ; | |
| 5303 | tabPageC hange(tabP age); | |
| 5304 | end; | |
| 5305 | ||
| 5306 | procedure TfrmFrame. NextButton Click(Send er: TObjec t); | |
| 5307 | begin | |
| 5308 | if FProc cessingNex tClick the n Exit; | |
| 5309 | FProcces singNextCl ick := tru e; | |
| 5310 | popAlert s.AutoPopu p := TRUE; | |
| 5311 | mnuFileN ext.Enable d := True; | |
| 5312 | mnuFileN extClick(S elf); | |
| 5313 | FProcces singNextCl ick := fal se; | |
| 5314 | end; | |
| 5315 | ||
| 5316 | procedure TfrmFrame. NextButton MouseDown( Sender: TO bject; But ton: TMous eButton; | |
| 5317 | Shif t: TShiftS tate; X, Y : Integer) ; | |
| 5318 | begin | |
| 5319 | popAler ts.AutoPop up := TRUE ; | |
| 5320 | end; | |
| 5321 | ||
| 5322 | procedure TfrmFrame. SetUpNextB utton; | |
| 5323 | begin | |
| 5324 | if FNex tButton <> nil then | |
| 5325 | begin | |
| 5326 | FNex tButton.fr ee; | |
| 5327 | FNex tButton := nil; | |
| 5328 | end; | |
| 5329 | FNextBu tton := TB itBtn.Crea te(self); | |
| 5330 | FNextBu tton.Paren t:= frmFra me; | |
| 5331 | FNextBu tton.Glyph := FNextB uttonBitma p; | |
| 5332 | FNextBu tton.OnMou seDown := NextButton MouseDown; | |
| 5333 | FNextBu tton.OnCli ck := Next ButtonClic k; | |
| 5334 | FNextBu tton.Capti on := '&Ne xt'; | |
| 5335 | FNextBu tton.Popup Menu := po pAlerts; | |
| 5336 | FNextBu tton.Top : = stsArea. Top; | |
| 5337 | FNextBu tton.Left := FNextBu ttonL; | |
| 5338 | FNextBu tton.Heigh t := stsAr ea.Height; | |
| 5339 | FNextBu tton.Width := stsAre a.Panels[2 ].Width; | |
| 5340 | FNextBu tton.TabSt op := True ; | |
| 5341 | FNextBu tton.TabOr der := 1; | |
| 5342 | FNextBu tton.show; | |
| 5343 | end; | |
| 5344 | ||
| 5345 | Procedure TfrmFrame. GetExclude dFromMixed (); | |
| 5346 | var | |
| 5347 | VistaList : TStringL ist; | |
| 5348 | I: intege r; | |
| 5349 | begin | |
| 5350 | VistaList := TStrin gList.Crea te; | |
| 5351 | try | |
| 5352 | GetUserL istParam(V istaList, 'OR EXCLUD E FROM MIX CASE'); | |
| 5353 | if Vista List.Count > 0 then | |
| 5354 | begin | |
| 5355 | Exclud eFromMixed .Clear; | |
| 5356 | for I := 0 to Vi staList.Co unt - 1 do | |
| 5357 | Excl udeFromMix ed.Add(Mix edCase(Pie ce(VistaLi st[I], U, 2), True)) ; | |
| 5358 | end; | |
| 5359 | finally | |
| 5360 | VistaLis t.Free; | |
| 5361 | end; | |
| 5362 | end; | |
| 5363 | ||
| 5364 | initializa tion | |
| 5365 | SpecifyF ormIsNotAD ialog(Tfrm Frame); | |
| 5366 | ||
| 5367 | finalizati on | |
| 5368 | ||
| 5369 | ||
| 5370 | end. |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.