Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORWTPD1

ORWTPD1.m

Go to the documentation of this file.
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
 ;