ORWTPD1 ; SLC/PKS - Personal Preferences. [7/22/04 10:53am]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17,1997
;
Q
;
GETEFDAT(INFO) ; Get non-user level Encounter appointment date range params.
;
N ORSTART,ORSTOP
S INFO=""
;
S ORSTART=$$GET^XPAR("DIV^SYS^PKG","ORQQEAPT ENC APPT START",1,"I")
I 'ORSTART S ORSTART=60
;
S ORSTOP=$$GET^XPAR("DIV^SYS^PKG","ORQQEAPT ENC APPT STOP",1,"I")
I 'ORSTOP S ORSTOP=0
;
S INFO=ORSTART_U_ORSTOP
;
Q
;
GETEDATS(INFO) ; Get user's (all levels) Encounter app't date range params.
;
N ORSRV,ORUSER
S ORUSER=DUZ
;
S ORSRV=$G(^VA(200,DUZ,5)) I +ORSRV>0 S ORSRV=$P(ORSRV,U) ; Get S/S.
S INFO=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$G(ORSRV)_"^DIV^SYS^PKG","ORQQEAPT ENC APPT START",1,"I")_U
S INFO=INFO_$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$G(ORSRV)_"^DIV^SYS^PKG","ORQQEAPT ENC APPT STOP",1,"I")
;
Q
;
PUTEDATS(OK,Y) ; Save Encounter app't date range params at user level.
;
N ORSTART,ORSTOP,ORUSER
;
S OK=1,ORUSER=DUZ
S ORSTART=$P(Y,U,1)
S ORSTOP=$P(Y,U,2)
I ORSTART="" S ORSTART=0
I ORSTOP="" S ORSTOP=0
I ORSTART>999 S ORSTART=999
I ORSTOP>999 S ORSTART=999
;
D EN^XPAR(ORUSER_";VA(200,","ORQQEAPT ENC APPT START",1,ORSTART)
D EN^XPAR(ORUSER_";VA(200,","ORQQEAPT ENC APPT STOP",1,ORSTOP)
;
Q
;
GETCSDEF(INFO) ; Get Div/Sys/Pkg Cover Sheet default range parameters.
;
N ORVAL
;
S ORVAL=""
S ORVAL=$$GET^XPAR("DIV^SYS^PKG","ORQQCSDR CS RANGE START",1,"I")
S ORVAL=$$CHKRNG(ORVAL,999)
S INFO=ORVAL_U,ORVAL=""
S ORVAL=$$GET^XPAR("DIV^SYS^PKG","ORQQCSDR CS RANGE STOP",1,"I")
S ORVAL=$$CHKRNG(ORVAL,999)
S INFO=INFO_ORVAL
;
Q
;
GETCSRNG(VAL) ; Get user's Cover Sheet date range defaults.
;
N ORSRV,ORUSER,ORVAL
S ORUSER=DUZ
;
S ORVAL=""
S ORSRV=$G(^VA(200,DUZ,5)) I +ORSRV>0 S ORSRV=$P(ORSRV,U) ; Get S/S.
S ORVAL=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$G(ORSRV)_"^DIV^SYS^PKG","ORQQCSDR CS RANGE START",1,"I")
S ORVAL=$$CHKRNG(ORVAL,999)
S VAL=ORVAL_U,ORVAL=""
S ORVAL=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$G(ORSRV)_"^DIV^SYS^PKG","ORQQCSDR CS RANGE STOP",1,"I")
S ORVAL=$$CHKRNG(ORVAL,999)
S VAL=VAL_ORVAL
;
Q
;
PUTCSRNG(OK,INFO) ; Save user's Cover Sheet data range defaults.
;
N ORINPT,OROUTPT,ORSTART,ORSTOP,ORUSER
;
S OK=1,ORUSER=DUZ
S ORSTART=+$P(INFO,U,3) S:ORSTART>999 ORSTART=999 S ORSTART=$S(ORSTART=0:"T",ORSTART<0:"T"_ORSTART,1:"T+"_ORSTART)
S ORSTOP=+$P(INFO,U,4) S:ORSTOP>999 ORSTART=999 S ORSTOP=$S(ORSTOP=0:"T",ORSTOP<0:"T"_ORSTOP,1:"T+"_ORSTOP)
S ORINPT=+$P(INFO,U,1),ORINPT=$S('ORINPT:"@",1:ORINPT)
S OROUTPT=+$P(INFO,U,2),OROUTPT=$S('OROUTPT:"@",1:OROUTPT)
D EN^XPAR(ORUSER_";VA(200,","ORQQCSDR CS RANGE START",1,ORSTART)
D EN^XPAR(ORUSER_";VA(200,","ORQQCSDR CS RANGE STOP",1,ORSTOP)
D EN^XPAR(ORUSER_";VA(200,","ORQQLR DATE RANGE INPT",1,ORINPT)
D EN^XPAR(ORUSER_";VA(200,","ORQQLR DATE RANGE OUTPT",1,OROUTPT)
;
Q
;
GETEAFL(Y) ; Get "future days limit" parameter setting for Enc appt selection.
;
S Y=$$GET^XPAR("DIV^SYS^PKG^USR","ORQQEAFL ENC APPT FUTURE LIMIT",1,"I")
;
Q
;
CHKRNG(ORV,ORLIMIT) ; Check a "T-xx" or "T+xx" value.
;
; ORLIMIT must be a positive number.
;
N ORNEG,ORPOS,ORT,ORTT,ORVALUE
;
S (ORNEG,ORPOS,ORT,ORTT)=0
I $G(ORV)="" Q ORV
I $G(ORLIMIT)=0 Q ORV
;
I ORV["-" S ORNEG=1
I ORV["+" S ORPOS=1
I ORV["T" S ORT=1
I ORV["t" S ORTT=1
S ORVALUE=ORV
I ORT S ORVALUE=$P(ORV,"T",2)
I ORTT S ORVALUE=$P(ORV,"t",2)
I ORPOS S ORVALUE=$P(ORVALUE,"+",2)
I ORNEG S ORVALUE=$P(ORVALUE,"-",2)
I ORVALUE>ORLIMIT S ORVALUE=ORLIMIT
;
S ORV="T+"_ORVALUE
I ORNEG S ORV="T-"_ORVALUE
;
Q ORV
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWTPD1 3684 printed Dec 13, 2024@02:37:32 Page 2
ORWTPD1 ; SLC/PKS - Personal Preferences. [7/22/04 10:53am]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17,1997
+2 ;
+3 QUIT
+4 ;
GETEFDAT(INFO) ; Get non-user level Encounter appointment date range params.
+1 ;
+2 NEW ORSTART,ORSTOP
+3 SET INFO=""
+4 ;
+5 SET ORSTART=$$GET^XPAR("DIV^SYS^PKG","ORQQEAPT ENC APPT START",1,"I")
+6 IF 'ORSTART
SET ORSTART=60
+7 ;
+8 SET ORSTOP=$$GET^XPAR("DIV^SYS^PKG","ORQQEAPT ENC APPT STOP",1,"I")
+9 IF 'ORSTOP
SET ORSTOP=0
+10 ;
+11 SET INFO=ORSTART_U_ORSTOP
+12 ;
+13 QUIT
+14 ;
GETEDATS(INFO) ; Get user's (all levels) Encounter app't date range params.
+1 ;
+2 NEW ORSRV,ORUSER
+3 SET ORUSER=DUZ
+4 ;
+5 ; Get S/S.
SET ORSRV=$GET(^VA(200,DUZ,5))
IF +ORSRV>0
SET ORSRV=$PIECE(ORSRV,U)
+6 SET INFO=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$GET(ORSRV)_"^DIV^SYS^PKG","ORQQEAPT ENC APPT START",1,"I")_U
+7 SET INFO=INFO_$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$GET(ORSRV)_"^DIV^SYS^PKG","ORQQEAPT ENC APPT STOP",1,"I")
+8 ;
+9 QUIT
+10 ;
PUTEDATS(OK,Y) ; Save Encounter app't date range params at user level.
+1 ;
+2 NEW ORSTART,ORSTOP,ORUSER
+3 ;
+4 SET OK=1
SET ORUSER=DUZ
+5 SET ORSTART=$PIECE(Y,U,1)
+6 SET ORSTOP=$PIECE(Y,U,2)
+7 IF ORSTART=""
SET ORSTART=0
+8 IF ORSTOP=""
SET ORSTOP=0
+9 IF ORSTART>999
SET ORSTART=999
+10 IF ORSTOP>999
SET ORSTART=999
+11 ;
+12 DO EN^XPAR(ORUSER_";VA(200,","ORQQEAPT ENC APPT START",1,ORSTART)
+13 DO EN^XPAR(ORUSER_";VA(200,","ORQQEAPT ENC APPT STOP",1,ORSTOP)
+14 ;
+15 QUIT
+16 ;
GETCSDEF(INFO) ; Get Div/Sys/Pkg Cover Sheet default range parameters.
+1 ;
+2 NEW ORVAL
+3 ;
+4 SET ORVAL=""
+5 SET ORVAL=$$GET^XPAR("DIV^SYS^PKG","ORQQCSDR CS RANGE START",1,"I")
+6 SET ORVAL=$$CHKRNG(ORVAL,999)
+7 SET INFO=ORVAL_U
SET ORVAL=""
+8 SET ORVAL=$$GET^XPAR("DIV^SYS^PKG","ORQQCSDR CS RANGE STOP",1,"I")
+9 SET ORVAL=$$CHKRNG(ORVAL,999)
+10 SET INFO=INFO_ORVAL
+11 ;
+12 QUIT
+13 ;
GETCSRNG(VAL) ; Get user's Cover Sheet date range defaults.
+1 ;
+2 NEW ORSRV,ORUSER,ORVAL
+3 SET ORUSER=DUZ
+4 ;
+5 SET ORVAL=""
+6 ; Get S/S.
SET ORSRV=$GET(^VA(200,DUZ,5))
IF +ORSRV>0
SET ORSRV=$PIECE(ORSRV,U)
+7 SET ORVAL=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$GET(ORSRV)_"^DIV^SYS^PKG","ORQQCSDR CS RANGE START",1,"I")
+8 SET ORVAL=$$CHKRNG(ORVAL,999)
+9 SET VAL=ORVAL_U
SET ORVAL=""
+10 SET ORVAL=$$GET^XPAR("USR.`"_ORUSER_"^SRV.`"_+$GET(ORSRV)_"^DIV^SYS^PKG","ORQQCSDR CS RANGE STOP",1,"I")
+11 SET ORVAL=$$CHKRNG(ORVAL,999)
+12 SET VAL=VAL_ORVAL
+13 ;
+14 QUIT
+15 ;
PUTCSRNG(OK,INFO) ; Save user's Cover Sheet data range defaults.
+1 ;
+2 NEW ORINPT,OROUTPT,ORSTART,ORSTOP,ORUSER
+3 ;
+4 SET OK=1
SET ORUSER=DUZ
+5 SET ORSTART=+$PIECE(INFO,U,3)
if ORSTART>999
SET ORSTART=999
SET ORSTART=$SELECT(ORSTART=0:"T",ORSTART<0:"T"_ORSTART,1:"T+"_ORSTART)
+6 SET ORSTOP=+$PIECE(INFO,U,4)
if ORSTOP>999
SET ORSTART=999
SET ORSTOP=$SELECT(ORSTOP=0:"T",ORSTOP<0:"T"_ORSTOP,1:"T+"_ORSTOP)
+7 SET ORINPT=+$PIECE(INFO,U,1)
SET ORINPT=$SELECT('ORINPT:"@",1:ORINPT)
+8 SET OROUTPT=+$PIECE(INFO,U,2)
SET OROUTPT=$SELECT('OROUTPT:"@",1:OROUTPT)
+9 DO EN^XPAR(ORUSER_";VA(200,","ORQQCSDR CS RANGE START",1,ORSTART)
+10 DO EN^XPAR(ORUSER_";VA(200,","ORQQCSDR CS RANGE STOP",1,ORSTOP)
+11 DO EN^XPAR(ORUSER_";VA(200,","ORQQLR DATE RANGE INPT",1,ORINPT)
+12 DO EN^XPAR(ORUSER_";VA(200,","ORQQLR DATE RANGE OUTPT",1,OROUTPT)
+13 ;
+14 QUIT
+15 ;
GETEAFL(Y) ; Get "future days limit" parameter setting for Enc appt selection.
+1 ;
+2 SET Y=$$GET^XPAR("DIV^SYS^PKG^USR","ORQQEAFL ENC APPT FUTURE LIMIT",1,"I")
+3 ;
+4 QUIT
+5 ;
CHKRNG(ORV,ORLIMIT) ; Check a "T-xx" or "T+xx" value.
+1 ;
+2 ; ORLIMIT must be a positive number.
+3 ;
+4 NEW ORNEG,ORPOS,ORT,ORTT,ORVALUE
+5 ;
+6 SET (ORNEG,ORPOS,ORT,ORTT)=0
+7 IF $GET(ORV)=""
QUIT ORV
+8 IF $GET(ORLIMIT)=0
QUIT ORV
+9 ;
+10 IF ORV["-"
SET ORNEG=1
+11 IF ORV["+"
SET ORPOS=1
+12 IF ORV["T"
SET ORT=1
+13 IF ORV["t"
SET ORTT=1
+14 SET ORVALUE=ORV
+15 IF ORT
SET ORVALUE=$PIECE(ORV,"T",2)
+16 IF ORTT
SET ORVALUE=$PIECE(ORV,"t",2)
+17 IF ORPOS
SET ORVALUE=$PIECE(ORVALUE,"+",2)
+18 IF ORNEG
SET ORVALUE=$PIECE(ORVALUE,"-",2)
+19 IF ORVALUE>ORLIMIT
SET ORVALUE=ORLIMIT
+20 ;
+21 SET ORV="T+"_ORVALUE
+22 IF ORNEG
SET ORV="T-"_ORVALUE
+23 ;
+24 QUIT ORV
+25 ;