diff --git a/kids/BSDX_0141.k b/kids/BSDX_0142.k similarity index 75% rename from kids/BSDX_0141.k rename to kids/BSDX_0142.k index e74d1b6..cb7cd4c 100644 --- a/kids/BSDX_0141.k +++ b/kids/BSDX_0142.k @@ -1,575 +1,571 @@ -KIDS Distribution saved on Sep 29, 2010@11:07:36 -WV Clinical Scheduling -**KIDS**:BSDX 1.41^ +KIDS Distribution saved on Dec 07, 2010@01:24:23 +Scheduling GUI v 1.42 +**KIDS**:BSDX 1.42^ **INSTALL NAME** -BSDX 1.41 -"BLD",7915,0) -BSDX 1.41^IHS Windows Scheduling^^3100929^n -"BLD",7915,1,0) -^^1^1^3100929^^^^ -"BLD",7915,1,1,0) +BSDX 1.42 +"BLD",7653,0) +BSDX 1.42^IHS Windows Scheduling^^3101207^n +"BLD",7653,1,0) +^^1^1^3101207^^^^ +"BLD",7653,1,1,0) Clinical Scheduling M Server support routines, files, options and RPCs. -"BLD",7915,4,0) +"BLD",7653,4,0) ^9.64PA^9002018.5^9 -"BLD",7915,4,9002018.1,0) +"BLD",7653,4,9002018.1,0) 9002018.1 -"BLD",7915,4,9002018.1,222) +"BLD",7653,4,9002018.1,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.15,0) +"BLD",7653,4,9002018.15,0) 9002018.15 -"BLD",7915,4,9002018.15,222) +"BLD",7653,4,9002018.15,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.2,0) +"BLD",7653,4,9002018.2,0) 9002018.2 -"BLD",7915,4,9002018.2,222) +"BLD",7653,4,9002018.2,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.3,0) +"BLD",7653,4,9002018.3,0) 9002018.3 -"BLD",7915,4,9002018.3,222) +"BLD",7653,4,9002018.3,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.35,0) +"BLD",7653,4,9002018.35,0) 9002018.35 -"BLD",7915,4,9002018.35,222) +"BLD",7653,4,9002018.35,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.38,0) +"BLD",7653,4,9002018.38,0) 9002018.38 -"BLD",7915,4,9002018.38,222) +"BLD",7653,4,9002018.38,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.39,0) +"BLD",7653,4,9002018.39,0) 9002018.39 -"BLD",7915,4,9002018.39,222) +"BLD",7653,4,9002018.39,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.4,0) +"BLD",7653,4,9002018.4,0) 9002018.4 -"BLD",7915,4,9002018.4,222) +"BLD",7653,4,9002018.4,222) y^y^f^^n^^n^o^n -"BLD",7915,4,9002018.5,0) +"BLD",7653,4,9002018.5,0) 9002018.5 -"BLD",7915,4,9002018.5,222) +"BLD",7653,4,9002018.5,222) y^y^f^^n^^y^o^n -"BLD",7915,4,"B",9002018.1,9002018.1) +"BLD",7653,4,"B",9002018.1,9002018.1) -"BLD",7915,4,"B",9002018.15,9002018.15) +"BLD",7653,4,"B",9002018.15,9002018.15) -"BLD",7915,4,"B",9002018.2,9002018.2) +"BLD",7653,4,"B",9002018.2,9002018.2) -"BLD",7915,4,"B",9002018.3,9002018.3) +"BLD",7653,4,"B",9002018.3,9002018.3) -"BLD",7915,4,"B",9002018.35,9002018.35) +"BLD",7653,4,"B",9002018.35,9002018.35) -"BLD",7915,4,"B",9002018.38,9002018.38) +"BLD",7653,4,"B",9002018.38,9002018.38) -"BLD",7915,4,"B",9002018.39,9002018.39) +"BLD",7653,4,"B",9002018.39,9002018.39) -"BLD",7915,4,"B",9002018.4,9002018.4) +"BLD",7653,4,"B",9002018.4,9002018.4) -"BLD",7915,4,"B",9002018.5,9002018.5) +"BLD",7653,4,"B",9002018.5,9002018.5) -"BLD",7915,6.3) -8 -"BLD",7915,"ABPKG") +"BLD",7653,6.3) +9 +"BLD",7653,"ABPKG") n -"BLD",7915,"INIT") +"BLD",7653,"INIT") V0200^BSDX2E -"BLD",7915,"KRN",0) -^9.67PA^779.2^20 -"BLD",7915,"KRN",.4,0) +"BLD",7653,"KRN",0) +^9.67PA^8989.52^19 +"BLD",7653,"KRN",.4,0) .4 -"BLD",7915,"KRN",.4,"NM",0) +"BLD",7653,"KRN",.4,"NM",0) ^9.68A^^ -"BLD",7915,"KRN",.401,0) +"BLD",7653,"KRN",.401,0) .401 -"BLD",7915,"KRN",.402,0) +"BLD",7653,"KRN",.402,0) .402 -"BLD",7915,"KRN",.403,0) +"BLD",7653,"KRN",.403,0) .403 -"BLD",7915,"KRN",.5,0) +"BLD",7653,"KRN",.5,0) .5 -"BLD",7915,"KRN",.84,0) +"BLD",7653,"KRN",.84,0) .84 -"BLD",7915,"KRN",3.6,0) +"BLD",7653,"KRN",3.6,0) 3.6 -"BLD",7915,"KRN",3.8,0) +"BLD",7653,"KRN",3.8,0) 3.8 -"BLD",7915,"KRN",9.2,0) +"BLD",7653,"KRN",9.2,0) 9.2 -"BLD",7915,"KRN",9.8,0) +"BLD",7653,"KRN",9.8,0) 9.8 -"BLD",7915,"KRN",9.8,"NM",0) +"BLD",7653,"KRN",9.8,"NM",0) ^9.68A^36^36 -"BLD",7915,"KRN",9.8,"NM",1,0) +"BLD",7653,"KRN",9.8,"NM",1,0) BSDX01^^0^B107139484 -"BLD",7915,"KRN",9.8,"NM",2,0) +"BLD",7653,"KRN",9.8,"NM",2,0) BSDX02^^0^B16323271 -"BLD",7915,"KRN",9.8,"NM",3,0) +"BLD",7653,"KRN",9.8,"NM",3,0) BSDX03^^0^B2855259 -"BLD",7915,"KRN",9.8,"NM",4,0) +"BLD",7653,"KRN",9.8,"NM",4,0) BSDX04^^0^B31079316 -"BLD",7915,"KRN",9.8,"NM",5,0) -BSDX05^^0^B6801706 -"BLD",7915,"KRN",9.8,"NM",6,0) +"BLD",7653,"KRN",9.8,"NM",5,0) +BSDX05^^0^B10878471 +"BLD",7653,"KRN",9.8,"NM",6,0) BSDX06^^0^B6812445 -"BLD",7915,"KRN",9.8,"NM",7,0) -BSDX07^^0^B78302774 -"BLD",7915,"KRN",9.8,"NM",8,0) -BSDX08^^0^B36787520 -"BLD",7915,"KRN",9.8,"NM",9,0) -BSDX09^^0^B34793207 -"BLD",7915,"KRN",9.8,"NM",10,0) +"BLD",7653,"KRN",9.8,"NM",7,0) +BSDX07^^0^B188811791 +"BLD",7653,"KRN",9.8,"NM",8,0) +BSDX08^^0^B140041473 +"BLD",7653,"KRN",9.8,"NM",9,0) +BSDX09^^0^B35707298 +"BLD",7653,"KRN",9.8,"NM",10,0) BSDX12^^0^B7203579 -"BLD",7915,"KRN",9.8,"NM",11,0) -BSDX13^^0^B9753753 -"BLD",7915,"KRN",9.8,"NM",12,0) +"BLD",7653,"KRN",9.8,"NM",11,0) +BSDX13^^0^B9772451 +"BLD",7653,"KRN",9.8,"NM",12,0) BSDX14^^0^B6450810 -"BLD",7915,"KRN",9.8,"NM",13,0) +"BLD",7653,"KRN",9.8,"NM",13,0) BSDX15^^0^B5327807 -"BLD",7915,"KRN",9.8,"NM",14,0) +"BLD",7653,"KRN",9.8,"NM",14,0) BSDX16^^0^B11948965 -"BLD",7915,"KRN",9.8,"NM",15,0) +"BLD",7653,"KRN",9.8,"NM",15,0) BSDX17^^0^B2072173 -"BLD",7915,"KRN",9.8,"NM",16,0) +"BLD",7653,"KRN",9.8,"NM",16,0) BSDX18^^0^B87953431 -"BLD",7915,"KRN",9.8,"NM",17,0) +"BLD",7653,"KRN",9.8,"NM",17,0) BSDX19^^0^B7890401 -"BLD",7915,"KRN",9.8,"NM",18,0) +"BLD",7653,"KRN",9.8,"NM",18,0) BSDX20^^0^B5911607 -"BLD",7915,"KRN",9.8,"NM",19,0) +"BLD",7653,"KRN",9.8,"NM",19,0) BSDX21^^0^B8672065 -"BLD",7915,"KRN",9.8,"NM",20,0) +"BLD",7653,"KRN",9.8,"NM",20,0) BSDX22^^0^B9479861 -"BLD",7915,"KRN",9.8,"NM",21,0) +"BLD",7653,"KRN",9.8,"NM",21,0) BSDX23^^0^B8488013 -"BLD",7915,"KRN",9.8,"NM",22,0) +"BLD",7653,"KRN",9.8,"NM",22,0) BSDX24^^0^B13455014 -"BLD",7915,"KRN",9.8,"NM",23,0) +"BLD",7653,"KRN",9.8,"NM",23,0) BSDX25^^0^B16070744 -"BLD",7915,"KRN",9.8,"NM",24,0) -BSDX26^^0^B3226136 -"BLD",7915,"KRN",9.8,"NM",25,0) -BSDX27^^0^B97105556 -"BLD",7915,"KRN",9.8,"NM",26,0) +"BLD",7653,"KRN",9.8,"NM",24,0) +BSDX26^^0^B30714245 +"BLD",7653,"KRN",9.8,"NM",25,0) +BSDX27^^0^B133007616 +"BLD",7653,"KRN",9.8,"NM",26,0) BSDX28^^0^B32389827 -"BLD",7915,"KRN",9.8,"NM",27,0) -BSDX29^^0^B39369778 -"BLD",7915,"KRN",9.8,"NM",28,0) +"BLD",7653,"KRN",9.8,"NM",27,0) +BSDX29^^0^B51424449 +"BLD",7653,"KRN",9.8,"NM",28,0) BSDX30^^0^B6616255 -"BLD",7915,"KRN",9.8,"NM",29,0) -BSDX31^^0^B23243257 -"BLD",7915,"KRN",9.8,"NM",30,0) +"BLD",7653,"KRN",9.8,"NM",29,0) +BSDX31^^0^B67823338 +"BLD",7653,"KRN",9.8,"NM",30,0) BSDX32^^0^B17196738 -"BLD",7915,"KRN",9.8,"NM",31,0) +"BLD",7653,"KRN",9.8,"NM",31,0) BSDX33^^0^B14923306 -"BLD",7915,"KRN",9.8,"NM",32,0) +"BLD",7653,"KRN",9.8,"NM",32,0) BSDX34^^0^B43182525 -"BLD",7915,"KRN",9.8,"NM",33,0) +"BLD",7653,"KRN",9.8,"NM",33,0) BSDX35^^0^B8147998 -"BLD",7915,"KRN",9.8,"NM",34,0) +"BLD",7653,"KRN",9.8,"NM",34,0) BSDX11^^0^B6358791 -"BLD",7915,"KRN",9.8,"NM",35,0) -BSDXAPI^^0^B85422550 -"BLD",7915,"KRN",9.8,"NM",36,0) -BSDXGPRV^^0^B6645474 -"BLD",7915,"KRN",9.8,"NM","B","BSDX01",1) +"BLD",7653,"KRN",9.8,"NM",35,0) +BSDXAPI^^0^B105784370 +"BLD",7653,"KRN",9.8,"NM",36,0) +BSDXGPRV^^0^B4804670 +"BLD",7653,"KRN",9.8,"NM","B","BSDX01",1) -"BLD",7915,"KRN",9.8,"NM","B","BSDX02",2) +"BLD",7653,"KRN",9.8,"NM","B","BSDX02",2) -"BLD",7915,"KRN",9.8,"NM","B","BSDX03",3) +"BLD",7653,"KRN",9.8,"NM","B","BSDX03",3) -"BLD",7915,"KRN",9.8,"NM","B","BSDX04",4) +"BLD",7653,"KRN",9.8,"NM","B","BSDX04",4) -"BLD",7915,"KRN",9.8,"NM","B","BSDX05",5) +"BLD",7653,"KRN",9.8,"NM","B","BSDX05",5) -"BLD",7915,"KRN",9.8,"NM","B","BSDX06",6) +"BLD",7653,"KRN",9.8,"NM","B","BSDX06",6) -"BLD",7915,"KRN",9.8,"NM","B","BSDX07",7) +"BLD",7653,"KRN",9.8,"NM","B","BSDX07",7) -"BLD",7915,"KRN",9.8,"NM","B","BSDX08",8) +"BLD",7653,"KRN",9.8,"NM","B","BSDX08",8) -"BLD",7915,"KRN",9.8,"NM","B","BSDX09",9) +"BLD",7653,"KRN",9.8,"NM","B","BSDX09",9) -"BLD",7915,"KRN",9.8,"NM","B","BSDX11",34) +"BLD",7653,"KRN",9.8,"NM","B","BSDX11",34) -"BLD",7915,"KRN",9.8,"NM","B","BSDX12",10) +"BLD",7653,"KRN",9.8,"NM","B","BSDX12",10) -"BLD",7915,"KRN",9.8,"NM","B","BSDX13",11) +"BLD",7653,"KRN",9.8,"NM","B","BSDX13",11) -"BLD",7915,"KRN",9.8,"NM","B","BSDX14",12) +"BLD",7653,"KRN",9.8,"NM","B","BSDX14",12) -"BLD",7915,"KRN",9.8,"NM","B","BSDX15",13) +"BLD",7653,"KRN",9.8,"NM","B","BSDX15",13) -"BLD",7915,"KRN",9.8,"NM","B","BSDX16",14) +"BLD",7653,"KRN",9.8,"NM","B","BSDX16",14) -"BLD",7915,"KRN",9.8,"NM","B","BSDX17",15) +"BLD",7653,"KRN",9.8,"NM","B","BSDX17",15) -"BLD",7915,"KRN",9.8,"NM","B","BSDX18",16) +"BLD",7653,"KRN",9.8,"NM","B","BSDX18",16) -"BLD",7915,"KRN",9.8,"NM","B","BSDX19",17) +"BLD",7653,"KRN",9.8,"NM","B","BSDX19",17) -"BLD",7915,"KRN",9.8,"NM","B","BSDX20",18) +"BLD",7653,"KRN",9.8,"NM","B","BSDX20",18) -"BLD",7915,"KRN",9.8,"NM","B","BSDX21",19) +"BLD",7653,"KRN",9.8,"NM","B","BSDX21",19) -"BLD",7915,"KRN",9.8,"NM","B","BSDX22",20) +"BLD",7653,"KRN",9.8,"NM","B","BSDX22",20) -"BLD",7915,"KRN",9.8,"NM","B","BSDX23",21) +"BLD",7653,"KRN",9.8,"NM","B","BSDX23",21) -"BLD",7915,"KRN",9.8,"NM","B","BSDX24",22) +"BLD",7653,"KRN",9.8,"NM","B","BSDX24",22) -"BLD",7915,"KRN",9.8,"NM","B","BSDX25",23) +"BLD",7653,"KRN",9.8,"NM","B","BSDX25",23) -"BLD",7915,"KRN",9.8,"NM","B","BSDX26",24) +"BLD",7653,"KRN",9.8,"NM","B","BSDX26",24) -"BLD",7915,"KRN",9.8,"NM","B","BSDX27",25) +"BLD",7653,"KRN",9.8,"NM","B","BSDX27",25) -"BLD",7915,"KRN",9.8,"NM","B","BSDX28",26) +"BLD",7653,"KRN",9.8,"NM","B","BSDX28",26) -"BLD",7915,"KRN",9.8,"NM","B","BSDX29",27) +"BLD",7653,"KRN",9.8,"NM","B","BSDX29",27) -"BLD",7915,"KRN",9.8,"NM","B","BSDX30",28) +"BLD",7653,"KRN",9.8,"NM","B","BSDX30",28) -"BLD",7915,"KRN",9.8,"NM","B","BSDX31",29) +"BLD",7653,"KRN",9.8,"NM","B","BSDX31",29) -"BLD",7915,"KRN",9.8,"NM","B","BSDX32",30) +"BLD",7653,"KRN",9.8,"NM","B","BSDX32",30) -"BLD",7915,"KRN",9.8,"NM","B","BSDX33",31) +"BLD",7653,"KRN",9.8,"NM","B","BSDX33",31) -"BLD",7915,"KRN",9.8,"NM","B","BSDX34",32) +"BLD",7653,"KRN",9.8,"NM","B","BSDX34",32) -"BLD",7915,"KRN",9.8,"NM","B","BSDX35",33) +"BLD",7653,"KRN",9.8,"NM","B","BSDX35",33) -"BLD",7915,"KRN",9.8,"NM","B","BSDXAPI",35) +"BLD",7653,"KRN",9.8,"NM","B","BSDXAPI",35) -"BLD",7915,"KRN",9.8,"NM","B","BSDXGPRV",36) +"BLD",7653,"KRN",9.8,"NM","B","BSDXGPRV",36) -"BLD",7915,"KRN",19,0) +"BLD",7653,"KRN",19,0) 19 -"BLD",7915,"KRN",19,"NM",0) +"BLD",7653,"KRN",19,"NM",0) ^9.68A^1^1 -"BLD",7915,"KRN",19,"NM",1,0) +"BLD",7653,"KRN",19,"NM",1,0) BSDXRPC^^0 -"BLD",7915,"KRN",19,"NM","B","BSDXRPC",1) +"BLD",7653,"KRN",19,"NM","B","BSDXRPC",1) -"BLD",7915,"KRN",19.1,0) +"BLD",7653,"KRN",19.1,0) 19.1 -"BLD",7915,"KRN",19.1,"NM",0) +"BLD",7653,"KRN",19.1,"NM",0) ^9.68A^2^2 -"BLD",7915,"KRN",19.1,"NM",1,0) +"BLD",7653,"KRN",19.1,"NM",1,0) BSDXZMENU^^0 -"BLD",7915,"KRN",19.1,"NM",2,0) +"BLD",7653,"KRN",19.1,"NM",2,0) BSDXZMGR^^0 -"BLD",7915,"KRN",19.1,"NM","B","BSDXZMENU",1) +"BLD",7653,"KRN",19.1,"NM","B","BSDXZMENU",1) -"BLD",7915,"KRN",19.1,"NM","B","BSDXZMGR",2) +"BLD",7653,"KRN",19.1,"NM","B","BSDXZMGR",2) -"BLD",7915,"KRN",101,0) +"BLD",7653,"KRN",101,0) 101 -"BLD",7915,"KRN",101,"NM",0) +"BLD",7653,"KRN",101,"NM",0) ^9.68A^4^4 -"BLD",7915,"KRN",101,"NM",1,0) +"BLD",7653,"KRN",101,"NM",1,0) BSDX ADD APPOINTMENT^^0 -"BLD",7915,"KRN",101,"NM",2,0) +"BLD",7653,"KRN",101,"NM",2,0) BSDX CANCEL APPOINTMENT^^0 -"BLD",7915,"KRN",101,"NM",3,0) +"BLD",7653,"KRN",101,"NM",3,0) BSDX CHECKIN APPOINTMENT^^0 -"BLD",7915,"KRN",101,"NM",4,0) +"BLD",7653,"KRN",101,"NM",4,0) BSDX NOSHOW APPOINTMENT^^0 -"BLD",7915,"KRN",101,"NM","B","BSDX ADD APPOINTMENT",1) +"BLD",7653,"KRN",101,"NM","B","BSDX ADD APPOINTMENT",1) -"BLD",7915,"KRN",101,"NM","B","BSDX CANCEL APPOINTMENT",2) +"BLD",7653,"KRN",101,"NM","B","BSDX CANCEL APPOINTMENT",2) -"BLD",7915,"KRN",101,"NM","B","BSDX CHECKIN APPOINTMENT",3) +"BLD",7653,"KRN",101,"NM","B","BSDX CHECKIN APPOINTMENT",3) -"BLD",7915,"KRN",101,"NM","B","BSDX NOSHOW APPOINTMENT",4) +"BLD",7653,"KRN",101,"NM","B","BSDX NOSHOW APPOINTMENT",4) -"BLD",7915,"KRN",409.61,0) +"BLD",7653,"KRN",409.61,0) 409.61 -"BLD",7915,"KRN",771,0) +"BLD",7653,"KRN",771,0) 771 -"BLD",7915,"KRN",779.2,0) -779.2 -"BLD",7915,"KRN",870,0) +"BLD",7653,"KRN",870,0) 870 -"BLD",7915,"KRN",8989.51,0) +"BLD",7653,"KRN",8989.51,0) 8989.51 -"BLD",7915,"KRN",8989.52,0) +"BLD",7653,"KRN",8989.52,0) 8989.52 -"BLD",7915,"KRN",8994,0) +"BLD",7653,"KRN",8994,0) 8994 -"BLD",7915,"KRN",8994,"NM",0) +"BLD",7653,"KRN",8994,"NM",0) ^9.68A^59^56 -"BLD",7915,"KRN",8994,"NM",1,0) +"BLD",7653,"KRN",8994,"NM",1,0) BSDX ADD NEW APPOINTMENT^^0 -"BLD",7915,"KRN",8994,"NM",2,0) +"BLD",7653,"KRN",8994,"NM",2,0) BSDX ADD NEW AVAILABILITY^^0 -"BLD",7915,"KRN",8994,"NM",3,0) +"BLD",7653,"KRN",8994,"NM",3,0) BSDX APPT BLOCKS OVERLAP^^0 -"BLD",7915,"KRN",8994,"NM",4,0) +"BLD",7653,"KRN",8994,"NM",4,0) BSDX CANCEL APPOINTMENT^^0 -"BLD",7915,"KRN",8994,"NM",5,0) +"BLD",7653,"KRN",8994,"NM",5,0) BSDX CANCEL AVAILABILITY^^0 -"BLD",7915,"KRN",8994,"NM",6,0) +"BLD",7653,"KRN",8994,"NM",6,0) BSDX CREATE APPT SCHEDULE^^0 -"BLD",7915,"KRN",8994,"NM",7,0) +"BLD",7653,"KRN",8994,"NM",7,0) BSDX CREATE ASGND SLOT SCHED^^0 -"BLD",7915,"KRN",8994,"NM",10,0) +"BLD",7653,"KRN",8994,"NM",10,0) BSDX GET BASIC REG INFO^^0 -"BLD",7915,"KRN",8994,"NM",12,0) +"BLD",7653,"KRN",8994,"NM",12,0) BSDX TYPE BLOCKS OVERLAP^^0 -"BLD",7915,"KRN",8994,"NM",13,0) +"BLD",7653,"KRN",8994,"NM",13,0) BSDX ADD/EDIT ACCESS TYPE^^0 -"BLD",7915,"KRN",8994,"NM",14,0) +"BLD",7653,"KRN",8994,"NM",14,0) BSDX GET ACCESS GROUP TYPES^^0 -"BLD",7915,"KRN",8994,"NM",15,0) +"BLD",7653,"KRN",8994,"NM",15,0) BSDX GROUP RESOURCE^^0 -"BLD",7915,"KRN",8994,"NM",16,0) +"BLD",7653,"KRN",8994,"NM",16,0) BSDX RESOURCE GROUPS BY USER^^0 -"BLD",7915,"KRN",8994,"NM",17,0) +"BLD",7653,"KRN",8994,"NM",17,0) BSDX ADD/EDIT RESOURCEUSER^^0 -"BLD",7915,"KRN",8994,"NM",18,0) +"BLD",7653,"KRN",8994,"NM",18,0) BSDX DELETE RESOURCEUSER^^0 -"BLD",7915,"KRN",8994,"NM",19,0) +"BLD",7653,"KRN",8994,"NM",19,0) BSDX SCHEDULE USER^^0 -"BLD",7915,"KRN",8994,"NM",20,0) +"BLD",7653,"KRN",8994,"NM",20,0) BSDX ADD/EDIT RESOURCE^^0 -"BLD",7915,"KRN",8994,"NM",21,0) +"BLD",7653,"KRN",8994,"NM",21,0) BSDX SCHEDULING USER INFO^^0 -"BLD",7915,"KRN",8994,"NM",22,0) +"BLD",7653,"KRN",8994,"NM",22,0) BSDX RESOURCES^^0 -"BLD",7915,"KRN",8994,"NM",23,0) +"BLD",7653,"KRN",8994,"NM",23,0) BSDX ADD/EDIT RESOURCE GROUP^^0 -"BLD",7915,"KRN",8994,"NM",24,0) +"BLD",7653,"KRN",8994,"NM",24,0) BSDX DELETE RESOURCE GROUP^^0 -"BLD",7915,"KRN",8994,"NM",25,0) +"BLD",7653,"KRN",8994,"NM",25,0) BSDX DELETE RES GROUP ITEM^^0 -"BLD",7915,"KRN",8994,"NM",26,0) +"BLD",7653,"KRN",8994,"NM",26,0) BSDX DEPARTMENT RESOURCE^^0 -"BLD",7915,"KRN",8994,"NM",27,0) +"BLD",7653,"KRN",8994,"NM",27,0) BSDX DEPARTMENTS BY USER^^0 -"BLD",7915,"KRN",8994,"NM",28,0) +"BLD",7653,"KRN",8994,"NM",28,0) BSDX RESOURCES BY USER^^0 -"BLD",7915,"KRN",8994,"NM",29,0) +"BLD",7653,"KRN",8994,"NM",29,0) BSDX ADD ACCESS GROUP ITEM^^0 -"BLD",7915,"KRN",8994,"NM",30,0) +"BLD",7653,"KRN",8994,"NM",30,0) BSDX ADD RES GROUP ITEM^^0 -"BLD",7915,"KRN",8994,"NM",31,0) +"BLD",7653,"KRN",8994,"NM",31,0) BSDX ADD/EDIT ACCESS GROUP^^0 -"BLD",7915,"KRN",8994,"NM",32,0) +"BLD",7653,"KRN",8994,"NM",32,0) BSDX DELETE ACCESS GROUP^^0 -"BLD",7915,"KRN",8994,"NM",33,0) +"BLD",7653,"KRN",8994,"NM",33,0) BSDX DELETE ACCESS GROUP ITEM^^0 -"BLD",7915,"KRN",8994,"NM",34,0) +"BLD",7653,"KRN",8994,"NM",34,0) BSDX REGISTER EVENT^^0 -"BLD",7915,"KRN",8994,"NM",35,0) +"BLD",7653,"KRN",8994,"NM",35,0) BSDX UNREGISTER EVENT^^0 -"BLD",7915,"KRN",8994,"NM",36,0) +"BLD",7653,"KRN",8994,"NM",36,0) BSDX RAISE EVENT^^0 -"BLD",7915,"KRN",8994,"NM",37,0) +"BLD",7653,"KRN",8994,"NM",37,0) BSDX SEARCH AVAILABILITY^^0 -"BLD",7915,"KRN",8994,"NM",38,0) +"BLD",7653,"KRN",8994,"NM",38,0) BSDX CHECKIN APPOINTMENT^^0 -"BLD",7915,"KRN",8994,"NM",39,0) +"BLD",7653,"KRN",8994,"NM",39,0) BSDX EDIT APPOINTMENT^^0 -"BLD",7915,"KRN",8994,"NM",40,0) +"BLD",7653,"KRN",8994,"NM",40,0) BSDX PATIENT APPT DISPLAY^^0 -"BLD",7915,"KRN",8994,"NM",41,0) +"BLD",7653,"KRN",8994,"NM",41,0) BSDXPatientLookupRS^^0 -"BLD",7915,"KRN",8994,"NM",42,0) +"BLD",7653,"KRN",8994,"NM",42,0) BSDX SPACEBAR SET^^0 -"BLD",7915,"KRN",8994,"NM",43,0) +"BLD",7653,"KRN",8994,"NM",43,0) BSDX COPY APPOINTMENT CANCEL^^0 -"BLD",7915,"KRN",8994,"NM",44,0) +"BLD",7653,"KRN",8994,"NM",44,0) BSDX COPY APPOINTMENT STATUS^^0 -"BLD",7915,"KRN",8994,"NM",45,0) +"BLD",7653,"KRN",8994,"NM",45,0) BSDX COPY APPOINTMENTS^^0 -"BLD",7915,"KRN",8994,"NM",46,0) +"BLD",7653,"KRN",8994,"NM",46,0) BSDX CLINIC LETTERS^^0 -"BLD",7915,"KRN",8994,"NM",47,0) +"BLD",7653,"KRN",8994,"NM",47,0) BSDX NOSHOW^^0 -"BLD",7915,"KRN",8994,"NM",48,0) +"BLD",7653,"KRN",8994,"NM",48,0) BSDX IM HERE^^0 -"BLD",7915,"KRN",8994,"NM",49,0) +"BLD",7653,"KRN",8994,"NM",49,0) BSDX HOSPITAL LOCATION^^0 -"BLD",7915,"KRN",8994,"NM",50,0) +"BLD",7653,"KRN",8994,"NM",50,0) BSDX CLINIC SETUP^^0 -"BLD",7915,"KRN",8994,"NM",51,0) +"BLD",7653,"KRN",8994,"NM",51,0) BSDX REBOOK LIST^^0 -"BLD",7915,"KRN",8994,"NM",52,0) +"BLD",7653,"KRN",8994,"NM",52,0) BSDX REBOOK CLINIC LIST^^0 -"BLD",7915,"KRN",8994,"NM",53,0) +"BLD",7653,"KRN",8994,"NM",53,0) BSDX REBOOK SET^^0 -"BLD",7915,"KRN",8994,"NM",54,0) +"BLD",7653,"KRN",8994,"NM",54,0) BSDX RESOURCE LETTERS^^0 -"BLD",7915,"KRN",8994,"NM",55,0) +"BLD",7653,"KRN",8994,"NM",55,0) BSDX CANCEL CLINIC LIST^^0 -"BLD",7915,"KRN",8994,"NM",56,0) +"BLD",7653,"KRN",8994,"NM",56,0) BSDX CANCEL AV BY DATE^^0 -"BLD",7915,"KRN",8994,"NM",57,0) +"BLD",7653,"KRN",8994,"NM",57,0) BSDX REBOOK NEXT BLOCK^^0 -"BLD",7915,"KRN",8994,"NM",58,0) +"BLD",7653,"KRN",8994,"NM",58,0) BSDX EHR PATIENT^^0 -"BLD",7915,"KRN",8994,"NM",59,0) +"BLD",7653,"KRN",8994,"NM",59,0) BSDX HOSP LOC PROVIDERS^^0 -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD ACCESS GROUP ITEM",29) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD ACCESS GROUP ITEM",29) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD NEW APPOINTMENT",1) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD NEW APPOINTMENT",1) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD NEW AVAILABILITY",2) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD NEW AVAILABILITY",2) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD RES GROUP ITEM",30) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD RES GROUP ITEM",30) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD/EDIT ACCESS GROUP",31) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD/EDIT ACCESS GROUP",31) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD/EDIT ACCESS TYPE",13) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD/EDIT ACCESS TYPE",13) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCE",20) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCE",20) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCE GROUP",23) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCE GROUP",23) -"BLD",7915,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCEUSER",17) +"BLD",7653,"KRN",8994,"NM","B","BSDX ADD/EDIT RESOURCEUSER",17) -"BLD",7915,"KRN",8994,"NM","B","BSDX APPT BLOCKS OVERLAP",3) +"BLD",7653,"KRN",8994,"NM","B","BSDX APPT BLOCKS OVERLAP",3) -"BLD",7915,"KRN",8994,"NM","B","BSDX CANCEL APPOINTMENT",4) +"BLD",7653,"KRN",8994,"NM","B","BSDX CANCEL APPOINTMENT",4) -"BLD",7915,"KRN",8994,"NM","B","BSDX CANCEL AV BY DATE",56) +"BLD",7653,"KRN",8994,"NM","B","BSDX CANCEL AV BY DATE",56) -"BLD",7915,"KRN",8994,"NM","B","BSDX CANCEL AVAILABILITY",5) +"BLD",7653,"KRN",8994,"NM","B","BSDX CANCEL AVAILABILITY",5) -"BLD",7915,"KRN",8994,"NM","B","BSDX CANCEL CLINIC LIST",55) +"BLD",7653,"KRN",8994,"NM","B","BSDX CANCEL CLINIC LIST",55) -"BLD",7915,"KRN",8994,"NM","B","BSDX CHECKIN APPOINTMENT",38) +"BLD",7653,"KRN",8994,"NM","B","BSDX CHECKIN APPOINTMENT",38) -"BLD",7915,"KRN",8994,"NM","B","BSDX CLINIC LETTERS",46) +"BLD",7653,"KRN",8994,"NM","B","BSDX CLINIC LETTERS",46) -"BLD",7915,"KRN",8994,"NM","B","BSDX CLINIC SETUP",50) +"BLD",7653,"KRN",8994,"NM","B","BSDX CLINIC SETUP",50) -"BLD",7915,"KRN",8994,"NM","B","BSDX COPY APPOINTMENT CANCEL",43) +"BLD",7653,"KRN",8994,"NM","B","BSDX COPY APPOINTMENT CANCEL",43) -"BLD",7915,"KRN",8994,"NM","B","BSDX COPY APPOINTMENT STATUS",44) +"BLD",7653,"KRN",8994,"NM","B","BSDX COPY APPOINTMENT STATUS",44) -"BLD",7915,"KRN",8994,"NM","B","BSDX COPY APPOINTMENTS",45) +"BLD",7653,"KRN",8994,"NM","B","BSDX COPY APPOINTMENTS",45) -"BLD",7915,"KRN",8994,"NM","B","BSDX CREATE APPT SCHEDULE",6) +"BLD",7653,"KRN",8994,"NM","B","BSDX CREATE APPT SCHEDULE",6) -"BLD",7915,"KRN",8994,"NM","B","BSDX CREATE ASGND SLOT SCHED",7) +"BLD",7653,"KRN",8994,"NM","B","BSDX CREATE ASGND SLOT SCHED",7) -"BLD",7915,"KRN",8994,"NM","B","BSDX DELETE ACCESS GROUP",32) +"BLD",7653,"KRN",8994,"NM","B","BSDX DELETE ACCESS GROUP",32) -"BLD",7915,"KRN",8994,"NM","B","BSDX DELETE ACCESS GROUP ITEM",33) +"BLD",7653,"KRN",8994,"NM","B","BSDX DELETE ACCESS GROUP ITEM",33) -"BLD",7915,"KRN",8994,"NM","B","BSDX DELETE RES GROUP ITEM",25) +"BLD",7653,"KRN",8994,"NM","B","BSDX DELETE RES GROUP ITEM",25) -"BLD",7915,"KRN",8994,"NM","B","BSDX DELETE RESOURCE GROUP",24) +"BLD",7653,"KRN",8994,"NM","B","BSDX DELETE RESOURCE GROUP",24) -"BLD",7915,"KRN",8994,"NM","B","BSDX DELETE RESOURCEUSER",18) +"BLD",7653,"KRN",8994,"NM","B","BSDX DELETE RESOURCEUSER",18) -"BLD",7915,"KRN",8994,"NM","B","BSDX DEPARTMENT RESOURCE",26) +"BLD",7653,"KRN",8994,"NM","B","BSDX DEPARTMENT RESOURCE",26) -"BLD",7915,"KRN",8994,"NM","B","BSDX DEPARTMENTS BY USER",27) +"BLD",7653,"KRN",8994,"NM","B","BSDX DEPARTMENTS BY USER",27) -"BLD",7915,"KRN",8994,"NM","B","BSDX EDIT APPOINTMENT",39) +"BLD",7653,"KRN",8994,"NM","B","BSDX EDIT APPOINTMENT",39) -"BLD",7915,"KRN",8994,"NM","B","BSDX EHR PATIENT",58) +"BLD",7653,"KRN",8994,"NM","B","BSDX EHR PATIENT",58) -"BLD",7915,"KRN",8994,"NM","B","BSDX GET ACCESS GROUP TYPES",14) +"BLD",7653,"KRN",8994,"NM","B","BSDX GET ACCESS GROUP TYPES",14) -"BLD",7915,"KRN",8994,"NM","B","BSDX GET BASIC REG INFO",10) +"BLD",7653,"KRN",8994,"NM","B","BSDX GET BASIC REG INFO",10) -"BLD",7915,"KRN",8994,"NM","B","BSDX GROUP RESOURCE",15) +"BLD",7653,"KRN",8994,"NM","B","BSDX GROUP RESOURCE",15) -"BLD",7915,"KRN",8994,"NM","B","BSDX HOSP LOC PROVIDERS",59) +"BLD",7653,"KRN",8994,"NM","B","BSDX HOSP LOC PROVIDERS",59) -"BLD",7915,"KRN",8994,"NM","B","BSDX HOSPITAL LOCATION",49) +"BLD",7653,"KRN",8994,"NM","B","BSDX HOSPITAL LOCATION",49) -"BLD",7915,"KRN",8994,"NM","B","BSDX IM HERE",48) +"BLD",7653,"KRN",8994,"NM","B","BSDX IM HERE",48) -"BLD",7915,"KRN",8994,"NM","B","BSDX NOSHOW",47) +"BLD",7653,"KRN",8994,"NM","B","BSDX NOSHOW",47) -"BLD",7915,"KRN",8994,"NM","B","BSDX PATIENT APPT DISPLAY",40) +"BLD",7653,"KRN",8994,"NM","B","BSDX PATIENT APPT DISPLAY",40) -"BLD",7915,"KRN",8994,"NM","B","BSDX RAISE EVENT",36) +"BLD",7653,"KRN",8994,"NM","B","BSDX RAISE EVENT",36) -"BLD",7915,"KRN",8994,"NM","B","BSDX REBOOK CLINIC LIST",52) +"BLD",7653,"KRN",8994,"NM","B","BSDX REBOOK CLINIC LIST",52) -"BLD",7915,"KRN",8994,"NM","B","BSDX REBOOK LIST",51) +"BLD",7653,"KRN",8994,"NM","B","BSDX REBOOK LIST",51) -"BLD",7915,"KRN",8994,"NM","B","BSDX REBOOK NEXT BLOCK",57) +"BLD",7653,"KRN",8994,"NM","B","BSDX REBOOK NEXT BLOCK",57) -"BLD",7915,"KRN",8994,"NM","B","BSDX REBOOK SET",53) +"BLD",7653,"KRN",8994,"NM","B","BSDX REBOOK SET",53) -"BLD",7915,"KRN",8994,"NM","B","BSDX REGISTER EVENT",34) +"BLD",7653,"KRN",8994,"NM","B","BSDX REGISTER EVENT",34) -"BLD",7915,"KRN",8994,"NM","B","BSDX RESOURCE GROUPS BY USER",16) +"BLD",7653,"KRN",8994,"NM","B","BSDX RESOURCE GROUPS BY USER",16) -"BLD",7915,"KRN",8994,"NM","B","BSDX RESOURCE LETTERS",54) +"BLD",7653,"KRN",8994,"NM","B","BSDX RESOURCE LETTERS",54) -"BLD",7915,"KRN",8994,"NM","B","BSDX RESOURCES",22) +"BLD",7653,"KRN",8994,"NM","B","BSDX RESOURCES",22) -"BLD",7915,"KRN",8994,"NM","B","BSDX RESOURCES BY USER",28) +"BLD",7653,"KRN",8994,"NM","B","BSDX RESOURCES BY USER",28) -"BLD",7915,"KRN",8994,"NM","B","BSDX SCHEDULE USER",19) +"BLD",7653,"KRN",8994,"NM","B","BSDX SCHEDULE USER",19) -"BLD",7915,"KRN",8994,"NM","B","BSDX SCHEDULING USER INFO",21) +"BLD",7653,"KRN",8994,"NM","B","BSDX SCHEDULING USER INFO",21) -"BLD",7915,"KRN",8994,"NM","B","BSDX SEARCH AVAILABILITY",37) +"BLD",7653,"KRN",8994,"NM","B","BSDX SEARCH AVAILABILITY",37) -"BLD",7915,"KRN",8994,"NM","B","BSDX SPACEBAR SET",42) +"BLD",7653,"KRN",8994,"NM","B","BSDX SPACEBAR SET",42) -"BLD",7915,"KRN",8994,"NM","B","BSDX TYPE BLOCKS OVERLAP",12) +"BLD",7653,"KRN",8994,"NM","B","BSDX TYPE BLOCKS OVERLAP",12) -"BLD",7915,"KRN",8994,"NM","B","BSDX UNREGISTER EVENT",35) +"BLD",7653,"KRN",8994,"NM","B","BSDX UNREGISTER EVENT",35) -"BLD",7915,"KRN",8994,"NM","B","BSDXPatientLookupRS",41) +"BLD",7653,"KRN",8994,"NM","B","BSDXPatientLookupRS",41) -"BLD",7915,"KRN","B",.4,.4) +"BLD",7653,"KRN","B",.4,.4) -"BLD",7915,"KRN","B",.401,.401) +"BLD",7653,"KRN","B",.401,.401) -"BLD",7915,"KRN","B",.402,.402) +"BLD",7653,"KRN","B",.402,.402) -"BLD",7915,"KRN","B",.403,.403) +"BLD",7653,"KRN","B",.403,.403) -"BLD",7915,"KRN","B",.5,.5) +"BLD",7653,"KRN","B",.5,.5) -"BLD",7915,"KRN","B",.84,.84) +"BLD",7653,"KRN","B",.84,.84) -"BLD",7915,"KRN","B",3.6,3.6) +"BLD",7653,"KRN","B",3.6,3.6) -"BLD",7915,"KRN","B",3.8,3.8) +"BLD",7653,"KRN","B",3.8,3.8) -"BLD",7915,"KRN","B",9.2,9.2) +"BLD",7653,"KRN","B",9.2,9.2) -"BLD",7915,"KRN","B",9.8,9.8) +"BLD",7653,"KRN","B",9.8,9.8) -"BLD",7915,"KRN","B",19,19) +"BLD",7653,"KRN","B",19,19) -"BLD",7915,"KRN","B",19.1,19.1) +"BLD",7653,"KRN","B",19.1,19.1) -"BLD",7915,"KRN","B",101,101) +"BLD",7653,"KRN","B",101,101) -"BLD",7915,"KRN","B",409.61,409.61) +"BLD",7653,"KRN","B",409.61,409.61) -"BLD",7915,"KRN","B",771,771) +"BLD",7653,"KRN","B",771,771) -"BLD",7915,"KRN","B",779.2,779.2) +"BLD",7653,"KRN","B",870,870) -"BLD",7915,"KRN","B",870,870) +"BLD",7653,"KRN","B",8989.51,8989.51) -"BLD",7915,"KRN","B",8989.51,8989.51) +"BLD",7653,"KRN","B",8989.52,8989.52) -"BLD",7915,"KRN","B",8989.52,8989.52) +"BLD",7653,"KRN","B",8994,8994) -"BLD",7915,"KRN","B",8994,8994) - -"BLD",7915,"PRE") +"BLD",7653,"PRE") BSDX2E -"BLD",7915,"QUES",0) +"BLD",7653,"QUES",0) ^9.62^^ -"BLD",7915,"REQB",0) +"BLD",7653,"REQB",0) ^9.611^^ "DATA",9002018.5,1,0) -1^41^3100929.1043 +1^42^3101207.0043 "FIA",9002018.1) BSDX RESOURCE "FIA",9002018.1,0) @@ -585,7 +581,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.1,0,"RLRO") "FIA",9002018.1,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.1,9002018.1) 0 "FIA",9002018.1,9002018.11) @@ -611,7 +607,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.15,0,"RLRO") "FIA",9002018.15,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.15,9002018.15) 0 "FIA",9002018.2) @@ -629,7 +625,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.2,0,"RLRO") "FIA",9002018.2,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.2,9002018.2) 0 "FIA",9002018.2,9002018.21) @@ -649,7 +645,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.3,0,"RLRO") "FIA",9002018.3,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.3,9002018.3) 0 "FIA",9002018.3,9002018.31) @@ -669,7 +665,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.35,0,"RLRO") "FIA",9002018.35,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.35,9002018.35) 0 "FIA",9002018.38) @@ -687,7 +683,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.38,0,"RLRO") "FIA",9002018.38,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.38,9002018.38) 0 "FIA",9002018.39) @@ -705,7 +701,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.39,0,"RLRO") "FIA",9002018.39,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.39,9002018.39) 0 "FIA",9002018.4) @@ -723,7 +719,7 @@ y^y^f^^n^^n^o^n "FIA",9002018.4,0,"RLRO") "FIA",9002018.4,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.4,9002018.4) 0 "FIA",9002018.4,9002018.41) @@ -743,7 +739,7 @@ y^y^f^^n^^y^o^n "FIA",9002018.5,0,"RLRO") "FIA",9002018.5,0,"VR") -1.41^BSDX +1.42^BSDX "FIA",9002018.5,9002018.5) 0 "INIT") @@ -766,458 +762,458 @@ K ^BSDXAGTP("AC") 2^F^9002018.39^.02^30^2^F "IX",9002018.39,9002018.39,"AC",11.1,2,3) -"KRN",19,11052,-1) +"KRN",19,10987,-1) 0^1 -"KRN",19,11052,0) +"KRN",19,10987,0) BSDXRPC^WINDOWS SCHEDULING PROCEDURE CALLS^^B^^^^^^^^IHS Windows Scheduling -"KRN",19,11052,1,0) +"KRN",19,10987,1,0) ^19.06^4^4^3100618^^ -"KRN",19,11052,1,1,0) +"KRN",19,10987,1,1,0) This option hosts RPCs in the BSDX namespace. Windows Scheduling users -"KRN",19,11052,1,2,0) +"KRN",19,10987,1,2,0) mustg have access to this option -"KRN",19,11052,1,3,0) +"KRN",19,10987,1,3,0) -"KRN",19,11052,1,4,0) +"KRN",19,10987,1,4,0) in order to use Windows Scheduling. -"KRN",19,11052,99.1) +"KRN",19,10987,99.1) 61545,63078 -"KRN",19,11052,"RPC",0) +"KRN",19,10987,"RPC",0) ^19.05P^56^56 -"KRN",19,11052,"RPC",1,0) +"KRN",19,10987,"RPC",1,0) BSDX ADD ACCESS GROUP ITEM -"KRN",19,11052,"RPC",2,0) +"KRN",19,10987,"RPC",2,0) BSDX ADD NEW APPOINTMENT -"KRN",19,11052,"RPC",3,0) +"KRN",19,10987,"RPC",3,0) BSDX ADD NEW AVAILABILITY -"KRN",19,11052,"RPC",4,0) +"KRN",19,10987,"RPC",4,0) BSDX ADD RES GROUP ITEM -"KRN",19,11052,"RPC",5,0) +"KRN",19,10987,"RPC",5,0) BSDX ADD/EDIT ACCESS GROUP -"KRN",19,11052,"RPC",6,0) +"KRN",19,10987,"RPC",6,0) BSDX ADD/EDIT ACCESS TYPE -"KRN",19,11052,"RPC",7,0) +"KRN",19,10987,"RPC",7,0) BSDX ADD/EDIT RESOURCE -"KRN",19,11052,"RPC",8,0) +"KRN",19,10987,"RPC",8,0) BSDX ADD/EDIT RESOURCE GROUP -"KRN",19,11052,"RPC",9,0) +"KRN",19,10987,"RPC",9,0) BSDX ADD/EDIT RESOURCEUSER -"KRN",19,11052,"RPC",10,0) +"KRN",19,10987,"RPC",10,0) BSDX APPT BLOCKS OVERLAP -"KRN",19,11052,"RPC",11,0) +"KRN",19,10987,"RPC",11,0) BSDX CANCEL APPOINTMENT -"KRN",19,11052,"RPC",12,0) +"KRN",19,10987,"RPC",12,0) BSDX CANCEL AVAILABILITY -"KRN",19,11052,"RPC",13,0) +"KRN",19,10987,"RPC",13,0) BSDX CHECKIN APPOINTMENT -"KRN",19,11052,"RPC",14,0) +"KRN",19,10987,"RPC",14,0) BSDX CREATE APPT SCHEDULE -"KRN",19,11052,"RPC",15,0) +"KRN",19,10987,"RPC",15,0) BSDX CREATE ASGND SLOT SCHED -"KRN",19,11052,"RPC",16,0) +"KRN",19,10987,"RPC",16,0) BSDX DELETE ACCESS GROUP -"KRN",19,11052,"RPC",17,0) +"KRN",19,10987,"RPC",17,0) BSDX DELETE ACCESS GROUP ITEM -"KRN",19,11052,"RPC",18,0) +"KRN",19,10987,"RPC",18,0) BSDX DELETE RES GROUP ITEM -"KRN",19,11052,"RPC",19,0) +"KRN",19,10987,"RPC",19,0) BSDX DELETE RESOURCE GROUP -"KRN",19,11052,"RPC",20,0) +"KRN",19,10987,"RPC",20,0) BSDX DELETE RESOURCEUSER -"KRN",19,11052,"RPC",21,0) +"KRN",19,10987,"RPC",21,0) BSDX DEPARTMENT RESOURCE -"KRN",19,11052,"RPC",22,0) +"KRN",19,10987,"RPC",22,0) BSDX DEPARTMENTS BY USER -"KRN",19,11052,"RPC",23,0) +"KRN",19,10987,"RPC",23,0) BSDX EDIT APPOINTMENT -"KRN",19,11052,"RPC",24,0) +"KRN",19,10987,"RPC",24,0) BSDX GET ACCESS GROUP TYPES -"KRN",19,11052,"RPC",25,0) +"KRN",19,10987,"RPC",25,0) BSDX GET BASIC REG INFO -"KRN",19,11052,"RPC",26,0) +"KRN",19,10987,"RPC",26,0) BSDX GROUP RESOURCE -"KRN",19,11052,"RPC",27,0) +"KRN",19,10987,"RPC",27,0) BSDX PATIENT APPT DISPLAY -"KRN",19,11052,"RPC",28,0) +"KRN",19,10987,"RPC",28,0) BSDX RAISE EVENT -"KRN",19,11052,"RPC",29,0) +"KRN",19,10987,"RPC",29,0) BSDX REGISTER EVENT -"KRN",19,11052,"RPC",30,0) +"KRN",19,10987,"RPC",30,0) BSDX RESOURCE GROUPS BY USER -"KRN",19,11052,"RPC",31,0) +"KRN",19,10987,"RPC",31,0) BSDX RESOURCES -"KRN",19,11052,"RPC",32,0) +"KRN",19,10987,"RPC",32,0) BSDX RESOURCES BY USER -"KRN",19,11052,"RPC",33,0) +"KRN",19,10987,"RPC",33,0) BSDX SCHEDULE USER -"KRN",19,11052,"RPC",34,0) +"KRN",19,10987,"RPC",34,0) BSDX SCHEDULING USER INFO -"KRN",19,11052,"RPC",35,0) +"KRN",19,10987,"RPC",35,0) BSDX SEARCH AVAILABILITY -"KRN",19,11052,"RPC",36,0) +"KRN",19,10987,"RPC",36,0) BSDX TYPE BLOCKS OVERLAP -"KRN",19,11052,"RPC",37,0) +"KRN",19,10987,"RPC",37,0) BSDX UNREGISTER EVENT -"KRN",19,11052,"RPC",38,0) +"KRN",19,10987,"RPC",38,0) BSDXPatientLookupRS -"KRN",19,11052,"RPC",39,0) +"KRN",19,10987,"RPC",39,0) BSDX SPACEBAR SET -"KRN",19,11052,"RPC",40,0) +"KRN",19,10987,"RPC",40,0) BSDX COPY APPOINTMENTS -"KRN",19,11052,"RPC",41,0) +"KRN",19,10987,"RPC",41,0) BSDX COPY APPOINTMENT CANCEL -"KRN",19,11052,"RPC",42,0) +"KRN",19,10987,"RPC",42,0) BSDX COPY APPOINTMENT STATUS -"KRN",19,11052,"RPC",43,0) +"KRN",19,10987,"RPC",43,0) BSDX CLINIC LETTERS -"KRN",19,11052,"RPC",44,0) +"KRN",19,10987,"RPC",44,0) BSDX NOSHOW -"KRN",19,11052,"RPC",45,0) +"KRN",19,10987,"RPC",45,0) BSDX IM HERE -"KRN",19,11052,"RPC",46,0) +"KRN",19,10987,"RPC",46,0) BSDX HOSPITAL LOCATION -"KRN",19,11052,"RPC",47,0) +"KRN",19,10987,"RPC",47,0) BSDX CLINIC SETUP -"KRN",19,11052,"RPC",49,0) +"KRN",19,10987,"RPC",49,0) BSDX REBOOK LIST -"KRN",19,11052,"RPC",50,0) +"KRN",19,10987,"RPC",50,0) BSDX REBOOK CLINIC LIST -"KRN",19,11052,"RPC",51,0) +"KRN",19,10987,"RPC",51,0) BSDX REBOOK SET -"KRN",19,11052,"RPC",52,0) +"KRN",19,10987,"RPC",52,0) BSDX RESOURCE LETTERS -"KRN",19,11052,"RPC",53,0) +"KRN",19,10987,"RPC",53,0) BSDX CANCEL CLINIC LIST -"KRN",19,11052,"RPC",54,0) +"KRN",19,10987,"RPC",54,0) BSDX CANCEL AV BY DATE -"KRN",19,11052,"RPC",55,0) +"KRN",19,10987,"RPC",55,0) BSDX REBOOK NEXT BLOCK -"KRN",19,11052,"RPC",56,0) +"KRN",19,10987,"RPC",56,0) BSDX HOSP LOC PROVIDERS -"KRN",19,11052,"U") +"KRN",19,10987,"U") WINDOWS SCHEDULING PROCEDURE C -"KRN",19.1,488,-1) +"KRN",19.1,480,-1) 0^1 -"KRN",19.1,488,0) +"KRN",19.1,480,0) BSDXZMENU^IHS Windows Scheduling -"KRN",19.1,489,-1) +"KRN",19.1,481,-1) 0^2 -"KRN",19.1,489,0) +"KRN",19.1,481,0) BSDXZMGR^IHS Windows Scheduling Manager -"KRN",101,4299,-1) +"KRN",101,4262,-1) 0^2 -"KRN",101,4299,0) +"KRN",101,4262,0) BSDX CANCEL APPOINTMENT^BSDX CANCEL APPOINTMENT^^A^^^^^^^^ -"KRN",101,4299,1,0) +"KRN",101,4262,1,0) ^^4^4^3040915^ -"KRN",101,4299,1,1,0) +"KRN",101,4262,1,1,0) IHS protocol called by the PIMS v5.3 Scheduling Event Driver -"KRN",101,4299,1,2,0) +"KRN",101,4262,1,2,0) (BSDAM APPOINTMENT EVENTS). This protocol will -"KRN",101,4299,1,3,0) +"KRN",101,4262,1,3,0) cancel an appointment in the IHS Windows Scheduling package -"KRN",101,4299,1,4,0) +"KRN",101,4262,1,4,0) when the corresponding appointment in RPMS Scheduling is cancelled. -"KRN",101,4299,4) +"KRN",101,4262,4) ^^^BSDX CANCEL APPOINTMENT -"KRN",101,4299,20) +"KRN",101,4262,20) I $G(SDAMEVT)=2,$D(^BSDXAPPL) D CANEVT^BSDX08($G(DFN),$G(SDT),$G(SDCL)) -"KRN",101,4299,99) -61997,36371 -"KRN",101,4300,-1) +"KRN",101,4262,99) +61598,46412 +"KRN",101,4263,-1) 0^1 -"KRN",101,4300,0) +"KRN",101,4263,0) BSDX ADD APPOINTMENT^BSDX ADD APPOINTMENT^^A^^^^^^^^ -"KRN",101,4300,1,0) +"KRN",101,4263,1,0) ^101.06^4^4^3040915^^ -"KRN",101,4300,1,1,0) +"KRN",101,4263,1,1,0) IHS protocol called by the PIMS v5.3 Scheduling Event Driver -"KRN",101,4300,1,2,0) +"KRN",101,4263,1,2,0) (BSDAM APPOINTMENT EVENTS). This protocol will -"KRN",101,4300,1,3,0) +"KRN",101,4263,1,3,0) add an appointment in the IHS Windows Scheduling package -"KRN",101,4300,1,4,0) +"KRN",101,4263,1,4,0) when the corresponding appointment in RPMS Scheduling is added. -"KRN",101,4300,4) +"KRN",101,4263,4) ^^^BSDX ADD APPOINTMENT -"KRN",101,4300,20) +"KRN",101,4263,20) I $G(SDAMEVT)=1,$D(^BSDXAPPL) D ADDEVT^BSDX07($G(DFN),$G(SDT),$G(SDCL),$G(SDDA)) -"KRN",101,4300,99) -61997,36371 -"KRN",101,4301,-1) +"KRN",101,4263,99) +61598,46412 +"KRN",101,4264,-1) 0^4 -"KRN",101,4301,0) +"KRN",101,4264,0) BSDX NOSHOW APPOINTMENT^BSDX NOSHOW APPOINTMENT^^A^^^^^^^^ -"KRN",101,4301,1,0) +"KRN",101,4264,1,0) ^101.06^4^4^3040915^^ -"KRN",101,4301,1,1,0) +"KRN",101,4264,1,1,0) IHS protocol called by the PIMS v5.3 Scheduling Event Driver -"KRN",101,4301,1,2,0) +"KRN",101,4264,1,2,0) (BSDAM APPOINTMENT EVENTS). This protocol will -"KRN",101,4301,1,3,0) +"KRN",101,4264,1,3,0) no-show an appointment in the IHS Windows Scheduling package -"KRN",101,4301,1,4,0) +"KRN",101,4264,1,4,0) when the corresponding appointment in RPMS Scheduling is no-showed. -"KRN",101,4301,4) +"KRN",101,4264,4) ^^^BSDX NOSHOW APPOINTMENT -"KRN",101,4301,20) +"KRN",101,4264,20) I $G(SDAMEVT)=3,$D(^BSDXAPPL) D NOSEVT^BSDX31($G(DFN),$G(SDT),$G(SDCL)) -"KRN",101,4301,99) -61997,36371 -"KRN",101,4302,-1) +"KRN",101,4264,99) +61598,46412 +"KRN",101,4265,-1) 0^3 -"KRN",101,4302,0) +"KRN",101,4265,0) BSDX CHECKIN APPOINTMENT^BSDX CHECKIN APPOINTMENT^^A^^^^^^^^ -"KRN",101,4302,1,0) +"KRN",101,4265,1,0) ^101.06^4^4^3040915^^^ -"KRN",101,4302,1,1,0) +"KRN",101,4265,1,1,0) IHS protocol called by the PIMS v5.3 Scheduling Event Driver -"KRN",101,4302,1,2,0) +"KRN",101,4265,1,2,0) (BSDAM APPOINTMENT EVENTS). This protocol will -"KRN",101,4302,1,3,0) +"KRN",101,4265,1,3,0) check in an appointment in the IHS Windows Scheduling package -"KRN",101,4302,1,4,0) +"KRN",101,4265,1,4,0) when the corresponding appointment in RPMS Scheduling is checked in. -"KRN",101,4302,4) +"KRN",101,4265,4) ^^^BSDX CHECKIN APPOINTMENT -"KRN",101,4302,20) +"KRN",101,4265,20) I $G(SDAMEVT)=4,$D(^BSDXAPPL) D CHKEVT^BSDX25($G(DFN),$G(SDT),$G(SDCL)) -"KRN",101,4302,99) -61997,36371 -"KRN",8994,2590,-1) +"KRN",101,4265,99) +61598,46412 +"KRN",8994,2440,-1) 0^16 -"KRN",8994,2590,0) +"KRN",8994,2440,0) BSDX RESOURCE GROUPS BY USER^DEPUSR^BSDX01^4 -"KRN",8994,2591,-1) +"KRN",8994,2441,-1) 0^22 -"KRN",8994,2591,0) +"KRN",8994,2441,0) BSDX RESOURCES^RESUSR^BSDX01^4 -"KRN",8994,2592,-1) +"KRN",8994,2442,-1) 0^6 -"KRN",8994,2592,0) +"KRN",8994,2442,0) BSDX CREATE APPT SCHEDULE^CRSCH^BSDX02^4 -"KRN",8994,2593,-1) +"KRN",8994,2443,-1) 0^1 -"KRN",8994,2593,0) +"KRN",8994,2443,0) BSDX ADD NEW APPOINTMENT^APPADD^BSDX07^4 -"KRN",8994,2594,-1) +"KRN",8994,2444,-1) 0^4 -"KRN",8994,2594,0) +"KRN",8994,2444,0) BSDX CANCEL APPOINTMENT^APPDEL^BSDX08^4 -"KRN",8994,2595,-1) +"KRN",8994,2445,-1) 0^7 -"KRN",8994,2595,0) +"KRN",8994,2445,0) BSDX CREATE ASGND SLOT SCHED^CASSCH^BSDX04^4 -"KRN",8994,2596,-1) +"KRN",8994,2446,-1) 0^2 -"KRN",8994,2596,0) +"KRN",8994,2446,0) BSDX ADD NEW AVAILABILITY^AVADD^BSDX12^4 -"KRN",8994,2597,-1) +"KRN",8994,2447,-1) 0^5 -"KRN",8994,2597,0) +"KRN",8994,2447,0) BSDX CANCEL AVAILABILITY^AVDEL^BSDX13^4 -"KRN",8994,2598,-1) +"KRN",8994,2448,-1) 0^3 -"KRN",8994,2598,0) +"KRN",8994,2448,0) BSDX APPT BLOCKS OVERLAP^APBLKOV^BSDX05^4 -"KRN",8994,2599,-1) +"KRN",8994,2449,-1) 0^12 -"KRN",8994,2599,0) +"KRN",8994,2449,0) BSDX TYPE BLOCKS OVERLAP^TPBLKOV^BSDX06^4 -"KRN",8994,2600,-1) +"KRN",8994,2450,-1) 0^10 -"KRN",8994,2600,0) +"KRN",8994,2450,0) BSDX GET BASIC REG INFO^GETREGA^BSDX09^4 -"KRN",8994,2601,-1) +"KRN",8994,2451,-1) 0^15 -"KRN",8994,2601,0) +"KRN",8994,2451,0) BSDX GROUP RESOURCE^DEPRES^BSDX01^4 -"KRN",8994,2602,-1) +"KRN",8994,2452,-1) 0^13 -"KRN",8994,2602,0) +"KRN",8994,2452,0) BSDX ADD/EDIT ACCESS TYPE^ACCTYP^BSDX14^4 -"KRN",8994,2603,-1) +"KRN",8994,2453,-1) 0^14 -"KRN",8994,2603,0) +"KRN",8994,2453,0) BSDX GET ACCESS GROUP TYPES^GRPTYP^BSDX15^4 -"KRN",8994,2604,-1) +"KRN",8994,2454,-1) 0^20 -"KRN",8994,2604,0) +"KRN",8994,2454,0) BSDX ADD/EDIT RESOURCE^RSRC^BSDX16^4 -"KRN",8994,2605,-1) +"KRN",8994,2455,-1) 0^19 -"KRN",8994,2605,0) +"KRN",8994,2455,0) BSDX SCHEDULE USER^SCHUSR^BSDX17^4 -"KRN",8994,2606,-1) +"KRN",8994,2456,-1) 0^18 -"KRN",8994,2606,0) +"KRN",8994,2456,0) BSDX DELETE RESOURCEUSER^DELRU^BSDX18^4 -"KRN",8994,2607,-1) +"KRN",8994,2457,-1) 0^17 -"KRN",8994,2607,0) +"KRN",8994,2457,0) BSDX ADD/EDIT RESOURCEUSER^ADDRU^BSDX18^4 -"KRN",8994,2608,-1) +"KRN",8994,2458,-1) 0^21 -"KRN",8994,2608,0) +"KRN",8994,2458,0) BSDX SCHEDULING USER INFO^SUINFO^BSDX01^4 -"KRN",8994,2609,-1) +"KRN",8994,2459,-1) 0^23 -"KRN",8994,2609,0) +"KRN",8994,2459,0) BSDX ADD/EDIT RESOURCE GROUP^ADDRG^BSDX19^4 -"KRN",8994,2610,-1) +"KRN",8994,2460,-1) 0^24 -"KRN",8994,2610,0) +"KRN",8994,2460,0) BSDX DELETE RESOURCE GROUP^DELRG^BSDX19^4 -"KRN",8994,2611,-1) +"KRN",8994,2461,-1) 0^27 -"KRN",8994,2611,0) +"KRN",8994,2461,0) BSDX DEPARTMENTS BY USER^DEPUSR^BSDX01^4 -"KRN",8994,2612,-1) +"KRN",8994,2462,-1) 0^28 -"KRN",8994,2612,0) +"KRN",8994,2462,0) BSDX RESOURCES BY USER^RESUSR^BSDX01^4 -"KRN",8994,2613,-1) +"KRN",8994,2463,-1) 0^26 -"KRN",8994,2613,0) +"KRN",8994,2463,0) BSDX DEPARTMENT RESOURCE^DEPRES^BSDX01^4 -"KRN",8994,2614,-1) +"KRN",8994,2464,-1) 0^25 -"KRN",8994,2614,0) +"KRN",8994,2464,0) BSDX DELETE RES GROUP ITEM^DELRGI^BSDX20^4 -"KRN",8994,2615,-1) +"KRN",8994,2465,-1) 0^30 -"KRN",8994,2615,0) +"KRN",8994,2465,0) BSDX ADD RES GROUP ITEM^ADDRGI^BSDX20^4 -"KRN",8994,2616,-1) +"KRN",8994,2466,-1) 0^31 -"KRN",8994,2616,0) +"KRN",8994,2466,0) BSDX ADD/EDIT ACCESS GROUP^ADDAG^BSDX21^4 -"KRN",8994,2617,-1) +"KRN",8994,2467,-1) 0^32 -"KRN",8994,2617,0) +"KRN",8994,2467,0) BSDX DELETE ACCESS GROUP^DELAG^BSDX21^4 -"KRN",8994,2618,-1) +"KRN",8994,2468,-1) 0^29 -"KRN",8994,2618,0) +"KRN",8994,2468,0) BSDX ADD ACCESS GROUP ITEM^ADDAGI^BSDX22^4 -"KRN",8994,2619,-1) +"KRN",8994,2469,-1) 0^33 -"KRN",8994,2619,0) +"KRN",8994,2469,0) BSDX DELETE ACCESS GROUP ITEM^DELAGI^BSDX22^4 -"KRN",8994,2620,-1) +"KRN",8994,2470,-1) 0^34 -"KRN",8994,2620,0) +"KRN",8994,2470,0) BSDX REGISTER EVENT^REGEVNT^BSDX23^4 -"KRN",8994,2621,-1) +"KRN",8994,2471,-1) 0^35 -"KRN",8994,2621,0) +"KRN",8994,2471,0) BSDX UNREGISTER EVENT^UNREG^BSDX23^4 -"KRN",8994,2622,-1) +"KRN",8994,2472,-1) 0^36 -"KRN",8994,2622,0) +"KRN",8994,2472,0) BSDX RAISE EVENT^RAISEVNT^BSDX23^4 -"KRN",8994,2623,-1) +"KRN",8994,2473,-1) 0^37 -"KRN",8994,2623,0) +"KRN",8994,2473,0) BSDX SEARCH AVAILABILITY^SEARCH^BSDX24^4 -"KRN",8994,2624,-1) +"KRN",8994,2474,-1) 0^38 -"KRN",8994,2624,0) +"KRN",8994,2474,0) BSDX CHECKIN APPOINTMENT^CHECKIN^BSDX25^4 -"KRN",8994,2625,-1) +"KRN",8994,2475,-1) 0^39 -"KRN",8994,2625,0) +"KRN",8994,2475,0) BSDX EDIT APPOINTMENT^EDITAPT^BSDX26^4 -"KRN",8994,2626,-1) +"KRN",8994,2476,-1) 0^40 -"KRN",8994,2626,0) +"KRN",8994,2476,0) BSDX PATIENT APPT DISPLAY^PADISP^BSDX27^4 -"KRN",8994,2627,-1) +"KRN",8994,2477,-1) 0^41 -"KRN",8994,2627,0) +"KRN",8994,2477,0) BSDXPatientLookupRS^PTLOOKRS^BSDX28^1 -"KRN",8994,2628,-1) +"KRN",8994,2478,-1) 0^42 -"KRN",8994,2628,0) +"KRN",8994,2478,0) BSDX SPACEBAR SET^SPACE^BSDX30^4 -"KRN",8994,2629,-1) +"KRN",8994,2479,-1) 0^45 -"KRN",8994,2629,0) +"KRN",8994,2479,0) BSDX COPY APPOINTMENTS^BSDXCP^BSDX29^4 -"KRN",8994,2630,-1) +"KRN",8994,2480,-1) 0^44 -"KRN",8994,2630,0) +"KRN",8994,2480,0) BSDX COPY APPOINTMENT STATUS^CPSTAT^BSDX29^4 -"KRN",8994,2631,-1) +"KRN",8994,2481,-1) 0^43 -"KRN",8994,2631,0) +"KRN",8994,2481,0) BSDX COPY APPOINTMENT CANCEL^CPCANC^BSDX29^4 -"KRN",8994,2632,-1) +"KRN",8994,2482,-1) 0^46 -"KRN",8994,2632,0) +"KRN",8994,2482,0) BSDX CLINIC LETTERS^CLDISP^BSDX27^4 -"KRN",8994,2633,-1) +"KRN",8994,2483,-1) 0^47 -"KRN",8994,2633,0) +"KRN",8994,2483,0) BSDX NOSHOW^NOSHOW^BSDX31^4 -"KRN",8994,2634,-1) +"KRN",8994,2484,-1) 0^48 -"KRN",8994,2634,0) +"KRN",8994,2484,0) BSDX IM HERE^IMHERE^BSDX31^1 -"KRN",8994,2634,1,0) +"KRN",8994,2484,1,0) ^^2^2^3040304^ -"KRN",8994,2634,1,1,0) +"KRN",8994,2484,1,1,0) Returns a simple value to client. Used to establish continued existence -"KRN",8994,2634,1,2,0) +"KRN",8994,2484,1,2,0) of the client to the server; resets the server READ timeout. -"KRN",8994,2635,-1) +"KRN",8994,2485,-1) 0^49 -"KRN",8994,2635,0) +"KRN",8994,2485,0) BSDX HOSPITAL LOCATION^HOSPLOC^BSDX32^4 -"KRN",8994,2636,-1) +"KRN",8994,2486,-1) 0^50 -"KRN",8994,2636,0) +"KRN",8994,2486,0) BSDX CLINIC SETUP^CLNSET^BSDX32^4 -"KRN",8994,2637,-1) +"KRN",8994,2487,-1) 0^51 -"KRN",8994,2637,0) +"KRN",8994,2487,0) BSDX REBOOK LIST^RBLETT^BSDX34^4 -"KRN",8994,2638,-1) +"KRN",8994,2488,-1) 0^52 -"KRN",8994,2638,0) +"KRN",8994,2488,0) BSDX REBOOK CLINIC LIST^RBCLIN^BSDX34^4 -"KRN",8994,2639,-1) +"KRN",8994,2489,-1) 0^53 -"KRN",8994,2639,0) +"KRN",8994,2489,0) BSDX REBOOK SET^SETRBK^BSDX33^4 -"KRN",8994,2640,-1) +"KRN",8994,2490,-1) 0^54 -"KRN",8994,2640,0) +"KRN",8994,2490,0) BSDX RESOURCE LETTERS^RSRCLTR^BSDX35^4 -"KRN",8994,2641,-1) +"KRN",8994,2491,-1) 0^55 -"KRN",8994,2641,0) +"KRN",8994,2491,0) BSDX CANCEL CLINIC LIST^CANCLIN^BSDX34^4 -"KRN",8994,2642,-1) +"KRN",8994,2492,-1) 0^56 -"KRN",8994,2642,0) +"KRN",8994,2492,0) BSDX CANCEL AV BY DATE^AVDELDT^BSDX13^4 -"KRN",8994,2643,-1) +"KRN",8994,2493,-1) 0^57 -"KRN",8994,2643,0) +"KRN",8994,2493,0) BSDX REBOOK NEXT BLOCK^RBNEXT^BSDX33^4 -"KRN",8994,2644,-1) +"KRN",8994,2494,-1) 0^58 -"KRN",8994,2644,0) +"KRN",8994,2494,0) BSDX EHR PATIENT^EHRPT^BSDX30^4 -"KRN",8994,2645,-1) +"KRN",8994,2501,-1) 0^59 -"KRN",8994,2645,0) +"KRN",8994,2501,0) BSDX HOSP LOC PROVIDERS^P^BSDXGPRV^4 "MBREQ") 0 "ORD",3,19.1) -19.1;3;;;KEY^XPDTA1;KEYF1^XPDIA1;KEYE1^XPDIA1;KEYF2^XPDIA1;;KEYDEL^XPDIA1 +19.1;3;1;;KEY^XPDTA1;;;KEYF2^XPDIA1;;KEYDEL^XPDIA1 "ORD",3,19.1,0) SECURITY KEY "ORD",15,101) @@ -1232,22 +1228,22 @@ REMOTE PROCEDURE 19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA "ORD",18,19,0) OPTION -"PKG",213,-1) +"PKG",211,-1) 1^1 -"PKG",213,0) +"PKG",211,0) IHS Windows Scheduling^BSDX^IHS Windows Scheduling Extensions -"PKG",213,20,0) +"PKG",211,20,0) ^9.402P^^ -"PKG",213,22,0) +"PKG",211,22,0) ^9.49I^1^1 -"PKG",213,22,1,0) -1.41^3100929 -"PKG",213,22,1,1,0) -^^1^1^3100929 -"PKG",213,22,1,1,1,0) +"PKG",211,22,1,0) +1.42^3101207 +"PKG",211,22,1,1,0) +^^1^1^3101207 +"PKG",211,22,1,1,1,0) Clinical Scheduling M Server support routines, files, options and RPCs. -"PKG",213,"VERSION") -1.41 +"PKG",211,"VERSION") +1.42 "PRE") BSDX2E "QUES","XPF1",0) @@ -1327,7 +1323,7 @@ D XPZ2^XPDIQ "RTN","BSDX01",1,0) BSDX01 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/29/10 10:20am "RTN","BSDX01",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX01",3,0) ; "RTN","BSDX01",4,0) @@ -1921,7 +1917,7 @@ UnitTestINDIV2 "RTN","BSDX02",1,0) BSDX02 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 12:25pm "RTN","BSDX02",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX02",3,0) ; "RTN","BSDX02",4,0) @@ -2139,7 +2135,7 @@ ETRAP ;EP Error trap entry "RTN","BSDX03",1,0) BSDX03 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX03",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX03",3,0) ; "RTN","BSDX03",4,0) @@ -2257,7 +2253,7 @@ XR4K(BSDXDA) ;EP "RTN","BSDX04",1,0) BSDX04 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 7/15/10 12:44pm "RTN","BSDX04",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX04",3,0) ; Change Log: "RTN","BSDX04",4,0) @@ -2575,139 +2571,149 @@ STCOMM(BSDXRESN,BSDXRESD,BSDXS,BSDXAD) ; "RTN","BSDX04",160,0) Q "RTN","BSDX05") -0^5^B6801706 +0^5^B10878471 "RTN","BSDX05",1,0) -BSDX05 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 12:51pm +BSDX05 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 5:36pm "RTN","BSDX05",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX05",3,0) - ; + ; "RTN","BSDX05",4,0) ; Change Log: "RTN","BSDX05",5,0) ; UJO/SMH - July 11 2010: pass FM Dates for Start and End rather than US Dates "RTN","BSDX05",6,0) - ; + ; UJO/SMH - Dec 8 2010: In STCOMM, the logic was that an appointment "RTN","BSDX05",7,0) -APBLKOV(BSDXY,BSDXSTART,BSDXEND,BSDXRES) ;EP + ; that was a walk-in didn't count towards slot calculations. "RTN","BSDX05",8,0) - ;Called by BSDX APPT BLOCKS OVERLAP + ; I checked PIMS, and Walk-ins do indeed count towards slot calculations. "RTN","BSDX05",9,0) - ; July 11 2010 - pass FM Dates for Start and End rather than US Dates + ; Therefore, I commented this line out: "RTN","BSDX05",10,0) - ;(Duplicates old qryAppointmentBlocksOverlapB) + ; ;Q:$P(BSDXNOD,U,13)="y" ;WALKIN "RTN","BSDX05",11,0) - ;BSDXRES is resource name + ; "RTN","BSDX05",12,0) - ; +APBLKOV(BSDXY,BSDXSTART,BSDXEND,BSDXRES) ;EP "RTN","BSDX05",13,0) - ;Test lines: + ;Called by BSDX APPT BLOCKS OVERLAP "RTN","BSDX05",14,0) - ;D APBLKOV^BSDX05(.RES,"11-8-2000","11-8-2004","WHITT") ZW RES + ; July 11 2010 - pass FM Dates for Start and End rather than US Dates "RTN","BSDX05",15,0) - ;BSDX APPT BLOCKS OVERLAP^11-8-2000^11-8-2004^WHITT + ;(Duplicates old qryAppointmentBlocksOverlapB) "RTN","BSDX05",16,0) - ;S ^HW("BSDXD05")=BSDXSTART_U_BSDXEND_U_BSDXRES + ;BSDXRES is resource name "RTN","BSDX05",17,0) - ; + ; "RTN","BSDX05",18,0) - N BSDXERR,BSDXIEN,BSDXDEP,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXAD,BSDXNOD + ;Test lines: "RTN","BSDX05",19,0) - K ^BSDXTMP($J) + ;D APBLKOV^BSDX05(.RES,"11-8-2000","11-8-2004","WHITT") ZW RES "RTN","BSDX05",20,0) - S BSDXERR="" + ;BSDX APPT BLOCKS OVERLAP^11-8-2000^11-8-2004^WHITT "RTN","BSDX05",21,0) - S BSDXY="^BSDXTMP("_$J_")" + ;S ^HW("BSDXD05")=BSDXSTART_U_BSDXEND_U_BSDXRES "RTN","BSDX05",22,0) - S ^BSDXTMP($J,0)="D00030START_TIME^D00030END_TIME"_$C(30) + ; "RTN","BSDX05",23,0) - D + N BSDXERR,BSDXIEN,BSDXDEP,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXAD,BSDXNOD "RTN","BSDX05",24,0) - . S BSDXBS=0 + K ^BSDXTMP($J) "RTN","BSDX05",25,0) - . S BSDXEND=BSDXEND+.9999 ;Go to end of day + S BSDXERR="" "RTN","BSDX05",26,0) - . S BSDXRESN=BSDXRES + S BSDXY="^BSDXTMP("_$J_")" "RTN","BSDX05",27,0) - . Q:BSDXRESN="" + S ^BSDXTMP($J,0)="D00030START_TIME^D00030END_TIME"_$C(30) "RTN","BSDX05",28,0) - . Q:'$D(^BSDXRES("B",BSDXRESN)) + D "RTN","BSDX05",29,0) - . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0)) + . S BSDXBS=0 "RTN","BSDX05",30,0) - . Q:'+BSDXRESD + . S BSDXEND=BSDXEND+.9999 ;Go to end of day "RTN","BSDX05",31,0) - . Q:'$D(^BSDXAPPT("ARSRC",BSDXRESD)) + . S BSDXRESN=BSDXRES "RTN","BSDX05",32,0) - . D STRES(BSDXRESD,BSDXSTART,BSDXEND) + . Q:BSDXRESN="" "RTN","BSDX05",33,0) - . Q + . Q:'$D(^BSDXRES("B",BSDXRESN)) "RTN","BSDX05",34,0) - ; + . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0)) "RTN","BSDX05",35,0) - S BSDXI=$G(BSDXI)+1 + . Q:'+BSDXRESD "RTN","BSDX05",36,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + . Q:'$D(^BSDXAPPT("ARSRC",BSDXRESD)) "RTN","BSDX05",37,0) - Q + . D STRES(BSDXRESD,BSDXSTART,BSDXEND) "RTN","BSDX05",38,0) - ; + . Q "RTN","BSDX05",39,0) -STRES(BSDXRESD,BSDXSTART,BSDXEND) ; + ; "RTN","BSDX05",40,0) - ;$O THRU "ARSRC" XREF OF ^BSDXAPPT + S BSDXI=$G(BSDXI)+1 "RTN","BSDX05",41,0) - ;Start at the beginning of the day -- appts can't overlap days + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX05",42,0) - S BSDXS=$P(BSDXSTART,"."),BSDXS=BSDXS-.0001 + Q "RTN","BSDX05",43,0) - S BSDXI=0 + ; "RTN","BSDX05",44,0) - F S BSDXS=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS)) Q:'+BSDXS Q:BSDXS>BSDXEND D +STRES(BSDXRESD,BSDXSTART,BSDXEND) ; "RTN","BSDX05",45,0) - . S BSDXAD=0 F S BSDXAD=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS,BSDXAD)) Q:'+BSDXAD D STCOMM(BSDXAD) ;BSDXAD Is the AppointmentID + ;$O THRU "ARSRC" XREF OF ^BSDXAPPT "RTN","BSDX05",46,0) - . Q + ;Start at the beginning of the day -- appts can't overlap days "RTN","BSDX05",47,0) - Q + S BSDXS=$P(BSDXSTART,"."),BSDXS=BSDXS-.0001 "RTN","BSDX05",48,0) - ; + S BSDXI=0 "RTN","BSDX05",49,0) -STCOMM(BSDXAD) ; + F S BSDXS=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS)) Q:'+BSDXS Q:BSDXS>BSDXEND D "RTN","BSDX05",50,0) - S BSDXNEND=0,BSDXNSTART=0,BSDXPEND=0 + . S BSDXAD=0 F S BSDXAD=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS,BSDXAD)) Q:'+BSDXAD D STCOMM(BSDXAD) ;BSDXAD Is the AppointmentID "RTN","BSDX05",51,0) - Q:'$D(^BSDXAPPT(BSDXAD,0)) + . Q "RTN","BSDX05",52,0) - S BSDXNOD=^BSDXAPPT(BSDXAD,0) + Q "RTN","BSDX05",53,0) - Q:$P(BSDXNOD,U,10)=1 ;NO-SHOW Flag + ; "RTN","BSDX05",54,0) - Q:$P(BSDXNOD,U,12)]"" ;CANCELLED APPT +STCOMM(BSDXAD) ; "RTN","BSDX05",55,0) - Q:$P(BSDXNOD,U,13)="y" ;WALKIN + S BSDXNEND=0,BSDXNSTART=0,BSDXPEND=0 "RTN","BSDX05",56,0) - S BSDXNSTART=$P(BSDXNOD,U) + Q:'$D(^BSDXAPPT(BSDXAD,0)) "RTN","BSDX05",57,0) - S BSDXNEND=$P(BSDXNOD,U,2) + S BSDXNOD=^BSDXAPPT(BSDXAD,0) "RTN","BSDX05",58,0) - I BSDXNEND'>BSDXSTART Q ;End is less than start + Q:$P(BSDXNOD,U,10)=1 ;NO-SHOW Flag "RTN","BSDX05",59,0) - S Y=BSDXNSTART X ^DD("DD") S BSDXNSTART=$TR(Y,"@"," ") + Q:$P(BSDXNOD,U,12)]"" ;CANCELLED APPT "RTN","BSDX05",60,0) - S Y=BSDXNEND X ^DD("DD") S BSDXNEND=$TR(Y,"@"," ") + ; Q:$P(BSDXNOD,U,13)="y" ;WALKIN -- new in V 1.42. See top comments. "RTN","BSDX05",61,0) - S BSDXI=BSDXI+1 + S BSDXNSTART=$P(BSDXNOD,U) "RTN","BSDX05",62,0) - S ^BSDXTMP($J,BSDXI)=BSDXNSTART_U_BSDXNEND_$C(30) + S BSDXNEND=$P(BSDXNOD,U,2) "RTN","BSDX05",63,0) - Q + I BSDXNEND'>BSDXSTART Q ;End is less than start +"RTN","BSDX05",64,0) + S Y=BSDXNSTART X ^DD("DD") S BSDXNSTART=$TR(Y,"@"," ") +"RTN","BSDX05",65,0) + S Y=BSDXNEND X ^DD("DD") S BSDXNEND=$TR(Y,"@"," ") +"RTN","BSDX05",66,0) + S BSDXI=BSDXI+1 +"RTN","BSDX05",67,0) + S ^BSDXTMP($J,BSDXI)=BSDXNSTART_U_BSDXNEND_$C(30) +"RTN","BSDX05",68,0) + Q "RTN","BSDX06") 0^6^B6812445 "RTN","BSDX06",1,0) BSDX06 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 4:51pm "RTN","BSDX06",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX06",3,0) ; Change Log: "RTN","BSDX06",4,0) @@ -2827,11 +2833,11 @@ STCOMM(BSDXRESN,BSDXRESD) ;EP "RTN","BSDX06",61,0) Q "RTN","BSDX07") -0^7^B78302774 +0^7^B188811791 "RTN","BSDX07",1,0) -BSDX07 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 7/18/10 2:11pm +BSDX07 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 12:31pm "RTN","BSDX07",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX07",3,0) ; "RTN","BSDX07",4,0) @@ -2841,1235 +2847,1731 @@ BSDX07 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 7/18/10 2:11pm "RTN","BSDX07",6,0) ; v1.3 July 13 2010 - Add support i18n - Dates input as FM dates, not US. "RTN","BSDX07",7,0) - ; + ; v1.42 Oct 22 2010 - Transaction now restartable by providing arguments "RTN","BSDX07",8,0) - ; + ; thanks to Rick Marshall and Zach Gonzalez at Oroville. "RTN","BSDX07",9,0) -APPADDD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID) ;EP + ; v1.42 Oct 30 2010 - Extensive refactoring. "RTN","BSDX07",10,0) - ;Entry point for debugging + ; "RTN","BSDX07",11,0) - ; + ; Error Reference: "RTN","BSDX07",12,0) - I +$G(^HWDEBUG("BREAK","APPADD")),+$G(^HWDEBUG("BREAK"))=DUZ D DEBUG^%Serenji("APPADD^BSDX07(.BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID)",$P(^HWDEBUG("BREAK"),U,2)) + ; -1: Patient Record is locked. This means something is wrong!!!! "RTN","BSDX07",13,0) - E G ENDBG + ; -2: Start Time is not a valid Fileman date "RTN","BSDX07",14,0) - Q + ; -3: End Time is not a valid Fileman date "RTN","BSDX07",15,0) - ; + ; -4: End Time does not have time inside of it. "RTN","BSDX07",16,0) -APPADD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID) ;EP + ; -5: BSDXPATID is not numeric "RTN","BSDX07",17,0) - ;Called by BSDX ADD NEW APPOINTMENT + ; -6: Patient Does not exist in ^DPT "RTN","BSDX07",18,0) - ;Add new appointment + ; -7: Resource Name does not exist in B index of BSDX RESOURCE "RTN","BSDX07",19,0) - ;BSDXRES is ResourceName + ; -8: Resouce doesn't exist in ^BSDXRES "RTN","BSDX07",20,0) - ;BSDXLEN is the appointment duration in minutes + ; -9: Couldn't add appointment to BSDX APPOINTMENT "RTN","BSDX07",21,0) - ;BSDXATID is used for 2 purposes: + ; -10: Couldn't add appointment to files 2 and/or 44 "RTN","BSDX07",22,0) - ; if BSDXATID = "WALKIN" then BSDAPI is called to create a walkin appt. + ; -100: Mumps Error "RTN","BSDX07",23,0) - ; if BSDXATID = a number, then it is the access type id (used for rebooking) + "RTN","BSDX07",24,0) - ; +APPADDD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID) ;EP "RTN","BSDX07",25,0) - ;Create entry in BSDX APPOINTMENT + ;Entry point for debugging "RTN","BSDX07",26,0) - ;Returns recordset having fields + D DEBUG^%Serenji("APPADD^BSDX07(.BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID)") "RTN","BSDX07",27,0) - ; AppointmentID and ErrorNumber + Q "RTN","BSDX07",28,0) - ; + ; "RTN","BSDX07",29,0) - ;Test lines: +UT ; Unit Tests "RTN","BSDX07",30,0) -ENDBG ;BSDX ADD NEW APPOINTMENT^3091122.0930^3091122.1000^370^2^PEDIATRICIAN,DEMO^EXAM^SCRATCH NOTE + N ZZZ "RTN","BSDX07",31,0) - ; + ; Test for bad start date "RTN","BSDX07",32,0) - N BSDXERR,BSDXIEN,BSDXDEP,BSDXI,BSDXJ,BSDXAPPTI,BSDXDJ,BSDXRESD,BSDXRNOD,BSDXSCD,BSDXC,BSDXERR,BSDXWKIN + D APPADD(.ZZZ,2100123,3100123.3,2,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",33,0) - N BSDXNOEV + I +$P(^BSDXTMP($J,1),U,2)'=-2 W "Error in -2",! "RTN","BSDX07",34,0) - S BSDXNOEV=1 ;Don't execute BSDX ADD APPOINTMENT protocol + ; Test for bad end date "RTN","BSDX07",35,0) - K ^BSDXTMP($J) + D APPADD(.ZZZ,3100123,2100123.3,2,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",36,0) - S X="ETRAP^BSDX07",@^%ZOSF("TRAP") + I +$P(^BSDXTMP($J,1),U,2)'=-3 W "Error in -3",! "RTN","BSDX07",37,0) - S BSDXERR=0 + ; Test for end date without time "RTN","BSDX07",38,0) - S BSDXI=0 + D APPADD(.ZZZ,3100123.1,3100123,2,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",39,0) - S BSDXY="^BSDXTMP("_$J_")" + I +$P(^BSDXTMP($J,1),U,2)'=-4 W "Error in -4",! "RTN","BSDX07",40,0) - S ^BSDXTMP($J,BSDXI)="I00020APPOINTMENTID^T00020ERRORID"_$C(30) + ; Test for mumps error "RTN","BSDX07",41,0) - S BSDXI=BSDXI+1 + S bsdxdie=1 "RTN","BSDX07",42,0) - ; + D APPADD(.ZZZ,3100123.09,3100123.093,2,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",43,0) - ;Lock BSDX node + I +$P(^BSDXTMP($J,1),U,2)'=-100 W "Error in -100: M Error",! "RTN","BSDX07",44,0) - L +^BSDXAPPT(BSDXPATID):5 I '$T D ERR(BSDXI+1,"Another user is working with this patient's record. Please try again later") Q + K bsdxdie "RTN","BSDX07",45,0) - ; + ; Test for TRESTART "RTN","BSDX07",46,0) - TSTART + s bsdxrestart=1 "RTN","BSDX07",47,0) - ; v1.3 - date passed in as FM Date, not US date. + D APPADD(.ZZZ,3100123.09,3100123.093,3,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",48,0) - ;Check input data for errors + I +$P(^BSDXTMP($J,1),U,2)'=0&(+$P(^BSDXTMP($J,1),U,2)'=-10) W "Error in TRESTART",! "RTN","BSDX07",49,0) - ; S:BSDXSTART["@0000" BSDXSTART=$P(BSDXSTART,"@") + k bsdxrestart "RTN","BSDX07",50,0) - ; S:BSDXEND["@0000" BSDXEND=$P(BSDXEND,"@") + ; Test for non-numeric patient "RTN","BSDX07",51,0) - ; S %DT="T",X=BSDXSTART D ^%DT S BSDXSTART=Y + D APPADD(.ZZZ,3100123.09,3100123.093,"CAT,DOG","Dr Office",30,"Sam's Note",1) "RTN","BSDX07",52,0) - ; I BSDXSTART=-1 D ERR(BSDXI+1,"BSDX07 Error: Invalid Start Time") Q + I +$P(^BSDXTMP($J,1),U,2)'=-5 W "Error in -5",! "RTN","BSDX07",53,0) - ; S %DT="T",X=BSDXEND D ^%DT S BSDXEND=Y + ; Test for a non-existent patient "RTN","BSDX07",54,0) - ; I BSDXEND=-1 D ERR(BSDXI+1,"BSDX07 Error: Invalid End Time") Q + D APPADD(.ZZZ,3100123.09,3100123.093,8989898989,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",55,0) - ; + I +$P(^BSDXTMP($J,1),U,2)'=-6 W "Error in -6",! "RTN","BSDX07",56,0) - ; If C# sends the dates with extra zeros, remove them + ; Test for a non-existent resource name "RTN","BSDX07",57,0) - S BSDXSTART=+BSDXSTART,BSDXEND=+BSDXEND + D APPADD(.ZZZ,3100123.09,3100123.093,3,"lkajsflkjsadf",30,"Sam's Note",1) "RTN","BSDX07",58,0) - ; + I +$P(^BSDXTMP($J,1),U,2)'=-7 W "Error in -7",! "RTN","BSDX07",59,0) - I $L(BSDXEND,".")=1 D ERR(BSDXI+1,"BSDX07 Error: Invalid End Time") Q + ; Test for corrupted resource "RTN","BSDX07",60,0) - I BSDXSTART>BSDXEND S BSDXTMP=BSDXEND,BSDXEND=BSDXSTART,BSDXSTART=BSDXTMP + ; Can't test for -8 since it requires DB corruption "RTN","BSDX07",61,0) - I '+BSDXPATID,'$D(^DPT(BSDXPATID,0)) D ERR(BSDXI+1,"BSDX07 Error: Invalid Patient ID") Q + ; Test for inability to add appointment to BSDX Appointment "RTN","BSDX07",62,0) - ;Validate Resource entry + ; Also requires something wrong in the DB "RTN","BSDX07",63,0) - S BSDXERR=0 K BSDXRESD + ; Test for inability to add appointment to 2,44 "RTN","BSDX07",64,0) - I '$D(^BSDXRES("B",BSDXRES)) D ERR(BSDXI+1,"BSDX07 Error: Invalid Resource ID") Q + ; Test by creating a duplicate appointment "RTN","BSDX07",65,0) - S BSDXRESD=$O(^BSDXRES("B",BSDXRES,0)) + D APPADD(.ZZZ,3100123.09,3100123.093,3,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",66,0) - S BSDXWKIN=0 + D APPADD(.ZZZ,3100123.09,3100123.093,3,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",67,0) - I BSDXATID="WALKIN" S BSDXWKIN=1 + I +$P(^BSDXTMP($J,1),U,2)'=-10 W "Error in -10",! "RTN","BSDX07",68,0) - I BSDXATID'?.N&(BSDXATID'="WALKIN") S BSDXATID="" + ; Test for normality: "RTN","BSDX07",69,0) - ; + D APPADD(.ZZZ,3110123.09,3110123.093,3,"Dr Office",30,"Sam's Note",1) "RTN","BSDX07",70,0) - S BSDXAPPTID=$$BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRESD,BSDXATID) + ; Does Appt exist? "RTN","BSDX07",71,0) - I 'BSDXAPPTID D ERR(BSDXI+1,"BSDX07 Error: Unable to add appointment to BSDX APPOINTMENT file.") Q + N APPID S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX07",72,0) - I BSDXNOTE]"" D BSDXWP(BSDXAPPTID,BSDXNOTE) + I 'APPID W "Error Making Appt-1" QUIT "RTN","BSDX07",73,0) - ; + I +^BSDXAPPT(APPID,0)'=3110123.09 W "Error Making Appt-2" "RTN","BSDX07",74,0) - ;Create RPMS Appointment + I '$D(^DPT(3,"S",3110123.09)) W "Error Making Appt-3" "RTN","BSDX07",75,0) - S BSDXRNOD=$G(^BSDXRES(BSDXRESD,0)) + I '$D(^SC(2,"S",3110123.09)) W "Error Making Appt-4" "RTN","BSDX07",76,0) - ;I BSDXRNOD="" D ERR(BSDXI+1,"BSDX07 Error: Unable to add appointment -- invalid Resource entry."),BSDXDEL(BSDXAPPTID) Q + QUIT "RTN","BSDX07",77,0) - I BSDXRNOD="" D ERR(BSDXI+1,"BSDX07 Error: Unable to add appointment -- invalid Resource entry.") Q + ; "RTN","BSDX07",78,0) - S BSDXSCD=$P(BSDXRNOD,U,4) +APPADD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID) ;EP "RTN","BSDX07",79,0) - ;I +BSDXSCD,$D(^SC(BSDXSCD,0)) D I +BSDXERR D ERR(BSDXI+1,"BSDX07 Error: Unable to make appointment. MAKE^BSDAPI returned error code: "_BSDXERR),BSDXDEL(BSDXAPPTID) Q + ;Called by RPC: BSDX ADD NEW APPOINTMENT "RTN","BSDX07",80,0) - I +BSDXSCD,$D(^SC(BSDXSCD,0)) D I +BSDXERR D ERR(BSDXI+1,"BSDX07 Error: Unable to make appointment. MAKE^BSDAPI returned error code: "_BSDXERR) Q + ; "RTN","BSDX07",81,0) - . S BSDXC("PAT")=BSDXPATID + ;Add new appointment to 3 files "RTN","BSDX07",82,0) - . S BSDXC("CLN")=BSDXSCD + ; - BSDX APPOINTMENT "RTN","BSDX07",83,0) - . S BSDXC("TYP")=3 ;3 for scheduled appts, 4 for walkins + ; - Hosp Location Appointment SubSubfile if Resource is linked to clinic "RTN","BSDX07",84,0) - . S:BSDXWKIN BSDXC("TYP")=4 + ; - Patient Appointment Subfile if Resource is linked to clinic "RTN","BSDX07",85,0) - . S BSDXC("ADT")=BSDXSTART + ; "RTN","BSDX07",86,0) - . S BSDXC("LEN")=BSDXLEN + ;Paramters: "RTN","BSDX07",87,0) - . S BSDXC("OI")=$E($G(BSDXNOTE),1,150) ;File 44 has 150 character limit on OTHER field + ;BSDXY: Global Return (RPC must be set to Global Array) "RTN","BSDX07",88,0) - . S BSDXC("OI")=$TR(BSDXC("OI"),";"," ") ;No semicolons allowed by MAKE^BSDAPI + ;BSDXSTART: FM Start Date "RTN","BSDX07",89,0) - . S BSDXC("OI")=$$STRIP(BSDXC("OI")) ;Strip control characters from note + ;BSDXEND: FM End Date "RTN","BSDX07",90,0) - . S BSDXC("USR")=DUZ + ;BSDXPATID: Patient DFN "RTN","BSDX07",91,0) - . S BSDXERR=$$MAKE^BSDXAPI(.BSDXC) + ;BSDXRES is ResourceName in BSDX RESOURCE file (not IEN) "RTN","BSDX07",92,0) - . Q:BSDXERR + ;BSDXLEN is the appointment duration in minutes "RTN","BSDX07",93,0) - . D AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) + ;BSDXNOTE is the Appiontment Note "RTN","BSDX07",94,0) - . ;L + ;BSDXATID is used for 2 purposes: "RTN","BSDX07",95,0) - . Q + ; if BSDXATID = "WALKIN" then BSDAPI is called to create a walkin appt. "RTN","BSDX07",96,0) - ; + ; if BSDXATID = a number, then it is the access type id (used for rebooking) "RTN","BSDX07",97,0) - ;Update RPMS Clinic availability + ; "RTN","BSDX07",98,0) - ;Return Recordset + ;Return: "RTN","BSDX07",99,0) - TCOMMIT + ; ADO.net Recordset having fields: "RTN","BSDX07",100,0) - L -^BSDXAPPT(BSDXPATID) + ; AppointmentID and ErrorNumber "RTN","BSDX07",101,0) - S BSDXI=BSDXI+1 + ; "RTN","BSDX07",102,0) - S ^BSDXTMP($J,BSDXI)=BSDXAPPTID_"^"_$C(30) + ;Test lines: "RTN","BSDX07",103,0) - S BSDXI=BSDXI+1 + ;BSDX ADD NEW APPOINTMENT^3091122.0930^3091122.1000^370^Dr Office^30^EXAM^WALKIN "RTN","BSDX07",104,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + ; "RTN","BSDX07",105,0) - Q + ; Return Array; set Return and clear array "RTN","BSDX07",106,0) -BSDXDEL(BSDXAPPTID) ;Deletes appointment BSDXAPPTID from BSDXAPPOINTMETN + S BSDXY=$NA(^BSDXTMP($J)) "RTN","BSDX07",107,0) - N DA,DIK + K ^BSDXTMP($J) "RTN","BSDX07",108,0) - S DIK="^BSDXAPPT(",DA=BSDXAPPTID + ; $ET "RTN","BSDX07",109,0) - D ^DIK + N $ET S $ET="G ETRAP^BSDX07" "RTN","BSDX07",110,0) - Q + ; Counter "RTN","BSDX07",111,0) - ; + N BSDXI S BSDXI=0 "RTN","BSDX07",112,0) -STRIP(BSDXZ) ;Replace control characters with spaces + ; Lock BSDX node, only to synchronize access to the globals. "RTN","BSDX07",113,0) - N BSDXI + ; It's not expected that the error will ever happen as no filing "RTN","BSDX07",114,0) - F BSDXI=1:1:$L(BSDXZ) I (32>$A($E(BSDXZ,BSDXI))) S BSDXZ=$E(BSDXZ,1,BSDXI-1)_" "_$E(BSDXZ,BSDXI+1,999) + ; is supposed to take 5 seconds. "RTN","BSDX07",115,0) - Q BSDXZ + L +^BSDXAPPT(BSDXPATID):5 I '$T D ERR(BSDXI,"-1~Patient record is locked. Please contact technical support.") Q "RTN","BSDX07",116,0) - ; + ; Header Node "RTN","BSDX07",117,0) -BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRESD,BSDXATID) ;ADD BSDX APPOINTMENT ENTRY + S ^BSDXTMP($J,BSDXI)="I00020APPOINTMENTID^T00100ERRORID"_$C(30) "RTN","BSDX07",118,0) - ;Returns ien in BSDXAPPT or 0 if failed + ;Restartable Transaction; restore paramters when starting. "RTN","BSDX07",119,0) - ;Create entry in BSDX APPOINTMENT + ; (Params restored are what's passed here + BSDXI) "RTN","BSDX07",120,0) - N BSDXAPPTID + TSTART (BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID,BSDXI):T="BSDX ADD NEW APPOINTMENT^BSDX07" "RTN","BSDX07",121,0) - S BSDXFDA(9002018.4,"+1,",.01)=BSDXSTART + ; "RTN","BSDX07",122,0) - S BSDXFDA(9002018.4,"+1,",.02)=BSDXEND + ; Turn off SDAM APPT PROTOCOL BSDX Entries "RTN","BSDX07",123,0) - S BSDXFDA(9002018.4,"+1,",.05)=BSDXPATID + N BSDXNOEV "RTN","BSDX07",124,0) - S BSDXFDA(9002018.4,"+1,",.07)=BSDXRESD + S BSDXNOEV=1 ;Don't execute BSDX ADD APPOINTMENT protocol "RTN","BSDX07",125,0) - S BSDXFDA(9002018.4,"+1,",.08)=$G(DUZ) + ; "RTN","BSDX07",126,0) - ;S BSDXFDA(9002018.4,"+1,",.09)=$G(DT) ;MJL 1/25/2007 + ; Set Error Message to be empty "RTN","BSDX07",127,0) - S BSDXFDA(9002018.4,"+1,",.09)=$$NOW^XLFDT + N BSDXERR S BSDXERR=0 "RTN","BSDX07",128,0) - S:BSDXATID="WALKIN" BSDXFDA(9002018.4,"+1,",.13)="y" + ; "RTN","BSDX07",129,0) - S:BSDXATID?.N BSDXFDA(9002018.4,"+1,",.06)=BSDXATID + ;;;test for error inside transaction. See if %ZTER works "RTN","BSDX07",130,0) - K BSDXIEN,BSDXMSG + I $G(bsdxdie) S X=1/0 "RTN","BSDX07",131,0) - D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") + ;;;test "RTN","BSDX07",132,0) - S BSDXAPPTID=+$G(BSDXIEN(1)) + ;;;test for TRESTART "RTN","BSDX07",133,0) - Q BSDXAPPTID + I $G(bsdxrestart) K bsdxrestart TRESTART "RTN","BSDX07",134,0) - ; + ;;;test "RTN","BSDX07",135,0) -BSDXWP(BSDXAPPTID,BSDXNOTE) ; + ; "RTN","BSDX07",136,0) - ;Add WP field + ; -- Start and End Date Processing -- "RTN","BSDX07",137,0) - I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" + ; If C# sends the dates with extra zeros, remove them "RTN","BSDX07",138,0) - I $D(BSDXNOTE(0)) S BSDXNOTE(.5)=BSDXNOTE(0) K BSDXNOTE(0) + S BSDXSTART=+BSDXSTART,BSDXEND=+BSDXEND "RTN","BSDX07",139,0) - I $D(BSDXNOTE(.5)) D + ; Are the dates valid? Must be FM Dates > than 2010 "RTN","BSDX07",140,0) - . D WP^DIE(9002018.4,BSDXAPPTID_",",1,"","BSDXNOTE","BSDXMSG") + I BSDXSTART'>3100000 D ERR(BSDXI,"-2~BSDX07 Error: Invalid Start Time") Q "RTN","BSDX07",141,0) - Q + I BSDXEND'>3100000 D ERR(BSDXI,"-3~BSDX07 Error: Invalid End Time") Q "RTN","BSDX07",142,0) - ; + ; If Ending date doesn't have a time, this is an error "RTN","BSDX07",143,0) -ADDEVT(BSDXPATID,BSDXSTART,BSDXSC,BSDXSCDA) ;EP + I $L(BSDXEND,".")=1 D ERR(BSDXI,"-4~BSDX07 Error: Invalid End Time") Q "RTN","BSDX07",144,0) - ;Called by BSDX ADD APPOINTMENT protocol + ; If the Start Date is greater than the end date, swap dates "RTN","BSDX07",145,0) - ;BSDXSC=IEN of clinic in ^SC + N BSDXTMP "RTN","BSDX07",146,0) - ;BSDXSCDA=IEN for ^SC(BSDXSC,"S",BSDXSTART,1,BSDXSCDA). Use to get Length & Note + I BSDXSTART>BSDXEND S BSDXTMP=BSDXEND,BSDXEND=BSDXSTART,BSDXSTART=BSDXTMP "RTN","BSDX07",147,0) - ; + ; "RTN","BSDX07",148,0) - N BSDXNOD,BSDXLEN,BSDXAPPTID,BSDXNODP,BSDXWKIN,BSDXRES + ; Check if the patient exists: "RTN","BSDX07",149,0) - Q:+$G(BSDXNOEV) + ; - DFN valid number? "RTN","BSDX07",150,0) - I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) + ; - Valid Patient in file 2? "RTN","BSDX07",151,0) - E I $D(^BSDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) + I '+BSDXPATID D ERR(BSDXI,"-5~BSDX07 Error: Invalid Patient ID") Q "RTN","BSDX07",152,0) - Q:'+$G(BSDXRES) + I '$D(^DPT(BSDXPATID,0)) D ERR(BSDXI,"-6~BSDX07 Error: Invalid Patient ID") Q "RTN","BSDX07",153,0) - S BSDXNOD=$G(^SC(BSDXSC,"S",BSDXSTART,1,BSDXSCDA,0)) + ; "RTN","BSDX07",154,0) - Q:BSDXNOD="" + ;Validate Resource entry "RTN","BSDX07",155,0) - S BSDXNODP=$G(^DPT(BSDXPATID,"S",BSDXSTART,0)) + I '$D(^BSDXRES("B",BSDXRES)) D ERR(BSDXI,"-7~BSDX07 Error: Invalid Resource ID") Q "RTN","BSDX07",156,0) - S BSDXWKIN="" + N BSDXRESD ; Resource IEN "RTN","BSDX07",157,0) - S:$P(BSDXNODP,U,7)=4 BSDXWKIN="WALKIN" ;Purpose of Visit field of DPT Appointment subfile + S BSDXRESD=$O(^BSDXRES("B",BSDXRES,0)) "RTN","BSDX07",158,0) - S BSDXLEN=$P(BSDXNOD,U,2) + N BSDXRNOD ; Resouce zero node "RTN","BSDX07",159,0) - Q:'+BSDXLEN + S BSDXRNOD=$G(^BSDXRES(BSDXRESD,0)) "RTN","BSDX07",160,0) - S BSDXEND=$$FMADD^XLFDT(BSDXSTART,0,0,BSDXLEN,0) + I BSDXRNOD="" D ERR(BSDXI,"-8~BSDX07 Error: invalid Resource entry.") Q "RTN","BSDX07",161,0) - S BSDXAPPTID=$$BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXWKIN) + ; "RTN","BSDX07",162,0) - Q:'+BSDXAPPTID + ; Walk-in (Unscheduled) Appointment? "RTN","BSDX07",163,0) - S BSDXNOTE=$P(BSDXNOD,U,4) + N BSDXWKIN S BSDXWKIN=0 "RTN","BSDX07",164,0) - I BSDXNOTE]"" D BSDXWP(BSDXAPPTID,BSDXNOTE) + I BSDXATID="WALKIN" S BSDXWKIN=1 "RTN","BSDX07",165,0) - D ADDEVT3(BSDXRES) + ; Reset Access Type ID if it doesn't say "WALKIN" and isn't a number "RTN","BSDX07",166,0) - Q + I BSDXATID'?.N&(BSDXATID'="WALKIN") S BSDXATID="" "RTN","BSDX07",167,0) - ; + ; "RTN","BSDX07",168,0) -ADDEVT3(BSDXRES) ; + ; Done with all checks, let's make appointment in BSDX APPOINTMENT "RTN","BSDX07",169,0) - ;Call RaiseEvent to notify GUI clients + N BSDXAPPTID "RTN","BSDX07",170,0) - N BSDXRESN + S BSDXAPPTID=$$BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRESD,BSDXATID) "RTN","BSDX07",171,0) - S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) + I 'BSDXAPPTID D ERR(BSDXI,"-9~BSDX07 Error: Unable to add appointment to BSDX APPOINTMENT file.") Q "RTN","BSDX07",172,0) - Q:BSDXRESN="" + I BSDXNOTE]"" D BSDXWP(BSDXAPPTID,BSDXNOTE) "RTN","BSDX07",173,0) - S BSDXRESN=$P(BSDXRESN,"^") + ; "RTN","BSDX07",174,0) - ;D EVENT^BSDX23("SCHEDULE-"_BSDXRESN,"","","") + ; Then Create Subfiles in 2/44 Appointment "RTN","BSDX07",175,0) - D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) + N BSDXSCD S BSDXSCD=$P(BSDXRNOD,U,4) ; Hosp Location IEN "RTN","BSDX07",176,0) - Q + ; Only if we have a valid Hosp Loc can we make an appointment "RTN","BSDX07",177,0) - ; + I +BSDXSCD,$D(^SC(BSDXSCD,0)) D I +BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: ~MAKE^BSDAPI returned error code: "_BSDXERR) Q "RTN","BSDX07",178,0) -ERR(BSDXI,BSDXERR) ;Error processing + . N BSDXC "RTN","BSDX07",179,0) - D ^%ZTER ;XXX: remove after we figure out the cause of error + . S BSDXC("PAT")=BSDXPATID "RTN","BSDX07",180,0) - S BSDXI=BSDXI+1 + . S BSDXC("CLN")=BSDXSCD "RTN","BSDX07",181,0) - S BSDXERR=$TR(BSDXERR,"^","~") + . S BSDXC("TYP")=3 ;3 for scheduled appts, 4 for walkins "RTN","BSDX07",182,0) - TROLLBACK + . S:BSDXWKIN BSDXC("TYP")=4 "RTN","BSDX07",183,0) - S ^BSDXTMP($J,BSDXI)="0^"_BSDXERR_$C(30) + . S BSDXC("ADT")=BSDXSTART "RTN","BSDX07",184,0) - S BSDXI=BSDXI+1 + . S BSDXC("LEN")=BSDXLEN "RTN","BSDX07",185,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + . S BSDXC("OI")=$E($G(BSDXNOTE),1,150) ;File 44 has 150 character limit on OTHER field "RTN","BSDX07",186,0) - L + . S BSDXC("OI")=$TR(BSDXC("OI"),";"," ") ;No semicolons allowed by MAKE^BSDXAPI "RTN","BSDX07",187,0) - Q + . S BSDXC("OI")=$$STRIP(BSDXC("OI")) ;Strip control characters from note "RTN","BSDX07",188,0) - ; + . S BSDXC("USR")=DUZ "RTN","BSDX07",189,0) -ETRAP ;EP Error trap entry + . S BSDXERR=$$MAKE^BSDXAPI(.BSDXC) "RTN","BSDX07",190,0) - D ^%ZTER + . Q:BSDXERR "RTN","BSDX07",191,0) - I '$D(BSDXI) N BSDXI S BSDXI=999999 + . ;Update RPMS Clinic availability "RTN","BSDX07",192,0) - S BSDXI=BSDXI+1 + . D AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) "RTN","BSDX07",193,0) - D ERR(BSDXI,"BSDX07 Error: "_$G(%ZTERROR)) + . Q "RTN","BSDX07",194,0) - Q + ; "RTN","BSDX07",195,0) - ; + ;Return Recordset "RTN","BSDX07",196,0) -DAY ;;^SUN^MON^TUES^WEDNES^THURS^FRI^SATUR + TCOMMIT "RTN","BSDX07",197,0) - ; + L -^BSDXAPPT(BSDXPATID) "RTN","BSDX07",198,0) -DOW S %=$E(X,1,3),Y=$E(X,4,5),Y=Y>2&'(%#4)+$E("144025036146",Y) + S BSDXI=BSDXI+1 "RTN","BSDX07",199,0) - F %=%:-1:281 S Y=%#4=1+1+Y + S ^BSDXTMP($J,BSDXI)=BSDXAPPTID_"^"_$C(30) "RTN","BSDX07",200,0) - S Y=$E(X,6,7)+Y#7 + S BSDXI=BSDXI+1 "RTN","BSDX07",201,0) - Q + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX07",202,0) - ; + Q "RTN","BSDX07",203,0) -AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) ;Update RPMS Clinic availability +BSDXDEL(BSDXAPPTID) ;Deletes appointment BSDXAPPTID from BSDXAPPOINTMETN "RTN","BSDX07",204,0) - ;SEE SDM1 + N DA,DIK "RTN","BSDX07",205,0) - N Y,DFN + S DIK="^BSDXAPPT(",DA=BSDXAPPTID "RTN","BSDX07",206,0) - N SL,STARTDAY,X,SC,SB,HSI,SI,STR,SDDIF,SDMAX,SDDATE,SDDMAX,SDSDATE,CCXN,MXOK,COV,SDPROG + D ^DIK "RTN","BSDX07",207,0) - N X1,SDEDT,X2,SD,SM,SS,S,SDLOCK,ST,I + Q "RTN","BSDX07",208,0) - S Y=BSDXSCD,DFN=BSDXPATID + ; "RTN","BSDX07",209,0) - S SL=$G(^SC(+Y,"SL")),X=$P(SL,U,3),STARTDAY=$S($L(X):X,1:8),SC=Y,SB=STARTDAY-1/100,X=$P(SL,U,6),HSI=$S(X=1:X,X:X,1:4),SI=$S(X="":4,X<3:4,X:X,1:4),STR="#@!$* XXWVUTSRQPONMLKJIHGFEDCBA0123456789jklmnopqrstuvwxyz",SDDIF=$S(HSI<3:8/HSI,1:2) K Y +STRIP(BSDXZ) ;Replace control characters with spaces "RTN","BSDX07",210,0) - ;Determine maximum days for scheduling + N BSDXI "RTN","BSDX07",211,0) - S SDMAX(1)=$P($G(^SC(+SC,"SDP")),U,2) S:'SDMAX(1) SDMAX(1)=365 + F BSDXI=1:1:$L(BSDXZ) I (32>$A($E(BSDXZ,BSDXI))) S BSDXZ=$E(BSDXZ,1,BSDXI-1)_" "_$E(BSDXZ,BSDXI+1,999) "RTN","BSDX07",212,0) - S (SDMAX,SDDMAX)=$$FMADD^XLFDT(DT,SDMAX(1)) + Q BSDXZ "RTN","BSDX07",213,0) - S SDDATE=BSDXSTART + ; "RTN","BSDX07",214,0) - S SDSDATE=SDDATE,SDDATE=SDDATE\1 +BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRESD,BSDXATID) ;ADD BSDX APPOINTMENT ENTRY "RTN","BSDX07",215,0) -1 ;L Q:$D(SDXXX) S CCXN=0 K MXOK,COV,SDPROT Q:DFN<0 S SC=+SC + ;Returns ien in BSDXAPPT or 0 if failed "RTN","BSDX07",216,0) - Q:$D(SDXXX) S CCXN=0 K MXOK,COV,SDPROT Q:DFN<0 S SC=+SC + ;Create entry in BSDX APPOINTMENT "RTN","BSDX07",217,0) - S X1=DT,SDEDT=365 S:$D(^SC(SC,"SDP")) SDEDT=$P(^SC(SC,"SDP"),"^",2) + N BSDXAPPTID "RTN","BSDX07",218,0) - S X2=SDEDT D C^%DTC S SDEDT=X + S BSDXFDA(9002018.4,"+1,",.01)=BSDXSTART "RTN","BSDX07",219,0) - S Y=BSDXSTART + S BSDXFDA(9002018.4,"+1,",.02)=BSDXEND "RTN","BSDX07",220,0) -EN1 S (X,SD)=Y,SM=0 D DOW + S BSDXFDA(9002018.4,"+1,",.05)=BSDXPATID "RTN","BSDX07",221,0) -S I '$D(^SC(SC,"ST",$P(SD,"."),1)) S SS=+$O(^SC(+SC,"T"_Y,SD)) Q:SS'>0 Q:^(SS,1)="" S ^SC(+SC,"ST",$P(SD,"."),1)=$E($P($T(DAY),U,Y+2),1,2)_" "_$E(SD,6,7)_$J("",SI+SI-6)_^(1),^(0)=$P(SD,".") + S BSDXFDA(9002018.4,"+1,",.07)=BSDXRESD "RTN","BSDX07",222,0) - S S=BSDXLEN + S BSDXFDA(9002018.4,"+1,",.08)=$G(DUZ) "RTN","BSDX07",223,0) - ;Check if BSDXLEN evenly divisible by appointment length + S BSDXFDA(9002018.4,"+1,",.09)=$$NOW^XLFDT "RTN","BSDX07",224,0) - S RPMSL=$P(SL,U) + S:BSDXATID="WALKIN" BSDXFDA(9002018.4,"+1,",.13)="y" "RTN","BSDX07",225,0) - I BSDXLEN9 +BSDXWP(BSDXAPPTID,BSDXNOTE) ; "RTN","BSDX07",232,0) - L +^SC(SC,"ST",$P(SD,"."),1):5 G:'$T SC + ;Add WP field "RTN","BSDX07",233,0) - S SDLOCK=0,S=^SC(SC,"ST",$P(SD,"."),1) + I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" "RTN","BSDX07",234,0) - S I=SD#1-SB*100,ST=I#1*SI\.6+($P(I,".")*SI),SS=SL*HSI/60*SDDIF+ST+ST + I $D(BSDXNOTE(0)) S BSDXNOTE(.5)=BSDXNOTE(0) K BSDXNOTE(0) "RTN","BSDX07",235,0) - I (I<1!'$F(S,"["))&(S'["CAN") L -^SC(SC,"ST",$P(SD,"."),1) Q + I $D(BSDXNOTE(.5)) D "RTN","BSDX07",236,0) - I SM<7 S %=$F(S,"[",SS-1) S:'%!($P(SL,"^",6)<3) %=999 I $F(S,"]",SS)'<%!(SDDIF=2&$E(S,ST+ST+1,SS-1)["[") S SM=7 + . D WP^DIE(9002018.4,BSDXAPPTID_",",1,"","BSDXNOTE","BSDXMSG") "RTN","BSDX07",237,0) - ; + Q "RTN","BSDX07",238,0) -SP I ST+ST>$L(S),$L(S)<80 S S=S_" " G SP + ; "RTN","BSDX07",239,0) - S SDNOT=1 +ADDEVT(BSDXPATID,BSDXSTART,BSDXSC,BSDXSCDA) ;EP "RTN","BSDX07",240,0) - S ABORT=0 + ;Called by BSDX ADD APPOINTMENT protocol "RTN","BSDX07",241,0) - F I=ST+ST:SDDIF:SS-SDDIF D Q:ABORT + ;BSDXSC=IEN of clinic in ^SC "RTN","BSDX07",242,0) - . S ST=$E(S,I+1) S:ST="" ST=" " + ;BSDXSCDA=IEN for ^SC(BSDXSC,"S",BSDXSTART,1,BSDXSCDA). Use to get Length & Note "RTN","BSDX07",243,0) - . S Y=$E(STR,$F(STR,ST)-2) + ; "RTN","BSDX07",244,0) - . I S["CAN"!(ST="X"&($D(^SC(+SC,"ST",$P(SD,"."),"CAN")))) S ABORT=1 Q + N BSDXNOD,BSDXLEN,BSDXAPPTID,BSDXNODP,BSDXWKIN,BSDXRES "RTN","BSDX07",245,0) - . I Y="" S ABORT=1 Q + Q:+$G(BSDXNOEV) "RTN","BSDX07",246,0) - . S:Y'?1NL&(SM<6) SM=6 S ST=$E(S,I+2,999) S:ST="" ST=" " S S=$E(S,1,I)_Y_ST + I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) "RTN","BSDX07",247,0) - . Q + E I $D(^BSDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) "RTN","BSDX07",248,0) - S ^SC(SC,"ST",$P(SD,"."),1)=S + Q:'+$G(BSDXRES) "RTN","BSDX07",249,0) - L -^SC(SC,"ST",$P(SD,"."),1) + S BSDXNOD=$G(^SC(BSDXSC,"S",BSDXSTART,1,BSDXSCDA,0)) "RTN","BSDX07",250,0) - Q + Q:BSDXNOD="" +"RTN","BSDX07",251,0) + S BSDXNODP=$G(^DPT(BSDXPATID,"S",BSDXSTART,0)) +"RTN","BSDX07",252,0) + S BSDXWKIN="" +"RTN","BSDX07",253,0) + S:$P(BSDXNODP,U,7)=4 BSDXWKIN="WALKIN" ;Purpose of Visit field of DPT Appointment subfile +"RTN","BSDX07",254,0) + S BSDXLEN=$P(BSDXNOD,U,2) +"RTN","BSDX07",255,0) + Q:'+BSDXLEN +"RTN","BSDX07",256,0) + S BSDXEND=$$FMADD^XLFDT(BSDXSTART,0,0,BSDXLEN,0) +"RTN","BSDX07",257,0) + S BSDXAPPTID=$$BSDXADD(BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXWKIN) +"RTN","BSDX07",258,0) + Q:'+BSDXAPPTID +"RTN","BSDX07",259,0) + S BSDXNOTE=$P(BSDXNOD,U,4) +"RTN","BSDX07",260,0) + I BSDXNOTE]"" D BSDXWP(BSDXAPPTID,BSDXNOTE) +"RTN","BSDX07",261,0) + D ADDEVT3(BSDXRES) +"RTN","BSDX07",262,0) + Q +"RTN","BSDX07",263,0) + ; +"RTN","BSDX07",264,0) +ADDEVT3(BSDXRES) ; +"RTN","BSDX07",265,0) + ;Call RaiseEvent to notify GUI clients +"RTN","BSDX07",266,0) + N BSDXRESN +"RTN","BSDX07",267,0) + S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) +"RTN","BSDX07",268,0) + Q:BSDXRESN="" +"RTN","BSDX07",269,0) + S BSDXRESN=$P(BSDXRESN,"^") +"RTN","BSDX07",270,0) + ;D EVENT^BSDX23("SCHEDULE-"_BSDXRESN,"","","") +"RTN","BSDX07",271,0) + D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) +"RTN","BSDX07",272,0) + Q +"RTN","BSDX07",273,0) + ; +"RTN","BSDX07",274,0) +ERR(BSDXI,BSDXERR) ;Error processing +"RTN","BSDX07",275,0) + S BSDXI=BSDXI+1 +"RTN","BSDX07",276,0) + S BSDXERR=$TR(BSDXERR,"^","~") +"RTN","BSDX07",277,0) + I $TL>0 TROLLBACK +"RTN","BSDX07",278,0) + S ^BSDXTMP($J,BSDXI)="0^"_BSDXERR_$C(30) +"RTN","BSDX07",279,0) + S BSDXI=BSDXI+1 +"RTN","BSDX07",280,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX07",281,0) + L -^BSDXAPPT(BSDXPATID) +"RTN","BSDX07",282,0) + Q +"RTN","BSDX07",283,0) + ; +"RTN","BSDX07",284,0) +ETRAP ;EP Error trap entry +"RTN","BSDX07",285,0) + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap +"RTN","BSDX07",286,0) + ; Rollback, otherwise ^XTER will be empty from future rollback +"RTN","BSDX07",287,0) + I $TL>0 TROLLBACK +"RTN","BSDX07",288,0) + D ^%ZTER +"RTN","BSDX07",289,0) + S $EC="" ; Clear Error +"RTN","BSDX07",290,0) + ; Log error message and send to client +"RTN","BSDX07",291,0) + I '$D(BSDXI) N BSDXI S BSDXI=0 +"RTN","BSDX07",292,0) + D ERR(BSDXI,"-100~BSDX07 Error: "_$G(%ZTERZE)) +"RTN","BSDX07",293,0) + Q +"RTN","BSDX07",294,0) + ; +"RTN","BSDX07",295,0) +DAY ;;^SUN^MON^TUES^WEDNES^THURS^FRI^SATUR +"RTN","BSDX07",296,0) + ; +"RTN","BSDX07",297,0) +DOW S %=$E(X,1,3),Y=$E(X,4,5),Y=Y>2&'(%#4)+$E("144025036146",Y) +"RTN","BSDX07",298,0) + F %=%:-1:281 S Y=%#4=1+1+Y +"RTN","BSDX07",299,0) + S Y=$E(X,6,7)+Y#7 +"RTN","BSDX07",300,0) + Q +"RTN","BSDX07",301,0) + ; +"RTN","BSDX07",302,0) +AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) ;Update RPMS Clinic availability +"RTN","BSDX07",303,0) + ;SEE SDM1 +"RTN","BSDX07",304,0) + N Y,DFN +"RTN","BSDX07",305,0) + N SL,STARTDAY,X,SC,SB,HSI,SI,STR,SDDIF,SDMAX,SDDATE,SDDMAX,SDSDATE,CCXN,MXOK,COV,SDPROG +"RTN","BSDX07",306,0) + N X1,SDEDT,X2,SD,SM,SS,S,SDLOCK,ST,I +"RTN","BSDX07",307,0) + S Y=BSDXSCD,DFN=BSDXPATID +"RTN","BSDX07",308,0) + S SL=$G(^SC(+Y,"SL")),X=$P(SL,U,3),STARTDAY=$S($L(X):X,1:8),SC=Y,SB=STARTDAY-1/100,X=$P(SL,U,6),HSI=$S(X=1:X,X:X,1:4),SI=$S(X="":4,X<3:4,X:X,1:4),STR="#@!$* XXWVUTSRQPONMLKJIHGFEDCBA0123456789jklmnopqrstuvwxyz",SDDIF=$S(HSI<3:8/HSI,1:2) K Y +"RTN","BSDX07",309,0) + ;Determine maximum days for scheduling +"RTN","BSDX07",310,0) + S SDMAX(1)=$P($G(^SC(+SC,"SDP")),U,2) S:'SDMAX(1) SDMAX(1)=365 +"RTN","BSDX07",311,0) + S (SDMAX,SDDMAX)=$$FMADD^XLFDT(DT,SDMAX(1)) +"RTN","BSDX07",312,0) + S SDDATE=BSDXSTART +"RTN","BSDX07",313,0) + S SDSDATE=SDDATE,SDDATE=SDDATE\1 +"RTN","BSDX07",314,0) +1 ;L Q:$D(SDXXX) S CCXN=0 K MXOK,COV,SDPROT Q:DFN<0 S SC=+SC +"RTN","BSDX07",315,0) + Q:$D(SDXXX) S CCXN=0 K MXOK,COV,SDPROT Q:DFN<0 S SC=+SC +"RTN","BSDX07",316,0) + S X1=DT,SDEDT=365 S:$D(^SC(SC,"SDP")) SDEDT=$P(^SC(SC,"SDP"),"^",2) +"RTN","BSDX07",317,0) + S X2=SDEDT D C^%DTC S SDEDT=X +"RTN","BSDX07",318,0) + S Y=BSDXSTART +"RTN","BSDX07",319,0) +EN1 S (X,SD)=Y,SM=0 D DOW +"RTN","BSDX07",320,0) +S I '$D(^SC(SC,"ST",$P(SD,"."),1)) S SS=+$O(^SC(+SC,"T"_Y,SD)) Q:SS'>0 Q:^(SS,1)="" S ^SC(+SC,"ST",$P(SD,"."),1)=$E($P($T(DAY),U,Y+2),1,2)_" "_$E(SD,6,7)_$J("",SI+SI-6)_^(1),^(0)=$P(SD,".") +"RTN","BSDX07",321,0) + S S=BSDXLEN +"RTN","BSDX07",322,0) + ;Check if BSDXLEN evenly divisible by appointment length +"RTN","BSDX07",323,0) + S RPMSL=$P(SL,U) +"RTN","BSDX07",324,0) + I BSDXLEN9 +"RTN","BSDX07",331,0) + L +^SC(SC,"ST",$P(SD,"."),1):5 G:'$T SC +"RTN","BSDX07",332,0) + S SDLOCK=0,S=^SC(SC,"ST",$P(SD,"."),1) +"RTN","BSDX07",333,0) + S I=SD#1-SB*100,ST=I#1*SI\.6+($P(I,".")*SI),SS=SL*HSI/60*SDDIF+ST+ST +"RTN","BSDX07",334,0) + I (I<1!'$F(S,"["))&(S'["CAN") L -^SC(SC,"ST",$P(SD,"."),1) Q +"RTN","BSDX07",335,0) + I SM<7 S %=$F(S,"[",SS-1) S:'%!($P(SL,"^",6)<3) %=999 I $F(S,"]",SS)'<%!(SDDIF=2&$E(S,ST+ST+1,SS-1)["[") S SM=7 +"RTN","BSDX07",336,0) + ; +"RTN","BSDX07",337,0) +SP I ST+ST>$L(S),$L(S)<80 S S=S_" " G SP +"RTN","BSDX07",338,0) + S SDNOT=1 +"RTN","BSDX07",339,0) + S ABORT=0 +"RTN","BSDX07",340,0) + F I=ST+ST:SDDIF:SS-SDDIF D Q:ABORT +"RTN","BSDX07",341,0) + . S ST=$E(S,I+1) S:ST="" ST=" " +"RTN","BSDX07",342,0) + . S Y=$E(STR,$F(STR,ST)-2) +"RTN","BSDX07",343,0) + . I S["CAN"!(ST="X"&($D(^SC(+SC,"ST",$P(SD,"."),"CAN")))) S ABORT=1 Q +"RTN","BSDX07",344,0) + . I Y="" S ABORT=1 Q +"RTN","BSDX07",345,0) + . S:Y'?1NL&(SM<6) SM=6 S ST=$E(S,I+2,999) S:ST="" ST=" " S S=$E(S,1,I)_Y_ST +"RTN","BSDX07",346,0) + . Q +"RTN","BSDX07",347,0) + S ^SC(SC,"ST",$P(SD,"."),1)=S +"RTN","BSDX07",348,0) + L -^SC(SC,"ST",$P(SD,"."),1) +"RTN","BSDX07",349,0) + Q "RTN","BSDX08") -0^8^B36787520 +0^8^B140041473 "RTN","BSDX08",1,0) -BSDX08 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/15/10 8:21pm +BSDX08 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 12:35pm "RTN","BSDX08",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX08",3,0) - ; + ; "RTN","BSDX08",4,0) - ; + ; Original by HMW. New Written by Sam Habiel. Licensed under LGPL. "RTN","BSDX08",5,0) -APPDELD(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ;EP + ; "RTN","BSDX08",6,0) - ;Entry point for debugging + ; Change History "RTN","BSDX08",7,0) - ; + ; 3101022 UJO/SMH v1.42 "RTN","BSDX08",8,0) - ;D DEBUG^%Serenji("APPDEL^BSDX08(.BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT)") + ; - Transaction now restartable. Thanks to "RTN","BSDX08",9,0) - Q + ; --> Zach Gonzalez and Rick Marshall for fix. "RTN","BSDX08",10,0) - ; + ; - Extra TROLLBACK in Lock Statement when lock fails. "RTN","BSDX08",11,0) -APPDEL(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ;EP + ; --> Removed--Rollback is already in ERR tag. "RTN","BSDX08",12,0) - ;Called by BSDX CANCEL APPOINTMENT + ; - Added new statements to old SD code in AVUPDT to obviate "RTN","BSDX08",13,0) - ;Cancels appointment + ; --> need to restore variables in transaction "RTN","BSDX08",14,0) - ;BSDXAPTID is entry number in BSDX APPOINTMENT file + ; - Refactored this chunk of code. Don't really know whether it "RTN","BSDX08",15,0) - ;BSDXTYP is C for clinic-cancelled and PC for patient cancelled + ; --> worked in the first place. Waiting for bug report to know. "RTN","BSDX08",16,0) - ;BSDXCR is pointer to CANCELLATION REASON File (409.2) + ; - Refactored all of APPDEL. "RTN","BSDX08",17,0) - ;BSDXNOT is user note + ; "RTN","BSDX08",18,0) - ;Returns error code in recordset field ERRORID + ; Error Reference: "RTN","BSDX08",19,0) - ; + ; -1~BSDX08: Appt record is locked. Please contact technical support. "RTN","BSDX08",20,0) - ; + ; -2~BSDX08: Invalid Appointment ID "RTN","BSDX08",21,0) - N BSDXNOD,BSDXPATID,BSDXSTART,DIK,DA,BSDXID,BSDXI,BSDXZ,BSDXERR + ; -3~BSDX08: Invalid Appointment ID "RTN","BSDX08",22,0) - N BSDXLOC,BSDXLEN,BSDXSCIEN + ; -4~BSDX08: Cancelled appointment does not have a Resouce ID "RTN","BSDX08",23,0) - N BSDXNOEV + ; -5~BSDX08: Resouce ID does not exist in BSDX RESOURCE "RTN","BSDX08",24,0) - S BSDXNOEV=1 ;Don't execute BSDX CANCEL APPOINTMENT protocol + ; -6~BSDX08: Invalid Hosp Location stored in Database "RTN","BSDX08",25,0) - ; + ; -7~BSDX08: Patient does not have an appointment in PIMS Clinic "RTN","BSDX08",26,0) - D ^XBKVAR S X="ETRAP^BSDX08",@^%ZOSF("TRAP") + ; -8^BSDX08: Unable to find associated PIMS appointment for this patient "RTN","BSDX08",27,0) - S BSDXI=0 + ; -9^BSDX08: BSDXAPI returned an error: (error) "RTN","BSDX08",28,0) - K ^BSDXTMP($J) + ; -100~BSDX08 Error: (Mumps Error) "RTN","BSDX08",29,0) - S BSDXY="^BSDXTMP("_$J_")" + ; "RTN","BSDX08",30,0) - S ^BSDXTMP($J,BSDXI)="T00020ERRORID"_$C(30) +APPDELD(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ;EP "RTN","BSDX08",31,0) - S BSDXI=BSDXI+1 + ;Entry point for debugging "RTN","BSDX08",32,0) - TSTART + D DEBUG^%Serenji("APPDEL^BSDX08(.BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT)") "RTN","BSDX08",33,0) - I '+BSDXAPTID D ERR(BSDXI,"BSDX08: Invalid Appointment ID") Q + Q "RTN","BSDX08",34,0) - I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"BSDX08: Invalid Appointment ID") Q + ; "RTN","BSDX08",35,0) - ; +UT ; Unit Tests "RTN","BSDX08",36,0) - ;Delete APPOINTMENT entries + ; Test 1: Make normal appointment and cancel it. See if every thing works "RTN","BSDX08",37,0) - S BSDXNOD=^BSDXAPPT(BSDXAPTID,0) + N ZZZ "RTN","BSDX08",38,0) - S BSDXPATID=$P(BSDXNOD,U,5) + D APPADD^BSDX07(.ZZZ,3110123.2,3110123.3,4,"Dr Office",10,"Sam's Note",1) "RTN","BSDX08",39,0) - S BSDXSTART=$P(BSDXNOD,U) + S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX08",40,0) - ; + D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note") "RTN","BSDX08",41,0) - ;Lock BSDX node + I $P(^BSDXAPPT(APPID,0),U,12)'>0 W "Error in Cancellation-1" "RTN","BSDX08",42,0) - L +^BSDXAPPT(BSDXPATID):5 I '$T D ERR(BSDXI+1,"Another user is working with this patient's record. Please try again later") TROLLBACK Q + I $O(^SC(2,"S",3110123.2,1,0))]"" W "Error in Cancellation-2" "RTN","BSDX08",43,0) - ; + I $P(^DPT(4,"S",3110123.2,0),U,2)'="PC" W "Error in Cancellation-3" "RTN","BSDX08",44,0) - D BSDXCAN(BSDXAPTID) + I ^DPT(4,"S",3110123.2,"R")'="Sam's Cancel Note" W "Error in Cancellation-4" "RTN","BSDX08",45,0) - ; + ; "RTN","BSDX08",46,0) - S BSDXSC1=$P(BSDXNOD,U,7) ;RESOURCEID + ; Test 2: Check for -1 "RTN","BSDX08",47,0) - I BSDXSC1]"",$D(^BSDXRES(BSDXSC1,0)) D I +$G(BSDXZ) S BSDXERR=BSDXERR_$P(BSDXZ,U,2) D ERR(BSDXI,BSDXERR) Q + ; Make appt "RTN","BSDX08",48,0) - . S BSDXNOD=^BSDXRES(BSDXSC1,0) + D APPADD^BSDX07(.ZZZ,3110125.2,3110125.3,4,"Dr Office",10,"Sam's Note",1) "RTN","BSDX08",49,0) - . S BSDXLOC=$P(BSDXNOD,U,4) ;HOSPITAL LOCATION + ; Lock the node in another job "RTN","BSDX08",50,0) - . Q:'+BSDXLOC + S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX08",51,0) - . S BSDXSCIEN=$$SCIEN^BSDXAPI(BSDXPATID,BSDXLOC,BSDXSTART) I BSDXSCIEN="" D I 'BSDXZ Q ;Q:BSDXZ + ; W "Lock ^BSDXAPPT("_APPID_") in another session. You have 10 seconds." H 10 "RTN","BSDX08",52,0) - . . S BSDXERR="BSDX08: Unable to find associated RPMS appointment for this patient. " + D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note") "RTN","BSDX08",53,0) - . . S BSDXZ=1 + ; "RTN","BSDX08",54,0) - . . I '$D(^BSDXRES(BSDXSC1,20)) S BSDXZ=0 Q + ; Test 3: Check for -100 "RTN","BSDX08",55,0) - . . N BSDX1 + S bsdxdie=1 "RTN","BSDX08",56,0) - . . S BSDX1=0 + D APPADD^BSDX07(.ZZZ,3110126.2,3110126.3,4,"Dr Office",10,"Sam's Note",1) "RTN","BSDX08",57,0) - . . F S BSDX1=$O(^BSDXRES(BSDXSC1,20,BSDX1)) Q:'+BSDX1 Q:BSDXZ=0 D + S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX08",58,0) - . . . Q:'$D(^BSDXRES(BSDXSC1,20,BSDX1,0)) + D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons") "RTN","BSDX08",59,0) - . . . S BSDXLOC=$P(^BSDXRES(BSDXSC1,20,BSDX1,0),U) + I $P(^BSDXTMP($J,1),"~")'=-100 W "Error in -100",! "RTN","BSDX08",60,0) - . . . S BSDXSCIEN=$$SCIEN^BSDXAPI(BSDXPATID,BSDXLOC,BSDXSTART) I +BSDXSCIEN S BSDXZ=0 Q + K bsdxdie "RTN","BSDX08",61,0) - . S BSDXERR="BSDX08: CANCEL^BSDXAPI Returned " + ; "RTN","BSDX08",62,0) - . I BSDXLOC']"" S BSDXZ="0^Unable to find associated RPMS appointment for this patient." Q + ; Test 4: Restartable transaction "RTN","BSDX08",63,0) - . I '$D(^SC(BSDXLOC,0)) S BSDXZ="0^Unable to find associated RPMS appointment for this patient." Q + S bsdxrestart=1 "RTN","BSDX08",64,0) - . S BSDXNOD=$G(^SC(BSDXLOC,"S",BSDXSTART,1,BSDXSCIEN,0)) + D APPADD^BSDX07(.ZZZ,3110128.2,3110128.3,4,"Dr Office",10,"Sam's Note",1) "RTN","BSDX08",65,0) - . I BSDXNOD="" S BSDXZ="0^Unable to find associated RPMS appointment for this patient." Q + S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX08",66,0) - . S BSDXLEN=$P(BSDXNOD,U,2) + D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons") "RTN","BSDX08",67,0) - . D APCAN(.BSDXZ,BSDXLOC,BSDXPATID,BSDXSTART) + I $P(^DPT(4,"S",3110128.2,0),U,2)'="PC" W "Error in Restartable Transaction",! "RTN","BSDX08",68,0) - . Q:+$G(BSDXZ) + ; "RTN","BSDX08",69,0) - . D AVUPDT(BSDXLOC,BSDXSTART,BSDXLEN) + ; Test 5: for invalid Appointment ID (-2 and -3) "RTN","BSDX08",70,0) - . ;L + D APPDEL^BSDX08(.ZZZ,0,"PC",1,"Reasons") "RTN","BSDX08",71,0) - ; + I $P(^BSDXTMP($J,1),"~")'=-2 W "Error in -2",! "RTN","BSDX08",72,0) - TCOMMIT + D APPDEL^BSDX08(.ZZZ,999999,"PC",1,"Reasons") "RTN","BSDX08",73,0) - L -^BSDXAPPT(BSDXPATID) + I $P(^BSDXTMP($J,1),"~")'=-3 W "Error in -3",! "RTN","BSDX08",74,0) - S BSDXI=BSDXI+1 + QUIT "RTN","BSDX08",75,0) - S ^BSDXTMP($J,BSDXI)=""_$C(30) + ; Lock the node in another job for testing. "RTN","BSDX08",76,0) - S BSDXI=BSDXI+1 +UTL(APPID) L +^BSDXAPPT(APPID) HANG 10 QUIT "RTN","BSDX08",77,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + ; "RTN","BSDX08",78,0) - Q +APPDEL(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ;EP "RTN","BSDX08",79,0) - ; + ;Called by RPC: BSDX CANCEL APPOINTMENT "RTN","BSDX08",80,0) -AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) ;Update RPMS Clinic availability + ;Cancels existing appointment in BSDX APPOINTMENT and 44/2 subfiles "RTN","BSDX08",81,0) - ;See SDCNP0 + ;Input Parameters: "RTN","BSDX08",82,0) - S (SD,S)=BSDXSTART + ; - BSDXAPTID is entry number in BSDX APPOINTMENT file "RTN","BSDX08",83,0) - S I=BSDXSCD + ; - BSDXTYP is C for clinic-cancelled and PC for patient cancelled "RTN","BSDX08",84,0) - Q:'$D(^SC(I,"ST",SD\1,1)) + ; - BSDXCR is pointer to CANCELLATION REASON File (409.2) "RTN","BSDX08",85,0) - S SL=^SC(I,"SL"),X=$P(SL,U,3),STARTDAY=$S($L(X):X,1:8),SB=STARTDAY-1/100,X=$P(SL,U,6),HSI=$S(X:X,1:4),SI=$S(X="":4,X<3:4,X:X,1:4),STR="#@!$* XXWVUTSRQPONMLKJIHGFEDCBA0123456789jklmnopqrstuvwxyz",SDDIF=$S(HSI<3:8/HSI,1:2) K Y + ; - BSDXNOT is user note "RTN","BSDX08",86,0) - S SL=BSDXLEN + ; "RTN","BSDX08",87,0) - S S=^SC(I,"ST",SD\1,1),Y=SD#1-SB*100,ST=Y#1*SI\.6+(Y\1*SI),SS=SL*HSI/60 + ; Returns error code in recordset field ERRORID. Zero is success. "RTN","BSDX08",88,0) - I Y'<1 F I=ST+ST:SDDIF S Y=$E(STR,$F(STR,$E(S,I+1))) Q:Y="" S S=$E(S,1,I)_Y_$E(S,I+2,999),SS=SS-1 Q:SS'>0 + ; Returns Global Array. Must use this type in RPC. "RTN","BSDX08",89,0) - S ^SC(BSDXSCD,"ST",SD\1,1)=S + ; "RTN","BSDX08",90,0) - Q + ; Return Array: set Return and clear array "RTN","BSDX08",91,0) - ; + S BSDXY=$NA(^BSDXTMP($J)) "RTN","BSDX08",92,0) -APCAN(BSDXZ,BSDXLOC,BSDXDFN,BSDXSD) ; + K ^BSDXTMP($J) "RTN","BSDX08",93,0) - ;Cancel appointment for patient BSDXDFN in clinic BSDXSC1 -"RTN","BSDX08",94,0) - ;at time BSDXSD -"RTN","BSDX08",95,0) - N BSDXC,%H -"RTN","BSDX08",96,0) - S BSDXC("PAT")=BSDXPATID -"RTN","BSDX08",97,0) - S BSDXC("CLN")=BSDXLOC -"RTN","BSDX08",98,0) - S BSDXC("TYP")=BSDXTYP -"RTN","BSDX08",99,0) - S BSDXC("ADT")=BSDXSD -"RTN","BSDX08",100,0) - S %H=$H D YMD^%DTC -"RTN","BSDX08",101,0) - S BSDXC("CDT")=X+% -"RTN","BSDX08",102,0) - S BSDXC("NOT")=BSDXNOT -"RTN","BSDX08",103,0) - S:'+$G(BSDXCR) BSDXCR=11 ;Other -"RTN","BSDX08",104,0) - S BSDXC("CR")=BSDXCR -"RTN","BSDX08",105,0) - S BSDXC("USR")=DUZ -"RTN","BSDX08",106,0) ; +"RTN","BSDX08",94,0) + ; Set min DUZ vars if they don't exist +"RTN","BSDX08",95,0) + D ^XBKVAR +"RTN","BSDX08",96,0) + ; +"RTN","BSDX08",97,0) + ; $ET +"RTN","BSDX08",98,0) + N $ET S $ET="G ETRAP^BSDX08" +"RTN","BSDX08",99,0) + ; +"RTN","BSDX08",100,0) + ; Counter +"RTN","BSDX08",101,0) + N BSDXI S BSDXI=0 +"RTN","BSDX08",102,0) + ; Header Node +"RTN","BSDX08",103,0) + S ^BSDXTMP($J,BSDXI)="T00100ERRORID"_$C(30) +"RTN","BSDX08",104,0) + ; +"RTN","BSDX08",105,0) + ; Lock BSDX node, only to synchronize access to the globals. +"RTN","BSDX08",106,0) + ; It's not expected that the error will ever happen as no filing "RTN","BSDX08",107,0) - S BSDXZ=$$CANCEL^BSDXAPI(.BSDXC) + ; is supposed to take 5 seconds. "RTN","BSDX08",108,0) - Q + L +^BSDXAPPT(BSDXAPTID):5 I '$T D ERR(BSDXI,"-1~BSDX08: Appt record is locked. Please contact technical support.") Q "RTN","BSDX08",109,0) ; "RTN","BSDX08",110,0) -BSDXCAN(BSDXAPTID) ; + ;Restartable Transaction; restore paramters when starting. "RTN","BSDX08",111,0) - ;Cancel BSDX APPOINTMENT entry + ; (Params restored are what's passed here + BSDXI) "RTN","BSDX08",112,0) - N %DT,X,BSDXDATE,Y,BSDXIENS,BSDXFDA,BSDXMSG + TSTART (BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT,BSDXI):T="BSDX CANCEL APPOINTEMENT^BSDX08" "RTN","BSDX08",113,0) - S %DT="XT",X="NOW" D ^%DT ; X ^DD("DD") + ; "RTN","BSDX08",114,0) - S BSDXDATE=Y + ; Turn off SDAM APPT PROTOCOL BSDX Entries "RTN","BSDX08",115,0) - S BSDXIENS=BSDXAPTID_"," + N BSDXNOEV "RTN","BSDX08",116,0) - S BSDXFDA(9002018.4,BSDXIENS,.12)=BSDXDATE + S BSDXNOEV=1 ;Don't execute BSDX CANCEL APPOINTMENT protocol "RTN","BSDX08",117,0) - K BSDXMSG + ; "RTN","BSDX08",118,0) - D FILE^DIE("","BSDXFDA","BSDXMSG") + ;;;test for error inside transaction. See if %ZTER works "RTN","BSDX08",119,0) - Q + I $G(bsdxdie) S X=1/0 "RTN","BSDX08",120,0) - ; + ;;;test "RTN","BSDX08",121,0) -CANEVT(BSDXPAT,BSDXSTART,BSDXSC) ;EP Called by BSDX CANCEL APPOINTMENT event + ;;;test for TRESTART "RTN","BSDX08",122,0) - ;when appointments cancelled via PIMS interface. + I $G(bsdxrestart) K bsdxrestart TRESTART "RTN","BSDX08",123,0) - ;Propagates cancellation to BSDXAPPT and raises refresh event to running GUI clients + ;;;test "RTN","BSDX08",124,0) - N BSDXFOUND,BSDXRES + ; "RTN","BSDX08",125,0) - Q:+$G(BSDXNOEV) + ; Check appointment ID and whether it exists "RTN","BSDX08",126,0) - Q:'+$G(BSDXSC) + I '+BSDXAPTID D ERR(BSDXI,"-2~BSDX08: Invalid Appointment ID") Q "RTN","BSDX08",127,0) - S BSDXFOUND=0 + I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"-3~BSDX08: Invalid Appointment ID") Q "RTN","BSDX08",128,0) - I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) S BSDXFOUND=$$CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) + ; "RTN","BSDX08",129,0) - I BSDXFOUND D CANEVT3(BSDXRES) Q + ; Start Processing: "RTN","BSDX08",130,0) - I $D(^BXDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) S BSDXFOUND=$$CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) + ; First, add cancellation date to appt entry in BSDX APPOINTMENT "RTN","BSDX08",131,0) - I BSDXFOUND D CANEVT3(BSDXRES) + N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAPTID,0) ; BSDX Appt Node "RTN","BSDX08",132,0) - Q + N BSDXPATID S BSDXPATID=$P(BSDXNOD,U,5) ; Patient ID "RTN","BSDX08",133,0) - ; + N BSDXSTART S BSDXSTART=$P(BSDXNOD,U) ; Start Time "RTN","BSDX08",134,0) -CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) ; + D BSDXCAN(BSDXAPTID) ; Add a cancellation date in BSDX APPOINTMENT "RTN","BSDX08",135,0) - ;Get appointment id in BSDXAPT + ; "RTN","BSDX08",136,0) - ;If found, call BSDXCAN(BSDXAPPT) and return 1 + ; Second, cancel appt in "S" nodes in file 2 and 44, then update Legacy PIMS Availability "RTN","BSDX08",137,0) - ;else return 0 + N BSDXSC1 S BSDXSC1=$P(BSDXNOD,U,7) ;RESOURCEID "RTN","BSDX08",138,0) - N BSDXFOUND,BSDXAPPT + ; If the resouce id doesn't exist... "RTN","BSDX08",139,0) - S BSDXFOUND=0 + I BSDXSC1="" D ERR(BSDXI,"-4~BSDX08: Cancelled appointment does not have a Resouce ID") QUIT "RTN","BSDX08",140,0) - Q:'+BSDXRES BSDXFOUND + I '$D(^BSDXRES(BSDXSC1,0)) D ERR(BSDXI,"-5~BSDX08: Resouce ID does not exist in BSDX RESOURCE") QUIT "RTN","BSDX08",141,0) - Q:'$D(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART)) BSDXFOUND + ; Get zero node of resouce "RTN","BSDX08",142,0) - S BSDXAPPT=0 F S BSDXAPPT=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART,BSDXAPPT)) Q:'+BSDXAPPT D Q:BSDXFOUND + S BSDXNOD=^BSDXRES(BSDXSC1,0) "RTN","BSDX08",143,0) - . S BSDXNOD=$G(^BSDXAPPT(BSDXAPPT,0)) Q:BSDXNOD="" + ; Get Hosp location "RTN","BSDX08",144,0) - . I $P(BSDXNOD,U,5)=BSDXPAT,$P(BSDXNOD,U,12)="" S BSDXFOUND=1 Q + N BSDXLOC S BSDXLOC=$P(BSDXNOD,U,4) "RTN","BSDX08",145,0) - I BSDXFOUND,+$G(BSDXAPPT) D BSDXCAN(BSDXAPPT) + ; Error indicator for Hosp Location filing for getting out of routine "RTN","BSDX08",146,0) - Q BSDXFOUND + N BSDXERR S BSDXERR=0 "RTN","BSDX08",147,0) - ; + ; Only file in 2/44 if there is an associated hospital location "RTN","BSDX08",148,0) -CANEVT3(BSDXRES) ; + I BSDXLOC D QUIT:BSDXERR "RTN","BSDX08",149,0) - ;Call RaiseEvent to notify GUI clients + . I '$D(^SC(BSDXLOC,0)) S BSDXERR=1 D ERR(BSDXI,"-6~BSDX08: Invalid Hosp Location stored in Database") QUIT "RTN","BSDX08",150,0) - ; + . ; Get the IEN of the appointment in the "S" node of ^SC "RTN","BSDX08",151,0) - N BSDXRESN + . N BSDXSCIEN "RTN","BSDX08",152,0) - S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) + . S BSDXSCIEN=$$SCIEN^BSDXAPI(BSDXPATID,BSDXLOC,BSDXSTART) "RTN","BSDX08",153,0) - Q:BSDXRESN="" + . I BSDXSCIEN="" S BSDXERR=1 D ERR(BSDXI,"-7~BSDX08: Patient does not have an appointment in PIMS Clinic") QUIT "RTN","BSDX08",154,0) - S BSDXRESN=$P(BSDXRESN,"^") + . ; Get the appointment node "RTN","BSDX08",155,0) - ;D EVENT^BSDX23("SCHEDULE-"_BSDXRESN,"","","") + . S BSDXNOD=$G(^SC(BSDXLOC,"S",BSDXSTART,1,BSDXSCIEN,0)) "RTN","BSDX08",156,0) - D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) + . I BSDXNOD="" S BSDXERR=1 D ERR(BSDXI,"-8^BSDX08: Unable to find associated PIMS appointment for this patient") QUIT "RTN","BSDX08",157,0) - Q + . N BSDXLEN S BSDXLEN=$P(BSDXNOD,U,2) "RTN","BSDX08",158,0) - ; + . ; Cancel through BSDXAPI "RTN","BSDX08",159,0) -ERR(BSDXI,BSDXERR) ;Error processing + . N BSDXZ "RTN","BSDX08",160,0) - S BSDXI=BSDXI+1 + . D APCAN(.BSDXZ,BSDXLOC,BSDXPATID,BSDXSTART) "RTN","BSDX08",161,0) - S BSDXERR=$TR(BSDXERR,"^","~") + . I +BSDXZ>0 S BSDXERR=1 D ERR(BSDXI,"-9^BSDX08: BSDXAPI returned an error: "_$P(BSDXZ,U,2)) QUIT "RTN","BSDX08",162,0) - TROLLBACK + . ; Update Legacy PIMS clinic Availability "RTN","BSDX08",163,0) - S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30) + . D AVUPDT(BSDXLOC,BSDXSTART,BSDXLEN) "RTN","BSDX08",164,0) - S BSDXI=BSDXI+1 -"RTN","BSDX08",165,0) - S ^BSDXTMP($J,BSDXI)=$C(31) -"RTN","BSDX08",166,0) - L -"RTN","BSDX08",167,0) - Q -"RTN","BSDX08",168,0) ; -"RTN","BSDX08",169,0) -ETRAP ;EP Error trap entry -"RTN","BSDX08",170,0) - D ^%ZTER -"RTN","BSDX08",171,0) - I '$D(BSDXI) N BSDXI S BSDXI=999999 -"RTN","BSDX08",172,0) +"RTN","BSDX08",165,0) + TCOMMIT +"RTN","BSDX08",166,0) + L -^BSDXAPPT(BSDXAPTID) +"RTN","BSDX08",167,0) S BSDXI=BSDXI+1 -"RTN","BSDX08",173,0) - D ERR(BSDXI,"BSDX08 Error: "_$G(%ZTERROR)) -"RTN","BSDX08",174,0) +"RTN","BSDX08",168,0) + S ^BSDXTMP($J,BSDXI)=""_$C(30) +"RTN","BSDX08",169,0) + S BSDXI=BSDXI+1 +"RTN","BSDX08",170,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX08",171,0) Q +"RTN","BSDX08",172,0) + ; +"RTN","BSDX08",173,0) +AVUPDT(BSDXSCD,BSDXSTART,BSDXLEN) ;Update Legacy PIMS Clinic availability +"RTN","BSDX08",174,0) + ;See SDCNP0 +"RTN","BSDX08",175,0) + N SD,S ; Start Date +"RTN","BSDX08",176,0) + S (SD,S)=BSDXSTART +"RTN","BSDX08",177,0) + N I ; Clinic IEN in 44 +"RTN","BSDX08",178,0) + S I=BSDXSCD +"RTN","BSDX08",179,0) + ; if day has no schedule in legacy PIMS, forget about this update. +"RTN","BSDX08",180,0) + Q:'$D(^SC(I,"ST",SD\1,1)) +"RTN","BSDX08",181,0) + N SL ; Clinic characteristics node (length of appt, when appts start etc) +"RTN","BSDX08",182,0) + S SL=^SC(I,"SL") +"RTN","BSDX08",183,0) + N X ; Hour Clinic Display Begins +"RTN","BSDX08",184,0) + S X=$P(SL,U,3) +"RTN","BSDX08",185,0) + N STARTDAY ; When does the day start? +"RTN","BSDX08",186,0) + S STARTDAY=$S($L(X):X,1:8) ; If defined, use it; otherwise, 8am +"RTN","BSDX08",187,0) + N SB ; ?? Who knows? Day Start - 1 divided by 100. +"RTN","BSDX08",188,0) + S SB=STARTDAY-1/100 +"RTN","BSDX08",189,0) + S X=$P(SL,U,6) ; Now X is Display increments per hour +"RTN","BSDX08",190,0) + N HSI ; Slots per hour, try 1 +"RTN","BSDX08",191,0) + S HSI=$S(X:X,1:4) ; if defined, use it; otherwise, 4 +"RTN","BSDX08",192,0) + N SI ; Slots per hour, try 2 +"RTN","BSDX08",193,0) + S SI=$S(X="":4,X<3:4,X:X,1:4) ; If slots "", or less than 3, then 4 +"RTN","BSDX08",194,0) + N STR ; ?? +"RTN","BSDX08",195,0) + S STR="#@!$* XXWVUTSRQPONMLKJIHGFEDCBA0123456789jklmnopqrstuvwxyz" +"RTN","BSDX08",196,0) + N SDDIF ; Slots per hour diff?? +"RTN","BSDX08",197,0) + S SDDIF=$S(HSI<3:8/HSI,1:2) +"RTN","BSDX08",198,0) + S SL=BSDXLEN ; Dammit, reusing variable; SL now Appt Length from GUI +"RTN","BSDX08",199,0) + S S=^SC(I,"ST",SD\1,1) ; reusing var again; S now Day Pattern from PIMS +"RTN","BSDX08",200,0) + N Y ; Hours since start of Date +"RTN","BSDX08",201,0) + S Y=SD#1-SB*100 ;SD#1=FM Time portion; -SB minus start of day; conv to hrs +"RTN","BSDX08",202,0) + N ST ; ?? +"RTN","BSDX08",203,0) + ; Y#1 -> Minutes; *SI -> * Slots per hour; \.6 trunc min to hour +"RTN","BSDX08",204,0) + ; Y\1 -> Hours since start of day; * SI: * slots +"RTN","BSDX08",205,0) + S ST=Y#1*SI\.6+(Y\1*SI) +"RTN","BSDX08",206,0) + N SS ; how many slots are supposed to be taken by appointment +"RTN","BSDX08",207,0) + S SS=SL*HSI/60 ; (nb: try SL: 30 min; HSI: 4 slots) +"RTN","BSDX08",208,0) + N I +"RTN","BSDX08",209,0) + I Y'<1 D ; If Hours since start of Date is greater than 1 +"RTN","BSDX08",210,0) + . ; loop through pattern. Tired of documenting. +"RTN","BSDX08",211,0) + . F I=ST+ST:SDDIF D Q:Y="" Q:SS'>0 +"RTN","BSDX08",212,0) + . . S Y=$E(STR,$F(STR,$E(S,I+1))) Q:Y="" +"RTN","BSDX08",213,0) + . . S S=$E(S,1,I)_Y_$E(S,I+2,999) +"RTN","BSDX08",214,0) + . . S SS=SS-1 +"RTN","BSDX08",215,0) + . . Q:SS'>0 +"RTN","BSDX08",216,0) + S ^SC(BSDXSCD,"ST",SD\1,1)=S ; new pattern; global set +"RTN","BSDX08",217,0) + Q +"RTN","BSDX08",218,0) + ; +"RTN","BSDX08",219,0) +APCAN(BSDXZ,BSDXLOC,BSDXDFN,BSDXSD) ; +"RTN","BSDX08",220,0) + ;Cancel appointment for patient BSDXDFN in clinic BSDXSC1 +"RTN","BSDX08",221,0) + ;at time BSDXSD +"RTN","BSDX08",222,0) + N BSDXC,%H +"RTN","BSDX08",223,0) + S BSDXC("PAT")=BSDXPATID +"RTN","BSDX08",224,0) + S BSDXC("CLN")=BSDXLOC +"RTN","BSDX08",225,0) + S BSDXC("TYP")=BSDXTYP +"RTN","BSDX08",226,0) + S BSDXC("ADT")=BSDXSD +"RTN","BSDX08",227,0) + S %H=$H D YMD^%DTC +"RTN","BSDX08",228,0) + S BSDXC("CDT")=X+% +"RTN","BSDX08",229,0) + S BSDXC("NOT")=BSDXNOT +"RTN","BSDX08",230,0) + S:'+$G(BSDXCR) BSDXCR=11 ;Other +"RTN","BSDX08",231,0) + S BSDXC("CR")=BSDXCR +"RTN","BSDX08",232,0) + S BSDXC("USR")=DUZ +"RTN","BSDX08",233,0) + ; +"RTN","BSDX08",234,0) + S BSDXZ=$$CANCEL^BSDXAPI(.BSDXC) +"RTN","BSDX08",235,0) + Q +"RTN","BSDX08",236,0) + ; +"RTN","BSDX08",237,0) +BSDXCAN(BSDXAPTID) ; +"RTN","BSDX08",238,0) + ;Cancel BSDX APPOINTMENT entry +"RTN","BSDX08",239,0) + N %DT,X,BSDXDATE,Y,BSDXIENS,BSDXFDA,BSDXMSG +"RTN","BSDX08",240,0) + S %DT="XT",X="NOW" D ^%DT ; X ^DD("DD") +"RTN","BSDX08",241,0) + S BSDXDATE=Y +"RTN","BSDX08",242,0) + S BSDXIENS=BSDXAPTID_"," +"RTN","BSDX08",243,0) + S BSDXFDA(9002018.4,BSDXIENS,.12)=BSDXDATE +"RTN","BSDX08",244,0) + K BSDXMSG +"RTN","BSDX08",245,0) + D FILE^DIE("","BSDXFDA","BSDXMSG") +"RTN","BSDX08",246,0) + Q +"RTN","BSDX08",247,0) + ; +"RTN","BSDX08",248,0) +CANEVT(BSDXPAT,BSDXSTART,BSDXSC) ;EP Called by BSDX CANCEL APPOINTMENT event +"RTN","BSDX08",249,0) + ;when appointments cancelled via PIMS interface. +"RTN","BSDX08",250,0) + ;Propagates cancellation to BSDXAPPT and raises refresh event to running GUI clients +"RTN","BSDX08",251,0) + N BSDXFOUND,BSDXRES +"RTN","BSDX08",252,0) + Q:+$G(BSDXNOEV) +"RTN","BSDX08",253,0) + Q:'+$G(BSDXSC) +"RTN","BSDX08",254,0) + S BSDXFOUND=0 +"RTN","BSDX08",255,0) + I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) S BSDXFOUND=$$CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) +"RTN","BSDX08",256,0) + I BSDXFOUND D CANEVT3(BSDXRES) Q +"RTN","BSDX08",257,0) + I $D(^BXDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) S BSDXFOUND=$$CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) +"RTN","BSDX08",258,0) + I BSDXFOUND D CANEVT3(BSDXRES) +"RTN","BSDX08",259,0) + Q +"RTN","BSDX08",260,0) + ; +"RTN","BSDX08",261,0) +CANEVT1(BSDXRES,BSDXSTART,BSDXPAT) ; +"RTN","BSDX08",262,0) + ;Get appointment id in BSDXAPT +"RTN","BSDX08",263,0) + ;If found, call BSDXCAN(BSDXAPPT) and return 1 +"RTN","BSDX08",264,0) + ;else return 0 +"RTN","BSDX08",265,0) + N BSDXFOUND,BSDXAPPT +"RTN","BSDX08",266,0) + S BSDXFOUND=0 +"RTN","BSDX08",267,0) + Q:'+BSDXRES BSDXFOUND +"RTN","BSDX08",268,0) + Q:'$D(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART)) BSDXFOUND +"RTN","BSDX08",269,0) + S BSDXAPPT=0 F S BSDXAPPT=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART,BSDXAPPT)) Q:'+BSDXAPPT D Q:BSDXFOUND +"RTN","BSDX08",270,0) + . S BSDXNOD=$G(^BSDXAPPT(BSDXAPPT,0)) Q:BSDXNOD="" +"RTN","BSDX08",271,0) + . I $P(BSDXNOD,U,5)=BSDXPAT,$P(BSDXNOD,U,12)="" S BSDXFOUND=1 Q +"RTN","BSDX08",272,0) + I BSDXFOUND,+$G(BSDXAPPT) D BSDXCAN(BSDXAPPT) +"RTN","BSDX08",273,0) + Q BSDXFOUND +"RTN","BSDX08",274,0) + ; +"RTN","BSDX08",275,0) +CANEVT3(BSDXRES) ; +"RTN","BSDX08",276,0) + ;Call RaiseEvent to notify GUI clients +"RTN","BSDX08",277,0) + ; +"RTN","BSDX08",278,0) + N BSDXRESN +"RTN","BSDX08",279,0) + S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) +"RTN","BSDX08",280,0) + Q:BSDXRESN="" +"RTN","BSDX08",281,0) + S BSDXRESN=$P(BSDXRESN,"^") +"RTN","BSDX08",282,0) + ;D EVENT^BSDX23("SCHEDULE-"_BSDXRESN,"","","") +"RTN","BSDX08",283,0) + D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) +"RTN","BSDX08",284,0) + Q +"RTN","BSDX08",285,0) + ; +"RTN","BSDX08",286,0) +ERR(BSDXI,BSDXERR) ;Error processing +"RTN","BSDX08",287,0) + S BSDXI=BSDXI+1 +"RTN","BSDX08",288,0) + S BSDXERR=$TR(BSDXERR,"^","~") +"RTN","BSDX08",289,0) + I $TL>0 TROLLBACK +"RTN","BSDX08",290,0) + S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30) +"RTN","BSDX08",291,0) + S BSDXI=BSDXI+1 +"RTN","BSDX08",292,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX08",293,0) + L -^BSDXAPPT(BSDXAPTID) +"RTN","BSDX08",294,0) + QUIT +"RTN","BSDX08",295,0) + ; +"RTN","BSDX08",296,0) +ETRAP ;EP Error trap entry +"RTN","BSDX08",297,0) + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap +"RTN","BSDX08",298,0) + ; Rollback, otherwise ^XTER will be empty from future rollback +"RTN","BSDX08",299,0) + I $TL>0 TROLLBACK +"RTN","BSDX08",300,0) + D ^%ZTER +"RTN","BSDX08",301,0) + S $EC="" ; Clear Error +"RTN","BSDX08",302,0) + ; Log error message and send to client +"RTN","BSDX08",303,0) + I '$D(BSDXI) N BSDXI S BSDXI=0 +"RTN","BSDX08",304,0) + D ERR(BSDXI,"-100~BSDX08 Error: "_$G(%ZTERZE)) +"RTN","BSDX08",305,0) + QUIT +"RTN","BSDX08",306,0) + ; +"RTN","BSDX08",307,0) + ;;;NB: This is code that is unused in both original and port. +"RTN","BSDX08",308,0) + ; ; If not appt in the "S" node is found in ^SC then check associated RPMS Clinic Multiple +"RTN","BSDX08",309,0) + ; I BSDXSCIEN="" D I 'BSDXZ Q ;Q:BSDXZ +"RTN","BSDX08",310,0) + ; . S BSDXERR="BSDX08: Unable to find associated RPMS appointment for this patient. " +"RTN","BSDX08",311,0) + ; . S BSDXZ=1 +"RTN","BSDX08",312,0) + ; . ; Check if there are associated RPMS clinics. (not currently used) Does the multiple exist? No, then quit +"RTN","BSDX08",313,0) + ; . I '$D(^BSDXRES(BSDXSC1,20)) S BSDXZ=0 QUIT +"RTN","BSDX08",314,0) + ; . ; Loop through the multiple. Get Location and then the ^SC "S" node IEN. +"RTN","BSDX08",315,0) + ; . N BSDX1 S BSDX1=0 +"RTN","BSDX08",316,0) + ; . F S BSDX1=$O(^BSDXRES(BSDXSC1,20,BSDX1)) Q:'+BSDX1 Q:BSDXZ=0 D +"RTN","BSDX08",317,0) + ; . . Q:'$D(^BSDXRES(BSDXSC1,20,BSDX1,0)) +"RTN","BSDX08",318,0) + ; . . S BSDXLOC=$P(^BSDXRES(BSDXSC1,20,BSDX1,0),U) +"RTN","BSDX08",319,0) + . ; . . S BSDXSCIEN=$$SCIEN^BSDXAPI(BSDXPATID,BSDXLOC,BSDXSTART) I +BSDXSCIEN S BSDXZ=0 Q "RTN","BSDX09") -0^9^B34793207 +0^9^B35707298 "RTN","BSDX09",1,0) -BSDX09 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 8/16/10 4:28pm +BSDX09 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 10/20/10 4:16pm "RTN","BSDX09",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX09",3,0) ; "RTN","BSDX09",4,0) - ; Change Log: + ; Change Log: "RTN","BSDX09",5,0) - ; UJO/TH - v 1.3 on 3100714 - Extra Demographics: + ; UJO/TH - v 1.3 on 3100714 - Extra Demographics: "RTN","BSDX09",6,0) - ; - Email + ; - Email "RTN","BSDX09",7,0) - ; - Cell Phone + ; - Cell Phone "RTN","BSDX09",8,0) - ; - Country + ; - Country "RTN","BSDX09",9,0) - ; - + refactoring of routine + ; - + refactoring of routine "RTN","BSDX09",10,0) ; "RTN","BSDX09",11,0) - ; UJO/TH - v 1.3 on 3100715 - Change SSN to PID and get PID field instead + ; UJO/TH - v 1.3 on 3100715 - Change SSN to PID and get PID field instead "RTN","BSDX09",12,0) ; "RTN","BSDX09",13,0) -GETREGA(BSDXRET,BSDXPAT) ;EP + ; UJO/TH - v 1.42 on 3101020 - Add Sex field. "RTN","BSDX09",14,0) - ; + ; "RTN","BSDX09",15,0) - ; See below for the returned fields +GETREGA(BSDXRET,BSDXPAT) ;EP "RTN","BSDX09",16,0) ; "RTN","BSDX09",17,0) - ;For patient with ien BSDXPAT + ; See below for the returned fields "RTN","BSDX09",18,0) - ;K ^BSDXTMP($J) + ; "RTN","BSDX09",19,0) - S BSDXERR="" + ;For patient with ien BSDXPAT "RTN","BSDX09",20,0) - S BSDXRET="^BSDXTMP("_$J_")" + ;K ^BSDXTMP($J) "RTN","BSDX09",21,0) - ; + S BSDXERR="" "RTN","BSDX09",22,0) - N OUT S OUT=$NA(^BSDXTMP($J,0)) + S BSDXRET="^BSDXTMP("_$J_")" "RTN","BSDX09",23,0) - S $P(@OUT,U,1)="T00030IEN" + ; "RTN","BSDX09",24,0) - S $P(@OUT,U,2)="T00030STREET" + N OUT S OUT=$NA(^BSDXTMP($J,0)) "RTN","BSDX09",25,0) - S $P(@OUT,U,3)="T00030CITY" + S $P(@OUT,U,1)="T00030IEN" "RTN","BSDX09",26,0) - S $P(@OUT,U,4)="T00030STATE" + S $P(@OUT,U,2)="T00030STREET" "RTN","BSDX09",27,0) - S $P(@OUT,U,5)="T00030ZIP" + S $P(@OUT,U,3)="T00030CITY" "RTN","BSDX09",28,0) - S $P(@OUT,U,6)="T00030NAME" + S $P(@OUT,U,4)="T00030STATE" "RTN","BSDX09",29,0) - S $P(@OUT,U,7)="D00030DOB" + S $P(@OUT,U,5)="T00030ZIP" "RTN","BSDX09",30,0) - S $P(@OUT,U,8)="T00030PID" + S $P(@OUT,U,6)="T00030NAME" "RTN","BSDX09",31,0) - S $P(@OUT,U,9)="T00030HRN" + S $P(@OUT,U,7)="D00030DOB" "RTN","BSDX09",32,0) - S $P(@OUT,U,10)="T00030HOMEPHONE" + S $P(@OUT,U,8)="T00030PID" "RTN","BSDX09",33,0) - S $P(@OUT,U,11)="T00030OFCPHONE" + S $P(@OUT,U,9)="T00030HRN" "RTN","BSDX09",34,0) - S $P(@OUT,U,12)="T00030MSGPHONE" + S $P(@OUT,U,10)="T00030HOMEPHONE" "RTN","BSDX09",35,0) - S $P(@OUT,U,13)="T00030NOK NAME" + S $P(@OUT,U,11)="T00030OFCPHONE" "RTN","BSDX09",36,0) - S $P(@OUT,U,14)="T00030RELATIONSHIP" + S $P(@OUT,U,12)="T00030MSGPHONE" "RTN","BSDX09",37,0) - S $P(@OUT,U,15)="T00030PHONE" + S $P(@OUT,U,13)="T00030NOK NAME" "RTN","BSDX09",38,0) - S $P(@OUT,U,16)="T00030STREET" + S $P(@OUT,U,14)="T00030RELATIONSHIP" "RTN","BSDX09",39,0) - S $P(@OUT,U,17)="T00030CITY" + S $P(@OUT,U,15)="T00030PHONE" "RTN","BSDX09",40,0) - S $P(@OUT,U,18)="T00030STATE" + S $P(@OUT,U,16)="T00030STREET" "RTN","BSDX09",41,0) - S $P(@OUT,U,19)="T00030ZIP" + S $P(@OUT,U,17)="T00030CITY" "RTN","BSDX09",42,0) - S $P(@OUT,U,20)="D00030DATAREVIEWED" + S $P(@OUT,U,18)="T00030STATE" "RTN","BSDX09",43,0) - S $P(@OUT,U,21)="T00030RegistrationComments" + S $P(@OUT,U,19)="T00030ZIP" "RTN","BSDX09",44,0) - S $P(@OUT,U,22)="T00050EMAIL ADDRESS" + S $P(@OUT,U,20)="D00030DATAREVIEWED" "RTN","BSDX09",45,0) - S $P(@OUT,U,23)="T00020PHONE NUMBER [CELLULAR]" + S $P(@OUT,U,21)="T00030RegistrationComments" "RTN","BSDX09",46,0) - S $P(@OUT,U,24)="T00030COUNTRY" + S $P(@OUT,U,22)="T00050EMAIL ADDRESS" "RTN","BSDX09",47,0) - S $E(@OUT,$L(@OUT)+1)=$C(30) + S $P(@OUT,U,23)="T00020PHONE NUMBER [CELLULAR]" "RTN","BSDX09",48,0) - ; + S $P(@OUT,U,24)="T00030COUNTRY" "RTN","BSDX09",49,0) - ; + S $P(@OUT,U,25)="T00030SEX" "RTN","BSDX09",50,0) - N BSDXNOD,BSDXNAM,Y,U + S $E(@OUT,$L(@OUT)+1)=$C(30) "RTN","BSDX09",51,0) - S U="^" + ; "RTN","BSDX09",52,0) - S BSDXY="ERROR" + ; "RTN","BSDX09",53,0) - K NAME + N BSDXNOD,BSDXNAM,Y,U "RTN","BSDX09",54,0) - I '+BSDXPAT S ^BSDXTMP($J,1)=$C(31) Q + S U="^" "RTN","BSDX09",55,0) - I '$D(^DPT(+BSDXPAT,0)) S ^BSDXTMP($J,1)=$C(31) Q + S BSDXY="ERROR" "RTN","BSDX09",56,0) - S BSDXY="" + K NAME "RTN","BSDX09",57,0) - S $P(BSDXY,U)=BSDXPAT + I '+BSDXPAT S ^BSDXTMP($J,1)=$C(31) Q "RTN","BSDX09",58,0) - ;//smh S $P(BSDXY,U,23)="" + I '$D(^DPT(+BSDXPAT,0)) S ^BSDXTMP($J,1)=$C(31) Q "RTN","BSDX09",59,0) - S $P(BSDXY,U,21)="" + S BSDXY="" "RTN","BSDX09",60,0) - S BSDXNOD=^DPT(+BSDXPAT,0) + S $P(BSDXY,U)=BSDXPAT "RTN","BSDX09",61,0) - S $P(BSDXY,"^",6)=$P(BSDXNOD,U) ;NAME + ;//smh S $P(BSDXY,U,23)="" "RTN","BSDX09",62,0) - S $P(BSDXY,"^",8)=$$GET1^DIQ(2,BSDXPAT,"PRIMARY LONG ID") ;PID + S $P(BSDXY,U,21)="" "RTN","BSDX09",63,0) - S Y=$P(BSDXNOD,U,3) I Y]"" X ^DD("DD") S Y=$TR(Y,"@"," ") + S BSDXNOD=^DPT(+BSDXPAT,0) "RTN","BSDX09",64,0) - S $P(BSDXY,"^",7)=Y ;DOB + S $P(BSDXY,"^",6)=$P(BSDXNOD,U) ;NAME "RTN","BSDX09",65,0) - S $P(BSDXY,"^",9)="" + S $P(BSDXY,"^",8)=$$GET1^DIQ(2,BSDXPAT,"PRIMARY LONG ID") ;PID "RTN","BSDX09",66,0) - I $D(DUZ(2)) I DUZ(2)>0 S $P(BSDXY,"^",9)=$P($G(^AUPNPAT(BSDXPAT,41,DUZ(2),0)),U,2) ;HRN + S Y=$P(BSDXNOD,U,3) I Y]"" X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX09",67,0) - D MAIL + S $P(BSDXY,"^",7)=Y ;DOB "RTN","BSDX09",68,0) - D PHONE + S $P(BSDXY,"^",9)="" "RTN","BSDX09",69,0) - D NOK + I $D(DUZ(2)) I DUZ(2)>0 S $P(BSDXY,"^",9)=$P($G(^AUPNPAT(BSDXPAT,41,DUZ(2),0)),U,2) ;HRN "RTN","BSDX09",70,0) - D DATAREV + D MAIL "RTN","BSDX09",71,0) - ;/smh D MEDICARE + D PHONE "RTN","BSDX09",72,0) - D REGCMT + D NOK "RTN","BSDX09",73,0) - S $P(BSDXY,"^",22)=$$GET1^DIQ(2,BSDXPAT,"EMAIL ADDRESS") + D DATAREV "RTN","BSDX09",74,0) - S $P(BSDXY,"^",23)=$$GET1^DIQ(2,BSDXPAT,"PHONE NUMBER [CELLULAR]") + ;/smh D MEDICARE "RTN","BSDX09",75,0) - S $P(BSDXY,"^",24)=$$GET1^DIQ(2,BSDXPAT,"COUNTRY:DESCRIPTION") + D REGCMT "RTN","BSDX09",76,0) - N BSDXBEG,BSDXEND,BSDXLEN,BSDXI + S $P(BSDXY,"^",22)=$$GET1^DIQ(2,BSDXPAT,"EMAIL ADDRESS") "RTN","BSDX09",77,0) - S BSDXLEN=$L(BSDXY) + S $P(BSDXY,"^",23)=$$GET1^DIQ(2,BSDXPAT,"PHONE NUMBER [CELLULAR]") "RTN","BSDX09",78,0) - S BSDXBEG=0,BSDXI=2 + S $P(BSDXY,"^",24)=$$GET1^DIQ(2,BSDXPAT,"COUNTRY:DESCRIPTION") "RTN","BSDX09",79,0) - F D Q:BSDXEND=BSDXLEN + S $P(BSDXY,"^",25)=$$GET1^DIQ(2,BSDXPAT,"SEX") "RTN","BSDX09",80,0) - . S BSDXEND=BSDXBEG+100 + N BSDXBEG,BSDXEND,BSDXLEN,BSDXI "RTN","BSDX09",81,0) - . S:BSDXEND>BSDXLEN BSDXEND=BSDXLEN + S BSDXLEN=$L(BSDXY) "RTN","BSDX09",82,0) - . S BSDXI=BSDXI+1 + S BSDXBEG=0,BSDXI=2 "RTN","BSDX09",83,0) - . S ^BSDXTMP($J,BSDXI)=$E(BSDXY,BSDXBEG,BSDXEND) + F D Q:BSDXEND=BSDXLEN "RTN","BSDX09",84,0) - . S BSDXBEG=BSDXBEG+101 + . S BSDXEND=BSDXBEG+100 "RTN","BSDX09",85,0) - S ^BSDXTMP($J,BSDXI+1)=$C(30)_$C(31) + . S:BSDXEND>BSDXLEN BSDXEND=BSDXLEN "RTN","BSDX09",86,0) - Q + . S BSDXI=BSDXI+1 "RTN","BSDX09",87,0) - ; + . S ^BSDXTMP($J,BSDXI)=$E(BSDXY,BSDXBEG,BSDXEND) "RTN","BSDX09",88,0) -MAIL N BSDXST + . S BSDXBEG=BSDXBEG+101 "RTN","BSDX09",89,0) - Q:'$D(^DPT(+BSDXPAT,.11)) + S ^BSDXTMP($J,BSDXI+1)=$C(30)_$C(31) "RTN","BSDX09",90,0) - S BSDXNOD=^DPT(+BSDXPAT,.11) + Q "RTN","BSDX09",91,0) - Q:BSDXNOD="" + ; "RTN","BSDX09",92,0) - S $P(BSDXY,"^",2)=$E($P(BSDXNOD,U),1,50) ;STREET +MAIL N BSDXST "RTN","BSDX09",93,0) - S $P(BSDXY,"^",3)=$P(BSDXNOD,U,4) ;CITY + Q:'$D(^DPT(+BSDXPAT,.11)) "RTN","BSDX09",94,0) - S BSDXST=$P(BSDXNOD,U,5) + S BSDXNOD=^DPT(+BSDXPAT,.11) "RTN","BSDX09",95,0) - I +BSDXST,$D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2) + Q:BSDXNOD="" "RTN","BSDX09",96,0) - S $P(BSDXY,"^",4)=BSDXST ;STATE + S $P(BSDXY,"^",2)=$E($P(BSDXNOD,U),1,50) ;STREET "RTN","BSDX09",97,0) - S $P(BSDXY,"^",5)=$P(BSDXNOD,U,6) ;ZIP + S $P(BSDXY,"^",3)=$P(BSDXNOD,U,4) ;CITY "RTN","BSDX09",98,0) - Q + S BSDXST=$P(BSDXNOD,U,5) "RTN","BSDX09",99,0) - ; + I +BSDXST,$D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2) "RTN","BSDX09",100,0) -PHONE ;PHONE 10,11,12 HOME,OFC,MSG + S $P(BSDXY,"^",4)=BSDXST ;STATE "RTN","BSDX09",101,0) - I $D(^DPT(+BSDXPAT,.13)) D + S $P(BSDXY,"^",5)=$P(BSDXNOD,U,6) ;ZIP "RTN","BSDX09",102,0) - . S BSDXNOD=^DPT(+BSDXPAT,.13) + Q "RTN","BSDX09",103,0) - . S $P(BSDXY,U,10)=$P(BSDXNOD,U,1) + ; "RTN","BSDX09",104,0) - . S $P(BSDXY,U,11)=$P(BSDXNOD,U,2) +PHONE ;PHONE 10,11,12 HOME,OFC,MSG "RTN","BSDX09",105,0) - I $D(^DPT(+BSDXPAT,.121)) D + I $D(^DPT(+BSDXPAT,.13)) D "RTN","BSDX09",106,0) - . S BSDXNOD=^DPT(+BSDXPAT,.121) + . S BSDXNOD=^DPT(+BSDXPAT,.13) "RTN","BSDX09",107,0) - . S $P(BSDXY,U,12)=$P(BSDXNOD,U,10) + . S $P(BSDXY,U,10)=$P(BSDXNOD,U,1) "RTN","BSDX09",108,0) - Q + . S $P(BSDXY,U,11)=$P(BSDXNOD,U,2) "RTN","BSDX09",109,0) - ; + I $D(^DPT(+BSDXPAT,.121)) D "RTN","BSDX09",110,0) -NOK ;NOK + . S BSDXNOD=^DPT(+BSDXPAT,.121) "RTN","BSDX09",111,0) - ; 13 NOK NAME^RELATIONSHIP^PHONE^STREET^CITY^STATE^ZIP + . S $P(BSDXY,U,12)=$P(BSDXNOD,U,10) "RTN","BSDX09",112,0) - N Y,BSDXST + Q "RTN","BSDX09",113,0) - I $D(^DPT(+BSDXPAT,.21)) D + ; "RTN","BSDX09",114,0) - . S BSDXNOD=^DPT(+BSDXPAT,.21) +NOK ;NOK "RTN","BSDX09",115,0) - . S $P(BSDXY,U,13)=$P(BSDXNOD,U,1) + ; 13 NOK NAME^RELATIONSHIP^PHONE^STREET^CITY^STATE^ZIP "RTN","BSDX09",116,0) - . S $P(BSDXY,U,14)=$$VAL^XBDIQ1(9000001,BSDXPAT,2802) + N Y,BSDXST "RTN","BSDX09",117,0) - . S $P(BSDXY,U,15)=$P(BSDXNOD,U,9) + I $D(^DPT(+BSDXPAT,.21)) D "RTN","BSDX09",118,0) - . S $P(BSDXY,U,16)=$P(BSDXNOD,U,3) + . S BSDXNOD=^DPT(+BSDXPAT,.21) "RTN","BSDX09",119,0) - . S $P(BSDXY,U,17)=$P(BSDXNOD,U,6) + . S $P(BSDXY,U,13)=$P(BSDXNOD,U,1) "RTN","BSDX09",120,0) - . S BSDXST=$P(BSDXNOD,U,7) + . S $P(BSDXY,U,14)=$$VAL^XBDIQ1(9000001,BSDXPAT,2802) "RTN","BSDX09",121,0) - . I +BSDXST D + . S $P(BSDXY,U,15)=$P(BSDXNOD,U,9) "RTN","BSDX09",122,0) - . . I $D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2),$P(BSDXY,U,18)=BSDXST + . S $P(BSDXY,U,16)=$P(BSDXNOD,U,3) "RTN","BSDX09",123,0) - . S $P(BSDXY,U,19)=$P(BSDXNOD,U,8) + . S $P(BSDXY,U,17)=$P(BSDXNOD,U,6) "RTN","BSDX09",124,0) - Q + . S BSDXST=$P(BSDXNOD,U,7) "RTN","BSDX09",125,0) - ; + . I +BSDXST D "RTN","BSDX09",126,0) -DATAREV S $P(BSDXY,U,20)=$P($$VAL^XBDIQ1(9000001,BSDXPAT,16651),"@") + . . I $D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2),$P(BSDXY,U,18)=BSDXST "RTN","BSDX09",127,0) - Q + . S $P(BSDXY,U,19)=$P(BSDXNOD,U,8) "RTN","BSDX09",128,0) - ; + Q "RTN","BSDX09",129,0) -REGCMT N BSDXI,BSDXM,BSDXR + ; "RTN","BSDX09",130,0) - S BSDXR="" +DATAREV S $P(BSDXY,U,20)=$P($$VAL^XBDIQ1(9000001,BSDXPAT,16651),"@") "RTN","BSDX09",131,0) - D ENP^XBDIQ1(9000001,BSDXPAT,1301,"BSDXM(") + Q "RTN","BSDX09",132,0) - S BSDXI=0 F S BSDXI=$O(BSDXM(1301,BSDXI)) Q:'+BSDXI D + ; "RTN","BSDX09",133,0) - . S BSDXR=BSDXR_" "_BSDXM(1301,BSDXI) +REGCMT N BSDXI,BSDXM,BSDXR "RTN","BSDX09",134,0) - ; S $P(BSDXY,U,23)=$TR($E(BSDXR,1,1024),U," ") ; MJL 1/17/2007 //smh + S BSDXR="" "RTN","BSDX09",135,0) - S $P(BSDXY,U,21)=$TR($E(BSDXR,1,1024),U," ") ; + D ENP^XBDIQ1(9000001,BSDXPAT,1301,"BSDXM(") "RTN","BSDX09",136,0) - Q + S BSDXI=0 F S BSDXI=$O(BSDXM(1301,BSDXI)) Q:'+BSDXI D "RTN","BSDX09",137,0) - ; + . S BSDXR=BSDXR_" "_BSDXM(1301,BSDXI) "RTN","BSDX09",138,0) -GETMCAID(BSDXY,BSDXPAT) ; not in wv + ; S $P(BSDXY,U,23)=$TR($E(BSDXR,1,1024),U," ") ; MJL 1/17/2007 //smh "RTN","BSDX09",139,0) - ;Returns PATIENTIEN^ENTRY#^MEDICAID#^SUBENTRY#^ELIG.BEGIN^ELIG.END | + S $P(BSDXY,U,21)=$TR($E(BSDXR,1,1024),U," ") ; "RTN","BSDX09",140,0) - ;File is not dinum + Q "RTN","BSDX09",141,0) - N C,N,ASDGX,BSDXM,BSDXBLD,BSDXCNT + ; "RTN","BSDX09",142,0) - N BSDXIEN +GETMCAID(BSDXY,BSDXPAT) ; not in wv "RTN","BSDX09",143,0) - S BSDXBLD="" + ;Returns PATIENTIEN^ENTRY#^MEDICAID#^SUBENTRY#^ELIG.BEGIN^ELIG.END | "RTN","BSDX09",144,0) - S BSDXIEN=0 + ;File is not dinum "RTN","BSDX09",145,0) - S BSDXCNT=1 + N C,N,ASDGX,BSDXM,BSDXBLD,BSDXCNT "RTN","BSDX09",146,0) - F S BSDXIEN=$O(^AUPNMCD("B",BSDXPAT,BSDXIEN)) Q:'+BSDXIEN D + N BSDXIEN "RTN","BSDX09",147,0) - . S BSDXNUM=$$VAL^XBDIQ1(9000004,BSDXIEN,.03) ;MCAID# + S BSDXBLD="" "RTN","BSDX09",148,0) - . D ENPM^XBDIQ1(9000004.11,BSDXIEN_",0",".01:.02","ASDGX(") + S BSDXIEN=0 "RTN","BSDX09",149,0) - . S C=1,N=0,BSDXM="" + S BSDXCNT=1 "RTN","BSDX09",150,0) - . F S N=$O(ASDGX(N)) Q:'N D + F S BSDXIEN=$O(^AUPNMCD("B",BSDXPAT,BSDXIEN)) Q:'+BSDXIEN D "RTN","BSDX09",151,0) - . . S $P(BSDXY,"|",C)=BSDXPAT_U_BSDXIEN_U_BSDXNUM_U_N_U_ASDGX(N,.01)_U_ASDGX(N,.02) + . S BSDXNUM=$$VAL^XBDIQ1(9000004,BSDXIEN,.03) ;MCAID# "RTN","BSDX09",152,0) - . . S C=C+1 + . D ENPM^XBDIQ1(9000004.11,BSDXIEN_",0",".01:.02","ASDGX(") "RTN","BSDX09",153,0) - . . Q + . S C=1,N=0,BSDXM="" "RTN","BSDX09",154,0) - . Q + . F S N=$O(ASDGX(N)) Q:'N D "RTN","BSDX09",155,0) - Q + . . S $P(BSDXY,"|",C)=BSDXPAT_U_BSDXIEN_U_BSDXNUM_U_N_U_ASDGX(N,.01)_U_ASDGX(N,.02) "RTN","BSDX09",156,0) - ; + . . S C=C+1 "RTN","BSDX09",157,0) -MEDICARE ; not in WV + . . Q "RTN","BSDX09",158,0) - S $P(BSDXY,U,21)=$$VAL^XBDIQ1(9000003,BSDXPAT,.03) + . Q "RTN","BSDX09",159,0) - S $P(BSDXY,U,22)=$$VAL^XBDIQ1(9000003,BSDXPAT,.04) -"RTN","BSDX09",160,0) Q -"RTN","BSDX09",161,0) +"RTN","BSDX09",160,0) ; +"RTN","BSDX09",161,0) +MEDICARE ; not in WV "RTN","BSDX09",162,0) -GETMCARE(BSDXY,BSDXPAT) ; + S $P(BSDXY,U,21)=$$VAL^XBDIQ1(9000003,BSDXPAT,.03) "RTN","BSDX09",163,0) - ;Returns IEN^MEDICARE#^SUFFIX^SUBENTRY#^TYPE^ELIG.BEGIN^ELIG.END | + S $P(BSDXY,U,22)=$$VAL^XBDIQ1(9000003,BSDXPAT,.04) "RTN","BSDX09",164,0) - ;File is dinum + Q "RTN","BSDX09",165,0) ; "RTN","BSDX09",166,0) - N ASDGX,C,N,BSDXNUM,BSDXSUF,BSDXBLD +GETMCARE(BSDXY,BSDXPAT) ; "RTN","BSDX09",167,0) - S BSDXNUM=$$VAL^XBDIQ1(9000003,BSDXPAT,.03) + ;Returns IEN^MEDICARE#^SUFFIX^SUBENTRY#^TYPE^ELIG.BEGIN^ELIG.END | "RTN","BSDX09",168,0) - S BSDXSUF=$$VAL^XBDIQ1(9000003,BSDXPAT,.04) -"RTN","BSDX09",169,0) - D ENPM^XBDIQ1(9000003.11,BSDXPAT_",0",".01:.03","ASDGX(") -"RTN","BSDX09",170,0) - S C=1,N=0,BSDXBLD="" -"RTN","BSDX09",171,0) - F S N=$O(ASDGX(N)) Q:'N D -"RTN","BSDX09",172,0) - . S $P(BSDXY,"|",C)=BSDXPAT_U_BSDXNUM_U_BSDXSUF_U_N_U_ASDGX(N,.03)_U_ASDGX(N,.01)_U_ASDGX(N,.02) -"RTN","BSDX09",173,0) - . S C=C+1 -"RTN","BSDX09",174,0) - . Q -"RTN","BSDX09",175,0) - Q -"RTN","BSDX09",176,0) - ; -"RTN","BSDX09",177,0) -GETPVTIN(BSDXY,BSDXPAT) ; -"RTN","BSDX09",178,0) - ;Returns IEN^SUBENTRY^INSURER^POLICYNUMBER^ELIG.BEGIN^ELIG.END|... -"RTN","BSDX09",179,0) ;File is dinum +"RTN","BSDX09",169,0) + ; +"RTN","BSDX09",170,0) + N ASDGX,C,N,BSDXNUM,BSDXSUF,BSDXBLD +"RTN","BSDX09",171,0) + S BSDXNUM=$$VAL^XBDIQ1(9000003,BSDXPAT,.03) +"RTN","BSDX09",172,0) + S BSDXSUF=$$VAL^XBDIQ1(9000003,BSDXPAT,.04) +"RTN","BSDX09",173,0) + D ENPM^XBDIQ1(9000003.11,BSDXPAT_",0",".01:.03","ASDGX(") +"RTN","BSDX09",174,0) + S C=1,N=0,BSDXBLD="" +"RTN","BSDX09",175,0) + F S N=$O(ASDGX(N)) Q:'N D +"RTN","BSDX09",176,0) + . S $P(BSDXY,"|",C)=BSDXPAT_U_BSDXNUM_U_BSDXSUF_U_N_U_ASDGX(N,.03)_U_ASDGX(N,.01)_U_ASDGX(N,.02) +"RTN","BSDX09",177,0) + . S C=C+1 +"RTN","BSDX09",178,0) + . Q +"RTN","BSDX09",179,0) + Q "RTN","BSDX09",180,0) ; "RTN","BSDX09",181,0) - N ASDGX,C,N +GETPVTIN(BSDXY,BSDXPAT) ; "RTN","BSDX09",182,0) - D ENPM^XBDIQ1(9000006.11,BSDXPAT_",0",".01;.02;.06;.07","ASDGX(") + ;Returns IEN^SUBENTRY^INSURER^POLICYNUMBER^ELIG.BEGIN^ELIG.END|... "RTN","BSDX09",183,0) - S C=1,N=0 + ;File is dinum "RTN","BSDX09",184,0) - F S N=$O(ASDGX(N)) Q:'N D -"RTN","BSDX09",185,0) - . S $P(BSDXY,"|",C)=BSDXPAT_U_N_U_ASDGX(N,.01)_U_ASDGX(N,.02)_U_ASDGX(N,.06)_U_ASDGX(N,.07) -"RTN","BSDX09",186,0) - . S C=C+1 -"RTN","BSDX09",187,0) - . Q -"RTN","BSDX09",188,0) - Q -"RTN","BSDX09",189,0) ; +"RTN","BSDX09",185,0) + N ASDGX,C,N +"RTN","BSDX09",186,0) + D ENPM^XBDIQ1(9000006.11,BSDXPAT_",0",".01;.02;.06;.07","ASDGX(") +"RTN","BSDX09",187,0) + S C=1,N=0 +"RTN","BSDX09",188,0) + F S N=$O(ASDGX(N)) Q:'N D +"RTN","BSDX09",189,0) + . S $P(BSDXY,"|",C)=BSDXPAT_U_N_U_ASDGX(N,.01)_U_ASDGX(N,.02)_U_ASDGX(N,.06)_U_ASDGX(N,.07) "RTN","BSDX09",190,0) -DFN(FILE,BSDXPAT) ; -- returns ien for file + . S C=C+1 "RTN","BSDX09",191,0) - I FILE'[9000004 Q BSDXPAT + . Q "RTN","BSDX09",192,0) + Q +"RTN","BSDX09",193,0) + ; +"RTN","BSDX09",194,0) +DFN(FILE,BSDXPAT) ; -- returns ien for file +"RTN","BSDX09",195,0) + I FILE'[9000004 Q BSDXPAT +"RTN","BSDX09",196,0) Q +$O(^AUPNMCD("B",BSDXPAT,0)) "RTN","BSDX11") 0^34^B6358791 "RTN","BSDX11",1,0) BSDX11 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX11",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX11",3,0) ; "RTN","BSDX11",4,0) @@ -4213,7 +4715,7 @@ INSTALLD(BMXPKG) ; "RTN","BSDX12",1,0) BSDX12 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/18/10 2:14pm "RTN","BSDX12",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX12",3,0) ; "RTN","BSDX12",4,0) @@ -4363,11 +4865,11 @@ ERR(ERRNO) ;Error processing "RTN","BSDX12",76,0) Q "RTN","BSDX13") -0^11^B9753753 +0^11^B9772451 "RTN","BSDX13",1,0) -BSDX13 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/18/10 2:17pm +BSDX13 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 6:05pm "RTN","BSDX13",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX13",3,0) ; "RTN","BSDX13",4,0) @@ -4429,7 +4931,7 @@ AVDELDT(BSDXY,BSDXRESD,BSDXSTART,BSDXEND) ;EP "RTN","BSDX13",32,0) ; I Y=-1 D ERR(0,"AVDELDT-BSDX13: Invalid End Date") Q "RTN","BSDX13",33,0) - S BSDXEND=$P(Y,".")_".99999" + S BSDXEND=$P(BSDXEND,".")_".99999" "RTN","BSDX13",34,0) I '+BSDXRESD D ERR(0,"AVDELDT-BSDX13: Invalid Resource ID") Q "RTN","BSDX13",35,0) @@ -4459,7 +4961,7 @@ ERROR ; "RTN","BSDX13",47,0) S BSDXI=BSDXI+1 "RTN","BSDX13",48,0) - D ERR(0,"BSDX13 M Error: <"_$G(%ZTERROR)_">") + D ERR(0,"BSDX13 M Error: <"_$G(%ZTERZE)_">") "RTN","BSDX13",49,0) Q "RTN","BSDX13",50,0) @@ -4639,7 +5141,7 @@ APTINBLK(BSDXAVID) ; "RTN","BSDX14",1,0) BSDX14 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX14",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX14",3,0) ; "RTN","BSDX14",4,0) @@ -4785,7 +5287,7 @@ ERROR ; "RTN","BSDX15",1,0) BSDX15 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX15",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX15",3,0) ; "RTN","BSDX15",4,0) @@ -4937,7 +5439,7 @@ ETRAP ;EP Error trap entry "RTN","BSDX16",1,0) BSDX16 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX16",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX16",3,0) ; "RTN","BSDX16",4,0) @@ -5149,7 +5651,7 @@ ERR(BSDXERID,ERRTXT) ;Error processing "RTN","BSDX17",1,0) BSDX17 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX17",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX17",3,0) ; "RTN","BSDX17",4,0) @@ -5225,7 +5727,7 @@ SCHUSR(BSDXY) ;EP "RTN","BSDX18",1,0) BSDX18 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX18",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX18",3,0) ; "RTN","BSDX18",4,0) @@ -5847,7 +6349,7 @@ MADEXST(BSDXU,BSDXR) ; "RTN","BSDX19",1,0) BSDX19 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX19",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX19",3,0) ; "RTN","BSDX19",4,0) @@ -6027,7 +6529,7 @@ ERROR ; "RTN","BSDX20",1,0) BSDX20 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX20",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX20",3,0) ; "RTN","BSDX20",4,0) @@ -6187,7 +6689,7 @@ ETRAP ;EP Error trap entry "RTN","BSDX21",1,0) BSDX21 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 5/21/10 9:42pm "RTN","BSDX21",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX21",3,0) ; "RTN","BSDX21",4,0) @@ -6395,7 +6897,7 @@ ERROR ; "RTN","BSDX22",1,0) BSDX22 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX22",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX22",3,0) ; "RTN","BSDX22",4,0) @@ -6577,7 +7079,7 @@ ERROR ; "RTN","BSDX23",1,0) BSDX23 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX23",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX23",3,0) ; "RTN","BSDX23",4,0) @@ -6787,7 +7289,7 @@ RAISEVNT(BSDXY,BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT) ;EP "RTN","BSDX24",1,0) BSDX24 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX24",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX24",3,0) ; "RTN","BSDX24",4,0) @@ -7043,7 +7545,7 @@ SEARCH(BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY) ;EP "RTN","BSDX25",1,0) BSDX25 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX25",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX25",3,0) ; "RTN","BSDX25",4,0) @@ -7271,625 +7773,811 @@ ERR(ERRNO) ;Error processing "RTN","BSDX25",115,0) Q "RTN","BSDX26") -0^24^B3226136 +0^24^B30714245 "RTN","BSDX26",1,0) -BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; +BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 12:38pm "RTN","BSDX26",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX26",3,0) - ; + ; Change History: "RTN","BSDX26",4,0) - ; + ; 3101023 - UJO/SMH - Addition of restartable transaction; relocation of tx. "RTN","BSDX26",5,0) -EDITAPTD(BSDXY,BSDXAPTID,BSDXNOTE) ;EP + ; --> Thanks to Zach Gonzalez and Rick Marshall "RTN","BSDX26",6,0) - ;Entry point for debugging + ; 3101205 - UJO/SMH - Extensive refactoring. "RTN","BSDX26",7,0) - ; + ; "RTN","BSDX26",8,0) - ;D DEBUG^%Serenji("EDITAPT^BSDX26(.BSDXY,BSDXAPTID,BSDXNOTE)") + ; Error Reference: "RTN","BSDX26",9,0) - Q + ; -1: Appt ID is not a number "RTN","BSDX26",10,0) - ; + ; -2: Appt IEN is not in ^BSDXAPPT "RTN","BSDX26",11,0) -EDITAPT(BSDXY,BSDXAPTID,BSDXNOTE) ;EP Edit appointment (only note text can be edited) + ; -3: FM Failure to file WP field in ^BSDXAPPT "RTN","BSDX26",12,0) - ; + ; "RTN","BSDX26",13,0) - N BSDXNOD,BSDXPATID,BSDXSTART,DIK,DA,BSDXID,BSDXI,BSDXZ,BSDXIENS +EDITAPTD(BSDXY,BSDXAPTID,BSDXNOTE) ;EP "RTN","BSDX26",14,0) - ; + ;Entry point for debugging "RTN","BSDX26",15,0) - D ^XBKVAR + ; "RTN","BSDX26",16,0) - S X="ETRAP^BSDX26",@^%ZOSF("TRAP") + D DEBUG^%Serenji("EDITAPT^BSDX26(.BSDXY,BSDXAPTID,BSDXNOTE)") "RTN","BSDX26",17,0) - S BSDXI=0 + Q "RTN","BSDX26",18,0) - K ^BSDXTMP($J) +UT ; Unit Tests "RTN","BSDX26",19,0) - S BSDXY="^BSDXTMP("_$J_")" + ; Test 1: Make sure this damn thing works "RTN","BSDX26",20,0) - S ^BSDXTMP($J,BSDXI)="T00020ERRORID"_$C(30) + N ZZZ "RTN","BSDX26",21,0) - S BSDXI=BSDXI+1 + N %H S %H=$H "RTN","BSDX26",22,0) - TSTART + N NOTE S NOTE="New Note "_%H "RTN","BSDX26",23,0) - I '+BSDXAPTID D ERR(BSDXI,"BSDX26: Invalid Appointment ID") Q + D EDITAPT(.ZZZ,188,NOTE) "RTN","BSDX26",24,0) - I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"BSDX26: Invalid Appointment ID") Q + I ^BSDXAPPT(188,1,1,0)'=NOTE W "ERROR",! B "RTN","BSDX26",25,0) - ;Add WP field + ; Test 2: Test Errors -1 and -2 "RTN","BSDX26",26,0) - ;I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" + N ZZZ "RTN","BSDX26",27,0) - S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" + N NOTE S NOTE="Nothing important" "RTN","BSDX26",28,0) - I $D(BSDXNOTE(0)) S BSDXNOTE(.5)=BSDXNOTE(0) K BSDXNOTE(0) + D EDITAPT(.ZZZ,"BLAHBLAH",NOTE) "RTN","BSDX26",29,0) - I $D(BSDXNOTE(.5)) D + I +^BSDXTMP($J,1)'=-1 W "ERROR IN -1",! B "RTN","BSDX26",30,0) - . D WP^DIE(9002018.4,BSDXAPTID_",",1,"","BSDXNOTE","BSDXMSG") + D EDITAPT(.ZZZ,298734322,NOTE) "RTN","BSDX26",31,0) - ; + I +^BSDXTMP($J,1)'=-2 W "ERROR IN -2",! B "RTN","BSDX26",32,0) - ;Return Recordset + ; Test 4: M Error "RTN","BSDX26",33,0) - TCOMMIT + N bsdxdie S bsdxdie=1 "RTN","BSDX26",34,0) - S BSDXI=BSDXI+1 + D EDITAPT(.ZZZ,188,NOTE) "RTN","BSDX26",35,0) - S ^BSDXTMP($J,BSDXI)="-1"_$C(30) + I +^BSDXTMP($J,1)'=-100 W "ERROR IN -100",! B "RTN","BSDX26",36,0) - S BSDXI=BSDXI+1 + k bsdxdie "RTN","BSDX26",37,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + ; Test 5: Trestart "RTN","BSDX26",38,0) - Q + N bsdxrestart S bsdxrestart=1 "RTN","BSDX26",39,0) - ; + N %H S %H=$H "RTN","BSDX26",40,0) - ; + N NOTE S NOTE="New Note "_%H "RTN","BSDX26",41,0) -ERR(BSDXI,BSDXERR) ;Error processing + D EDITAPT(.ZZZ,188,NOTE) "RTN","BSDX26",42,0) - S BSDXI=BSDXI+1 + I ^BSDXAPPT(188,1,1,0)'=NOTE W "ERROR in TRESTART",! B "RTN","BSDX26",43,0) - TROLLBACK + ; Test 6: for Hosp Location Update "RTN","BSDX26",44,0) - S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30) + N DATE S DATE=$$NOW^XLFDT() "RTN","BSDX26",45,0) - S BSDXI=BSDXI+1 + S DATE=$E(DATE,1,12) ; Just get minutes b/c of HL file input transform "RTN","BSDX26",46,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + D APPADD^BSDX07(.ZZZ,DATE,DATE+.001,3,"Dr Office",30,"Old Note",1) "RTN","BSDX26",47,0) - Q + N APPID S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX26",48,0) - ; + D EDITAPT(.ZZZ,APPID,"New Note") "RTN","BSDX26",49,0) -ETRAP ;EP Error trap entry + I ^BSDXAPPT(APTID,1,1,0)'="New Note" W "Error in HL Section",! B "RTN","BSDX26",50,0) - TROLLBACK + I $P(^SC(2,"S",DATE,1,1,0),U,4)'="New Note" W "Error in HL Section",! B "RTN","BSDX26",51,0) - D ^%ZTER + QUIT "RTN","BSDX26",52,0) - I '$D(BSDXI) N BSDXI S BSDXI=999999 + ; "RTN","BSDX26",53,0) - S BSDXI=BSDXI+1 +EDITAPT(BSDXY,BSDXAPTID,BSDXNOTE) ;EP Edit appointment (only note text can be edited) "RTN","BSDX26",54,0) - D ERR(BSDXI,"BSDX26 Error: "_$G(%ZTERROR)) + ; Called by RPC: BSDX EDIT APPOINTMENT "RTN","BSDX26",55,0) - Q + ; +"RTN","BSDX26",56,0) + ; Edits Appointment Text in BSDX APPOINTMENT file & Hosp Location (44) file +"RTN","BSDX26",57,0) + ; +"RTN","BSDX26",58,0) + ; Parameters: +"RTN","BSDX26",59,0) + ; - BSDXY: Global Return (RPC must be set to Global Array) +"RTN","BSDX26",60,0) + ; - BSDXAPTID: Appointment IEN in BSDX APPOINTMENT +"RTN","BSDX26",61,0) + ; - BSDXNOTE: New note +"RTN","BSDX26",62,0) + ; +"RTN","BSDX26",63,0) + ; Return: +"RTN","BSDX26",64,0) + ; ADO.net Recordset having 1 field: ERRORID +"RTN","BSDX26",65,0) + ; If Okay: -1; otherwise, positive integer with message +"RTN","BSDX26",66,0) + ; +"RTN","BSDX26",67,0) + ; Return Array; set Return and clear array +"RTN","BSDX26",68,0) + S BSDXY=$NA(^BSDXTMP($J)) +"RTN","BSDX26",69,0) + K ^BSDXTMP($J) +"RTN","BSDX26",70,0) + ; ET +"RTN","BSDX26",71,0) + N $ET S $ET="G ETRAP^BSDX26" +"RTN","BSDX26",72,0) + ; Set up basic DUZ variables +"RTN","BSDX26",73,0) + D ^XBKVAR +"RTN","BSDX26",74,0) + ; Counter +"RTN","BSDX26",75,0) + N BSDXI S BSDXI=0 +"RTN","BSDX26",76,0) + ; Header Node +"RTN","BSDX26",77,0) + S ^BSDXTMP($J,BSDXI)="T00100ERRORID"_$C(30) +"RTN","BSDX26",78,0) + ; Restartable txn for GT.M. Restored vars are Params + BSDXI. +"RTN","BSDX26",79,0) + TSTART (BSDXY,BSDXAPTID,BSDXNOTE,BSDXI):T="BSDX EDIT APPOINTMENT^BSDX26" +"RTN","BSDX26",80,0) + ; +"RTN","BSDX26",81,0) + ;;;test for error inside transaction. See if %ZTER works +"RTN","BSDX26",82,0) + I $G(bsdxdie) S X=1/0 +"RTN","BSDX26",83,0) + ;;;test +"RTN","BSDX26",84,0) + ;;;test for TRESTART +"RTN","BSDX26",85,0) + I $G(bsdxrestart) K bsdxrestart TRESTART +"RTN","BSDX26",86,0) + ;;;test +"RTN","BSDX26",87,0) + ; +"RTN","BSDX26",88,0) + ; Validate Appointment ID +"RTN","BSDX26",89,0) + I '+BSDXAPTID D ERR(BSDXI,"-1~BSDX26: Invalid Appointment ID") QUIT +"RTN","BSDX26",90,0) + I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"-2~BSDX26: Invalid Appointment ID") QUIT +"RTN","BSDX26",91,0) + ; Put the WP in decendant fields from the root to file as a WP field +"RTN","BSDX26",92,0) + S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" +"RTN","BSDX26",93,0) + I $D(BSDXNOTE(0)) S BSDXNOTE(.5)=BSDXNOTE(0) K BSDXNOTE(0) +"RTN","BSDX26",94,0) + N BSDXMSG ; Message in case of error in filing. +"RTN","BSDX26",95,0) + I $D(BSDXNOTE(.5)) D +"RTN","BSDX26",96,0) + . D WP^DIE(9002018.4,BSDXAPTID_",",1,"","BSDXNOTE","BSDXMSG") +"RTN","BSDX26",97,0) + I $D(BSDXMSG) D ERR(BSDXI,"-3~BSDX26: Fileman failure to file data into 9002018.4") QUIT +"RTN","BSDX26",98,0) + ; +"RTN","BSDX26",99,0) + ; Now file in file 44: +"RTN","BSDX26",100,0) + N PTIEN S PTIEN=$$GET1^DIQ(9002018.4,BSDXAPTID,".05","I") ; Patient IEN +"RTN","BSDX26",101,0) + N HLIEN S HLIEN=$$GET1^DIQ(9002018.4,BSDXAPTID,".07:.04","I") ; HL Location IEN pointed to by Resource ID +"RTN","BSDX26",102,0) + N DATE S DATE=+^BSDXAPPT(BSDXAPTID,0) ; Date of APPT +"RTN","BSDX26",103,0) + N BSDXRES S BSDXRES=0 ; Result +"RTN","BSDX26",104,0) + ; Update Note only if we have a linked hospital location. +"RTN","BSDX26",105,0) + I HLIEN S BSDXRES=$$UPDATENOTE^BSDXAPI(PTIEN,HLIEN,DATE,BSDXNOTE(.5)) +"RTN","BSDX26",106,0) + ; If we get an error (denoted by -1 in BSDXRES), return error to client +"RTN","BSDX26",107,0) + I BSDXRES<0 D ERR(BSDXI,"-4~BSDX26: BSDXAPI reports an error: "_BSDXRES) QUIT +"RTN","BSDX26",108,0) + ;Return Recordset +"RTN","BSDX26",109,0) + TCOMMIT +"RTN","BSDX26",110,0) + S BSDXI=BSDXI+1 +"RTN","BSDX26",111,0) + S ^BSDXTMP($J,BSDXI)="-1"_$C(30) +"RTN","BSDX26",112,0) + S BSDXI=BSDXI+1 +"RTN","BSDX26",113,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX26",114,0) + QUIT +"RTN","BSDX26",115,0) + ; +"RTN","BSDX26",116,0) +ERR(BSDXI,BSDXERR) ;Error processing +"RTN","BSDX26",117,0) + S BSDXI=BSDXI+1 +"RTN","BSDX26",118,0) + S BSDXERR=$TR(BSDXERR,"^","~") +"RTN","BSDX26",119,0) + I $TL>0 TROLLBACK +"RTN","BSDX26",120,0) + S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30) +"RTN","BSDX26",121,0) + S BSDXI=BSDXI+1 +"RTN","BSDX26",122,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX26",123,0) + QUIT +"RTN","BSDX26",124,0) + ; +"RTN","BSDX26",125,0) +ETRAP ;EP Error trap entry +"RTN","BSDX26",126,0) + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap +"RTN","BSDX26",127,0) + I $TL>0 TROLLBACK +"RTN","BSDX26",128,0) + D ^%ZTER +"RTN","BSDX26",129,0) + S $EC="" +"RTN","BSDX26",130,0) + I '$D(BSDXI) N BSDXI S BSDXI=0 +"RTN","BSDX26",131,0) + D ERR(BSDXI,"-100~BSDX26 Error: "_$G(%ZTERZE)) +"RTN","BSDX26",132,0) + Q "RTN","BSDX27") -0^25^B97105556 +0^25^B133007616 "RTN","BSDX27",1,0) -BSDX27 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 12:22pm +BSDX27 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 4:52pm "RTN","BSDX27",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX27",3,0) ; "RTN","BSDX27",4,0) ; Change Log: July 15, 2010 "RTN","BSDX27",5,0) - ; UJO/SMH - i18n: FM Dates passed into routine for Clinic Letters - CLDISP tag + ; UJO/SMH - i18n: FM Dates passed into routine for Clinic Letters - CLDISP ta "RTN","BSDX27",6,0) - ; + ; v 1.42 - 3101208 - SMH "RTN","BSDX27",7,0) - ; + ; - Added check to skip cancelled appointments. Check was forgotten "RTN","BSDX27",8,0) - Q + ; in original code. "RTN","BSDX27",9,0) - ; + ; . N BSDXFLAGS S BSDXFLAGS=$P(BSDXNOD,U,2) ; No show and Cancel Flags "RTN","BSDX27",10,0) -PADISPD(BSDXY,BSDXPAT) ;EP + ; . Q:BSDXFLAGS["C" ; if appt is cancelled, quit "RTN","BSDX27",11,0) - ;Entry point for debugging + ; "RTN","BSDX27",12,0) - ; + Q "RTN","BSDX27",13,0) - ;D DEBUG^%Serenji("PADISP^BSDX27(.BSDXY,BSDXPAT)") + ; "RTN","BSDX27",14,0) - Q +PADISPD(BSDXY,BSDXPAT) ;EP "RTN","BSDX27",15,0) - ; + ;Entry point for debugging "RTN","BSDX27",16,0) -PADISP(BSDXY,BSDXPAT) ;EP + ; "RTN","BSDX27",17,0) - ;Return recordset of patient appointments used in listing + ;D DEBUG^%Serenji("PADISP^BSDX27(.BSDXY,BSDXPAT)") "RTN","BSDX27",18,0) - ;a patient's appointments and generating patient letters. + Q "RTN","BSDX27",19,0) - ;Called by rpc BSDX PATIENT APPT DISPLAY + ; "RTN","BSDX27",20,0) - ; +PADISP(BSDXY,BSDXPAT) ;EP "RTN","BSDX27",21,0) - N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXDOB,BSDXHRN,BSDXSEX,BSDXCNID,BSDXCNOD,BSDXMADE,BSDXCLRK,BSDXNOT,BSDXQ + ;Return recordset of patient appointments used in listing "RTN","BSDX27",22,0) - N BSDXSTRT + ;a patient's appointments and generating patient letters. "RTN","BSDX27",23,0) - N BSDXSTRE,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON + ;Called by rpc BSDX PATIENT APPT DISPLAY "RTN","BSDX27",24,0) - S BSDXY="^BSDXTMP("_$J_")" + ; "RTN","BSDX27",25,0) - S BSDXI=0 + ; Sam's Notes: "RTN","BSDX27",26,0) - S ^BSDXTMP($J,BSDXI)="T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus" + ; Relatively complex algorithm. "RTN","BSDX27",27,0) - S ^BSDXTMP($J,BSDXI)=^(BSDXI)_"^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE"_$C(30) + ; 1. First, loop through ^DPT(DA,"S", and get all appointments. "RTN","BSDX27",28,0) - S X="ERROR^BSDX27",@^%ZOSF("TRAP") + ; Exclude cancelled appts. Store in BSDXDPT array. "RTN","BSDX27",29,0) - ;Get patient info + ; 2. Go through ^BSDXAPPT("CPAT", (patient index) . "RTN","BSDX27",30,0) - ; + ; Get the info from there and compar with BSDXDPT array. If "RTN","BSDX27",31,0) - I '+BSDXPAT S ^BSDXTMP($J,1)=$C(31) Q + ; they are the same, get all info, and rm entry from BSDXDPT array. "RTN","BSDX27",32,0) - I '$D(^DPT(+BSDXPAT,0)) S ^BSDXTMP($J,1)=$C(31) Q + ; 3. If there are any remaining entries in BSDXDPT (PIMS leftovers), "RTN","BSDX27",33,0) - S BSDXNOD=$$PATINFO(BSDXPAT) + ; Get the data from file 2 and 44. "RTN","BSDX27",34,0) - S BSDXNAM=$P(BSDXNOD,U) ;NAME + ; "RTN","BSDX27",35,0) - S BSDXSEX=$P(BSDXNOD,U,2) ;SEX + N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXDOB,BSDXHRN,BSDXSEX,BSDXCNID,BSDXCNOD,BSDXMADE,BSDXCLRK,BSDXNOT,BSDXQ "RTN","BSDX27",36,0) - S BSDXDOB=$P(BSDXNOD,U,3) ;DOB + N BSDXSTRT "RTN","BSDX27",37,0) - S BSDXHRN=$P(BSDXNOD,U,4) ;Health Record Number for location DUZ(2) + N BSDXSTRE,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON "RTN","BSDX27",38,0) - S BSDXSTRE=$P(BSDXNOD,U,5) ;Street + S BSDXY="^BSDXTMP("_$J_")" "RTN","BSDX27",39,0) - S BSDXCITY=$P(BSDXNOD,U,6) ;City + S BSDXI=0 "RTN","BSDX27",40,0) - S BSDXST=$P(BSDXNOD,U,7) ;State + S ^BSDXTMP($J,BSDXI)="T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus" "RTN","BSDX27",41,0) - S BSDXZIP=$P(BSDXNOD,U,8) ;zip + S ^BSDXTMP($J,BSDXI)=^(BSDXI)_"^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE"_$C(30) "RTN","BSDX27",42,0) - S BSDXPHON=$P(BSDXNOD,U,9) ;homephone + S X="ERROR^BSDX27",@^%ZOSF("TRAP") "RTN","BSDX27",43,0) - ; + ;Get patient info "RTN","BSDX27",44,0) - ;Organize ^DPT(BSDXPAT,"S," nodes + ; "RTN","BSDX27",45,0) - ; into BSDXDPT(CLINIC,DATE) + I '+BSDXPAT S ^BSDXTMP($J,1)=$C(31) Q "RTN","BSDX27",46,0) - ; + I '$D(^DPT(+BSDXPAT,0)) S ^BSDXTMP($J,1)=$C(31) Q "RTN","BSDX27",47,0) - I $D(^DPT(BSDXPAT,"S")) S BSDXDT=0 F S BSDXDT=$O(^DPT(BSDXPAT,"S",BSDXDT)) Q:'+BSDXDT D + S BSDXNOD=$$PATINFO(BSDXPAT) "RTN","BSDX27",48,0) - . S BSDXNOD=$G(^DPT(BSDXPAT,"S",BSDXDT,0)) + S BSDXNAM=$P(BSDXNOD,U) ;NAME "RTN","BSDX27",49,0) - . S BSDXCID=$P(BSDXNOD,U) + S BSDXSEX=$P(BSDXNOD,U,2) ;SEX "RTN","BSDX27",50,0) - . Q:'+BSDXCID + S BSDXDOB=$P(BSDXNOD,U,3) ;DOB "RTN","BSDX27",51,0) - . Q:'$D(^SC(BSDXCID,0)) + S BSDXHRN=$P(BSDXNOD,U,4) ;Health Record Number for location DUZ(2) "RTN","BSDX27",52,0) - . S BSDXDPT(BSDXCID,BSDXDT)=BSDXNOD + S BSDXSTRE=$P(BSDXNOD,U,5) ;Street "RTN","BSDX27",53,0) - ; + S BSDXCITY=$P(BSDXNOD,U,6) ;City "RTN","BSDX27",54,0) - ;$O Through ^BSDX("CPAT", + S BSDXST=$P(BSDXNOD,U,7) ;State "RTN","BSDX27",55,0) - S BSDXIEN=0 + S BSDXZIP=$P(BSDXNOD,U,8) ;zip "RTN","BSDX27",56,0) - I $D(^BSDXAPPT("CPAT",BSDXPAT)) F S BSDXIEN=$O(^BSDXAPPT("CPAT",BSDXPAT,BSDXIEN)) Q:'BSDXIEN D + S BSDXPHON=$P(BSDXNOD,U,9) ;homephone "RTN","BSDX27",57,0) - . N BSDXNOD,BSDXAPT,BSDXCID,BSDXCNOD,BSDXCLN,BSDX44,BSDXDNOD,BSDXSTAT,BSDX,BSDXTYPE,BSDXLIN + ; "RTN","BSDX27",58,0) - . S BSDXNOD=$G(^BSDXAPPT(BSDXIEN,0)) + ;Organize ^DPT(BSDXPAT,"S," nodes "RTN","BSDX27",59,0) - . Q:BSDXNOD="" + ; into BSDXDPT(CLINIC,DATE) "RTN","BSDX27",60,0) - . Q:$P(BSDXNOD,U,12)]"" ;CANCELLED + ; "RTN","BSDX27",61,0) - . S Y=$P(BSDXNOD,U) + I $D(^DPT(BSDXPAT,"S")) S BSDXDT=0 F S BSDXDT=$O(^DPT(BSDXPAT,"S",BSDXDT)) Q:'+BSDXDT D "RTN","BSDX27",62,0) - . Q:'+Y + . S BSDXNOD=$G(^DPT(BSDXPAT,"S",BSDXDT,0)) "RTN","BSDX27",63,0) - . X ^DD("DD") S Y=$TR(Y,"@"," ") + . S BSDXCID=$P(BSDXNOD,U) "RTN","BSDX27",64,0) - . S BSDXAPT=Y ;Appointment date time + . Q:'+BSDXCID "RTN","BSDX27",65,0) - . S BSDXCLRK=$P(BSDXNOD,U,8) ;Appointment made by + . Q:'$D(^SC(BSDXCID,0)) "RTN","BSDX27",66,0) - . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) + . N BSDXFLAGS S BSDXFLAGS=$P(BSDXNOD,U,2) ; No show and Cancel Flags "RTN","BSDX27",67,0) - . S Y=$P(BSDXNOD,U,9) ;Date Appointment Made + . Q:BSDXFLAGS["C" ; if appt is cancelled, quit "RTN","BSDX27",68,0) - . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") + . S BSDXDPT(BSDXCID,BSDXDT)=BSDXNOD "RTN","BSDX27",69,0) - . S BSDXMADE=Y + ; "RTN","BSDX27",70,0) - . ;NOTE + ;$O Through ^BSDX("CPAT", "RTN","BSDX27",71,0) - . S BSDXNOT="" + S BSDXIEN=0 "RTN","BSDX27",72,0) - . I $D(^BSDXAPPT(BSDXIEN,1,0)) S BSDXNOT="",BSDXQ=0 F S BSDXQ=$O(^BSDXAPPT(BSDXIEN,1,BSDXQ)) Q:'+BSDXQ D + I $D(^BSDXAPPT("CPAT",BSDXPAT)) F S BSDXIEN=$O(^BSDXAPPT("CPAT",BSDXPAT,BSDXIEN)) Q:'BSDXIEN D "RTN","BSDX27",73,0) - . . S BSDXLIN=$G(^BSDXAPPT(BSDXIEN,1,BSDXQ,0)) + . N BSDXNOD,BSDXAPT,BSDXCID,BSDXCNOD,BSDXCLN,BSDX44,BSDXDNOD,BSDXSTAT,BSDX,BSDXTYPE,BSDXLIN "RTN","BSDX27",74,0) - . . S:(BSDXLIN'="")&($E(BSDXLIN,$L(BSDXLIN)-1,$L(BSDXLIN))'=" ") BSDXLIN=BSDXLIN_" " + . S BSDXNOD=$G(^BSDXAPPT(BSDXIEN,0)) "RTN","BSDX27",75,0) - . . S BSDXNOT=BSDXNOT_BSDXLIN + . Q:BSDXNOD="" "RTN","BSDX27",76,0) - . ;Resource + . Q:$P(BSDXNOD,U,12)]"" ;CANCELLED "RTN","BSDX27",77,0) - . S BSDXCID=$P(BSDXNOD,U,7) ;IEN of BSDX RESOURCE + . S Y=$P(BSDXNOD,U) "RTN","BSDX27",78,0) - . Q:'+BSDXCID + . Q:'+Y "RTN","BSDX27",79,0) - . Q:'$D(^BSDXRES(BSDXCID,0)) + . X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",80,0) - . S BSDXCNOD=$G(^BSDXRES(BSDXCID,0)) ;BSDX RESOURCE node + . S BSDXAPT=Y ;Appointment date time "RTN","BSDX27",81,0) - . Q:BSDXCNOD="" + . S BSDXCLRK=$P(BSDXNOD,U,8) ;Appointment made by "RTN","BSDX27",82,0) - . S BSDXCLN=$P(BSDXCNOD,U) ;Text name of BSDX Resource + . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) "RTN","BSDX27",83,0) - . S BSDX44=$P(BSDXCNOD,U,4) ;File 44 pointer + . S Y=$P(BSDXNOD,U,9) ;Date Appointment Made "RTN","BSDX27",84,0) - . ;If appt entry in ^DPT(PAT,"S" exists for this clinic, get the TYPE/STATUS info from + . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",85,0) - . ;the BSDXDPT array and delete the BSDXDPT node + . S BSDXMADE=Y "RTN","BSDX27",86,0) - . S BSDXTYPE="" + . ;NOTE "RTN","BSDX27",87,0) - . I +BSDX44,$D(BSDXDPT(BSDX44,$P(BSDXNOD,U))) D ;BSDXNOD is the BSDX APPOINTMENT node + . S BSDXNOT="" "RTN","BSDX27",88,0) - . . S BSDXDNOD=BSDXDPT(BSDX44,$P(BSDXNOD,U)) ;BSDXDNOD is a copy of the ^DPT(PAT,"S" node + . I $D(^BSDXAPPT(BSDXIEN,1,0)) S BSDXNOT="",BSDXQ=0 F S BSDXQ=$O(^BSDXAPPT(BSDXIEN,1,BSDXQ)) Q:'+BSDXQ D "RTN","BSDX27",89,0) - . . S BSDXTYPE=$$STATUS(BSDXPAT,$P(BSDXNOD,U),BSDXDNOD) ;IHS/OIT/HMW 20050208 Added + . . S BSDXLIN=$G(^BSDXAPPT(BSDXIEN,1,BSDXQ,0)) "RTN","BSDX27",90,0) - . . K BSDXDPT(BSDX44,$P(BSDXNOD,U)) + . . S:(BSDXLIN'="")&($E(BSDXLIN,$L(BSDXLIN)-1,$L(BSDXLIN))'=" ") BSDXLIN=BSDXLIN_" " "RTN","BSDX27",91,0) - . S BSDXI=BSDXI+1 + . . S BSDXNOT=BSDXNOT_BSDXLIN "RTN","BSDX27",92,0) - . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_BSDXCID_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) + . ;Resource "RTN","BSDX27",93,0) - . Q + . S BSDXCID=$P(BSDXNOD,U,7) ;IEN of BSDX RESOURCE "RTN","BSDX27",94,0) - ; + . Q:'+BSDXCID "RTN","BSDX27",95,0) - ;Go through remaining BSDXDPT( entries + . Q:'$D(^BSDXRES(BSDXCID,0)) "RTN","BSDX27",96,0) - I $D(BSDXDPT) S BSDX44=0 D + . S BSDXCNOD=$G(^BSDXRES(BSDXCID,0)) ;BSDX RESOURCE node "RTN","BSDX27",97,0) - . F S BSDX44=$O(BSDXDPT(BSDX44)) Q:'+BSDX44 S BSDXDT=0 D + . Q:BSDXCNOD="" "RTN","BSDX27",98,0) - . . F S BSDXDT=$O(BSDXDPT(BSDX44,BSDXDT)) Q:'+BSDXDT D + . S BSDXCLN=$P(BSDXCNOD,U) ;Text name of BSDX Resource "RTN","BSDX27",99,0) - . . . S BSDXDNOD=BSDXDPT(BSDX44,BSDXDT) + . S BSDX44=$P(BSDXCNOD,U,4) ;File 44 pointer "RTN","BSDX27",100,0) - . . . S Y=BSDXDT + . ;If appt entry in ^DPT(PAT,"S" exists for this clinic, get the TYPE/STATUS info from "RTN","BSDX27",101,0) - . . . Q:'+Y + . ;the BSDXDPT array and delete the BSDXDPT node "RTN","BSDX27",102,0) - . . . X ^DD("DD") S Y=$TR(Y,"@"," ") + . S BSDXTYPE="" "RTN","BSDX27",103,0) - . . . S BSDXAPT=Y + . I +BSDX44,$D(BSDXDPT(BSDX44,$P(BSDXNOD,U))) D ;BSDXNOD is the BSDX APPOINTMENT node "RTN","BSDX27",104,0) - . . . S BSDXTYPE=$$STATUS(BSDXPAT,BSDXDT,BSDXDNOD) ;IHS/OIT/HMW 20050208 Added + . . S BSDXDNOD=BSDXDPT(BSDX44,$P(BSDXNOD,U)) ;BSDXDNOD is a copy of the ^DPT(PAT,"S" node "RTN","BSDX27",105,0) - . . . S BSDXCLN=$P($G(^SC(BSDX44,0)),U) + . . S BSDXTYPE=$$STATUS(BSDXPAT,$P(BSDXNOD,U),BSDXDNOD) ;IHS/OIT/HMW 20050208 Added "RTN","BSDX27",106,0) - . . . S BSDXCLRK=$P(BSDXDNOD,U,18) + . . K BSDXDPT(BSDX44,$P(BSDXNOD,U)) "RTN","BSDX27",107,0) - . . . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) + . S BSDXI=BSDXI+1 "RTN","BSDX27",108,0) - . . . S Y=$P(BSDXDNOD,U,19) + . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_BSDXCID_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) "RTN","BSDX27",109,0) - . . . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") + . Q "RTN","BSDX27",110,0) - . . . S BSDXMADE=Y + ; "RTN","BSDX27",111,0) - . . . S BSDXNOT="" + ;Go through remaining BSDXDPT( entries "RTN","BSDX27",112,0) - . . . S BSDXI=BSDXI+1 + I $D(BSDXDPT) S BSDX44=0 D "RTN","BSDX27",113,0) - . . . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) + . F S BSDX44=$O(BSDXDPT(BSDX44)) Q:'+BSDX44 S BSDXDT=0 D "RTN","BSDX27",114,0) - . . . K BSDXDPT(BSDX44,BSDXDT) + . . F S BSDXDT=$O(BSDXDPT(BSDX44,BSDXDT)) Q:'+BSDXDT D "RTN","BSDX27",115,0) - ; + . . . S BSDXDNOD=BSDXDPT(BSDX44,BSDXDT) "RTN","BSDX27",116,0) - S BSDXI=BSDXI+1 + . . . S Y=BSDXDT "RTN","BSDX27",117,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + . . . Q:'+Y "RTN","BSDX27",118,0) - Q + . . . X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",119,0) - ; + . . . S BSDXAPT=Y "RTN","BSDX27",120,0) -STATUS(PAT,DATE,NODE) ; returns appt status + . . . S BSDXTYPE=$$STATUS(BSDXPAT,BSDXDT,BSDXDNOD) ;IHS/OIT/HMW 20050208 Added "RTN","BSDX27",121,0) - ;IHS/OIT/HMW 20050208 Added from BSDDPA + . . . S BSDXCLN=$P($G(^SC(BSDX44,0)),U) "RTN","BSDX27",122,0) - NEW TYP + . . . S BSDXCLRK=$P(BSDXDNOD,U,18) "RTN","BSDX27",123,0) - S TYP=$$APPTYP^BSDXAPI(PAT,DATE) ;sched vs. walkin + . . . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) "RTN","BSDX27",124,0) - I $P(NODE,U,2)["C" Q TYP_" - CANCELLED" + . . . S Y=$P(BSDXDNOD,U,19) "RTN","BSDX27",125,0) - I $P(NODE,U,2)'="NT",$P(NODE,U,2)["N" Q TYP_" - NO SHOW" + . . . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",126,0) - I $$CO^BSDXAPI(PAT,+NODE,DATE) Q TYP_" - CHECKED OUT" + . . . S BSDXMADE=Y "RTN","BSDX27",127,0) - I $$CI^BSDXAPI(PAT,+NODE,DATE) Q TYP_" - CHECKED IN" + . . . S BSDXNOT="" "RTN","BSDX27",128,0) - Q TYP + . . . S BSDXI=BSDXI+1 "RTN","BSDX27",129,0) - ; + . . . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) "RTN","BSDX27",130,0) -ERROR ; + . . . K BSDXDPT(BSDX44,BSDXDT) "RTN","BSDX27",131,0) - D ERR(BSDXI,"RPMS Error") + ; "RTN","BSDX27",132,0) - Q + S BSDXI=BSDXI+1 "RTN","BSDX27",133,0) - ; + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX27",134,0) -ERR(BSDXI,ERRNO,MSG) ;Error processing + Q "RTN","BSDX27",135,0) - S:'$D(BSDXI) BSDXI=999 + ; "RTN","BSDX27",136,0) - I +ERRNO S BSDXERR=ERRNO+134234112 ;vbObjectError +STATUS(PAT,DATE,NODE) ; returns appt status "RTN","BSDX27",137,0) - E S BSDXERR=ERRNO + ;IHS/OIT/HMW 20050208 Added from BSDDPA "RTN","BSDX27",138,0) - S BSDXI=BSDXI+1 + NEW TYP "RTN","BSDX27",139,0) - S ^BSDXTMP($J,BSDXI)=MSG_"^^^^^^^^^^^^^^^"_$C(30) + S TYP=$$APPTYP^BSDXAPI(PAT,DATE) ;sched vs. walkin "RTN","BSDX27",140,0) - S BSDXI=BSDXI+1 + I $P(NODE,U,2)["C" Q TYP_" - CANCELLED" "RTN","BSDX27",141,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + I $P(NODE,U,2)'="NT",$P(NODE,U,2)["N" Q TYP_" - NO SHOW" "RTN","BSDX27",142,0) - Q + I $$CO^BSDXAPI(PAT,+NODE,DATE) Q TYP_" - CHECKED OUT" "RTN","BSDX27",143,0) -PATINFO(BSDXPAT) ;EP + I $$CI^BSDXAPI(PAT,+NODE,DATE) Q TYP_" - CHECKED IN" "RTN","BSDX27",144,0) - ;Intrisic Function returns NAME^SEX^DOB^HRN^STREET^CITY^STATE^ZIP^PHONE for patient ien BSDXPAT + Q TYP "RTN","BSDX27",145,0) - ;DOB is in external format + ; "RTN","BSDX27",146,0) - ;HRN depends on existence of DUZ(2) +ERROR ; "RTN","BSDX27",147,0) - ; + D ERR(BSDXI,"RPMS Error") "RTN","BSDX27",148,0) - N BSDXNOD,BSDXNAM,BSDXSEX,BSDXDOB,BSDXHRN,BSDXSTRT,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON + Q "RTN","BSDX27",149,0) - S BSDXNOD=^DPT(+BSDXPAT,0) + ; "RTN","BSDX27",150,0) - S BSDXNAM=$P(BSDXNOD,U) ;NAME +ERR(BSDXI,ERRNO,MSG) ;Error processing "RTN","BSDX27",151,0) - S BSDXSEX=$P(BSDXNOD,U,2) + S:'$D(BSDXI) BSDXI=999 "RTN","BSDX27",152,0) - S BSDXSEX=$S(BSDXSEX="F":"FEMALE",BSDXSEX="M":"MALE",1:"") + I +ERRNO S BSDXERR=ERRNO+134234112 ;vbObjectError "RTN","BSDX27",153,0) - S Y=$P(BSDXNOD,U,3) I Y]"" X ^DD("DD") S Y=$TR(Y,"@"," ") + E S BSDXERR=ERRNO "RTN","BSDX27",154,0) - S BSDXDOB=Y ;DOB + S BSDXI=BSDXI+1 "RTN","BSDX27",155,0) - S BSDXHRN="" + S ^BSDXTMP($J,BSDXI)=MSG_"^^^^^^^^^^^^^^^"_$C(30) "RTN","BSDX27",156,0) - I $D(DUZ(2)) I DUZ(2)>0 S BSDXHRN=$P($G(^AUPNPAT(BSDXPAT,41,DUZ(2),0)),U,2) ;HRN + S BSDXI=BSDXI+1 "RTN","BSDX27",157,0) - ; + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX27",158,0) - S BSDXNOD=$G(^DPT(+BSDXPAT,.11)) + Q "RTN","BSDX27",159,0) - S (BSDXSTRT,BSDXCITY,BSDXST,BSDXZIP)="" +PATINFO(BSDXPAT) ;EP "RTN","BSDX27",160,0) - I BSDXNOD]"" D + ;Intrisic Function returns NAME^SEX^DOB^HRN^STREET^CITY^STATE^ZIP^PHONE for patient ien BSDXPAT "RTN","BSDX27",161,0) - . S BSDXSTRT=$E($P(BSDXNOD,U),1,50) ;STREET + ;DOB is in external format "RTN","BSDX27",162,0) - . S BSDXCITY=$P(BSDXNOD,U,4) ;CITY + ;HRN depends on existence of DUZ(2) "RTN","BSDX27",163,0) - . S BSDXST=$P(BSDXNOD,U,5) ;STATE + ; "RTN","BSDX27",164,0) - . I +BSDXST,$D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2) + N BSDXNOD,BSDXNAM,BSDXSEX,BSDXDOB,BSDXHRN,BSDXSTRT,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON "RTN","BSDX27",165,0) - . S BSDXZIP=$P(BSDXNOD,U,6) ;ZIP + S BSDXNOD=^DPT(+BSDXPAT,0) "RTN","BSDX27",166,0) - ; + S BSDXNAM=$P(BSDXNOD,U) ;NAME "RTN","BSDX27",167,0) - S BSDXNOD=$G(^DPT(+BSDXPAT,.13)) ;PHONE + S BSDXSEX=$P(BSDXNOD,U,2) "RTN","BSDX27",168,0) - S BSDXPHON=$P(BSDXNOD,U) + S BSDXSEX=$S(BSDXSEX="F":"FEMALE",BSDXSEX="M":"MALE",1:"") "RTN","BSDX27",169,0) - ; + S Y=$P(BSDXNOD,U,3) I Y]"" X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",170,0) - Q BSDXNAM_U_BSDXSEX_U_BSDXDOB_U_BSDXHRN_U_BSDXSTRT_U_BSDXCITY_U_BSDXST_U_BSDXZIP_U_BSDXPHON + S BSDXDOB=Y ;DOB "RTN","BSDX27",171,0) - ; + S BSDXHRN="" "RTN","BSDX27",172,0) -CLDISPD(BSDXY,BSDXCLST,BSDXBEG,BSDXEND) ;EP + I $D(DUZ(2)) I DUZ(2)>0 S BSDXHRN=$P($G(^AUPNPAT(BSDXPAT,41,DUZ(2),0)),U,2) ;HRN "RTN","BSDX27",173,0) - ;Entry point for debugging + ; "RTN","BSDX27",174,0) - ; + S BSDXNOD=$G(^DPT(+BSDXPAT,.11)) "RTN","BSDX27",175,0) - ;D DEBUG^%Serenji("CLDISP^BSDX27(.BSDXY,BSDXCLST,BSDXBEG,BSDXEND)") + S (BSDXSTRT,BSDXCITY,BSDXST,BSDXZIP)="" "RTN","BSDX27",176,0) - Q + I BSDXNOD]"" D "RTN","BSDX27",177,0) - ; + . S BSDXSTRT=$E($P(BSDXNOD,U),1,50) ;STREET "RTN","BSDX27",178,0) -CLDISP(BSDXY,BSDXCLST,BSDXBEG,BSDXEND) ;EP + . S BSDXCITY=$P(BSDXNOD,U,4) ;CITY "RTN","BSDX27",179,0) - ; + . S BSDXST=$P(BSDXNOD,U,5) ;STATE "RTN","BSDX27",180,0) - ;Return recordset of patient appointments + . I +BSDXST,$D(^DIC(5,+BSDXST,0)) S BSDXST=$P(^DIC(5,+BSDXST,0),U,2) "RTN","BSDX27",181,0) - ;between dates BSDXBEG and BSDXEND for each clinic in BSDXCLST. + . S BSDXZIP=$P(BSDXNOD,U,6) ;ZIP "RTN","BSDX27",182,0) - ;Used in listing a patient's appointments and generating patient letters. + ; "RTN","BSDX27",183,0) - ;BSDXCLST is a |-delimited list of BSDX RESOURCE iens. (The last |-piece is null, so discard it.) + S BSDXNOD=$G(^DPT(+BSDXPAT,.13)) ;PHONE "RTN","BSDX27",184,0) - ;BSDXBEG and BSDXEND are in external date form. + S BSDXPHON=$P(BSDXNOD,U) "RTN","BSDX27",185,0) - ;Called by BSDX CLINIC LETTERS + ; "RTN","BSDX27",186,0) - ; + Q BSDXNAM_U_BSDXSEX_U_BSDXDOB_U_BSDXHRN_U_BSDXSTRT_U_BSDXCITY_U_BSDXST_U_BSDXZIP_U_BSDXPHON "RTN","BSDX27",187,0) - ; July 10, 2010 -- to support i18n, we pass dates from client in + ; "RTN","BSDX27",188,0) - ; locale-neutral Fileman format. No need to convert it. +CLDISPD(BSDXY,BSDXCLST,BSDXBEG,BSDXEND) ;EP "RTN","BSDX27",189,0) - N BSDXI,BSDXNOD,BSDXNAM,BSDXDOB,BSDXHRN,BSDXSEX,BSDXCID,BSDXCNOD,BSDXDT + ;Entry point for debugging "RTN","BSDX27",190,0) - N BSDXJ,BSDXAID,BSDXPAT,BSDXPNOD,BSDXCLN,BSDXCLRK,BSDXMADE,BSDXNOT,BSDXLIN + ; "RTN","BSDX27",191,0) - N BSDXSTRT + ;D DEBUG^%Serenji("CLDISP^BSDX27(.BSDXY,BSDXCLST,BSDXBEG,BSDXEND)") "RTN","BSDX27",192,0) - N BSDXSTRE,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON + Q "RTN","BSDX27",193,0) - S BSDXY="^BSDXTMP("_$J_")" + ; "RTN","BSDX27",194,0) - K ^BSDXTMP($J) +CLDISP(BSDXY,BSDXCLST,BSDXBEG,BSDXEND) ;EP "RTN","BSDX27",195,0) - S BSDXI=0 + ; "RTN","BSDX27",196,0) - S ^BSDXTMP($J,BSDXI)="T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus" + ;Return recordset of patient appointments "RTN","BSDX27",197,0) - S ^BSDXTMP($J,BSDXI)=^(BSDXI)_"^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE"_$C(30) + ;between dates BSDXBEG and BSDXEND for each clinic in BSDXCLST. "RTN","BSDX27",198,0) - S X="ERROR^BSDX27",@^%ZOSF("TRAP") + ;Used in listing a patient's appointments and generating patient letters. "RTN","BSDX27",199,0) - ; + ;BSDXCLST is a |-delimited list of BSDX RESOURCE iens. (The last |-piece is null, so discard it.) "RTN","BSDX27",200,0) - ;Convert beginning and ending dates + ;BSDXBEG and BSDXEND are in external date form. "RTN","BSDX27",201,0) - ; + ;Called by BSDX CLINIC LETTERS "RTN","BSDX27",202,0) - S BSDXBEG=BSDXBEG-1,BSDXBEG=BSDXBEG_".9999" + ; "RTN","BSDX27",203,0) - S BSDXEND=BSDXEND_".9999" + ; July 10, 2010 -- to support i18n, we pass dates from client in "RTN","BSDX27",204,0) - I BSDXCLST="" D ERR(BSDXI,0,"Routine: BSDX27, Error: Null clinic list") Q + ; locale-neutral Fileman format. No need to convert it. "RTN","BSDX27",205,0) - ; + N BSDXI,BSDXNOD,BSDXNAM,BSDXDOB,BSDXHRN,BSDXSEX,BSDXCID,BSDXCNOD,BSDXDT "RTN","BSDX27",206,0) - ;For each clinic in BSDXCLST $O through ^BSDXAPPT("ARSRC",ResourceIEN,FMDate,ApptIEN) + N BSDXJ,BSDXAID,BSDXPAT,BSDXPNOD,BSDXCLN,BSDXCLRK,BSDXMADE,BSDXNOT,BSDXLIN "RTN","BSDX27",207,0) - ; + N BSDXSTRT "RTN","BSDX27",208,0) - F BSDXJ=1:1:$L(BSDXCLST,"|")-1 S BSDXCID=$P(BSDXCLST,"|",BSDXJ) D + N BSDXSTRE,BSDXCITY,BSDXST,BSDXZIP,BSDXPHON "RTN","BSDX27",209,0) - . S BSDXCLN=$G(^BSDXRES(BSDXCID,0)) S BSDXCLN=$P(BSDXCLN,U) Q:BSDXCLN="" + S BSDXY="^BSDXTMP("_$J_")" "RTN","BSDX27",210,0) - . S BSDXSTRT=BSDXBEG F S BSDXSTRT=$O(^BSDXAPPT("ARSRC",BSDXCID,BSDXSTRT)) Q:'+BSDXSTRT Q:BSDXSTRT>BSDXEND D + K ^BSDXTMP($J) "RTN","BSDX27",211,0) - . . S BSDXAID=0 F S BSDXAID=$O(^BSDXAPPT("ARSRC",BSDXCID,BSDXSTRT,BSDXAID)) Q:'+BSDXAID D + S BSDXI=0 "RTN","BSDX27",212,0) - . . . S BSDXNOD=$G(^BSDXAPPT(BSDXAID,0)) + S ^BSDXTMP($J,BSDXI)="T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus" "RTN","BSDX27",213,0) - . . . Q:BSDXNOD="" + S ^BSDXTMP($J,BSDXI)=^(BSDXI)_"^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE"_$C(30) "RTN","BSDX27",214,0) - . . . Q:$P(BSDXNOD,U,12)]"" ;CANCELLED + S X="ERROR^BSDX27",@^%ZOSF("TRAP") "RTN","BSDX27",215,0) - . . . Q:$P(BSDXNOD,U,13)="y" ;WALKIN + ; "RTN","BSDX27",216,0) - . . . S Y=$P(BSDXNOD,U) + ;Convert beginning and ending dates "RTN","BSDX27",217,0) - . . . Q:'+Y + ; "RTN","BSDX27",218,0) - . . . X ^DD("DD") S Y=$TR(Y,"@"," ") + S BSDXBEG=BSDXBEG-1,BSDXBEG=BSDXBEG_".9999" "RTN","BSDX27",219,0) - . . . S BSDXAPT=Y ;Appointment date time + S BSDXEND=BSDXEND_".9999" "RTN","BSDX27",220,0) - . . . ; + I BSDXCLST="" D ERR(BSDXI,0,"Routine: BSDX27, Error: Null clinic list") Q "RTN","BSDX27",221,0) - . . . ;NOTE + ; "RTN","BSDX27",222,0) - . . . S BSDXNOT="" + ;For each clinic in BSDXCLST $O through ^BSDXAPPT("ARSRC",ResourceIEN,FMDate,ApptIEN) "RTN","BSDX27",223,0) - . . . I $D(^BSDXAPPT(BSDXAID,1,0)) S BSDXQ=0 F S BSDXQ=$O(^BSDXAPPT(BSDXAID,1,BSDXQ)) Q:'+BSDXQ D + ; "RTN","BSDX27",224,0) - . . . . S BSDXLIN=$G(^BSDXAPPT(BSDXAID,1,BSDXQ,0)) + F BSDXJ=1:1:$L(BSDXCLST,"|")-1 S BSDXCID=$P(BSDXCLST,"|",BSDXJ) D "RTN","BSDX27",225,0) - . . . . S:(BSDXLIN'="")&($E(BSDXLIN,$L(BSDXLIN)-1,$L(BSDXLIN))'=" ") BSDXLIN=BSDXLIN_" " + . S BSDXCLN=$G(^BSDXRES(BSDXCID,0)) S BSDXCLN=$P(BSDXCLN,U) Q:BSDXCLN="" "RTN","BSDX27",226,0) - . . . . S BSDXNOT=BSDXNOT_BSDXLIN + . S BSDXSTRT=BSDXBEG F S BSDXSTRT=$O(^BSDXAPPT("ARSRC",BSDXCID,BSDXSTRT)) Q:'+BSDXSTRT Q:BSDXSTRT>BSDXEND D "RTN","BSDX27",227,0) - . . . ; + . . S BSDXAID=0 F S BSDXAID=$O(^BSDXAPPT("ARSRC",BSDXCID,BSDXSTRT,BSDXAID)) Q:'+BSDXAID D "RTN","BSDX27",228,0) - . . . S BSDXPAT=$P(BSDXNOD,U,5) + . . . S BSDXNOD=$G(^BSDXAPPT(BSDXAID,0)) "RTN","BSDX27",229,0) - . . . S BSDXPNOD=$$PATINFO(BSDXPAT) + . . . Q:BSDXNOD="" "RTN","BSDX27",230,0) - . . . S BSDXNAM=$P(BSDXPNOD,U) ;NAME + . . . Q:$P(BSDXNOD,U,12)]"" ;CANCELLED "RTN","BSDX27",231,0) - . . . S BSDXSEX=$P(BSDXPNOD,U,2) ;SEX + . . . Q:$P(BSDXNOD,U,13)="y" ;WALKIN "RTN","BSDX27",232,0) - . . . S BSDXDOB=$P(BSDXPNOD,U,3) ;DOB + . . . S Y=$P(BSDXNOD,U) "RTN","BSDX27",233,0) - . . . S BSDXHRN=$P(BSDXPNOD,U,4) ;Health Record Number for location DUZ(2) + . . . Q:'+Y "RTN","BSDX27",234,0) - . . . S BSDXSTRE=$P(BSDXPNOD,U,5) ;Street + . . . X ^DD("DD") S Y=$TR(Y,"@"," ") "RTN","BSDX27",235,0) - . . . S BSDXCITY=$P(BSDXPNOD,U,6) ;City + . . . S BSDXAPT=Y ;Appointment date time "RTN","BSDX27",236,0) - . . . S BSDXST=$P(BSDXPNOD,U,7) ;State + . . . ; "RTN","BSDX27",237,0) - . . . S BSDXZIP=$P(BSDXPNOD,U,8) ;zip + . . . ;NOTE "RTN","BSDX27",238,0) - . . . S BSDXPHON=$P(BSDXPNOD,U,9) ;homephone + . . . S BSDXNOT="" "RTN","BSDX27",239,0) - . . . S BSDXTYPE="" ;Type/status doesn't exist for BSDX APPT clinics and it's not needed for clinic letters + . . . I $D(^BSDXAPPT(BSDXAID,1,0)) S BSDXQ=0 F S BSDXQ=$O(^BSDXAPPT(BSDXAID,1,BSDXQ)) Q:'+BSDXQ D "RTN","BSDX27",240,0) - . . . S BSDXCLRK=$P(BSDXNOD,U,8) + . . . . S BSDXLIN=$G(^BSDXAPPT(BSDXAID,1,BSDXQ,0)) "RTN","BSDX27",241,0) - . . . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) + . . . . S:(BSDXLIN'="")&($E(BSDXLIN,$L(BSDXLIN)-1,$L(BSDXLIN))'=" ") BSDXLIN=BSDXLIN_" " "RTN","BSDX27",242,0) - . . . S Y=$P(BSDXNOD,U,9) + . . . . S BSDXNOT=BSDXNOT_BSDXLIN "RTN","BSDX27",243,0) - . . . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") + . . . ; "RTN","BSDX27",244,0) - . . . S BSDXMADE=Y + . . . S BSDXPAT=$P(BSDXNOD,U,5) "RTN","BSDX27",245,0) - . . . S BSDXI=BSDXI+1 + . . . S BSDXPNOD=$$PATINFO(BSDXPAT) "RTN","BSDX27",246,0) - . . . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_BSDXCID_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) + . . . S BSDXNAM=$P(BSDXPNOD,U) ;NAME "RTN","BSDX27",247,0) - ; + . . . S BSDXSEX=$P(BSDXPNOD,U,2) ;SEX "RTN","BSDX27",248,0) - S BSDXI=BSDXI+1 + . . . S BSDXDOB=$P(BSDXPNOD,U,3) ;DOB "RTN","BSDX27",249,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + . . . S BSDXHRN=$P(BSDXPNOD,U,4) ;Health Record Number for location DUZ(2) "RTN","BSDX27",250,0) - Q + . . . S BSDXSTRE=$P(BSDXPNOD,U,5) ;Street +"RTN","BSDX27",251,0) + . . . S BSDXCITY=$P(BSDXPNOD,U,6) ;City +"RTN","BSDX27",252,0) + . . . S BSDXST=$P(BSDXPNOD,U,7) ;State +"RTN","BSDX27",253,0) + . . . S BSDXZIP=$P(BSDXPNOD,U,8) ;zip +"RTN","BSDX27",254,0) + . . . S BSDXPHON=$P(BSDXPNOD,U,9) ;homephone +"RTN","BSDX27",255,0) + . . . S BSDXTYPE="" ;Type/status doesn't exist for BSDX APPT clinics and it's not needed for clinic letters +"RTN","BSDX27",256,0) + . . . S BSDXCLRK=$P(BSDXNOD,U,8) +"RTN","BSDX27",257,0) + . . . S:+BSDXCLRK BSDXCLRK=$G(^VA(200,BSDXCLRK,0)),BSDXCLRK=$P(BSDXCLRK,U) +"RTN","BSDX27",258,0) + . . . S Y=$P(BSDXNOD,U,9) +"RTN","BSDX27",259,0) + . . . I +Y X ^DD("DD") S Y=$TR(Y,"@"," ") +"RTN","BSDX27",260,0) + . . . S BSDXMADE=Y +"RTN","BSDX27",261,0) + . . . S BSDXI=BSDXI+1 +"RTN","BSDX27",262,0) + . . . S ^BSDXTMP($J,BSDXI)=BSDXNAM_"^"_BSDXDOB_"^"_BSDXSEX_"^"_BSDXHRN_"^"_BSDXAPT_"^"_BSDXCLN_"^"_BSDXTYPE_"^"_BSDXCID_"^"_BSDXCLRK_"^"_BSDXMADE_"^"_BSDXNOT_"^"_BSDXSTRE_"^"_BSDXCITY_"^"_BSDXST_"^"_BSDXZIP_"^"_BSDXPHON_$C(30) +"RTN","BSDX27",263,0) + ; +"RTN","BSDX27",264,0) + S BSDXI=BSDXI+1 +"RTN","BSDX27",265,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX27",266,0) + Q "RTN","BSDX28") 0^26^B32389827 "RTN","BSDX28",1,0) BSDX28 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/18/10 2:30pm "RTN","BSDX28",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX28",3,0) ; "RTN","BSDX28",4,0) @@ -8175,423 +8863,461 @@ ERR(ERRNO) ;Error processing "RTN","BSDX28",144,0) Q "RTN","BSDX29") -0^27^B39369778 +0^27^B51424449 "RTN","BSDX29",1,0) -BSDX29 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/18/10 2:03pm +BSDX29 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 12:39pm "RTN","BSDX29",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX29",3,0) - ; + ; "RTN","BSDX29",4,0) - ; Change Log: + ; Change Log: "RTN","BSDX29",5,0) - ; v1.3 by WV/SMH on 3100713 + ; v1.3 by WV/SMH on 3100713 "RTN","BSDX29",6,0) ; - Beginning and Ending dates passed as FM Dates "RTN","BSDX29",7,0) - ; + ; v1.42 by WV/SMH on 3101023 "RTN","BSDX29",8,0) -BSDXCPD(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP + ; - Transaction moved; now restartable too. "RTN","BSDX29",9,0) - ;Entry point for debugging + ; --> Thanks to Zach Gonzalez and Rick Marshall. "RTN","BSDX29",10,0) - ; + ; - Refactoring of major portions of routine "RTN","BSDX29",11,0) - ;D DEBUG^%Serenji("BSDXCP^BSDX29(.BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND)") -"RTN","BSDX29",12,0) - Q -"RTN","BSDX29",13,0) ; +"RTN","BSDX29",12,0) +BSDXCPD(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP +"RTN","BSDX29",13,0) + ;Entry point for debugging "RTN","BSDX29",14,0) -BSDXCP(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP + ; "RTN","BSDX29",15,0) - ;Copy appointments from HOSPITAL LOCATION entry BSDX44 to BSDX RESOURCE entry BSDXRES + D DEBUG^%Serenji("BSDXCP^BSDX29(.BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND)") "RTN","BSDX29",16,0) - ;Beginning with appointments on day BSDXBEG and ending on BSDXEND, inclusive + Q "RTN","BSDX29",17,0) ; "RTN","BSDX29",18,0) - ;Returns ADO Recordset formatted fields containing count of records copied and error message: +BSDXCP(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP "RTN","BSDX29",19,0) - ; + ;Copy appointments from HOSPITAL LOCATION entry BSDX44 to BSDX RESOURCE entry BSDXRES "RTN","BSDX29",20,0) - ; July 13 2010: D dates (BEG and END) from US format to FM Dates for i18n + ;Beginning with appointments on day BSDXBEG and ending on BSDXEND, inclusive "RTN","BSDX29",21,0) - ; + ;Called by RPC: BSDX COPY APPOINTMENTS "RTN","BSDX29",22,0) ; "RTN","BSDX29",23,0) - S BSDXY="^BSDXTMP("_$J_")" + ; Parameters: "RTN","BSDX29",24,0) - N BSDXI,BSDXST,ZTSK + ; - BSDXY: Global Return "RTN","BSDX29",25,0) - S BSDXI=0 + ; - BSDXRES: BSDX RESOURCE to copy appointments to "RTN","BSDX29",26,0) - S X="ETRAP^BSDX29",@^%ZOSF("TRAP") + ; - BSDX44: Hospital Location IEN to copy appointments from "RTN","BSDX29",27,0) - S ^BSDXTMP($J,0)="T00010TASK_NUMBER^T00020ERRORID"_$C(30) + ; - BSDXBEG: Beginning Date in FM Format "RTN","BSDX29",28,0) - ; + ; - BSDXEND: End Date in FM Format "RTN","BSDX29",29,0) - ;Convert beginning and ending dates -"RTN","BSDX29",30,0) ; +"RTN","BSDX29",30,0) + ;Returns ADO Recordset containing TASK_NUMBER and ERRORID "RTN","BSDX29",31,0) - ;TODO:Validate FM Dates coming through + ; "RTN","BSDX29",32,0) - ; + ; Return Array "RTN","BSDX29",33,0) - S BSDXBEG=BSDXBEG-1 + S BSDXY=$NA(^BSDXTMP($J)) "RTN","BSDX29",34,0) - S BSDXEND=BSDXEND+1 + K ^BSDXTMP($J) "RTN","BSDX29",35,0) - ; + ; $ET "RTN","BSDX29",36,0) - S ZTRTN="ZTM^BSDX29",ZTDTH=$H,ZTDESC="COPY PATIENT APPTS" + N $ET S $ET="G ETRAP^BSDX29" "RTN","BSDX29",37,0) - S ZTSAVE("BSDXBEG")="",ZTSAVE("BSDXEND")="",ZTSAVE("BSDX44")="",ZTSAVE("BSDXRES")="" + ; Counter "RTN","BSDX29",38,0) - D ^%ZTLOAD + N BSDXI S BSDXI=0 "RTN","BSDX29",39,0) - ; + ; Header Node "RTN","BSDX29",40,0) - S BSDXI=BSDXI+1 + S ^BSDXTMP($J,0)="T00010TASK_NUMBER^T00100ERRORID"_$C(30) "RTN","BSDX29",41,0) - S BSDXST=$S($G(ZTSK)>0:"OK",1:"Unable to create task.") + ; "RTN","BSDX29",42,0) - S ^BSDXTMP($J,BSDXI)=$G(ZTSK)_"^"_BSDXST_$C(30)_$C(31) + ; Make dates inclusive; add 1 to FM dates "RTN","BSDX29",43,0) - Q + S BSDXBEG=BSDXBEG-1 "RTN","BSDX29",44,0) - ; + S BSDXEND=BSDXEND+1 "RTN","BSDX29",45,0) -ZTMTST ; + ; "RTN","BSDX29",46,0) - ; + ; Taskman variables "RTN","BSDX29",47,0) - S %DT="AE" D ^%DT S BSDXBEG=Y + N ZTSK,ZTRTN,ZTDTH,ZTDESC,ZTSAVE "RTN","BSDX29",48,0) - S %DT="AE" D ^%DT S BSDXEND=Y + ; Task Load "RTN","BSDX29",49,0) - S BSDX44=3,BSDXSRES=1,ZTSK=3380 + S ZTRTN="ZTM^BSDX29",ZTDTH=$H,ZTDESC="COPY PATIENT APPTS" "RTN","BSDX29",50,0) - D ZTM + S ZTSAVE("BSDXBEG")="",ZTSAVE("BSDXEND")="",ZTSAVE("BSDX44")="",ZTSAVE("BSDXRES")="" "RTN","BSDX29",51,0) - Q + D ^%ZTLOAD "RTN","BSDX29",52,0) - ; + ; Set up return ADO.net dataset "RTN","BSDX29",53,0) -ZTMD ;EP - Debug entry point + N BSDXST S BSDXST=$S($G(ZTSK)>0:"OK",1:"Unable to create task.") "RTN","BSDX29",54,0) - ;D DEBUG^%Serenji("ZTM^BSDX29") + S BSDXI=BSDXI+1 "RTN","BSDX29",55,0) - Q + S ^BSDXTMP($J,BSDXI)=$G(ZTSK)_"^"_BSDXST_$C(30)_$C(31) "RTN","BSDX29",56,0) - ; + QUIT "RTN","BSDX29",57,0) -ZTM ;EP + ; "RTN","BSDX29",58,0) - ;Taskman entry point +ZTMD ;EP - Debug entry point "RTN","BSDX29",59,0) - S X="ZTMERR^BSDX29",@^%ZOSF("TRAP") + ;D DEBUG^%Serenji("ZTM^BSDX29") "RTN","BSDX29",60,0) - ;$O through ^SC(BSDX44,"S", + Q "RTN","BSDX29",61,0) - Q:'$D(ZTSK) + ; "RTN","BSDX29",62,0) - N BSDXCNT,BSDXIEN,BSDXNOD,BSDXNOTE,BSDXCAN,BSDXPAT,BSDXLEN,BSDXMADE,BSDXCLRK,BSDXPAT,BSDXQUIT +ZTM ;EP - Taskman entry point "RTN","BSDX29",63,0) - S BSDXCNT=0,BSDXQUIT=0 + ; Variables set up in ZTSAVE above "RTN","BSDX29",64,0) - S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT + ; "RTN","BSDX29",65,0) - TSTART + Q:'$D(ZTSK) "RTN","BSDX29",66,0) - F S BSDXBEG=$O(^SC(BSDX44,"S",BSDXBEG)) Q:'+BSDXBEG Q:BSDXBEG>BSDXEND Q:BSDXQUIT D + ; $ET "RTN","BSDX29",67,0) - . S BSDXIEN=0 F S BSDXIEN=$O(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN)) Q:'+BSDXIEN Q:BSDXQUIT D + N $ET S $ET="G ZTMERR^BSDX29" "RTN","BSDX29",68,0) - . . S BSDXNOD=$G(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN,0)) + ; Txn "RTN","BSDX29",69,0) - . . Q:'+BSDXNOD + TSTART (BSDXBEG,BSDXEND,BSDX44,BSDXRES):T="BSDX COPY APPOINTMENT^BSDX29" "RTN","BSDX29",70,0) - . . S BSDXCAN=$P(BSDXNOD,U,9) + ;$O through ^SC(BSDX44,"S", "RTN","BSDX29",71,0) - . . Q:BSDXCAN="C" + N BSDXCNT S BSDXCNT=0 ; Count of Copied Appointments "RTN","BSDX29",72,0) - . . S BSDXPAT=$P(BSDXNOD,U) + N BSDXQUIT S BSDXQUIT=0 ; Quit Flag to be retrieved from an external proc "RTN","BSDX29",73,0) - . . S BSDXLEN=$P(BSDXNOD,U,2) ;duration in minutes + ; Set Count "RTN","BSDX29",74,0) - . . S BSDXCLRK=$P(BSDXNOD,U,6) ;appt made by (clerk) + S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT "RTN","BSDX29",75,0) - . . S BSDXMADE=$P(BSDXNOD,U,7) ;date appt made + ; Loop through dates here. "RTN","BSDX29",76,0) - . . S BSDXNOTE=$P(BSDXNOD,U,4) ;'OTHER' field contains note + F S BSDXBEG=$O(^SC(BSDX44,"S",BSDXBEG)) Q:'+BSDXBEG Q:BSDXBEG>BSDXEND Q:BSDXQUIT D "RTN","BSDX29",77,0) - . . S BSDXCNT=BSDXCNT+$$XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) + . ; Loop through Entries in each date in the subsubfile. "RTN","BSDX29",78,0) - . . I +BSDXCNT,BSDXCNT#10=0 S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT_" records copied." ;every 10th record + . ; Quit if we are at the end or if a remote process requests a quit. "RTN","BSDX29",79,0) - . . I $D(^BSDXTMP("BSDXCOPY",ZTSK,"CANCEL")) S BSDXQUIT=1 ;Check for cancel flag + . N BSDXIEN S BSDXIEN=0 "RTN","BSDX29",80,0) - . . Q + . F S BSDXIEN=$O(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN)) Q:'+BSDXIEN Q:BSDXQUIT D "RTN","BSDX29",81,0) - . Q + . . N BSDXNOD S BSDXNOD=$G(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN,0)) ; Node "RTN","BSDX29",82,0) - I 'BSDXQUIT TCOMMIT + . . Q:'+BSDXNOD ; Quit if no node "RTN","BSDX29",83,0) - E TROLLBACK + . . N BSDXCAN S BSDXCAN=$P(BSDXNOD,U,9) ; Cancel flag "RTN","BSDX29",84,0) - S ^BSDXTMP("BSDXCOPY",ZTSK)=$S(BSDXQUIT:"Cancelled. No records copied.",1:"Finished. "_BSDXCNT_" records copied.") + . . Q:BSDXCAN="C" ; Quit if appt cancelled "RTN","BSDX29",85,0) - Q + . . N BSDXPAT S BSDXPAT=$P(BSDXNOD,U) ; Patient "RTN","BSDX29",86,0) - ; + . . N BSDXLEN S BSDXLEN=$P(BSDXNOD,U,2) ;duration in minutes "RTN","BSDX29",87,0) -ZTMERR ; + . . N BSDXCLRK S BSDXCLRK=$P(BSDXNOD,U,6) ;appt made by (clerk) "RTN","BSDX29",88,0) - TROLLBACK + . . N BSDXMADE S BSDXMADE=$P(BSDXNOD,U,7) ;date appt made "RTN","BSDX29",89,0) - D ^%ZTER + . . N BSDXNOTE S BSDXNOTE=$P(BSDXNOD,U,4) ;'OTHER' field contains note "RTN","BSDX29",90,0) - Q + . . S BSDXCNT=BSDXCNT+$$XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) "RTN","BSDX29",91,0) - ; + . . I +BSDXCNT,BSDXCNT#10=0 S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT_" records copied." ;every 10th record "RTN","BSDX29",92,0) -XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) ;EP + . . I $D(^BSDXTMP("BSDXCOPY",ZTSK,"CANCEL")) S BSDXQUIT=1 ;Check for cancel flag "RTN","BSDX29",93,0) - ; + . . Q "RTN","BSDX29",94,0) - ;Copy record to BSDX APPOINTMENT file -"RTN","BSDX29",95,0) - ;Return 1 if record copied, otherwise 0 -"RTN","BSDX29",96,0) - ; -"RTN","BSDX29",97,0) - ;$O Thru ^BSDXAPPT to determine if this appt already added -"RTN","BSDX29",98,0) - N BSDXEND,BSDXIEN,BSDXFND,BSDXPAT2 -"RTN","BSDX29",99,0) - S BSDXIEN=0,BSDXFND=0 -"RTN","BSDX29",100,0) - F S BSDXIEN=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXBEG,BSDXIEN)) Q:'+BSDXIEN D Q:BSDXFND -"RTN","BSDX29",101,0) - . S BSDXNOD=$G(^BSDXAPPT(BSDXIEN,0)) -"RTN","BSDX29",102,0) - . Q:'+BSDXNOD -"RTN","BSDX29",103,0) - . S BSDXPAT2=$P(BSDXNOD,U,5) -"RTN","BSDX29",104,0) - . S BSDXFND=0 -"RTN","BSDX29",105,0) - . I BSDXPAT2=BSDXPAT S BSDXFND=1 -"RTN","BSDX29",106,0) . Q -"RTN","BSDX29",107,0) - Q:BSDXFND 0 -"RTN","BSDX29",108,0) - ; -"RTN","BSDX29",109,0) - ;Add to BSDX APPOINTMENT -"RTN","BSDX29",110,0) - S BSDXEND=BSDXBEG -"RTN","BSDX29",111,0) - ;Calculate ending time from beginning time and duration. -"RTN","BSDX29",112,0) - S BSDXEND=$$ADDMIN(BSDXBEG,BSDXLEN) -"RTN","BSDX29",113,0) - S BSDXIENS="+1," -"RTN","BSDX29",114,0) - S BSDXFDA(9002018.4,BSDXIENS,.01)=BSDXBEG -"RTN","BSDX29",115,0) - S BSDXFDA(9002018.4,BSDXIENS,.02)=BSDXEND -"RTN","BSDX29",116,0) - S BSDXFDA(9002018.4,BSDXIENS,.05)=BSDXPAT -"RTN","BSDX29",117,0) - S BSDXFDA(9002018.4,BSDXIENS,.07)=BSDXRES -"RTN","BSDX29",118,0) - S BSDXFDA(9002018.4,BSDXIENS,.08)=BSDXCLRK -"RTN","BSDX29",119,0) - S BSDXFDA(9002018.4,BSDXIENS,.09)=BSDXMADE -"RTN","BSDX29",120,0) - ; -"RTN","BSDX29",121,0) - K BSDXIEN -"RTN","BSDX29",122,0) - D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") -"RTN","BSDX29",123,0) - S BSDXIEN=+$G(BSDXIEN(1)) -"RTN","BSDX29",124,0) - I '+BSDXIEN Q 0 -"RTN","BSDX29",125,0) - ; -"RTN","BSDX29",126,0) - ;Add WP field -"RTN","BSDX29",127,0) - I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" D -"RTN","BSDX29",128,0) - . D WP^DIE(9002018.4,BSDXIEN_",",1,"","BSDXNOTE","BSDXMSG") -"RTN","BSDX29",129,0) - ; -"RTN","BSDX29",130,0) - Q 1 -"RTN","BSDX29",131,0) - ; -"RTN","BSDX29",132,0) -ERR(BSDXI,BSDXCNT,BSDXERR) ;Error processing -"RTN","BSDX29",133,0) - S BSDXI=BSDXI+1 -"RTN","BSDX29",134,0) - S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_BSDXERR_$C(30) -"RTN","BSDX29",135,0) - S BSDXI=BSDXI+1 -"RTN","BSDX29",136,0) - S ^BSDXTMP($J,BSDXI)=$C(31) -"RTN","BSDX29",137,0) +"RTN","BSDX29",95,0) + I 'BSDXQUIT TCOMMIT +"RTN","BSDX29",96,0) + E TROLLBACK +"RTN","BSDX29",97,0) + S ^BSDXTMP("BSDXCOPY",ZTSK)=$S(BSDXQUIT:"Cancelled. No records copied.",1:"Finished. "_BSDXCNT_" records copied.") +"RTN","BSDX29",98,0) Q -"RTN","BSDX29",138,0) +"RTN","BSDX29",99,0) ; -"RTN","BSDX29",139,0) -ETRAP ;EP Error trap entry -"RTN","BSDX29",140,0) +"RTN","BSDX29",100,0) +ZTMERR ; For now, error from TM is only in trap; not returned to client. +"RTN","BSDX29",101,0) + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap +"RTN","BSDX29",102,0) + ; Rollback before logging the error +"RTN","BSDX29",103,0) + I $TL>0 TROLLBACK +"RTN","BSDX29",104,0) D ^%ZTER +"RTN","BSDX29",105,0) + S $EC="" ; Clear Error +"RTN","BSDX29",106,0) + QUIT +"RTN","BSDX29",107,0) + ; +"RTN","BSDX29",108,0) +XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) ;EP +"RTN","BSDX29",109,0) + ; +"RTN","BSDX29",110,0) + ;Copy record to BSDX APPOINTMENT file +"RTN","BSDX29",111,0) + ;Return 1 if record copied, otherwise 0 +"RTN","BSDX29",112,0) + ; +"RTN","BSDX29",113,0) + ;$O Thru ^BSDXAPPT to determine if this appt already added +"RTN","BSDX29",114,0) + N BSDXEND,BSDXIEN,BSDXFND,BSDXPAT2 +"RTN","BSDX29",115,0) + S BSDXIEN=0,BSDXFND=0 +"RTN","BSDX29",116,0) + F S BSDXIEN=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXBEG,BSDXIEN)) Q:'+BSDXIEN D Q:BSDXFND +"RTN","BSDX29",117,0) + . S BSDXNOD=$G(^BSDXAPPT(BSDXIEN,0)) +"RTN","BSDX29",118,0) + . Q:'+BSDXNOD +"RTN","BSDX29",119,0) + . S BSDXPAT2=$P(BSDXNOD,U,5) +"RTN","BSDX29",120,0) + . S BSDXFND=0 +"RTN","BSDX29",121,0) + . I BSDXPAT2=BSDXPAT S BSDXFND=1 +"RTN","BSDX29",122,0) + . Q +"RTN","BSDX29",123,0) + Q:BSDXFND 0 +"RTN","BSDX29",124,0) + ; +"RTN","BSDX29",125,0) + ;Add to BSDX APPOINTMENT +"RTN","BSDX29",126,0) + S BSDXEND=BSDXBEG +"RTN","BSDX29",127,0) + ;Calculate ending time from beginning time and duration. +"RTN","BSDX29",128,0) + S BSDXEND=$$ADDMIN(BSDXBEG,BSDXLEN) +"RTN","BSDX29",129,0) + S BSDXIENS="+1," +"RTN","BSDX29",130,0) + S BSDXFDA(9002018.4,BSDXIENS,.01)=BSDXBEG +"RTN","BSDX29",131,0) + S BSDXFDA(9002018.4,BSDXIENS,.02)=BSDXEND +"RTN","BSDX29",132,0) + S BSDXFDA(9002018.4,BSDXIENS,.05)=BSDXPAT +"RTN","BSDX29",133,0) + S BSDXFDA(9002018.4,BSDXIENS,.07)=BSDXRES +"RTN","BSDX29",134,0) + S BSDXFDA(9002018.4,BSDXIENS,.08)=BSDXCLRK +"RTN","BSDX29",135,0) + S BSDXFDA(9002018.4,BSDXIENS,.09)=BSDXMADE +"RTN","BSDX29",136,0) + ; +"RTN","BSDX29",137,0) + K BSDXIEN +"RTN","BSDX29",138,0) + D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") +"RTN","BSDX29",139,0) + S BSDXIEN=+$G(BSDXIEN(1)) +"RTN","BSDX29",140,0) + I '+BSDXIEN Q 0 "RTN","BSDX29",141,0) - I '$D(BSDXI) N BSDXI S BSDXI=999 + ; "RTN","BSDX29",142,0) - S BSDXI=BSDXI+1 + ;Add WP field "RTN","BSDX29",143,0) - D ERR(BSDXI,$G(BSDXCNT),"Routine: BSDX29, Error: "_$G(%ZTERROR)) + I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" D "RTN","BSDX29",144,0) - Q + . D WP^DIE(9002018.4,BSDXIEN_",",1,"","BSDXNOTE","BSDXMSG") "RTN","BSDX29",145,0) ; "RTN","BSDX29",146,0) -CPSTAT(BSDXY,BSDXTSK) ;EP + Q 1 "RTN","BSDX29",147,0) - ;Return status (copied record count) of tasked job having ZTSK=BSDXTSK + ; "RTN","BSDX29",148,0) - ; +ERR(BSDXI,BSDXCNT,BSDXERR) ;Error processing "RTN","BSDX29",149,0) - S BSDXY="^BSDXTMP("_$J_")" + S BSDXI=BSDXI+1 "RTN","BSDX29",150,0) - N BSDXI,BSDXCNT + S BSDXERR=$TR(BSDXERR,"^","~") "RTN","BSDX29",151,0) - S BSDXI=0 + S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_BSDXERR_$C(30) "RTN","BSDX29",152,0) - S X="ETRAP^BSDX29",@^%ZOSF("TRAP") + S BSDXI=BSDXI+1 "RTN","BSDX29",153,0) - S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30) + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX29",154,0) - S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK)) + Q "RTN","BSDX29",155,0) - I BSDXCNT["Finished" K ^BSDXTMP("BSDXCOPY",BSDXTSK) + ; "RTN","BSDX29",156,0) - I BSDXCNT["Cancelled" K ^BSDXTMP("BSDXCOPY",BSDXTSK) +ETRAP ;EP Error trap entry "RTN","BSDX29",157,0) - ;I $D(^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")) K ^BSDXTMP("BSDXCOPY",BSDXTSK) + ; No Txn here. So don't rollback anything "RTN","BSDX29",158,0) - S BSDXI=BSDXI+1 + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap "RTN","BSDX29",159,0) - S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31) + D ^%ZTER "RTN","BSDX29",160,0) - Q + S $EC="" ; Clear error "RTN","BSDX29",161,0) - ; + I '$D(BSDXI) N BSDXI S BSDXI=0 "RTN","BSDX29",162,0) -CPCANC(BSDXY,BSDXTSK) ;EP + D ERR(BSDXI,$G(BSDXCNT),"~100~BSDX29, Error: "_$G(%ZTERZE)) "RTN","BSDX29",163,0) - ;Signal tasked job having ZTSK=BSDXTSK to cancel -"RTN","BSDX29",164,0) - ;Returns current record count of copy process -"RTN","BSDX29",165,0) - ; -"RTN","BSDX29",166,0) - S BSDXY="^BSDXTMP("_$J_")" -"RTN","BSDX29",167,0) - N BSDXI,BSDXCNT -"RTN","BSDX29",168,0) - S BSDXI=0 -"RTN","BSDX29",169,0) - S X="ETRAP^BSDX29",@^%ZOSF("TRAP") -"RTN","BSDX29",170,0) - S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30) -"RTN","BSDX29",171,0) - S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK)) -"RTN","BSDX29",172,0) - I BSDXCNT["FINISHED" K ^BSDXTMP("BSDXCOPY",BSDXTSK) -"RTN","BSDX29",173,0) - E S ^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")="" -"RTN","BSDX29",174,0) - S BSDXI=BSDXI+1 -"RTN","BSDX29",175,0) - S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31) -"RTN","BSDX29",176,0) Q +"RTN","BSDX29",164,0) + ; +"RTN","BSDX29",165,0) +CPSTAT(BSDXY,BSDXTSK) ;EP - Note: As of Dec 6 2010: Inactive Code +"RTN","BSDX29",166,0) + ;Return status (copied record count) of tasked job having ZTSK=BSDXTSK +"RTN","BSDX29",167,0) + ; +"RTN","BSDX29",168,0) + S BSDXY="^BSDXTMP("_$J_")" +"RTN","BSDX29",169,0) + N BSDXI,BSDXCNT +"RTN","BSDX29",170,0) + S BSDXI=0 +"RTN","BSDX29",171,0) + S X="ETRAP^BSDX29",@^%ZOSF("TRAP") +"RTN","BSDX29",172,0) + S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30) +"RTN","BSDX29",173,0) + S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK)) +"RTN","BSDX29",174,0) + I BSDXCNT["Finished" K ^BSDXTMP("BSDXCOPY",BSDXTSK) +"RTN","BSDX29",175,0) + I BSDXCNT["Cancelled" K ^BSDXTMP("BSDXCOPY",BSDXTSK) +"RTN","BSDX29",176,0) + ;I $D(^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")) K ^BSDXTMP("BSDXCOPY",BSDXTSK) "RTN","BSDX29",177,0) - ; + S BSDXI=BSDXI+1 "RTN","BSDX29",178,0) -ADDMIN(BSDXSTRT,BSDXLEN) ; + S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31) "RTN","BSDX29",179,0) - ; + Q "RTN","BSDX29",180,0) - ;Add BSDXLEN minutes to time BSDXSTRT and return end time + ; "RTN","BSDX29",181,0) - N BSDXEND,BSDXH,BSDXM,BSDXSTIM,BSDXETIM +CPCANC(BSDXY,BSDXTSK) ;EP Note: As of Dec 6 2010: Inactive code. "RTN","BSDX29",182,0) - S BSDXEND=$P(BSDXSTRT,".") + ;Signal tasked job having ZTSK=BSDXTSK to cancel "RTN","BSDX29",183,0) - ; + ;Returns current record count of copy process "RTN","BSDX29",184,0) - ;Convert start time to minutes past midnight + ; "RTN","BSDX29",185,0) - S BSDXSTIM=$P(BSDXSTRT,".",2) + S BSDXY="^BSDXTMP("_$J_")" "RTN","BSDX29",186,0) - S BSDXSTIM=BSDXSTIM_"0000" + N BSDXI,BSDXCNT "RTN","BSDX29",187,0) - S BSDXSTIM=$E(BSDXSTIM,1,4) + S BSDXI=0 "RTN","BSDX29",188,0) - S BSDXH=$E(BSDXSTIM,1,2) + S X="ETRAP^BSDX29",@^%ZOSF("TRAP") "RTN","BSDX29",189,0) - S BSDXH=BSDXH*60 + S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30) "RTN","BSDX29",190,0) - S BSDXH=BSDXH+$E(BSDXSTIM,3,4) + S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK)) "RTN","BSDX29",191,0) - ; + I BSDXCNT["FINISHED" K ^BSDXTMP("BSDXCOPY",BSDXTSK) "RTN","BSDX29",192,0) - ;Add duration to find minutes past midnight of end time + E S ^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")="" "RTN","BSDX29",193,0) - S BSDXETIM=BSDXH+BSDXLEN + S BSDXI=BSDXI+1 "RTN","BSDX29",194,0) - ; + S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31) "RTN","BSDX29",195,0) - ;Convert back to a time + Q "RTN","BSDX29",196,0) - S BSDXH=BSDXETIM\60 + ; "RTN","BSDX29",197,0) - S BSDXH="00"_BSDXH +ADDMIN(BSDXSTRT,BSDXLEN) ; "RTN","BSDX29",198,0) - S BSDXH=$E(BSDXH,$L(BSDXH)-1,$L(BSDXH)) + ; "RTN","BSDX29",199,0) - S BSDXM=BSDXETIM#60 + ;Add BSDXLEN minutes to time BSDXSTRT and return end time "RTN","BSDX29",200,0) - S BSDXM="00"_BSDXM + N BSDXEND,BSDXH,BSDXM,BSDXSTIM,BSDXETIM "RTN","BSDX29",201,0) - S BSDXM=$E(BSDXM,$L(BSDXM)-1,$L(BSDXM)) + S BSDXEND=$P(BSDXSTRT,".") "RTN","BSDX29",202,0) - S BSDXETIM=BSDXH_BSDXM + ; "RTN","BSDX29",203,0) - I BSDXETIM>2400 S BSDXETIM=2400 + ;Convert start time to minutes past midnight "RTN","BSDX29",204,0) - S $P(BSDXEND,".",2)=BSDXETIM + S BSDXSTIM=$P(BSDXSTRT,".",2) "RTN","BSDX29",205,0) + S BSDXSTIM=BSDXSTIM_"0000" +"RTN","BSDX29",206,0) + S BSDXSTIM=$E(BSDXSTIM,1,4) +"RTN","BSDX29",207,0) + S BSDXH=$E(BSDXSTIM,1,2) +"RTN","BSDX29",208,0) + S BSDXH=BSDXH*60 +"RTN","BSDX29",209,0) + S BSDXH=BSDXH+$E(BSDXSTIM,3,4) +"RTN","BSDX29",210,0) + ; +"RTN","BSDX29",211,0) + ;Add duration to find minutes past midnight of end time +"RTN","BSDX29",212,0) + S BSDXETIM=BSDXH+BSDXLEN +"RTN","BSDX29",213,0) + ; +"RTN","BSDX29",214,0) + ;Convert back to a time +"RTN","BSDX29",215,0) + S BSDXH=BSDXETIM\60 +"RTN","BSDX29",216,0) + S BSDXH="00"_BSDXH +"RTN","BSDX29",217,0) + S BSDXH=$E(BSDXH,$L(BSDXH)-1,$L(BSDXH)) +"RTN","BSDX29",218,0) + S BSDXM=BSDXETIM#60 +"RTN","BSDX29",219,0) + S BSDXM="00"_BSDXM +"RTN","BSDX29",220,0) + S BSDXM=$E(BSDXM,$L(BSDXM)-1,$L(BSDXM)) +"RTN","BSDX29",221,0) + S BSDXETIM=BSDXH_BSDXM +"RTN","BSDX29",222,0) + I BSDXETIM>2400 S BSDXETIM=2400 +"RTN","BSDX29",223,0) + S $P(BSDXEND,".",2)=BSDXETIM +"RTN","BSDX29",224,0) Q BSDXEND "RTN","BSDX2E") 0^^B27292304 "RTN","BSDX2E",1,0) BSDX2E ;IHS/OIT/MJL - ENVIRONMENT CHECK FOR WINDOWS SCHEDULING [7/18/10 4:30pm] "RTN","BSDX2E",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX2E",3,0) ; "RTN","BSDX2E",4,0) @@ -8849,7 +9575,7 @@ SORRY(XPX) ; "RTN","BSDX30",1,0) BSDX30 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; [ 09/12/2007 1:54 PM ] "RTN","BSDX30",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX30",3,0) ; "RTN","BSDX30",4,0) @@ -9025,315 +9751,451 @@ PEVENT(BSDXWID,DFN) ;EP - Raise patient selection event to EHR "RTN","BSDX30",89,0) Q "RTN","BSDX31") -0^29^B23243257 +0^29^B67823338 "RTN","BSDX31",1,0) -BSDX31 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; +BSDX31 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 12:39pm "RTN","BSDX31",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX31",3,0) - ; + ; Change Log: "RTN","BSDX31",4,0) - ; + ; v1.42 Oct 23 2010 WV/SMH "RTN","BSDX31",5,0) -NOSHOWD(BSDXY,BSDXAPTID,BSDXNS) ;EP + ; - Change transaction to restartable. Thanks to Zach Gonzalez "RTN","BSDX31",6,0) - ;Entry point for debugging + ; --> and Rick Marshall for their help. "RTN","BSDX31",7,0) - ; + ; v1.42 Dec 6 2010: Extensive refactoring "RTN","BSDX31",8,0) - ;D DEBUG^%Serenji("NOSHOW^BSDX31(.BSDXY,BSDXAPTID,BSDXNS)") + ; "RTN","BSDX31",9,0) - Q + ; Error Reference: "RTN","BSDX31",10,0) - ; + ; -1: zero or null Appt ID "RTN","BSDX31",11,0) -NOSHOW(BSDXY,BSDXAPTID,BSDXNS) ;EP + ; -2: Invalid APPT ID (doesn't exist in ^BSDXAPPT) "RTN","BSDX31",12,0) - ;Called by BSDX NOSHOW + ; -3: No-show flag is invalid "RTN","BSDX31",13,0) - ;Sets appointment noshow flag in BSDX APPOINTMENT file + ; -4: Filing of No-show in ^BSDXAPPT failed "RTN","BSDX31",14,0) - ;BSDXAPTID is entry number in BSDX APPOINTMENT file + ; -5: Filing of No-show in ^DPT failed (BSDXAPI error) "RTN","BSDX31",15,0) - ;BSDXNS = 1: NOSHOW, 0: CANCEL NOSHO + ; -100: M Error "RTN","BSDX31",16,0) - ;Calls CANCEL^BSDAPI to set noshow data in ^DPT + ; "RTN","BSDX31",17,0) - ;Returns error code in recordset field ERRORID + ; "RTN","BSDX31",18,0) - ; +NOSHOWD(BSDXY,BSDXAPTID,BSDXNS) ;EP "RTN","BSDX31",19,0) - N BSDXNOD,BSDXPATID,BSDXSTART,BSDXID,BSDXI,BSDXZ,BSDXERR,BSDXMSG,BSDXFDA,BSDXIENS + ;Entry point for debugging "RTN","BSDX31",20,0) - N BSDXNOEV + ; "RTN","BSDX31",21,0) - S BSDXNOEV=1 ;Don't execute protocol + D DEBUG^%Serenji("NOSHOW^BSDX31(.BSDXY,BSDXAPTID,BSDXNS)") "RTN","BSDX31",22,0) - ; + Q "RTN","BSDX31",23,0) - D ^XBKVAR S X="ETRAP^BSDX31",@^%ZOSF("TRAP") + ; "RTN","BSDX31",24,0) - S BSDXI=0 +UT ; Unit Tests "RTN","BSDX31",25,0) - K ^BSDXTMP($J) + ; Test 1: Sanity Check "RTN","BSDX31",26,0) - S BSDXY="^BSDXTMP("_$J_")" + N ZZZ ; Garbage return variable "RTN","BSDX31",27,0) - S ^BSDXTMP($J,BSDXI)="I00020ERRORID^T00030ERRORTEXT"_$C(30) + N DATE S DATE=$$NOW^XLFDT() "RTN","BSDX31",28,0) - S BSDXI=BSDXI+1 + S DATE=$E(DATE,1,12) ; Just get minutes b/c of HL file input transform "RTN","BSDX31",29,0) - TSTART + D APPADD^BSDX07(.ZZZ,DATE,DATE+.0001,3,"Dr Office",30,"Old Note",1) "RTN","BSDX31",30,0) - I '+BSDXAPTID D ERR(0,"BSDX31: Invalid Appointment ID") Q + N APPID S APPID=+$P(^BSDXTMP($J,1),U) "RTN","BSDX31",31,0) - I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(0,"BSDX31: Invalid Appointment ID") Q + D NOSHOW(.ZZZ,APPID,1) "RTN","BSDX31",32,0) - S BSDXNS=+BSDXNS + I $P(^BSDXAPPT(APPID,0),U,10)'=1 W "ERROR T1",! B "RTN","BSDX31",33,0) - I BSDXNS'=1&(BSDXNS'=0) D ERR(0,"BSDX31: Invalid No Show value") Q + I $P(^DPT(3,"S",DATE,0),U,2)'="N" W "ERROR T1",! B "RTN","BSDX31",34,0) - ; + ; Test 2: Undo noshow "RTN","BSDX31",35,0) - ;Edit BSDX APPOINTMENT entry NOSHOW field + D NOSHOW(.ZZZ,APPID,0) "RTN","BSDX31",36,0) - S BSDXNOD=^BSDXAPPT(BSDXAPTID,0) + I $P(^BSDXAPPT(APPID,0),U,10)'="0" W "ERROR T2",! B "RTN","BSDX31",37,0) - I BSDXNOD="" D ERR(0,"BSDX31: Invalid Appointment ID") Q + I $P(^DPT(3,"S",DATE,0),U,2)'="" W "ERROR T2",! B "RTN","BSDX31",38,0) - S BSDXPATID=$P(BSDXNOD,U,5) + ; Test 3: -1 "RTN","BSDX31",39,0) - S BSDXSTART=$P(BSDXNOD,U) + D NOSHOW(.ZZZ,"",0) "RTN","BSDX31",40,0) - ; + I $P(^BSDXTMP($J,1),U)'=-1 W "ERROR T3",! B "RTN","BSDX31",41,0) - D BSDXNOS(BSDXAPTID,BSDXNS) + ; Test 4: -2 "RTN","BSDX31",42,0) - I $D(BSDXMSG("DIERR")) S BSDXMSG=$G(BSDXMSG("DIERR",1,"TEXT",1)) D ERR(0,"BSDX31: "_BSDXMSG) Q + D NOSHOW(.ZZZ,2938748233,0) "RTN","BSDX31",43,0) - ; + I $P(^BSDXTMP($J,1),U)'=-2 W "ERROR T4",! B "RTN","BSDX31",44,0) - S BSDXSC1=$P(BSDXNOD,U,7) ;RESOURCEID + ; Test 5: -3 "RTN","BSDX31",45,0) - I BSDXSC1]"",$D(^BSDXRES(BSDXSC1,0)) D I $G(BSDXZ)]"" S BSDXERR="BSDX31: APNOSHO Returned: "_BSDXZ D ERR(0,BSDXERR) Q + D NOSHOW(.ZZZ,APPID,3) "RTN","BSDX31",46,0) - . S BSDXNOD=^BSDXRES(BSDXSC1,0) + I $P(^BSDXTMP($J,1),U)'=-3 W "ERROR T5",! B "RTN","BSDX31",47,0) - . S BSDXSC1=$P(BSDXNOD,U,4) ;HOSPITAL LOCATION + ; Test 6: Mumps error (-100) "RTN","BSDX31",48,0) - . I BSDXSC1]"",$D(^SC(BSDXSC1,0)) D APNOSHO(.BSDXZ,BSDXSC1,BSDXPATID,BSDXSTART,BSDXNS) + s bsdxdie=1 "RTN","BSDX31",49,0) - ; + D NOSHOW(.ZZZ,APPID,1) "RTN","BSDX31",50,0) - TCOMMIT + I $P(^BSDXTMP($J,1),U)'=-100 W "ERROR T6",! B "RTN","BSDX31",51,0) - S BSDXI=BSDXI+1 + k bsdxdie "RTN","BSDX31",52,0) - S ^BSDXTMP($J,BSDXI)="1^"_$C(30) + ; Test 7: Restartable transaction "RTN","BSDX31",53,0) - S BSDXI=BSDXI+1 + s bsdxrestart=1 "RTN","BSDX31",54,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + D NOSHOW(.ZZZ,APPID,1) "RTN","BSDX31",55,0) - Q + I $P(^BSDXAPPT(APPID,0),U,10)'=1 W "ERROR T7",! B "RTN","BSDX31",56,0) - ; + QUIT "RTN","BSDX31",57,0) -APNOSHO(BSDXZ,BSDXSC1,BSDXDFN,BSDXSD,BSDXNS) ; +NOSHOW(BSDXY,BSDXAPTID,BSDXNS) ;EP - No show a patient "RTN","BSDX31",58,0) - ; update file 2 info + ; Called by RPC: BSDX NOSHOW "RTN","BSDX31",59,0) - ;Set noshow for patient BSDXDFN in clinic BSDXSC1 + ; Sets appointment noshow flag in BSDX APPOINTMENT file and "S" node in File 2 "RTN","BSDX31",60,0) - ;at time BSDXSD + ; "RTN","BSDX31",61,0) - N BSDXC,%H,BSDXCDT,BSDXIEN + ; Parameters: "RTN","BSDX31",62,0) - N BSDXIENS,BSDXFDA,BSDXMSG + ; BSDXY: Global Return "RTN","BSDX31",63,0) - S %H=$H D YMD^%DTC + ; BSDXAPTID is entry number in BSDX APPOINTMENT file "RTN","BSDX31",64,0) - S BSDXCDT=X+% + ; BSDXNS = 1: NOSHOW, 0: CANCEL NOSHO "RTN","BSDX31",65,0) - ; + ; "RTN","BSDX31",66,0) - S BSDXIENS=BSDXSD_","_BSDXDFN_"," + ; Returns ADO.net record set with fields "RTN","BSDX31",67,0) - I +BSDXNS D + ; - ERRORID; ERRORTEXT "RTN","BSDX31",68,0) - . S BSDXFDA(2.98,BSDXIENS,3)="N" + ; ERRORID of 1 is okay "RTN","BSDX31",69,0) - . S BSDXFDA(2.98,BSDXIENS,14)=DUZ + ; Anything else is an error. "RTN","BSDX31",70,0) - . S BSDXFDA(2.98,BSDXIENS,15)=BSDXCDT + ; "RTN","BSDX31",71,0) - E D + ; Return Array; set and clear "RTN","BSDX31",72,0) - . S BSDXFDA(2.98,BSDXIENS,3)="" + S BSDXY=$NA(^BSDXTMP($J)) "RTN","BSDX31",73,0) - . S BSDXFDA(2.98,BSDXIENS,14)="" + K ^BSDXTMP($J) "RTN","BSDX31",74,0) - . S BSDXFDA(2.98,BSDXIENS,15)="" + ; $ET "RTN","BSDX31",75,0) - K BSDXIEN + N $ET S $ET="G ETRAP^BSDX31" "RTN","BSDX31",76,0) - D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") + ; Basline vars "RTN","BSDX31",77,0) - S BSDXZ=$G(BSDXMSG("DIERR",1,"TEXT",1)) + D ^XBKVAR ; Set up baseline variables (DUZ, DUZ(2)) if they don't exist "RTN","BSDX31",78,0) - Q + ; Counter "RTN","BSDX31",79,0) - ; + N BSDXI S BSDXI=0 "RTN","BSDX31",80,0) -BSDXNOS(BSDXAPTID,BSDXNS) ; + ; Header Node "RTN","BSDX31",81,0) - ; + S ^BSDXTMP($J,BSDXI)="I00100ERRORID^T00030ERRORTEXT"_$C(30) "RTN","BSDX31",82,0) - N BSDXFDA,BSDXIENS + ; Begin transaction "RTN","BSDX31",83,0) - S BSDXIENS=BSDXAPTID_"," + TSTART (BSDXI,BSDXY,BSDXAPTID,BSDXNS):T="BSDX NOSHOW CANCEL^BSDX29" "RTN","BSDX31",84,0) - S BSDXFDA(9002018.4,BSDXIENS,.1)=BSDXNS ;NOSHOW + ;;;test for error inside transaction. See if %ZTER works "RTN","BSDX31",85,0) - D FILE^DIE("","BSDXFDA","BSDXMSG") + I $G(bsdxdie) S X=1/0 "RTN","BSDX31",86,0) - ; + ;;;TEST "RTN","BSDX31",87,0) - Q + ;;;test for TRESTART "RTN","BSDX31",88,0) - ; + I $G(bsdxrestart) K bsdxrestart TRESTART "RTN","BSDX31",89,0) -NOSEVT(BSDXPAT,BSDXSTART,BSDXSC) ;EP Called by BSDX NOSHOW APPOINTMENT event + ;;;test "RTN","BSDX31",90,0) - ;when appointments NOSHOW via PIMS interface. + ; Turn off SDAM APPT PROTOCOL BSDX Entries "RTN","BSDX31",91,0) - ;Propagates NOSHOW to BSDXAPPT and raises refresh event to running GUI clients + N BSDXNOEV S BSDXNOEV=1 ;Don't execute protocol "RTN","BSDX31",92,0) - ; + ; Appointment ID check "RTN","BSDX31",93,0) - Q:+$G(BSDXNOEV) + I '+BSDXAPTID D ERR(-1,"BSDX31: Invalid Appointment ID") Q "RTN","BSDX31",94,0) - Q:'+$G(BSDXSC) + I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(-2,"BSDX31: Invalid Appointment ID") Q "RTN","BSDX31",95,0) - Q:$G(SDATA("AFTER","STATUS"))["AUTO RE-BOOK" + ; Noshow value check - Must be 1 or 0 "RTN","BSDX31",96,0) - N BSDXSTAT,BSDXFOUND,BSDXRES + S BSDXNS=+BSDXNS "RTN","BSDX31",97,0) - S BSDXSTAT=1 + I BSDXNS'=1&(BSDXNS'=0) D ERR(-3,"BSDX31: Invalid No Show value") Q "RTN","BSDX31",98,0) - S:$G(SDATA("BEFORE","STATUS"))["NO-SHOW" BSDXSTAT=0 + ; Get Some data "RTN","BSDX31",99,0) - S BSDXFOUND=0 + N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAPTID,0) ; Node "RTN","BSDX31",100,0) - I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) S BSDXFOUND=$$NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) + N BSDXPATID S BSDXPATID=$P(BSDXNOD,U,5) ; DFN "RTN","BSDX31",101,0) - I BSDXFOUND D NOSEVT3(BSDXRES) Q + N BSDXSTART S BSDXSTART=$P(BSDXNOD,U) ; Start Date/Time "RTN","BSDX31",102,0) - I $D(^BXDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) S BSDXFOUND=$$NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) + ; Edit BSDX APPOINTMENT entry "RTN","BSDX31",103,0) - I BSDXFOUND D NOSEVT3(BSDXRES) + N BSDXMSG ; "RTN","BSDX31",104,0) - Q + D BSDXNOS(BSDXAPTID,BSDXNS,.BSDXMSG) ;Edit BSDX APPOINTMENT entry NOSHOW field "RTN","BSDX31",105,0) - ; + I $D(BSDXMSG("DIERR")) S BSDXMSG=$G(BSDXMSG("DIERR",1,"TEXT",1)) D ERR(-4,"BSDX31: "_BSDXMSG) Q "RTN","BSDX31",106,0) -NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) ; + ; Edit File 2 "S" node entry "RTN","BSDX31",107,0) - ;Get appointment id in BSDXAPT + N BSDXZ,BSDXERR ; Error variables to control looping "RTN","BSDX31",108,0) - ;If found, call BSDXNOS(BSDXAPPT) and return 1 + S BSDXSC1=$P(BSDXNOD,U,7) ;RESOURCEID "RTN","BSDX31",109,0) - ;else return 0 + ; If Resource ID exists, and HL exists (means that Resource is linked), No show in File 2 "RTN","BSDX31",110,0) - N BSDXFOUND,BSDXAPPT + I BSDXSC1]"",$D(^BSDXRES(BSDXSC1,0)) D I $G(BSDXZ)]"" S BSDXERR="BSDX31: APNOSHO Returned: "_BSDXZ D ERR(-5,BSDXERR) Q "RTN","BSDX31",111,0) - S BSDXFOUND=0 + . S BSDXNOD=^BSDXRES(BSDXSC1,0) "RTN","BSDX31",112,0) - Q:'+$G(BSDXRES) BSDXFOUND + . S BSDXSC1=$P(BSDXNOD,U,4) ;HOSPITAL LOCATION "RTN","BSDX31",113,0) - Q:'$D(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART)) BSDXFOUND + . I BSDXSC1]"",$D(^SC(BSDXSC1,0)) D APNOSHO(.BSDXZ,BSDXSC1,BSDXPATID,BSDXSTART,BSDXNS) "RTN","BSDX31",114,0) - S BSDXAPPT=0 F S BSDXAPPT=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART,BSDXAPPT)) Q:'+BSDXAPPT D Q:BSDXFOUND + ; "RTN","BSDX31",115,0) - . S BSDXNOD=$G(^BSDXAPPT(BSDXAPPT,0)) Q:BSDXNOD="" + TCOMMIT "RTN","BSDX31",116,0) - . I $P(BSDXNOD,U,5)=BSDXPAT,$P(BSDXNOD,U,12)="" S BSDXFOUND=1 Q + S BSDXI=BSDXI+1 "RTN","BSDX31",117,0) - I BSDXFOUND,+$G(BSDXAPPT) D BSDXNOS(BSDXAPPT,BSDXSTAT) + S ^BSDXTMP($J,BSDXI)="1^"_$C(30) ; 1 means everything okay "RTN","BSDX31",118,0) - Q BSDXFOUND + S BSDXI=BSDXI+1 "RTN","BSDX31",119,0) - ; + S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDX31",120,0) -NOSEVT3(BSDXRES) ; + QUIT "RTN","BSDX31",121,0) - ;Call RaiseEvent to notify GUI clients + ; "RTN","BSDX31",122,0) - ; +APNOSHO(BSDXZ,BSDXSC1,BSDXDFN,BSDXSD,BSDXNS) ; "RTN","BSDX31",123,0) - N BSDXRESN + ; update file 2 info "RTN","BSDX31",124,0) - S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) + ;Set noshow for patient BSDXDFN in clinic BSDXSC1 "RTN","BSDX31",125,0) - Q:BSDXRESN="" + ;at time BSDXSD "RTN","BSDX31",126,0) - S BSDXRESN=$P(BSDXRESN,"^") + N BSDXC,%H,BSDXCDT,BSDXIEN "RTN","BSDX31",127,0) - D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) + N BSDXIENS,BSDXFDA,BSDXMSG "RTN","BSDX31",128,0) - Q + S %H=$H D YMD^%DTC "RTN","BSDX31",129,0) - ; + S BSDXCDT=X+% "RTN","BSDX31",130,0) - ; + ; "RTN","BSDX31",131,0) -ERR(BSDXERID,ERRTXT) ;Error processing + S BSDXIENS=BSDXSD_","_BSDXDFN_"," "RTN","BSDX31",132,0) - S:'+$G(BSDXI) BSDXI=999999 + I +BSDXNS D "RTN","BSDX31",133,0) - S BSDXI=BSDXI+1 + . S BSDXFDA(2.98,BSDXIENS,3)="N" "RTN","BSDX31",134,0) - TROLLBACK + . S BSDXFDA(2.98,BSDXIENS,14)=DUZ "RTN","BSDX31",135,0) - S ^BSDXTMP($J,BSDXI)=BSDXERID_"^"_ERRTXT_$C(30) + . S BSDXFDA(2.98,BSDXIENS,15)=BSDXCDT "RTN","BSDX31",136,0) - S BSDXI=BSDXI+1 + E D "RTN","BSDX31",137,0) - S ^BSDXTMP($J,BSDXI)=$C(31) + . S BSDXFDA(2.98,BSDXIENS,3)="" "RTN","BSDX31",138,0) - Q + . S BSDXFDA(2.98,BSDXIENS,14)="" "RTN","BSDX31",139,0) - ; + . S BSDXFDA(2.98,BSDXIENS,15)="" "RTN","BSDX31",140,0) -ETRAP ;EP Error trap entry + K BSDXIEN "RTN","BSDX31",141,0) - D ^%ZTER + D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") "RTN","BSDX31",142,0) - I '$D(BSDXI) N BSDXI S BSDXI=999999 + S BSDXZ=$G(BSDXMSG("DIERR",1,"TEXT",1)) "RTN","BSDX31",143,0) - S BSDXI=BSDXI+1 + Q "RTN","BSDX31",144,0) - D ERR(0,"BSDX31 Error: "_$G(%ZTERROR)) + ; "RTN","BSDX31",145,0) - Q +BSDXNOS(BSDXAPTID,BSDXNS,BSDXMSG) ; "RTN","BSDX31",146,0) - ; + ; "RTN","BSDX31",147,0) -IMHERE(BSDXRES) ;EP + N BSDXFDA,BSDXIENS "RTN","BSDX31",148,0) - ;Entry point for BSDX IM HERE remote procedure + S BSDXIENS=BSDXAPTID_"," "RTN","BSDX31",149,0) - S BSDXRES=1 + S BSDXFDA(9002018.4,BSDXIENS,.1)=BSDXNS ;NOSHOW "RTN","BSDX31",150,0) - Q + D FILE^DIE("","BSDXFDA","BSDXMSG") "RTN","BSDX31",151,0) - ; + QUIT +"RTN","BSDX31",152,0) + ; +"RTN","BSDX31",153,0) +NOSEVT(BSDXPAT,BSDXSTART,BSDXSC) ;EP Called by BSDX NOSHOW APPOINTMENT event +"RTN","BSDX31",154,0) + ;when appointments NOSHOW via PIMS interface. +"RTN","BSDX31",155,0) + ;Propagates NOSHOW to BSDXAPPT and raises refresh event to running GUI clients +"RTN","BSDX31",156,0) + ; +"RTN","BSDX31",157,0) + Q:+$G(BSDXNOEV) +"RTN","BSDX31",158,0) + Q:'+$G(BSDXSC) +"RTN","BSDX31",159,0) + Q:$G(SDATA("AFTER","STATUS"))["AUTO RE-BOOK" +"RTN","BSDX31",160,0) + N BSDXSTAT,BSDXFOUND,BSDXRES +"RTN","BSDX31",161,0) + S BSDXSTAT=1 +"RTN","BSDX31",162,0) + S:$G(SDATA("BEFORE","STATUS"))["NO-SHOW" BSDXSTAT=0 +"RTN","BSDX31",163,0) + S BSDXFOUND=0 +"RTN","BSDX31",164,0) + I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) S BSDXFOUND=$$NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) +"RTN","BSDX31",165,0) + I BSDXFOUND D NOSEVT3(BSDXRES) Q +"RTN","BSDX31",166,0) + I $D(^BXDXRES("ASSOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ASSOC",BSDXSC,0)) S BSDXFOUND=$$NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) +"RTN","BSDX31",167,0) + I BSDXFOUND D NOSEVT3(BSDXRES) +"RTN","BSDX31",168,0) + Q +"RTN","BSDX31",169,0) + ; +"RTN","BSDX31",170,0) +NOSEVT1(BSDXRES,BSDXSTART,BSDXPAT,BSDXSTAT) ; +"RTN","BSDX31",171,0) + ;Get appointment id in BSDXAPT +"RTN","BSDX31",172,0) + ;If found, call BSDXNOS(BSDXAPPT) and return 1 +"RTN","BSDX31",173,0) + ;else return 0 +"RTN","BSDX31",174,0) + N BSDXFOUND,BSDXAPPT +"RTN","BSDX31",175,0) + S BSDXFOUND=0 +"RTN","BSDX31",176,0) + Q:'+$G(BSDXRES) BSDXFOUND +"RTN","BSDX31",177,0) + Q:'$D(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART)) BSDXFOUND +"RTN","BSDX31",178,0) + S BSDXAPPT=0 F S BSDXAPPT=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXSTART,BSDXAPPT)) Q:'+BSDXAPPT D Q:BSDXFOUND +"RTN","BSDX31",179,0) + . S BSDXNOD=$G(^BSDXAPPT(BSDXAPPT,0)) Q:BSDXNOD="" +"RTN","BSDX31",180,0) + . I $P(BSDXNOD,U,5)=BSDXPAT,$P(BSDXNOD,U,12)="" S BSDXFOUND=1 Q +"RTN","BSDX31",181,0) + I BSDXFOUND,+$G(BSDXAPPT) D BSDXNOS(BSDXAPPT,BSDXSTAT) +"RTN","BSDX31",182,0) + Q BSDXFOUND +"RTN","BSDX31",183,0) + ; +"RTN","BSDX31",184,0) +NOSEVT3(BSDXRES) ; +"RTN","BSDX31",185,0) + ;Call RaiseEvent to notify GUI clients +"RTN","BSDX31",186,0) + ; +"RTN","BSDX31",187,0) + N BSDXRESN +"RTN","BSDX31",188,0) + S BSDXRESN=$G(^BSDXRES(BSDXRES,0)) +"RTN","BSDX31",189,0) + Q:BSDXRESN="" +"RTN","BSDX31",190,0) + S BSDXRESN=$P(BSDXRESN,"^") +"RTN","BSDX31",191,0) + D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) +"RTN","BSDX31",192,0) + Q +"RTN","BSDX31",193,0) + ; +"RTN","BSDX31",194,0) + ; +"RTN","BSDX31",195,0) +ERR(BSDXERID,ERRTXT) ;Error processing +"RTN","BSDX31",196,0) + S BSDXI=BSDXI+1 +"RTN","BSDX31",197,0) + S ERRTXT=$TR(ERRTXT,"^","~") +"RTN","BSDX31",198,0) + I $TL>0 TROLLBACK +"RTN","BSDX31",199,0) + S ^BSDXTMP($J,BSDXI)=BSDXERID_"^"_ERRTXT_$C(30) +"RTN","BSDX31",200,0) + S BSDXI=BSDXI+1 +"RTN","BSDX31",201,0) + S ^BSDXTMP($J,BSDXI)=$C(31) +"RTN","BSDX31",202,0) + QUIT +"RTN","BSDX31",203,0) + ; +"RTN","BSDX31",204,0) +ETRAP ;EP Error trap entry +"RTN","BSDX31",205,0) + N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap +"RTN","BSDX31",206,0) + ; Rollback, otherwise ^XTER will be empty from future rollback +"RTN","BSDX31",207,0) + I $TL>0 TROLLBACK +"RTN","BSDX31",208,0) + D ^%ZTER +"RTN","BSDX31",209,0) + S $EC="" ; Clear Error +"RTN","BSDX31",210,0) + ; Send to client +"RTN","BSDX31",211,0) + I '$D(BSDXI) N BSDXI S BSDXI=0 +"RTN","BSDX31",212,0) + D ERR(-100,"BSDX31 Error: "_$G(%ZTERZE)) +"RTN","BSDX31",213,0) + QUIT +"RTN","BSDX31",214,0) + ; +"RTN","BSDX31",215,0) +IMHERE(BSDXRES) ;EP +"RTN","BSDX31",216,0) + ;Entry point for BSDX IM HERE remote procedure +"RTN","BSDX31",217,0) + S BSDXRES=1 +"RTN","BSDX31",218,0) + Q +"RTN","BSDX31",219,0) + ; "RTN","BSDX32") 0^30^B17196738 "RTN","BSDX32",1,0) BSDX32 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/29/10 10:21am "RTN","BSDX32",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX32",3,0) ; "RTN","BSDX32",4,0) @@ -9527,7 +10389,7 @@ CLNSET(BSDXY) ;EP "RTN","BSDX33",1,0) BSDX33 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 12:33pm "RTN","BSDX33",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX33",3,0) ; Mods by WV/STAR "RTN","BSDX33",4,0) @@ -9783,7 +10645,7 @@ ERROR2 ; "RTN","BSDX34",1,0) BSDX34 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 12:37pm "RTN","BSDX34",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX34",3,0) ; "RTN","BSDX34",4,0) @@ -10137,7 +10999,7 @@ ERR(ERRNO) ;Error processing "RTN","BSDX35",1,0) BSDX35 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; "RTN","BSDX35",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDX35",3,0) ; "RTN","BSDX35",4,0) @@ -10283,11 +11145,11 @@ ERR(ERRNO) ;Error processing "RTN","BSDX35",74,0) Q "RTN","BSDXAPI") -0^35^B85422550 +0^35^B105784370 "RTN","BSDXAPI",1,0) -BSDXAPI ; IHS/ANMC/LJF - SCHEDULING APIs ; 9/28/10 12:36pm +BSDXAPI ; IHS/ANMC/LJF - SCHEDULING APIs ; 12/6/10 5:50pm "RTN","BSDXAPI",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDXAPI",3,0) ;Orignal routine is BSDAPI by IHS/LJF, HMW, and MAW "RTN","BSDXAPI",4,0) @@ -10297,549 +11159,603 @@ BSDXAPI ; IHS/ANMC/LJF - SCHEDULING APIs ; 9/28/10 12:36pm "RTN","BSDXAPI",6,0) ; Change History: "RTN","BSDXAPI",7,0) - ; - Fixed errors having to do uncanceling patient appointments if it was a patient cancelled appointment. + ; 2010-11-5: "RTN","BSDXAPI",8,0) - ; - Use new style Fileman API for storing appointments in file 44 in $$MAKE due to problems with legacy API. + ; - Fixed errors having to do uncanceling patient appointments if it was a patient cancelled appointment. "RTN","BSDXAPI",9,0) - ; + ; - Use new style Fileman API for storing appointments in file 44 in $$MAKE due to problems with legacy API. "RTN","BSDXAPI",10,0) -MAKE1(DFN,CLIN,TYP,DATE,LEN,INFO) ; Simplified PEP w/ parameters for $$MAKE - making appointment + ; 2010-11-12: "RTN","BSDXAPI",11,0) - ; Call like this for DFN 23435 having an appointment at Hospital Location 33 + ; - Changed ="C" to ["C" in SCIEN. Cancelled appointments can be "PC" as well. "RTN","BSDXAPI",12,0) - ; have 3 (scheduled) or 4 (walkin) appt at Dec 20, 2009 @ 10:11:59 for 30 minutes appt + ; 2010-12-5 "RTN","BSDXAPI",13,0) - ; for Baby foxes hallucinations. + ; Added an entry point to update the patient note in file 44. "RTN","BSDXAPI",14,0) - ; S RESULT=$$MAKE1^BSDXAPI(23435,33,(3 or 4),3091220.221159,30,"I see Baby foxes") + ; 2010-12-6 "RTN","BSDXAPI",15,0) - S BSDR("PAT")=DFN ;DFN + ; MAKE1 incorrectly put info field in BSDR("INFO") rather than BSDR("OI") "RTN","BSDXAPI",16,0) - S BSDR("CLN")=CLIN ;Hosp Loc IEN + ; 2010-12-8 "RTN","BSDXAPI",17,0) - S BSDR("TYP")=TYP ;3 sched or 4 walkin + ; Removed restriction on max appt length. Even though this restriction "RTN","BSDXAPI",18,0) - S BSDR("ADT")=DATE ;Appointment date in FM format + ; exists in fileman (120 minutes), PIMS ignores it. Therefore, I "RTN","BSDXAPI",19,0) - S BSDR("LEN")=LEN ;Appt len upto 240 (min) + ; will ignore it here too. "RTN","BSDXAPI",20,0) - S BSDR("INFO")=INFO ;Reason for appt - up to 150 char + ; "RTN","BSDXAPI",21,0) - S BSDR("USR")=DUZ ;Person who made appt - current user +MAKE1(DFN,CLIN,TYP,DATE,LEN,INFO) ; Simplified PEP w/ parameters for $$MAKE - making appointment "RTN","BSDXAPI",22,0) - Q $$MAKE(.BSDR) + ; Call like this for DFN 23435 having an appointment at Hospital Location 33 "RTN","BSDXAPI",23,0) - ; + ; have 3 (scheduled) or 4 (walkin) appt at Dec 20, 2009 @ 10:11:59 for 30 minutes appt "RTN","BSDXAPI",24,0) -MAKE(BSDR) ;PEP; call to store appt made + ; for Baby foxes hallucinations. "RTN","BSDXAPI",25,0) - ; + ; S RESULT=$$MAKE1^BSDXAPI(23435,33,(3 or 4),3091220.221159,30,"I see Baby foxes") "RTN","BSDXAPI",26,0) - ; Make call using: S ERR=$$MAKE^BSDXAPI(.ARRAY) + S BSDR("PAT")=DFN ;DFN "RTN","BSDXAPI",27,0) - ; + S BSDR("CLN")=CLIN ;Hosp Loc IEN "RTN","BSDXAPI",28,0) - ; Input Array - + S BSDR("TYP")=TYP ;3 sched or 4 walkin "RTN","BSDXAPI",29,0) - ; BSDR("PAT") = ien of patient in file 2 + S BSDR("ADT")=DATE ;Appointment date in FM format "RTN","BSDXAPI",30,0) - ; BSDR("CLN") = ien of clinic in file 44 + S BSDR("LEN")=LEN ;Appt len upto 240 (min) "RTN","BSDXAPI",31,0) - ; BSDR("TYP") = 3 for scheduled appts, 4 for walkins + S BSDR("OI")=INFO ;Reason for appt - up to 150 char "RTN","BSDXAPI",32,0) - ; BSDR("ADT") = appointment date and time + S BSDR("USR")=DUZ ;Person who made appt - current user "RTN","BSDXAPI",33,0) - ; BSDR("LEN") = appointment length in minutes (5-120) + Q $$MAKE(.BSDR) "RTN","BSDXAPI",34,0) - ; BSDR("OI") = reason for appt - up to 150 characters + ; "RTN","BSDXAPI",35,0) - ; BSDR("USR") = user who made appt +MAKE(BSDR) ;PEP; call to store appt made "RTN","BSDXAPI",36,0) ; "RTN","BSDXAPI",37,0) - ;Output: error status and message + ; Make call using: S ERR=$$MAKE^BSDXAPI(.ARRAY) "RTN","BSDXAPI",38,0) - ; = 0 or null: everything okay + ; "RTN","BSDXAPI",39,0) - ; = 1^message: error and reason + ; Input Array - "RTN","BSDXAPI",40,0) - ; + ; BSDR("PAT") = ien of patient in file 2 "RTN","BSDXAPI",41,0) - I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) + ; BSDR("CLN") = ien of clinic in file 44 "RTN","BSDXAPI",42,0) - I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) + ; BSDR("TYP") = 3 for scheduled appts, 4 for walkins "RTN","BSDXAPI",43,0) - I ($G(BSDR("TYP"))<3)!($G(BSDR("TYP"))>4) Q 1_U_"Appt Type error: "_$G(BSDR("TYP")) + ; BSDR("ADT") = appointment date and time "RTN","BSDXAPI",44,0) - I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds + ; BSDR("LEN") = appointment length in minutes (5-120) "RTN","BSDXAPI",45,0) - I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) + ; BSDR("OI") = reason for appt - up to 150 characters "RTN","BSDXAPI",46,0) - ; + ; BSDR("USR") = user who made appt "RTN","BSDXAPI",47,0) - I ($G(BSDR("LEN"))<5)!($G(BSDR("LEN"))>240) Q 1_U_"Appt Length error: "_$G(BSDR("LEN")) + ; "RTN","BSDXAPI",48,0) - I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) + ;Output: error status and message "RTN","BSDXAPI",49,0) - I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)'["C" Q 1_U_"Patient "_BSDR("PAT")_" already has appt at "_BSDR("ADT") + ; = 0 or null: everything okay "RTN","BSDXAPI",50,0) - ; + ; = 1^message: error and reason "RTN","BSDXAPI",51,0) - NEW DIC,DA,Y,X,DD,DO,DLAYGO + ; "RTN","BSDXAPI",52,0) - ; + I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) "RTN","BSDXAPI",53,0) - I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)["C" D + I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) "RTN","BSDXAPI",54,0) - . ; "un-cancel" existing appt in file 2 + I ($G(BSDR("TYP"))<3)!($G(BSDR("TYP"))>4) Q 1_U_"Appt Type error: "_$G(BSDR("TYP")) "RTN","BSDXAPI",55,0) - . N BSDXFDA,BSDXIENS,BSDXMSG + I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds "RTN","BSDXAPI",56,0) - . S BSDXIENS=BSDR("ADT")_","_BSDR("PAT")_"," + I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) "RTN","BSDXAPI",57,0) - . S BSDXFDA(2.98,BSDXIENS,".01")=BSDR("CLN") + ; "RTN","BSDXAPI",58,0) - . S BSDXFDA(2.98,BSDXIENS,"3")="" + ;I ($G(BSDR("LEN"))<5)!($G(BSDR("LEN"))>240) Q 1_U_"Appt Length error: "_$G(BSDR("LEN")) ; v 1.42 - no check on length is done anymore. see top comments for details. "RTN","BSDXAPI",59,0) - . S BSDXFDA(2.98,BSDXIENS,"9")=BSDR("TYP") + I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) "RTN","BSDXAPI",60,0) - . S BSDXFDA(2.98,BSDXIENS,"9.5")=9 + I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)'["C" Q 1_U_"Patient "_BSDR("PAT")_" already has appt at "_BSDR("ADT") "RTN","BSDXAPI",61,0) - . S BSDXFDA(2.98,BSDXIENS,"14")="" + ; "RTN","BSDXAPI",62,0) - . S BSDXFDA(2.98,BSDXIENS,"15")="" + NEW DIC,DA,Y,X,DD,DO,DLAYGO "RTN","BSDXAPI",63,0) - . S BSDXFDA(2.98,BSDXIENS,"16")="" + ; "RTN","BSDXAPI",64,0) - . S BSDXFDA(2.98,BSDXIENS,"19")="" + I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)["C" D "RTN","BSDXAPI",65,0) - . S BSDXFDA(2.98,BSDXIENS,"20")=$$NOW^XLFDT + . ; "un-cancel" existing appt in file 2 "RTN","BSDXAPI",66,0) - . D FILE^DIE("","BSDXFDA","BSDXMSG") -"RTN","BSDXAPI",67,0) - . N BSDXTEMP S BSDXTEMP=$G(BSDXMSG) -"RTN","BSDXAPI",68,0) - E D I $G(BSDXERR(1)) Q 1_U_"FileMan add to DPT error: Patient="_BSDR("PAT")_" Appt="_BSDR("ADT") -"RTN","BSDXAPI",69,0) . N BSDXFDA,BSDXIENS,BSDXMSG +"RTN","BSDXAPI",67,0) + . S BSDXIENS=BSDR("ADT")_","_BSDR("PAT")_"," +"RTN","BSDXAPI",68,0) + . S BSDXFDA(2.98,BSDXIENS,".01")=BSDR("CLN") +"RTN","BSDXAPI",69,0) + . S BSDXFDA(2.98,BSDXIENS,"3")="" "RTN","BSDXAPI",70,0) - . S BSDXIENS="?+2,"_BSDR("PAT")_"," -"RTN","BSDXAPI",71,0) - . S BSDXIENS(2)=BSDR("ADT") -"RTN","BSDXAPI",72,0) - . S BSDXFDA(2.98,BSDXIENS,.01)=BSDR("CLN") -"RTN","BSDXAPI",73,0) . S BSDXFDA(2.98,BSDXIENS,"9")=BSDR("TYP") -"RTN","BSDXAPI",74,0) +"RTN","BSDXAPI",71,0) . S BSDXFDA(2.98,BSDXIENS,"9.5")=9 +"RTN","BSDXAPI",72,0) + . S BSDXFDA(2.98,BSDXIENS,"14")="" +"RTN","BSDXAPI",73,0) + . S BSDXFDA(2.98,BSDXIENS,"15")="" +"RTN","BSDXAPI",74,0) + . S BSDXFDA(2.98,BSDXIENS,"16")="" "RTN","BSDXAPI",75,0) - . S BSDXFDA(2.98,BSDXIENS,"20")=$$NOW^XLFDT + . S BSDXFDA(2.98,BSDXIENS,"19")="" "RTN","BSDXAPI",76,0) - . D UPDATE^DIE("","BSDXFDA","BSDXIENS","BSDXERR(1)") + . S BSDXFDA(2.98,BSDXIENS,"20")=$$NOW^XLFDT "RTN","BSDXAPI",77,0) - ; add appt to file 44 + . D FILE^DIE("","BSDXFDA","BSDXMSG") "RTN","BSDXAPI",78,0) - K DIC,DA,X,Y,DLAYGO,DD,DO + . N BSDXTEMP S BSDXTEMP=$G(BSDXMSG) "RTN","BSDXAPI",79,0) - I '$D(^SC(BSDR("CLN"),"S",0)) S ^SC(BSDR("CLN"),"S",0)="^44.001DA^^" + E D I $G(BSDXERR(1)) Q 1_U_"FileMan add to DPT error: Patient="_BSDR("PAT")_" Appt="_BSDR("ADT") "RTN","BSDXAPI",80,0) - I '$D(^SC(BSDR("CLN"),"S",BSDR("ADT"),0)) D I Y<1 Q 1_U_"Error adding date to file 44: Clinic="_BSDR("CLN")_" Date="_BSDR("ADT") + . N BSDXFDA,BSDXIENS,BSDXMSG "RTN","BSDXAPI",81,0) - . S DIC="^SC("_BSDR("CLN")_",""S"",",DA(1)=BSDR("CLN"),(X,DINUM)=BSDR("ADT") + . S BSDXIENS="?+2,"_BSDR("PAT")_"," "RTN","BSDXAPI",82,0) - . S DIC("P")="44.001DA",DIC(0)="L",DLAYGO=44.001 + . S BSDXIENS(2)=BSDR("ADT") "RTN","BSDXAPI",83,0) - . S Y=1 I '$D(@(DIC_X_")")) D FILE^DICN + . S BSDXFDA(2.98,BSDXIENS,.01)=BSDR("CLN") "RTN","BSDXAPI",84,0) - ; + . S BSDXFDA(2.98,BSDXIENS,"9")=BSDR("TYP") "RTN","BSDXAPI",85,0) - ; Sep 28 2010: Changed old style API to new style API. Keep for reference //smh + . S BSDXFDA(2.98,BSDXIENS,"9.5")=9 "RTN","BSDXAPI",86,0) - ;K DIC,DA,X,Y,DLAYGO,DD,DO,DINUM + . S BSDXFDA(2.98,BSDXIENS,"20")=$$NOW^XLFDT "RTN","BSDXAPI",87,0) - ;S DIC="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," + . D UPDATE^DIE("","BSDXFDA","BSDXIENS","BSDXERR(1)") "RTN","BSDXAPI",88,0) - ;S DA(2)=BSDR("CLN"),DA(1)=BSDR("ADT"),X=BSDR("PAT") + ; add appt to file 44 "RTN","BSDXAPI",89,0) - ;S DIC("DR")="1///"_BSDR("LEN")_";3///"_$E($G(BSDR("OI")),1,150)_";7///`"_BSDR("USR")_";8///"_$P($$NOW^XLFDT,".") + K DIC,DA,X,Y,DLAYGO,DD,DO "RTN","BSDXAPI",90,0) - ;S DIC("P")="44.003PA",DIC(0)="L",DLAYGO=44.003 + I '$D(^SC(BSDR("CLN"),"S",0)) S ^SC(BSDR("CLN"),"S",0)="^44.001DA^^" "RTN","BSDXAPI",91,0) - ;D FILE^DICN + I '$D(^SC(BSDR("CLN"),"S",BSDR("ADT"),0)) D I Y<1 Q 1_U_"Error adding date to file 44: Clinic="_BSDR("CLN")_" Date="_BSDR("ADT") "RTN","BSDXAPI",92,0) - ; + . S DIC="^SC("_BSDR("CLN")_",""S"",",DA(1)=BSDR("CLN"),(X,DINUM)=BSDR("ADT") "RTN","BSDXAPI",93,0) - N BSDXIENS S BSDXIENS="?+1,"_BSDR("ADT")_","_BSDR("CLN")_"," + . S DIC("P")="44.001DA",DIC(0)="L",DLAYGO=44.001 "RTN","BSDXAPI",94,0) - N BSDXFDA + . S Y=1 I '$D(@(DIC_X_")")) D FILE^DICN "RTN","BSDXAPI",95,0) - S BSDXFDA(44.003,BSDXIENS,.01)=BSDR("PAT") + ; "RTN","BSDXAPI",96,0) - S BSDXFDA(44.003,BSDXIENS,1)=BSDR("LEN") + ; Sep 28 2010: Changed old style API to new style API. Keep for reference //smh "RTN","BSDXAPI",97,0) - S BSDXFDA(44.003,BSDXIENS,3)=$E($G(BSDR("OI")),1,150) + ;K DIC,DA,X,Y,DLAYGO,DD,DO,DINUM "RTN","BSDXAPI",98,0) - S BSDXFDA(44.003,BSDXIENS,7)=BSDR("USR") + ;S DIC="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," "RTN","BSDXAPI",99,0) - S BSDXFDA(44.003,BSDXIENS,8)=$P($$NOW^XLFDT,".") + ;S DA(2)=BSDR("CLN"),DA(1)=BSDR("ADT"),X=BSDR("PAT") "RTN","BSDXAPI",100,0) - N BSDXERR + ;S DIC("DR")="1///"_BSDR("LEN")_";3///"_$E($G(BSDR("OI")),1,150)_";7///`"_BSDR("USR")_";8///"_$P($$NOW^XLFDT,".") "RTN","BSDXAPI",101,0) - D UPDATE^DIE("","BSDXFDA","","BSDXERR") + ;S DIC("P")="44.003PA",DIC(0)="L",DLAYGO=44.003 "RTN","BSDXAPI",102,0) - ; + ;D FILE^DICN "RTN","BSDXAPI",103,0) - I $D(BSDXERR) Q 1_U_"Error adding appt to file 44: Clinic="_BSDR("CLN")_" Date="_BSDR("ADT")_" Patient="_BSDR("PAT")_" Error: "_BSDXERR("DIERR",1,"TEXT",1) + ; "RTN","BSDXAPI",104,0) - ; + N BSDXIENS S BSDXIENS="?+1,"_BSDR("ADT")_","_BSDR("CLN")_"," "RTN","BSDXAPI",105,0) - ; call event driver + N BSDXFDA "RTN","BSDXAPI",106,0) - NEW DFN,SDT,SDCL,SDDA,SDMODE + S BSDXFDA(44.003,BSDXIENS,.01)=BSDR("PAT") "RTN","BSDXAPI",107,0) - S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2 + S BSDXFDA(44.003,BSDXIENS,1)=BSDR("LEN") "RTN","BSDXAPI",108,0) - S SDDA=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) + S BSDXFDA(44.003,BSDXIENS,3)=$E($G(BSDR("OI")),1,150) "RTN","BSDXAPI",109,0) - D MAKE^SDAMEVT(DFN,SDT,SDCL,SDDA,SDMODE) + S BSDXFDA(44.003,BSDXIENS,7)=BSDR("USR") "RTN","BSDXAPI",110,0) - Q 0 + S BSDXFDA(44.003,BSDXIENS,8)=$P($$NOW^XLFDT,".") "RTN","BSDXAPI",111,0) - ; + N BSDXERR "RTN","BSDXAPI",112,0) -CHECKIN1(DFN,CLIN,APDATE) ; Simplified PEP w/ parameters for $$CHECKIN - Checking in + D UPDATE^DIE("","BSDXFDA","","BSDXERR") "RTN","BSDXAPI",113,0) - ; Call like this for DFN 23435 checking in now at Hospital Location 33 + ; "RTN","BSDXAPI",114,0) - ; for appt at Dec 20, 2009 @ 10:11:59 + I $D(BSDXERR) Q 1_U_"Error adding appt to file 44: Clinic="_BSDR("CLN")_" Date="_BSDR("ADT")_" Patient="_BSDR("PAT")_" Error: "_BSDXERR("DIERR",1,"TEXT",1) "RTN","BSDXAPI",115,0) - ; S RESULT=$$CHECKIN1^BSDXAPI(23435,33,3091220.221159) + ; "RTN","BSDXAPI",116,0) - S BSDR("PAT")=DFN ;DFN + ; call event driver "RTN","BSDXAPI",117,0) - S BSDR("CLN")=CLIN ;Hosp Loc IEN + NEW DFN,SDT,SDCL,SDDA,SDMODE "RTN","BSDXAPI",118,0) - S BSDR("ADT")=APDATE ;Appt Date + S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2 "RTN","BSDXAPI",119,0) - S BSDR("CDT")=$$NOW^XLFDT ;Check-in date defaults to now + S SDDA=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) "RTN","BSDXAPI",120,0) - S BSDR("USR")=DUZ ;Check-in user defaults to current + D MAKE^SDAMEVT(DFN,SDT,SDCL,SDDA,SDMODE) "RTN","BSDXAPI",121,0) - Q $$CHECKIN(.BSDR) + Q 0 "RTN","BSDXAPI",122,0) ; "RTN","BSDXAPI",123,0) -CHECKIN(BSDR) ;EP; call to add checkin info to appt; IHS/ITSC/LJF 12/23/2004 PATCH 1002 +CHECKIN1(DFN,CLIN,APDATE) ; Simplified PEP w/ parameters for $$CHECKIN - Checking in "RTN","BSDXAPI",124,0) - ; + ; Call like this for DFN 23435 checking in now at Hospital Location 33 "RTN","BSDXAPI",125,0) - ; Make call by using: S ERR=$$CHECKIN^BSDXAPI(.ARRAY) + ; for appt at Dec 20, 2009 @ 10:11:59 "RTN","BSDXAPI",126,0) - ; + ; S RESULT=$$CHECKIN1^BSDXAPI(23435,33,3091220.221159) "RTN","BSDXAPI",127,0) - ; Input array - + S BSDR("PAT")=DFN ;DFN "RTN","BSDXAPI",128,0) - ; BSDR("PAT") = ien of patient in file 2 + S BSDR("CLN")=CLIN ;Hosp Loc IEN "RTN","BSDXAPI",129,0) - ; BSDR("CLN") = ien of clinic in file 44 + S BSDR("ADT")=APDATE ;Appt Date "RTN","BSDXAPI",130,0) - ; BSDR("ADT") = appt date/time + S BSDR("CDT")=$$NOW^XLFDT ;Check-in date defaults to now "RTN","BSDXAPI",131,0) - ; BSDR("CDT") = checkin date/time + S BSDR("USR")=DUZ ;Check-in user defaults to current "RTN","BSDXAPI",132,0) - ; BSDR("USR") = checkin user + Q $$CHECKIN(.BSDR) "RTN","BSDXAPI",133,0) ; "RTN","BSDXAPI",134,0) - ; Output value - +CHECKIN(BSDR) ;EP; call to add checkin info to appt; IHS/ITSC/LJF 12/23/2004 PATCH 1002 "RTN","BSDXAPI",135,0) - ; = 0 means everything worked + ; "RTN","BSDXAPI",136,0) - ; = 1^message means error with reason message + ; Make call by using: S ERR=$$CHECKIN^BSDXAPI(.ARRAY) "RTN","BSDXAPI",137,0) ; "RTN","BSDXAPI",138,0) - I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) + ; Input array - "RTN","BSDXAPI",139,0) - I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) + ; BSDR("PAT") = ien of patient in file 2 "RTN","BSDXAPI",140,0) - I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds + ; BSDR("CLN") = ien of clinic in file 44 "RTN","BSDXAPI",141,0) - I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) + ; BSDR("ADT") = appt date/time "RTN","BSDXAPI",142,0) - I $G(BSDR("CDT")) S BSDR("CDT")=+$E(BSDR("CDT"),1,12) ;remove seconds + ; BSDR("CDT") = checkin date/time "RTN","BSDXAPI",143,0) - I $G(BSDR("CDT"))'?7N1".".4N Q 1_U_"Checkin Date/Time error: "_$G(BSDR("CDT")) + ; BSDR("USR") = checkin user "RTN","BSDXAPI",144,0) - I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) + ; "RTN","BSDXAPI",145,0) - ; + ; Output value - "RTN","BSDXAPI",146,0) - ; find ien for appt in file 44 + ; = 0 means everything worked "RTN","BSDXAPI",147,0) - NEW IEN,DIE,DA,DR + ; = 1^message means error with reason message "RTN","BSDXAPI",148,0) - S IEN=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) -"RTN","BSDXAPI",149,0) - I 'IEN Q 1_U_"Error trying to find appointment for checkin: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") -"RTN","BSDXAPI",150,0) ; +"RTN","BSDXAPI",149,0) + I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) +"RTN","BSDXAPI",150,0) + I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) "RTN","BSDXAPI",151,0) - ; remember before status + I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds "RTN","BSDXAPI",152,0) - NEW SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL + I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) "RTN","BSDXAPI",153,0) - S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2,SDDA=IEN + I $G(BSDR("CDT")) S BSDR("CDT")=+$E(BSDR("CDT"),1,12) ;remove seconds "RTN","BSDXAPI",154,0) - S SDCIHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL + I $G(BSDR("CDT"))'?7N1".".4N Q 1_U_"Checkin Date/Time error: "_$G(BSDR("CDT")) "RTN","BSDXAPI",155,0) - D BEFORE^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL) + I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) "RTN","BSDXAPI",156,0) ; "RTN","BSDXAPI",157,0) - ; set checkin + ; find ien for appt in file 44 "RTN","BSDXAPI",158,0) - S DIE="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," + NEW IEN,DIE,DA,DR "RTN","BSDXAPI",159,0) - S DA(2)=BSDR("CLN"),DA(1)=BSDR("ADT"),DA=IEN + S IEN=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) "RTN","BSDXAPI",160,0) - S DR="309///"_BSDR("CDT")_";302///`"_BSDR("USR")_";305///"_$$NOW^XLFDT + I 'IEN Q 1_U_"Error trying to find appointment for checkin: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") "RTN","BSDXAPI",161,0) - D ^DIE -"RTN","BSDXAPI",162,0) ; +"RTN","BSDXAPI",162,0) + ; remember before status "RTN","BSDXAPI",163,0) - ; set after status + NEW SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL "RTN","BSDXAPI",164,0) - S SDDA=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) + S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2,SDDA=IEN "RTN","BSDXAPI",165,0) S SDCIHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL "RTN","BSDXAPI",166,0) - D AFTER^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL) + D BEFORE^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL) "RTN","BSDXAPI",167,0) ; "RTN","BSDXAPI",168,0) - ; call event driver + ; set checkin "RTN","BSDXAPI",169,0) - D EVT^SDAMEVT(.SDATA,4,SDMODE,SDCIHDL) + S DIE="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," "RTN","BSDXAPI",170,0) - Q 0 -"RTN","BSDXAPI",171,0) - ; -"RTN","BSDXAPI",172,0) -CANCEL1(DFN,CLIN,TYP,APDATE,REASON,INFO) ; PEP w/ parameters for $$CANCEL - cancelling appointment -"RTN","BSDXAPI",173,0) - ; Call like this for DFN 23435 cancelling an appointment at Hospital Location 33, -"RTN","BSDXAPI",174,0) - ; cancellation initiated by patient ("PC" rather than clinic "C"), -"RTN","BSDXAPI",175,0) - ; cancelling appt at Dec 20, 2009 @ 10:11:59 because of reason 1 in file 409.2 IEN (weather) -"RTN","BSDXAPI",176,0) - ; because foxes come out during bad weather. -"RTN","BSDXAPI",177,0) - ; S RESULT=$$CANCEL1^BSDXAPI(23435,33,"PC",3091220.221159,1,"Afraid of foxes") -"RTN","BSDXAPI",178,0) - S BSDR("PAT")=DFN -"RTN","BSDXAPI",179,0) - S BSDR("CLN")=CLIN -"RTN","BSDXAPI",180,0) - S BSDR("TYP")=TYP -"RTN","BSDXAPI",181,0) - S BSDR("ADT")=APDATE -"RTN","BSDXAPI",182,0) - S BSDR("CDT")=$$NOW^XLFDT -"RTN","BSDXAPI",183,0) - S BSDR("USR")=DUZ -"RTN","BSDXAPI",184,0) - S BSDR("CR")=REASON -"RTN","BSDXAPI",185,0) - S BSDR("NOT")=INFO -"RTN","BSDXAPI",186,0) - Q $$CANCEL(.BSDR) -"RTN","BSDXAPI",187,0) - ; -"RTN","BSDXAPI",188,0) -CANCEL(BSDR) ;PEP; called to cancel appt -"RTN","BSDXAPI",189,0) - ; -"RTN","BSDXAPI",190,0) - ; Make call using: S ERR=$$CANCEL^BSDXAPI(.ARRAY) -"RTN","BSDXAPI",191,0) - ; -"RTN","BSDXAPI",192,0) - ; Input Array - -"RTN","BSDXAPI",193,0) - ; BSDR("PAT") = ien of patient in file 2 -"RTN","BSDXAPI",194,0) - ; BSDR("CLN") = ien of clinic in file 44 -"RTN","BSDXAPI",195,0) - ; BSDR("TYP") = C for canceled by clinic; PC for patient canceled -"RTN","BSDXAPI",196,0) - ; BSDR("ADT") = appointment date and time -"RTN","BSDXAPI",197,0) - ; BSDR("CDT") = cancel date and time -"RTN","BSDXAPI",198,0) - ; BSDR("USR") = user who canceled appt -"RTN","BSDXAPI",199,0) - ; BSDR("CR") = cancel reason - pointer to file 409.2 -"RTN","BSDXAPI",200,0) - ; BSDR("NOT") = cancel remarks - optional notes to 160 characters -"RTN","BSDXAPI",201,0) - ; -"RTN","BSDXAPI",202,0) - ;Output: error status and message -"RTN","BSDXAPI",203,0) - ; = 0 or null: everything okay -"RTN","BSDXAPI",204,0) - ; = 1^message: error and reason -"RTN","BSDXAPI",205,0) - ; -"RTN","BSDXAPI",206,0) - I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) -"RTN","BSDXAPI",207,0) - I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) -"RTN","BSDXAPI",208,0) - I ($G(BSDR("TYP"))'="C"),($G(BSDR("TYP"))'="PC") Q 1_U_"Cancel Status error: "_$G(BSDR("TYP")) -"RTN","BSDXAPI",209,0) - I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds -"RTN","BSDXAPI",210,0) - I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) -"RTN","BSDXAPI",211,0) - I $G(BSDR("CDT")) S BSDR("CDT")=+$E(BSDR("CDT"),1,12) ;remove seconds -"RTN","BSDXAPI",212,0) - I $G(BSDR("CDT"))'?7N1".".4N Q 1_U_"Cancel Date/Time error: "_$G(BSDR("CDT")) -"RTN","BSDXAPI",213,0) - I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Canceled Appt Error: "_$G(BSDR("USR")) -"RTN","BSDXAPI",214,0) - I '$D(^SD(409.2,+$G(BSDR("CR")))) Q 1_U_"Cancel Reason error: "_$G(BSDR("CR")) -"RTN","BSDXAPI",215,0) - ; -"RTN","BSDXAPI",216,0) - NEW IEN,DIE,DA,DR -"RTN","BSDXAPI",217,0) - S IEN=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) -"RTN","BSDXAPI",218,0) - I 'IEN Q 1_U_"Error trying to find appointment for cancel: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") -"RTN","BSDXAPI",219,0) - ; -"RTN","BSDXAPI",220,0) - I $$CI(BSDR("PAT"),BSDR("CLN"),BSDR("ADT"),IEN) Q 1_U_"Patient already checked in; cannot cancel until checkin deleted: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") -"RTN","BSDXAPI",221,0) - ; -"RTN","BSDXAPI",222,0) - ; remember before status -"RTN","BSDXAPI",223,0) - NEW SDATA,DFN,SDT,SDCL,SDDA,SDCPHDL -"RTN","BSDXAPI",224,0) - S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2,SDDA=IEN -"RTN","BSDXAPI",225,0) - S SDCPHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL -"RTN","BSDXAPI",226,0) - D BEFORE^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCPHDL) -"RTN","BSDXAPI",227,0) - ; -"RTN","BSDXAPI",228,0) - ; get user who made appt and date appt made from ^SC -"RTN","BSDXAPI",229,0) - ; because data in ^SC will be deleted -"RTN","BSDXAPI",230,0) - NEW USER,DATE -"RTN","BSDXAPI",231,0) - S USER=$P($G(^SC(SDCL,"S",SDT,1,IEN,0)),U,6) -"RTN","BSDXAPI",232,0) - S DATE=$P($G(^SC(SDCL,"S",SDT,1,IEN,0)),U,7) -"RTN","BSDXAPI",233,0) - ; -"RTN","BSDXAPI",234,0) - ; update file 2 info -"RTN","BSDXAPI",235,0) - NEW DIE,DA,DR -"RTN","BSDXAPI",236,0) - S DIE="^DPT("_DFN_",""S"",",DA(1)=DFN,DA=SDT -"RTN","BSDXAPI",237,0) - S DR="3///"_BSDR("TYP")_";14///`"_BSDR("USR")_";15///"_BSDR("CDT")_";16///`"_BSDR("CR")_";19///`"_USER_";20///"_DATE -"RTN","BSDXAPI",238,0) - S:$G(BSDR("NOT"))]"" DR=DR_";17///"_$E(BSDR("NOT"),1,160) -"RTN","BSDXAPI",239,0) - D ^DIE -"RTN","BSDXAPI",240,0) - ; -"RTN","BSDXAPI",241,0) - ; delete data in ^SC -"RTN","BSDXAPI",242,0) - NEW DIK,DA -"RTN","BSDXAPI",243,0) - S DIK="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," -"RTN","BSDXAPI",244,0) S DA(2)=BSDR("CLN"),DA(1)=BSDR("ADT"),DA=IEN -"RTN","BSDXAPI",245,0) - D ^DIK -"RTN","BSDXAPI",246,0) +"RTN","BSDXAPI",171,0) + S DR="309///"_BSDR("CDT")_";302///`"_BSDR("USR")_";305///"_$$NOW^XLFDT +"RTN","BSDXAPI",172,0) + D ^DIE +"RTN","BSDXAPI",173,0) ; -"RTN","BSDXAPI",247,0) +"RTN","BSDXAPI",174,0) + ; set after status +"RTN","BSDXAPI",175,0) + S SDDA=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) +"RTN","BSDXAPI",176,0) + S SDCIHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL +"RTN","BSDXAPI",177,0) + D AFTER^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL) +"RTN","BSDXAPI",178,0) + ; +"RTN","BSDXAPI",179,0) ; call event driver -"RTN","BSDXAPI",248,0) - D CANCEL^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDMODE,SDCPHDL) -"RTN","BSDXAPI",249,0) +"RTN","BSDXAPI",180,0) + D EVT^SDAMEVT(.SDATA,4,SDMODE,SDCIHDL) +"RTN","BSDXAPI",181,0) Q 0 -"RTN","BSDXAPI",250,0) +"RTN","BSDXAPI",182,0) ; +"RTN","BSDXAPI",183,0) +CANCEL1(DFN,CLIN,TYP,APDATE,REASON,INFO) ; PEP w/ parameters for $$CANCEL - cancelling appointment +"RTN","BSDXAPI",184,0) + ; Call like this for DFN 23435 cancelling an appointment at Hospital Location 33, +"RTN","BSDXAPI",185,0) + ; cancellation initiated by patient ("PC" rather than clinic "C"), +"RTN","BSDXAPI",186,0) + ; cancelling appt at Dec 20, 2009 @ 10:11:59 because of reason 1 in file 409.2 IEN (weather) +"RTN","BSDXAPI",187,0) + ; because foxes come out during bad weather. +"RTN","BSDXAPI",188,0) + ; S RESULT=$$CANCEL1^BSDXAPI(23435,33,"PC",3091220.221159,1,"Afraid of foxes") +"RTN","BSDXAPI",189,0) + S BSDR("PAT")=DFN +"RTN","BSDXAPI",190,0) + S BSDR("CLN")=CLIN +"RTN","BSDXAPI",191,0) + S BSDR("TYP")=TYP +"RTN","BSDXAPI",192,0) + S BSDR("ADT")=APDATE +"RTN","BSDXAPI",193,0) + S BSDR("CDT")=$$NOW^XLFDT +"RTN","BSDXAPI",194,0) + S BSDR("USR")=DUZ +"RTN","BSDXAPI",195,0) + S BSDR("CR")=REASON +"RTN","BSDXAPI",196,0) + S BSDR("NOT")=INFO +"RTN","BSDXAPI",197,0) + Q $$CANCEL(.BSDR) +"RTN","BSDXAPI",198,0) + ; +"RTN","BSDXAPI",199,0) +CANCEL(BSDR) ;PEP; called to cancel appt +"RTN","BSDXAPI",200,0) + ; +"RTN","BSDXAPI",201,0) + ; Make call using: S ERR=$$CANCEL^BSDXAPI(.ARRAY) +"RTN","BSDXAPI",202,0) + ; +"RTN","BSDXAPI",203,0) + ; Input Array - +"RTN","BSDXAPI",204,0) + ; BSDR("PAT") = ien of patient in file 2 +"RTN","BSDXAPI",205,0) + ; BSDR("CLN") = ien of clinic in file 44 +"RTN","BSDXAPI",206,0) + ; BSDR("TYP") = C for canceled by clinic; PC for patient canceled +"RTN","BSDXAPI",207,0) + ; BSDR("ADT") = appointment date and time +"RTN","BSDXAPI",208,0) + ; BSDR("CDT") = cancel date and time +"RTN","BSDXAPI",209,0) + ; BSDR("USR") = user who canceled appt +"RTN","BSDXAPI",210,0) + ; BSDR("CR") = cancel reason - pointer to file 409.2 +"RTN","BSDXAPI",211,0) + ; BSDR("NOT") = cancel remarks - optional notes to 160 characters +"RTN","BSDXAPI",212,0) + ; +"RTN","BSDXAPI",213,0) + ;Output: error status and message +"RTN","BSDXAPI",214,0) + ; = 0 or null: everything okay +"RTN","BSDXAPI",215,0) + ; = 1^message: error and reason +"RTN","BSDXAPI",216,0) + ; +"RTN","BSDXAPI",217,0) + I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) +"RTN","BSDXAPI",218,0) + I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) +"RTN","BSDXAPI",219,0) + I ($G(BSDR("TYP"))'="C"),($G(BSDR("TYP"))'="PC") Q 1_U_"Cancel Status error: "_$G(BSDR("TYP")) +"RTN","BSDXAPI",220,0) + I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds +"RTN","BSDXAPI",221,0) + I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) +"RTN","BSDXAPI",222,0) + I $G(BSDR("CDT")) S BSDR("CDT")=+$E(BSDR("CDT"),1,12) ;remove seconds +"RTN","BSDXAPI",223,0) + I $G(BSDR("CDT"))'?7N1".".4N Q 1_U_"Cancel Date/Time error: "_$G(BSDR("CDT")) +"RTN","BSDXAPI",224,0) + I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Canceled Appt Error: "_$G(BSDR("USR")) +"RTN","BSDXAPI",225,0) + I '$D(^SD(409.2,+$G(BSDR("CR")))) Q 1_U_"Cancel Reason error: "_$G(BSDR("CR")) +"RTN","BSDXAPI",226,0) + ; +"RTN","BSDXAPI",227,0) + NEW IEN,DIE,DA,DR +"RTN","BSDXAPI",228,0) + S IEN=$$SCIEN(BSDR("PAT"),BSDR("CLN"),BSDR("ADT")) +"RTN","BSDXAPI",229,0) + I 'IEN Q 1_U_"Error trying to find appointment for cancel: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") +"RTN","BSDXAPI",230,0) + ; +"RTN","BSDXAPI",231,0) + I $$CI(BSDR("PAT"),BSDR("CLN"),BSDR("ADT"),IEN) Q 1_U_"Patient already checked in; cannot cancel until checkin deleted: Patient="_BSDR("PAT")_" Clinic="_BSDR("CLN")_" Appt="_BSDR("ADT") +"RTN","BSDXAPI",232,0) + ; +"RTN","BSDXAPI",233,0) + ; remember before status +"RTN","BSDXAPI",234,0) + NEW SDATA,DFN,SDT,SDCL,SDDA,SDCPHDL +"RTN","BSDXAPI",235,0) + S DFN=BSDR("PAT"),SDT=BSDR("ADT"),SDCL=BSDR("CLN"),SDMODE=2,SDDA=IEN +"RTN","BSDXAPI",236,0) + S SDCPHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL +"RTN","BSDXAPI",237,0) + D BEFORE^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCPHDL) +"RTN","BSDXAPI",238,0) + ; +"RTN","BSDXAPI",239,0) + ; get user who made appt and date appt made from ^SC +"RTN","BSDXAPI",240,0) + ; because data in ^SC will be deleted +"RTN","BSDXAPI",241,0) + NEW USER,DATE +"RTN","BSDXAPI",242,0) + S USER=$P($G(^SC(SDCL,"S",SDT,1,IEN,0)),U,6) +"RTN","BSDXAPI",243,0) + S DATE=$P($G(^SC(SDCL,"S",SDT,1,IEN,0)),U,7) +"RTN","BSDXAPI",244,0) + ; +"RTN","BSDXAPI",245,0) + ; update file 2 info +"RTN","BSDXAPI",246,0) + NEW DIE,DA,DR +"RTN","BSDXAPI",247,0) + S DIE="^DPT("_DFN_",""S"",",DA(1)=DFN,DA=SDT +"RTN","BSDXAPI",248,0) + S DR="3///"_BSDR("TYP")_";14///`"_BSDR("USR")_";15///"_BSDR("CDT")_";16///`"_BSDR("CR")_";19///`"_USER_";20///"_DATE +"RTN","BSDXAPI",249,0) + S:$G(BSDR("NOT"))]"" DR=DR_";17///"_$E(BSDR("NOT"),1,160) +"RTN","BSDXAPI",250,0) + D ^DIE "RTN","BSDXAPI",251,0) -CI(PAT,CLINIC,DATE,SDIEN) ;PEP; -- returns 1 if appt already checked-in + ; "RTN","BSDXAPI",252,0) - NEW X + ; delete data in ^SC "RTN","BSDXAPI",253,0) - S X=$G(SDIEN) ;ien sent in call + NEW DIK,DA "RTN","BSDXAPI",254,0) - I 'X S X=$$SCIEN(PAT,CLINIC,DATE) I 'X Q 0 + S DIK="^SC("_BSDR("CLN")_",""S"","_BSDR("ADT")_",1," "RTN","BSDXAPI",255,0) - S X=$P($G(^SC(CLINIC,"S",DATE,1,X,"C")),U) + S DA(2)=BSDR("CLN"),DA(1)=BSDR("ADT"),DA=IEN "RTN","BSDXAPI",256,0) - Q $S(X:1,1:0) + D ^DIK "RTN","BSDXAPI",257,0) ; "RTN","BSDXAPI",258,0) -SCIEN(PAT,CLINIC,DATE) ;PEP; returns ien for appt in ^SC + ; call event driver "RTN","BSDXAPI",259,0) - NEW X,IEN + D CANCEL^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDMODE,SDCPHDL) "RTN","BSDXAPI",260,0) - S X=0 F S X=$O(^SC(CLINIC,"S",DATE,1,X)) Q:'X Q:$G(IEN) D + Q 0 "RTN","BSDXAPI",261,0) - . Q:$P($G(^SC(CLINIC,"S",DATE,1,X,0)),U,9)="C" ;cancelled -"RTN","BSDXAPI",262,0) - . I +$G(^SC(CLINIC,"S",DATE,1,X,0))=PAT S IEN=X -"RTN","BSDXAPI",263,0) - Q $G(IEN) -"RTN","BSDXAPI",264,0) ; +"RTN","BSDXAPI",262,0) +CI(PAT,CLINIC,DATE,SDIEN) ;PEP; -- returns 1 if appt already checked-in +"RTN","BSDXAPI",263,0) + NEW X +"RTN","BSDXAPI",264,0) + S X=$G(SDIEN) ;ien sent in call "RTN","BSDXAPI",265,0) -APPTYP(PAT,DATE) ;PEP; -- returns type of appt (scheduled or walk-in) + I 'X S X=$$SCIEN(PAT,CLINIC,DATE) I 'X Q 0 "RTN","BSDXAPI",266,0) - NEW X S X=$P($G(^DPT(PAT,"S",DATE,0)),U,7) + S X=$P($G(^SC(CLINIC,"S",DATE,1,X,"C")),U) "RTN","BSDXAPI",267,0) - Q $S(X=3:"SCHED",X=4:"WALK-IN",1:"??") + Q $S(X:1,1:0) "RTN","BSDXAPI",268,0) ; "RTN","BSDXAPI",269,0) -CO(PAT,CLINIC,DATE,SDIEN) ;PEP; -- returns 1 if appt already checked-out +SCIEN(PAT,CLINIC,DATE) ;PEP; returns ien for appt in ^SC "RTN","BSDXAPI",270,0) - NEW X + NEW X,IEN "RTN","BSDXAPI",271,0) - S X=$G(SDIEN) ;ien sent in call + S X=0 F S X=$O(^SC(CLINIC,"S",DATE,1,X)) Q:'X Q:$G(IEN) D "RTN","BSDXAPI",272,0) - I 'X S X=$$SCIEN(PAT,CLINIC,DATE) I 'X Q 0 + . Q:$P($G(^SC(CLINIC,"S",DATE,1,X,0)),U,9)["C" ;cancelled "RTN","BSDXAPI",273,0) - S X=$P($G(^SC(CLINIC,"S",DATE,1,X,"C")),U,3) + . I +$G(^SC(CLINIC,"S",DATE,1,X,0))=PAT S IEN=X "RTN","BSDXAPI",274,0) - Q $S(X:1,1:0) + Q $G(IEN) "RTN","BSDXAPI",275,0) ; +"RTN","BSDXAPI",276,0) +APPTYP(PAT,DATE) ;PEP; -- returns type of appt (scheduled or walk-in) +"RTN","BSDXAPI",277,0) + NEW X S X=$P($G(^DPT(PAT,"S",DATE,0)),U,7) +"RTN","BSDXAPI",278,0) + Q $S(X=3:"SCHED",X=4:"WALK-IN",1:"??") +"RTN","BSDXAPI",279,0) + ; +"RTN","BSDXAPI",280,0) +CO(PAT,CLINIC,DATE,SDIEN) ;PEP; -- returns 1 if appt already checked-out +"RTN","BSDXAPI",281,0) + NEW X +"RTN","BSDXAPI",282,0) + S X=$G(SDIEN) ;ien sent in call +"RTN","BSDXAPI",283,0) + I 'X S X=$$SCIEN(PAT,CLINIC,DATE) I 'X Q 0 +"RTN","BSDXAPI",284,0) + S X=$P($G(^SC(CLINIC,"S",DATE,1,X,"C")),U,3) +"RTN","BSDXAPI",285,0) + Q $S(X:1,1:0) +"RTN","BSDXAPI",286,0) + ; +"RTN","BSDXAPI",287,0) +UPDATENOTE(PAT,CLINIC,DATE,NOTE) ; PEP; Update Note in ^SC for patient's appointment @ DATE +"RTN","BSDXAPI",288,0) + ; PAT = DFN +"RTN","BSDXAPI",289,0) + ; CLINIC = SC IEN +"RTN","BSDXAPI",290,0) + ; DATE = FM Date/Time of Appointment +"RTN","BSDXAPI",291,0) + ; +"RTN","BSDXAPI",292,0) + ; Returns: +"RTN","BSDXAPI",293,0) + ; 0 if okay +"RTN","BSDXAPI",294,0) + ; -1 if failure +"RTN","BSDXAPI",295,0) + N SCIEN S SCIEN=$$SCIEN(PAT,CLINIC,DATE) ; ien of appt in ^SC +"RTN","BSDXAPI",296,0) + I SCIEN<1 QUIT 0 ; Appt cancelled; cancelled appts rm'ed from file 44 +"RTN","BSDXAPI",297,0) + N BSDXIENS S BSDXIENS=SCIEN_","_DATE_","_CLINIC_"," +"RTN","BSDXAPI",298,0) + S BSDXFDA(44.003,BSDXIENS,3)=$E(NOTE,1,150) +"RTN","BSDXAPI",299,0) + N BSDXERR +"RTN","BSDXAPI",300,0) + D FILE^DIE("","BSDXFDA","BSDXERR") +"RTN","BSDXAPI",301,0) + I $D(BSDXERR) QUIT "-1~Can't file for Pat "_PAT_" in Clinic "_CLINIC_" at "_DATE_". Fileman reported an error: "_BSDXERR("DIERR",1,"TEXT",1) +"RTN","BSDXAPI",302,0) + QUIT 0 "RTN","BSDXGPRV") -0^36^B6645474 +0^36^B4804670 "RTN","BSDXGPRV",1,0) -BSDXGPRV ; WV/SMH - WINDOWS SCHEDULING RPCS ; 9/7/10 7:59am +BSDXGPRV ; WV/SMH - WINDOWS SCHEDULING RPCS ; 11/2/10 4:27pm "RTN","BSDXGPRV",2,0) - ;;1.41;BSDX;;Sep 29, 2010;Build 8 + ;;1.42;BSDX;;Dec 07, 2010;Build 9 "RTN","BSDXGPRV",3,0) ; "RTN","BSDXGPRV",4,0) @@ -10855,13 +11771,13 @@ ERROR ; "RTN","BSDXGPRV",9,0) ERR(BSDXERR) ;Error processing "RTN","BSDXGPRV",10,0) - D ^%ZTER + D ^%ZTER "RTN","BSDXGPRV",11,0) S BSDXI=BSDXI+1 "RTN","BSDXGPRV",12,0) - S ^BSDXTMP($J,BSDXI)=BSDXERR + S ^BSDXTMP($J,BSDXI)=BSDXERR "RTN","BSDXGPRV",13,0) - S BSDXI=BSDXI+1 + S BSDXI=BSDXI+1 "RTN","BSDXGPRV",14,0) S ^BSDXTMP($J,BSDXI)=$C(31) "RTN","BSDXGPRV",15,0) @@ -10883,17 +11799,17 @@ PD(BSDXY,HLIEN) ;EP Debugging entry point "RTN","BSDXGPRV",23,0) P(BSDXY,HLIEN) ; Public Entry point; Get Providers for Hosp Location "RTN","BSDXGPRV",24,0) - ; Input: HLIEN - Hospital Location IEN + ; Input: HLIEN - Hospital Location IEN "RTN","BSDXGPRV",25,0) - ; Output: ADO Datatable with columns: + ; Output: ADO Datatable with columns: "RTN","BSDXGPRV",26,0) - ; - HOSPITAL_LOCATION_ID, BMXIEN, PROV_NAME, DEFAULT + ; - HOSPITAL_LOCATION_ID, BMXIEN, PROV_NAME, DEFAULT "RTN","BSDXGPRV",27,0) - ; If there are providers in the PROVIDER multiple of file 44 + ; If there are providers in the PROVIDER multiple of file 44 "RTN","BSDXGPRV",28,0) - ; (Hospital Location) return them; + ; (Hospital Location) return them; "RTN","BSDXGPRV",29,0) - ; If no providers in PROVIDER multiple of file 44, return nothing + ; If no providers in PROVIDER multiple of file 44, return nothing "RTN","BSDXGPRV",30,0) ; Called by BSDX HOSP LOC PROVIDERS "RTN","BSDXGPRV",31,0) @@ -10901,11 +11817,11 @@ P(BSDXY,HLIEN) ; Public Entry point; Get Providers for Hosp Location "RTN","BSDXGPRV",32,0) S BSDXI=0 "RTN","BSDXGPRV",33,0) - I '$D(^SC(HLIEN,0)) D ERR("HOSPITAL LOCATION NOT FOUND") QUIT + I '$D(^SC(HLIEN,0)) D ERR("HOSPITAL LOCATION NOT FOUND") QUIT "RTN","BSDXGPRV",34,0) D ^XBKVAR "RTN","BSDXGPRV",35,0) - N $ET S $ET="G ERROR^BSDXGPRV" + N $ET S $ET="G ERROR^BSDXGPRV" "RTN","BSDXGPRV",36,0) K ^BSDXTMP($J) "RTN","BSDXGPRV",37,0) @@ -10913,41 +11829,41 @@ P(BSDXY,HLIEN) ; Public Entry point; Get Providers for Hosp Location "RTN","BSDXGPRV",38,0) S $P(^BSDXTMP($J,BSDXI),U,1)="I00020HOSPITAL_LOCATION_ID" "RTN","BSDXGPRV",39,0) - S $P(^BSDXTMP($J,BSDXI),U,2)="I00020BMXIEN" + S $P(^BSDXTMP($J,BSDXI),U,2)="I00020BMXIEN" "RTN","BSDXGPRV",40,0) - S $P(^BSDXTMP($J,BSDXI),U,3)="T00030NAME" + S $P(^BSDXTMP($J,BSDXI),U,3)="T00030NAME" "RTN","BSDXGPRV",41,0) - S $P(^BSDXTMP($J,BSDXI),U,4)="T00005DEFAULT" + S $P(^BSDXTMP($J,BSDXI),U,4)="T00005DEFAULT" "RTN","BSDXGPRV",42,0) - S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30) + S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30) "RTN","BSDXGPRV",43,0) ; "RTN","BSDXGPRV",44,0) - N OUTPUT + N OUTPUT "RTN","BSDXGPRV",45,0) - D GETS^DIQ(44,HLIEN_",","2600*","IE","OUTPUT") ; Provider Multiple + D GETS^DIQ(44,HLIEN_",","2600*","IE","OUTPUT") ; Provider Multiple "RTN","BSDXGPRV",46,0) - ; No results + ; No results "RTN","BSDXGPRV",47,0) - I '$D(OUTPUT) S ^BSDXTMP($J,BSDXI+1)=$C(31) QUIT + I '$D(OUTPUT) S ^BSDXTMP($J,BSDXI+1)=$C(31) QUIT "RTN","BSDXGPRV",48,0) - ; if results, get them + ; if results, get them "RTN","BSDXGPRV",49,0) - N I S I="" + N I S I="" "RTN","BSDXGPRV",50,0) - F S I=$O(OUTPUT(44.1,I)) Q:I="" D + F S I=$O(OUTPUT(44.1,I)) Q:I="" D "RTN","BSDXGPRV",51,0) - . S BSDXI=BSDXI+1 + . S BSDXI=BSDXI+1 "RTN","BSDXGPRV",52,0) - . S $P(^BSDXTMP($J,BSDXI),U,1)=HLIEN ; HL IEN + . S $P(^BSDXTMP($J,BSDXI),U,1)=HLIEN ; HL IEN "RTN","BSDXGPRV",53,0) - . S $P(^BSDXTMP($J,BSDXI),U,2)=$P(OUTPUT(44.1,I,.01,"I"),",") ; PROV IEN + . S $P(^BSDXTMP($J,BSDXI),U,2)=$P(OUTPUT(44.1,I,.01,"I"),",") ; PROV IEN "RTN","BSDXGPRV",54,0) - . S $P(^BSDXTMP($J,BSDXI),U,3)=$E(OUTPUT(44.1,I,.01,"E"),1,30) ; PROV NAME + . S $P(^BSDXTMP($J,BSDXI),U,3)=$E(OUTPUT(44.1,I,.01,"E"),1,30) ; PROV NAME "RTN","BSDXGPRV",55,0) - . S $P(^BSDXTMP($J,BSDXI),U,4)=OUTPUT(44.1,I,.02,"E") ; Default - YES, NO + . S $P(^BSDXTMP($J,BSDXI),U,4)=OUTPUT(44.1,I,.02,"E") ; Default - YES, NO "RTN","BSDXGPRV",56,0) - . S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30) + . S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30) "RTN","BSDXGPRV",57,0) S BSDXI=BSDXI+1 "RTN","BSDXGPRV",58,0) @@ -11080,6 +11996,8 @@ FIELD^^2001^8 "^DD",9002018.1,9002018.1,0,"PT",9002018.21,.01) +"^DD",9002018.1,9002018.1,0,"PT",9002018.25,.02) + "^DD",9002018.1,9002018.1,0,"PT",9002018.3,.01) "^DD",9002018.1,9002018.1,0,"PT",9002018.4,.07) @@ -11213,7 +12131,7 @@ ENTER ASSOCIATED RPMS CLINIC "^DD",9002018.15,9002018.15,0) FIELD^^.05^5 "^DD",9002018.15,9002018.15,0,"DT") -3100928 +3030703 "^DD",9002018.15,9002018.15,0,"IX","AC",9002018.15,.02) "^DD",9002018.15,9002018.15,0,"IX","B",9002018.15,.01) @@ -11271,7 +12189,7 @@ FIELD^^1^3 "^DD",9002018.2,9002018.2,0,"DDA") N "^DD",9002018.2,9002018.2,0,"DT") -3100928 +3030508 "^DD",9002018.2,9002018.2,0,"IX","AB",9002018.21,.01) "^DD",9002018.2,9002018.2,0,"IX","B",9002018.2,.01) @@ -11305,7 +12223,7 @@ RESOURCE^9002018.21P^^1;0 "^DD",9002018.2,9002018.21,0) RESOURCE SUB-FIELD^^.01^1 "^DD",9002018.2,9002018.21,0,"DT") -3100928 +3030508 "^DD",9002018.2,9002018.21,0,"IX","B",9002018.21,.01) "^DD",9002018.2,9002018.21,0,"NM","RESOURCE")