SDEC30 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
;
Q
;
SPACEBAR(SDECY,SDECDIC,SDECVAL) ;Update ^DISV with most recent lookup value SDECVAL from file SDECDIC
;SPACEBAR(SDECY,SDECDIC,SDECVAL) external parameter tag is in SDEC
;SDECDIC is the data global in the form GLOBAL(
;SDECVAL is the entry number (IEN) in the file
;
;Return Status = 1 if success, 0 if fail
;
S SDECY="^TMP(""SDEC"","_$J_")"
K @SDECY
N SDEC1,SDECRES
S SDECI=0
I (SDECDIC="")!('+$G(SDECVAL)) D ERR(SDECI+1,99) Q
S SDECDIC="^"_SDECDIC
S ^TMP("SDEC",$J,0)="T00020ERRORID"_$C(30)
I $D(@(SDECDIC_"SDECVAL,0)")),'$D(^(-9)) D ;Note: Naked reference is immediately preceded by the full global reference per SAC 2.2.2.8
. S ^DISV(DUZ,SDECDIC)=SDECVAL
. S SDECRES=1
E S SDECRES=0
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=SDECRES_$C(30)_$C(31)
Q
;
ERR(SDECI,SDECERR) ;Error processing
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=SDECERR_$C(30)
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=$C(31)
Q
;
ETRAP ;EP Error trap entry
I '$D(SDECI) N SDECI S SDECI=999
S SDECI=SDECI+1
D ERR(99,0)
Q
;
EHRPT(SDECY,SDECWID,SDECDFN) ;Raise patient selection event to CLIENT
;EHRPT(SDECY,SDECWID,SDECDFN) external parameter tag is in SDEC
;Return Status = 1 if success, 0 if error
;
S SDECY="^TMP(""SDEC"","_$J_")"
K @SDECY
N SDEC1,SDECRES
S SDECI=0,SDECRES=1
S ^TMP("SDEC",$J,0)="T00020ERRORID"_$C(30)
I '+SDECDFN D ERR(SDECI+1,0) Q
;
D PEVENT(SDECWID,SDECDFN) ;Raise patient selected event
;
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=SDECRES_$C(30)_$C(31)
Q
;
PEVENT(SDECWID,DFN) ;EP - Raise patient selection event to CLIENT
;
;Change patient context to patient DFN
;on all CLIENT client sessions associated with user DUZ
;and workstation SDECWID.
;
;If SDECWID is "", the context change is sent to
;all CLIENT client sessions belonging to user DUZ.
;
Q:'$G(DUZ)
;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 SDECWID'="" Q:SDECWID'=$TR($$GETVAR^CIANBUTL("WID",,,UID),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;. D QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDEC30 2292 printed Nov 22, 2024@18:00:26 Page 2
SDEC30 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
+1 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
+2 ;
+3 QUIT
+4 ;
SPACEBAR(SDECY,SDECDIC,SDECVAL) ;Update ^DISV with most recent lookup value SDECVAL from file SDECDIC
+1 ;SPACEBAR(SDECY,SDECDIC,SDECVAL) external parameter tag is in SDEC
+2 ;SDECDIC is the data global in the form GLOBAL(
+3 ;SDECVAL is the entry number (IEN) in the file
+4 ;
+5 ;Return Status = 1 if success, 0 if fail
+6 ;
+7 SET SDECY="^TMP(""SDEC"","_$JOB_")"
+8 KILL @SDECY
+9 NEW SDEC1,SDECRES
+10 SET SDECI=0
+11 IF (SDECDIC="")!('+$GET(SDECVAL))
DO ERR(SDECI+1,99)
QUIT
+12 SET SDECDIC="^"_SDECDIC
+13 SET ^TMP("SDEC",$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(@(SDECDIC_"SDECVAL,0)"))
IF '$DATA(^(-9))
Begin DoDot:1
+15 SET ^DISV(DUZ,SDECDIC)=SDECVAL
+16 SET SDECRES=1
End DoDot:1
+17 IF '$TEST
SET SDECRES=0
+18 SET SDECI=SDECI+1
+19 SET ^TMP("SDEC",$JOB,SDECI)=SDECRES_$CHAR(30)_$CHAR(31)
+20 QUIT
+21 ;
ERR(SDECI,SDECERR) ;Error processing
+1 SET SDECI=SDECI+1
+2 SET ^TMP("SDEC",$JOB,SDECI)=SDECERR_$CHAR(30)
+3 SET SDECI=SDECI+1
+4 SET ^TMP("SDEC",$JOB,SDECI)=$CHAR(31)
+5 QUIT
+6 ;
ETRAP ;EP Error trap entry
+1 IF '$DATA(SDECI)
NEW SDECI
SET SDECI=999
+2 SET SDECI=SDECI+1
+3 DO ERR(99,0)
+4 QUIT
+5 ;
EHRPT(SDECY,SDECWID,SDECDFN) ;Raise patient selection event to CLIENT
+1 ;EHRPT(SDECY,SDECWID,SDECDFN) external parameter tag is in SDEC
+2 ;Return Status = 1 if success, 0 if error
+3 ;
+4 SET SDECY="^TMP(""SDEC"","_$JOB_")"
+5 KILL @SDECY
+6 NEW SDEC1,SDECRES
+7 SET SDECI=0
SET SDECRES=1
+8 SET ^TMP("SDEC",$JOB,0)="T00020ERRORID"_$CHAR(30)
+9 IF '+SDECDFN
DO ERR(SDECI+1,0)
QUIT
+10 ;
+11 ;Raise patient selected event
DO PEVENT(SDECWID,SDECDFN)
+12 ;
+13 SET SDECI=SDECI+1
+14 SET ^TMP("SDEC",$JOB,SDECI)=SDECRES_$CHAR(30)_$CHAR(31)
+15 QUIT
+16 ;
PEVENT(SDECWID,DFN) ;EP - Raise patient selection event to CLIENT
+1 ;
+2 ;Change patient context to patient DFN
+3 ;on all CLIENT client sessions associated with user DUZ
+4 ;and workstation SDECWID.
+5 ;
+6 ;If SDECWID is "", the context change is sent to
+7 ;all CLIENT client sessions belonging to user DUZ.
+8 ;
+9 if '$GET(DUZ)
QUIT
+10 ;N UID,BRET
+11 ;S BRET=0,UID=0
+12 ;F S BRET=$$NXTUID^CIANBUTL(.UID,1) Q:'UID D
+13 ;. Q:DUZ'=$$GETVAR^CIANBUTL("DUZ",,,UID)
+14 ;. I SDECWID'="" Q:SDECWID'=$TR($$GETVAR^CIANBUTL("WID",,,UID),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+15 ;. D QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
+16 QUIT