BSDX30 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ; [ 09/12/2007 1:54 PM ]
;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
;
;
SPACED(BSDXY,BSDXDIC,BSDXVAL) ;EP
;Entry point for debugging
;
D DEBUG^%Serenji("SPACE^BSDX30(.BSDXY,BSDXDIC,BSDXVAL)")
Q
;
SPACE(BSDXY,BSDXDIC,BSDXVAL) ;EP
;Update ^DISV with most recent lookup value BSDXVAL from file BSDXDIC
;BSDXDIC is the data global in the form GLOBAL(
;BSDXVAL is the entry number (IEN) in the file
;
;Return Status = 1 if success, 0 if fail
;
S BSDXY="^BSDXTMP("_$J_")"
N BSDX1,BSDXRES
S BSDXI=0
S X="ETRAP^BSDX30",@^%ZOSF("TRAP")
I (BSDXDIC="")!('+$G(BSDXVAL)) D ERR(BSDXI+1,99) Q
S BSDXDIC="^"_BSDXDIC
S ^BSDXTMP($J,0)="T00020ERRORID"_$C(30)
I $D(@(BSDXDIC_"BSDXVAL,0)")),'$D(^(-9)) D ;Note: Naked reference is immediately preceded by the full global reference per SAC 2.2.2.8
. S ^DISV(DUZ,BSDXDIC)=BSDXVAL
. S BSDXRES=1
E S BSDXRES=0
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXRES_$C(30)_$C(31)
Q
;
ERR(BSDXI,BSDXERR) ;Error processing
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
ETRAP ;EP Error trap entry
I '$D(BSDXI) N BSDXI S BSDXI=999
S BSDXI=BSDXI+1
D ERR(99,0)
Q
;
EHRPTD(BSDXY,BSDXWID,BSDXDFN) ;
;
D DEBUG^%Serenji("EHRPT^BSDX30(.BSDXY,BSDXWID,BSDXDFN)")
Q
;
EHRPT(BSDXY,BSDXWID,BSDXDFN) ;
;
;Return Status = 1 if success, 0 if error
;
S BSDXY="^BSDXTMP("_$J_")"
N BSDX1,BSDXRES
S BSDXI=0,BSDXRES=1
S X="ETRAP^BSDX30",@^%ZOSF("TRAP")
S ^BSDXTMP($J,0)="T00020ERRORID"_$C(30)
I '+BSDXDFN D ERR(BSDXI+1,0) Q
;
D PEVENT(BSDXWID,BSDXDFN) ;Raise patient selected event
;
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXRES_$C(30)_$C(31)
Q
;
PEVENT(BSDXWID,DFN) ;EP - Raise patient selection event to EHR
;
;Change patient context to patient DFN
;on all EHR client sessions associated with user DUZ
;and workstation BSDXWID.
;
;If BSDXWID is "", the context change is sent to
;all EHR client sessions belonging to user DUZ.
;
Q:'$G(DUZ)
;N X
;S X="CIANBUTL" X ^%ZOSF("TEST") Q:'$T
;S X="CIANBEVT" X ^%ZOSF("TEST") Q:'$T
N UID,BRET
S BRET=0,UID=0
F S BRET=$$NXTUID^CIANBUTL(.UID,1) Q:'UID D
. Q:DUZ'=$$GETVAR^CIANBUTL("DUZ",,,UID)
. I BSDXWID'="" Q:BSDXWID'=$TR($$GETVAR^CIANBUTL("WID",,,UID),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
. D QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
Q
BSDX30 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ; [ 09/12/2007 1:54 PM ]
+1 ;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
+2 ;
+3 ;
SPACED(BSDXY,BSDXDIC,BSDXVAL) ;EP
+1 ;Entry point for debugging
+2 ;
+3 DO DEBUG^%Serenji("SPACE^BSDX30(.BSDXY,BSDXDIC,BSDXVAL)")
+4 QUIT
+5 ;
SPACE(BSDXY,BSDXDIC,BSDXVAL) ;EP
+1 ;Update ^DISV with most recent lookup value BSDXVAL from file BSDXDIC
+2 ;BSDXDIC is the data global in the form GLOBAL(
+3 ;BSDXVAL is the entry number (IEN) in the file
+4 ;
+5 ;Return Status = 1 if success, 0 if fail
+6 ;
+7 SET BSDXY="^BSDXTMP("_$JOB_")"
+8 NEW BSDX1,BSDXRES
+9 SET BSDXI=0
+10 SET X="ETRAP^BSDX30"
SET @^%ZOSF("TRAP")
+11 IF (BSDXDIC="")!('+$GET(BSDXVAL))
DO ERR(BSDXI+1,99)
QUIT
+12 SET BSDXDIC="^"_BSDXDIC
+13 SET ^BSDXTMP($JOB,0)="T00020ERRORID"_$CHAR(30)
+14 ;Note: Naked reference is immediately preceded by the full global reference per SAC 2.2.2.8
IF $DATA(@(BSDXDIC_"BSDXVAL,0)"))
IF '$DATA(^(-9))
Begin DoDot:1
+15 SET ^DISV(DUZ,BSDXDIC)=BSDXVAL
+16 SET BSDXRES=1
End DoDot:1
+17 IF '$TEST
SET BSDXRES=0
+18 SET BSDXI=BSDXI+1
+19 SET ^BSDXTMP($JOB,BSDXI)=BSDXRES_$CHAR(30)_$CHAR(31)
+20 QUIT
+21 ;
ERR(BSDXI,BSDXERR) ;Error processing
+1 SET BSDXI=BSDXI+1
+2 SET ^BSDXTMP($JOB,BSDXI)=BSDXERR_$CHAR(30)
+3 SET BSDXI=BSDXI+1
+4 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+5 QUIT
+6 ;
ETRAP ;EP Error trap entry
+1 IF '$DATA(BSDXI)
NEW BSDXI
SET BSDXI=999
+2 SET BSDXI=BSDXI+1
+3 DO ERR(99,0)
+4 QUIT
+5 ;
EHRPTD(BSDXY,BSDXWID,BSDXDFN) ;
+1 ;
+2 DO DEBUG^%Serenji("EHRPT^BSDX30(.BSDXY,BSDXWID,BSDXDFN)")
+3 QUIT
+4 ;
EHRPT(BSDXY,BSDXWID,BSDXDFN) ;
+1 ;
+2 ;Return Status = 1 if success, 0 if error
+3 ;
+4 SET BSDXY="^BSDXTMP("_$JOB_")"
+5 NEW BSDX1,BSDXRES
+6 SET BSDXI=0
SET BSDXRES=1
+7 SET X="ETRAP^BSDX30"
SET @^%ZOSF("TRAP")
+8 SET ^BSDXTMP($JOB,0)="T00020ERRORID"_$CHAR(30)
+9 IF '+BSDXDFN
DO ERR(BSDXI+1,0)
QUIT
+10 ;
+11 ;Raise patient selected event
DO PEVENT(BSDXWID,BSDXDFN)
+12 ;
+13 SET BSDXI=BSDXI+1
+14 SET ^BSDXTMP($JOB,BSDXI)=BSDXRES_$CHAR(30)_$CHAR(31)
+15 QUIT
+16 ;
PEVENT(BSDXWID,DFN) ;EP - Raise patient selection event to EHR
+1 ;
+2 ;Change patient context to patient DFN
+3 ;on all EHR client sessions associated with user DUZ
+4 ;and workstation BSDXWID.
+5 ;
+6 ;If BSDXWID is "", the context change is sent to
+7 ;all EHR client sessions belonging to user DUZ.
+8 ;
+9 IF '$GET(DUZ)
QUIT
+10 ;N X
+11 ;S X="CIANBUTL" X ^%ZOSF("TEST") Q:'$T
+12 ;S X="CIANBEVT" X ^%ZOSF("TEST") Q:'$T
+13 NEW UID,BRET
+14 SET BRET=0
SET UID=0
+15 FOR
SET BRET=$$NXTUID^CIANBUTL(.UID,1)
IF 'UID
QUIT
Begin DoDot:1
+16 IF DUZ'=$$GETVAR^CIANBUTL("DUZ",,,UID)
QUIT
+17 IF BSDXWID'=""
IF BSDXWID'=$TRANSLATE($$GETVAR^CIANBUTL("WID",,,UID),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
QUIT
+18 DO QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
End DoDot:1
+19 QUIT