ORWUBCMA ; SLC/KCM/JLI - General Utilites for Windows Calls; 1/12/02
;;3.0;ORDER ENTRY/RESULTS REPORTING;**133**;Dec 17, 1997
;;OR BCMA ORDER COM;**133**;1/10/2002
;
USERINFO(REC) ; return relevant info for current user
; return DUZ^NAME^USRCLS^CANSIGN^ISPROVIDER^ORDERROLE^NOORDER^DTIME^
; COUNTDOWN^ENABLEVERIFY^NOTIFYAPPS^MSGHANG^DOMAIN^SERVICE^
; AUTOSAVE^INITTAB^LASTTAB
N X
S REC=DUZ_U_$P(^VA(200,DUZ,0),U)
S $P(REC,U,3)=$S($D(^XUSEC("ORES",DUZ)):3,$D(^XUSEC("ORELSE",DUZ)):2,$D(^XUSEC("OREMAS",DUZ)):1,1:0)
S $P(REC,U,4)=$D(^XUSEC("ORES",DUZ))&$D(^XUSEC("PROVIDER",DUZ))
S $P(REC,U,5)=$D(^XUSEC("PROVIDER",DUZ))
S $P(REC,U,6)=$$ORDROLE
S $P(REC,U,7)=$$GET^XPAR("USR^SYS^PKG","ORWOR DISABLE ORDERING",1,"I")
S $P(REC,U,8)=$$GET^XPAR("USR^SYS","ORWOR TIMEOUT CHART",1,"I")
I '$P(REC,U,8),$G(DTIME) S $P(REC,U,8)=DTIME
S $P(REC,U,9)=$$GET^XPAR("USR^SYS^PKG","ORWOR TIMEOUT COUNTDOWN",1,"I")
S X=$$GET^XPAR("USR^SYS^PKG","ORWOR ENABLE VERIFY",1,"I")
S $P(REC,U,10)=$S(X=1:1,X=2:0,1:'$P(REC,U,7))
S $P(REC,U,11)=$$GET^XPAR("USR^SYS^PKG","ORWOR BROADCAST MESSAGES",1,"I")
S $P(REC,U,12)=$$GET^XPAR("USR^SYS^PKG","ORWOR AUTO CLOSE PT MSG",1,"I")
S $P(REC,U,13)=$$KSP^XUPARAM("WHERE") ; domain
S $P(REC,U,14)=+$G(^VA(200,DUZ,5)) ; service/section
S $P(REC,U,15)=$$GET^XPAR("USR^SYS^PKG","ORWOR AUTOSAVE NOTE",1,"I")
S $P(REC,U,16)=$$GET^XPAR("USR^DIV^SYS^PKG","ORCH INITIAL TAB",1,"I")
S $P(REC,U,17)=$$GET^XPAR("USR^DIV^SYS^PKG","ORCH USE LAST TAB",1,"I")
S $P(REC,U,18)=$$GET^XPAR("USR^DIV^SYS^PKG","ORWOR DISABLE WEB ACCESS",1,"I")
S $P(REC,U,19)=$$GET^XPAR("SYS^PKG","ORWOR DISABLE HOLD ORDERS",1,"I")
Q
ORDROLE() ; returns the role a person takes in ordering
; VAL: 0=nokey, 1=clerk, 2=nurse, 3=physician, 4=student, 5=bad keys
I ($D(^XUSEC("OREMAS",DUZ))+$D(^XUSEC("ORELSE",DUZ))+$D(^XUSEC("ORES",DUZ)))>1 Q 5
I $D(^XUSEC("OREMAS",DUZ)) Q 1 ; clerk
I $D(^XUSEC("ORELSE",DUZ)) Q 2 ; nurse
I $D(^XUSEC("ORES",DUZ)),$D(^XUSEC("PROVIDER",DUZ)) Q 3 ; doctor
I $D(^XUSEC("PROVIDER",DUZ)) Q 4 ; student
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWUBCMA 2177 printed Nov 22, 2024@17:47:40 Page 2
ORWUBCMA ; SLC/KCM/JLI - General Utilites for Windows Calls; 1/12/02
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**133**;Dec 17, 1997
+2 ;;OR BCMA ORDER COM;**133**;1/10/2002
+3 ;
USERINFO(REC) ; return relevant info for current user
+1 ; return DUZ^NAME^USRCLS^CANSIGN^ISPROVIDER^ORDERROLE^NOORDER^DTIME^
+2 ; COUNTDOWN^ENABLEVERIFY^NOTIFYAPPS^MSGHANG^DOMAIN^SERVICE^
+3 ; AUTOSAVE^INITTAB^LASTTAB
+4 NEW X
+5 SET REC=DUZ_U_$PIECE(^VA(200,DUZ,0),U)
+6 SET $PIECE(REC,U,3)=$SELECT($DATA(^XUSEC("ORES",DUZ)):3,$DATA(^XUSEC("ORELSE",DUZ)):2,$DATA(^XUSEC("OREMAS",DUZ)):1,1:0)
+7 SET $PIECE(REC,U,4)=$DATA(^XUSEC("ORES",DUZ))&$DATA(^XUSEC("PROVIDER",DUZ))
+8 SET $PIECE(REC,U,5)=$DATA(^XUSEC("PROVIDER",DUZ))
+9 SET $PIECE(REC,U,6)=$$ORDROLE
+10 SET $PIECE(REC,U,7)=$$GET^XPAR("USR^SYS^PKG","ORWOR DISABLE ORDERING",1,"I")
+11 SET $PIECE(REC,U,8)=$$GET^XPAR("USR^SYS","ORWOR TIMEOUT CHART",1,"I")
+12 IF '$PIECE(REC,U,8)
IF $GET(DTIME)
SET $PIECE(REC,U,8)=DTIME
+13 SET $PIECE(REC,U,9)=$$GET^XPAR("USR^SYS^PKG","ORWOR TIMEOUT COUNTDOWN",1,"I")
+14 SET X=$$GET^XPAR("USR^SYS^PKG","ORWOR ENABLE VERIFY",1,"I")
+15 SET $PIECE(REC,U,10)=$SELECT(X=1:1,X=2:0,1:'$PIECE(REC,U,7))
+16 SET $PIECE(REC,U,11)=$$GET^XPAR("USR^SYS^PKG","ORWOR BROADCAST MESSAGES",1,"I")
+17 SET $PIECE(REC,U,12)=$$GET^XPAR("USR^SYS^PKG","ORWOR AUTO CLOSE PT MSG",1,"I")
+18 ; domain
SET $PIECE(REC,U,13)=$$KSP^XUPARAM("WHERE")
+19 ; service/section
SET $PIECE(REC,U,14)=+$GET(^VA(200,DUZ,5))
+20 SET $PIECE(REC,U,15)=$$GET^XPAR("USR^SYS^PKG","ORWOR AUTOSAVE NOTE",1,"I")
+21 SET $PIECE(REC,U,16)=$$GET^XPAR("USR^DIV^SYS^PKG","ORCH INITIAL TAB",1,"I")
+22 SET $PIECE(REC,U,17)=$$GET^XPAR("USR^DIV^SYS^PKG","ORCH USE LAST TAB",1,"I")
+23 SET $PIECE(REC,U,18)=$$GET^XPAR("USR^DIV^SYS^PKG","ORWOR DISABLE WEB ACCESS",1,"I")
+24 SET $PIECE(REC,U,19)=$$GET^XPAR("SYS^PKG","ORWOR DISABLE HOLD ORDERS",1,"I")
+25 QUIT
ORDROLE() ; returns the role a person takes in ordering
+1 ; VAL: 0=nokey, 1=clerk, 2=nurse, 3=physician, 4=student, 5=bad keys
+2 IF ($DATA(^XUSEC("OREMAS",DUZ))+$DATA(^XUSEC("ORELSE",DUZ))+$DATA(^XUSEC("ORES",DUZ)))>1
QUIT 5
+3 ; clerk
IF $DATA(^XUSEC("OREMAS",DUZ))
QUIT 1
+4 ; nurse
IF $DATA(^XUSEC("ORELSE",DUZ))
QUIT 2
+5 ; doctor
IF $DATA(^XUSEC("ORES",DUZ))
IF $DATA(^XUSEC("PROVIDER",DUZ))
QUIT 3
+6 ; student
IF $DATA(^XUSEC("PROVIDER",DUZ))
QUIT 4
+7 QUIT 0