PSOERPR1 ;BIRM/MFR - eRx Holding Queue Preferences - Rx List View Queue ;08/29/22
;;7.0;OUTPATIENT PHARMACY;**700,746**;DEC 1997;Build 106
;
EN ; - Entry Point
N DIR,DIRUT,DIROUT,PSOPRIEN,DA,Y,X
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
;
S (PSOCHNG,PSOQUIT)=0 D FULL^VALM1 W !
;
; - Reset user/division preferences
I $D(^PS(52.35,PSOPRIEN,"RXV",DUZ)) D
. D DISPLAY
. S DIR("A")=" Delete this saved default view? "
. S DIR(0)="YA",DIR("B")="NO" D ^DIR I $D(DIRUT)!$D(DIROUT) S PSOQUIT=1 Q
. I Y=1 D DELETE,LOAD
. W !
I PSOQUIT Q
;
LKBKD ; - Look Back Days
K DIR,DIRUT,DIROUT,SAVEX,X,Y
S DIR(0)="52.353,1",DIR("B")=PSOLKBKD
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"LKBKD")
W $S(X>0:" DAYS",1:" (TODAY'S)") S PSOLKBKD=X
D CHANGED("LKBKD",PSOLKBKD)
;
SRTBY ; - Sort By
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,2",DIR("B")=PSOSRTBY
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"SRTBY")
S PSOSRTBY=Y D CHANGED("SRTBY",PSOSRTBY)
;
ORDER ; - Sort Order
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,3",DIR("B")=PSORDER
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"ORDER")
S PSORDER=Y D CHANGED("ORDER",PSORDER)
;
DETDP ; - Display Details
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,10",DIR("B")=$S(PSODETDP:"YES",1:"NO")
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"DETDP")
S PSODETDP=Y D CHANGED("DETDP",PSODETDP)
;
INCCS ; - Include CS/Non-CS
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,8",DIR("B")=PSOCSERX
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"ORDER")
S PSOCSERX=Y D CHANGED("INCCS",PSOCSERX)
;
CSSCH ; - CS Schedule
I PSOCSERX="Non-CS" G MAXQSIZ
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,9",DIR("B")=$S(PSOCSSCH=1:"SCHEDULE II ONLY",PSOCSSCH=2:"SCHEDULES III - V",1:"SCHEDULES II - V")
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"ORDER")
S PSOCSSCH=Y D CHANGED("CSSCH",PSOCSSCH)
;
GRPCS ; - Group By CS/Non-CS
I PSOCSERX="Non-CS" G MAXQSIZ
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,4",DIR("B")=$S(PSOCSGRP:"YES",1:"NO")
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"ORDER")
S PSOCSGRP=Y D CHANGED("GRPCS",PSOCSGRP)
;
ALLST ; - Display All Statuses
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,5",DIR("B")=$S(PSOALLST:"YES",1:"NO")
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"ALLST")
S PSOALLST=Y D CHANGED("ALLST",PSOALLST)
;
MAXQSIZ ; - Maximum Queue Size
K DIR,DIRUT,DIROUT,X,Y
S DIR(0)="52.353,7",DIR("B")=PSOMAXQS
D ^DIR I $D(DIRUT)!$D(DIROUT) G @$$GOTO(X,"MAXQSIZ")
S PSOMAXQS=Y D CHANGED("MAXQSIZ",PSOMAXQS)
;
EXIT ; Exit
;
; - Save view?
I $G(PSOCHNG) D
. S PSORFRSH=1
. W ! S DIR(0)="YA",DIR("B")="NO",DIR("A")="Save as your default view? "
. D ^DIR I $D(DIRUT)!$D(DIROUT)!(Y=0) Q
. D SAVE
;
S VALMBCK="R"
;
END Q
;
DISPLAY ; - Displays the current view
N LN,PSOPRIEN,PRFDAT,PREFS
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
;
I $D(^PS(52.35,PSOPRIEN,"RXV",DUZ)) D
. D GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9;10","IE","PRFDAT")
. M PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
. W !?5,"Your saved default view:"
. S $P(LN,"-",24)="" W !?5,LN
. W !?5,"LOOK BACK DAYS : ",$G(PREFS(1,"E"))," DAYS"
. W !?5,"SORT BY : ",$G(PREFS(2,"E"))
. W !?5,"SORT ORDER : ",$G(PREFS(3,"E"))
. W !?5,"DISPLAY DETAILS : ",$G(PREFS(10,"E"))
. W !?5,"INCLUDE CS/NON-CS : ",$G(PREFS(8,"E"))
. I $G(PREFS(8,"I"))'="Non-CS" D
. . W !?5,"CS SCHEDULE : ",$G(PREFS(9,"E"))
. . W !?5,"GROUP BY CS/NON-CS : ",$G(PREFS(4,"E"))
. W !?5,"INCLUDE ALL STATUSES: ",$G(PREFS(5,"E"))
. W !?5,"MAXIMUM QUEUE SIZE : ",$G(PREFS(7,"E"))
. W !
Q
;
GOTO(INPUT,HOME) ; - Directed up-arrow
N GOTO,TAG,TRGT
I $P(INPUT,"^",2)="" S PSOQUIT=1 Q "EXIT"
;
S TRGT=$P(INPUT,"^",2)
S TAG("LOOK BACK DAYS")="LKBKD"
S TAG("SORT BY")="SRTBY"
S TAG("SORT ORDER")="ORDER"
S TAG("DISPLAY DETAILS")="DETDP"
S TAG("INCLUDE CS/NON-CS")="INCCS"
S TAG("CS SCHEDULE")="CSSCH"
S TAG("GROUP BY CS/NON-CS")="GRPCS"
S TAG("INCLUDE ALL STATUSES")="ALLST"
S TAG("MAXIMUM QUEUE SIZE")="MAXQSIZ"
;
S GOTO=HOME
S TAG="" F S TAG=$O(TAG(TAG)) Q:TAG="" I $E(TAG,1,$L(TRGT))=TRGT S GOTO=TAG(TAG) Q
I GOTO=HOME W " ??",$C(7)
;
Q GOTO
;
LOAD ; Loading Factory/Division/User preferences for Single Patient View
;Output: PSOLKBKD - Look Back Days
; PSOSRTBY - Sort By
; PSORDER - Sort Order ("A":Asc,"D":Desc)
; PSODETDP - Display Details (1:ON/0:OFF)
; PSOCSERX - Include CS/Non-CS (C:CS Only/N:Non-CS Only/B:Both)
; PSOSCSCH - CS Schedule (1:II Only/2:III-V/3:II-V)
; PSOCSGRP - Group by CS/Non-CS (1:YES/0:NO)
; PSOALLST - Include All Statuses (1:YES/0:NO)
; PSOMAXQS - Maximum Queue Size
; - 'Factory' Defaults
I $G(RESETLBD)!'$G(PSOLKBKD) D
. S PSOLKBKD=365
. I $$GET1^DIQ(59,PSOSITE,10.2) S PSOLKBKD=$$GET1^DIQ(59,PSOSITE,10.2)
S PSOSRTBY="RE",PSORDER="A",PSOCSERX="B",PSOCSSCH=3,(PSOCSGRP,PSOALLST,PSODETDP)=0,PSOMAXQS=999
;
N PSOPRIEN
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
;
; - User's preferences
I $D(^PS(52.35,PSOPRIEN,"RXV",DUZ,0)) D SET Q
;
Q
;
CHANGED(FIELD,VALUE) ; - Sets PSOCHNG so the list can be refreshed
; FIELD - Field to be checked if was changed/edited
; VALUE - New Value for the field
I $G(PSOCHNG) Q
;
N PSOPRIEN,PRFDAT,PREFS
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
; - Saved User's preferences
D GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9","IE","PRFDAT")
M PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
;
I FIELD="LKBKD",VALUE'=$G(PREFS(1,"I")) S PSOCHNG=1 Q
I FIELD="SRTBY",VALUE'=$G(PREFS(2,"I")) S PSOCHNG=1 Q
I FIELD="ORDER",VALUE'=$G(PREFS(3,"I")) S PSOCHNG=1 Q
I FIELD="DETDP",VALUE'=$G(PREFS(10,"I")) S PSOCHNG=1 Q
I FIELD="INCCS",VALUE'=$G(PREFS(8,"I")) S PSOCHNG=1 Q
I FIELD="CSSCH",VALUE'=$G(PREFS(9,"I")) S PSOCHNG=1 Q
I FIELD="GRPCS",VALUE'=$G(PREFS(4,"I")) S PSOCHNG=1 Q
I FIELD="ALLST",VALUE'=$G(PREFS(5,"I")) S PSOCHNG=1 Q
I FIELD="MSGTYPE",VALUE'=$G(PREFS(6,"I")) S PSOCHNG=1 Q
I FIELD="MAXQSIZ",VALUE'=$G(PREFS(7,"I")) S PSOCHNG=1 Q
;
Q
;
SET ; Sets Preferences Variables
N PSOPRIEN,PRFDAT,PREFS
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
D GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9;10","I","PRFDAT")
M PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
I $G(RESETLBD) S X=$G(PREFS(1,"I")) I X'="" S PSOLKBKD=X
S X=$G(PREFS(2,"I")) I X'="" S PSOSRTBY=X
S X=$G(PREFS(3,"I")) I X'="" S PSORDER=X
S X=$G(PREFS(8,"I")) I X'="" S PSOCSERX=X
S X=$G(PREFS(9,"I")) I X'="" S PSOCSSCH=X
S X=$G(PREFS(4,"I")) I X'="" S PSOCSGRP=X
S X=$G(PREFS(5,"I")) I X'="" S PSOALLST=X
S X=$G(PREFS(7,"I")) I X'="" S PSOMAXQS=X
S X=$G(PREFS(10,"I")) I X'="" S PSODETDP=X
Q
;
SAVE ; - Saves User's Preferences
N DIE,DR,DA,PSOPRIEN
;
S PSOPRIEN=+$O(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0)) I 'PSOPRIEN Q
;
W !!,"Saving..."
;
I '$D(^PS(52.35,PSOPRIEN,"RXV",DUZ,0)) D
. N %,DIC,DR,DA,X,DINUM,DLAYGO,DD,DO
. S DIC="^PS(52.35,"_PSOPRIEN_",""RXV"","
. S DA(1)=PSOPRIEN,(DINUM,X)=DUZ,DIC(0)=""
. K DD,DO D FILE^DICN K DD,DO
;
S DR="1///"_PSOLKBKD_";2///"_PSOSRTBY_";3///"_PSORDER_";8///"_PSOCSERX
S DR=DR_";9///"_$S(PSOCSERX'="Non-CS":PSOCSSCH,1:"@")_";4///"_$S(PSOCSERX'="Non-CS":PSOCSGRP,1:"@")
S DR=DR_";5///"_PSOALLST_";7///"_PSOMAXQS_";10///"_PSODETDP
;
S DIE="^PS(52.35,"_PSOPRIEN_",""RXV"",",DA(1)=PSOPRIEN,DA=DUZ
D ^DIE H 1 W "OK!" H .5
Q
;
DELETE ; - Deletes user/division preferences
N DIK,DA,DIE,DR
;
W !!,"Deleting..."
;
S DIK="^PS(52.35,"_PSOPRIEN_",""RXV"",",DA(1)=PSOPRIEN,DA=DUZ
D ^DIK H 1 W "OK!"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOERPR1 7900 printed Dec 13, 2024@02:27:48 Page 2
PSOERPR1 ;BIRM/MFR - eRx Holding Queue Preferences - Rx List View Queue ;08/29/22
+1 ;;7.0;OUTPATIENT PHARMACY;**700,746**;DEC 1997;Build 106
+2 ;
EN ; - Entry Point
+1 NEW DIR,DIRUT,DIROUT,PSOPRIEN,DA,Y,X
+2 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+3 ;
+4 SET (PSOCHNG,PSOQUIT)=0
DO FULL^VALM1
WRITE !
+5 ;
+6 ; - Reset user/division preferences
+7 IF $DATA(^PS(52.35,PSOPRIEN,"RXV",DUZ))
Begin DoDot:1
+8 DO DISPLAY
+9 SET DIR("A")=" Delete this saved default view? "
+10 SET DIR(0)="YA"
SET DIR("B")="NO"
DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
SET PSOQUIT=1
QUIT
+11 IF Y=1
DO DELETE
DO LOAD
+12 WRITE !
End DoDot:1
+13 IF PSOQUIT
QUIT
+14 ;
LKBKD ; - Look Back Days
+1 KILL DIR,DIRUT,DIROUT,SAVEX,X,Y
+2 SET DIR(0)="52.353,1"
SET DIR("B")=PSOLKBKD
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"LKBKD")
+4 WRITE $SELECT(X>0:" DAYS",1:" (TODAY'S)")
SET PSOLKBKD=X
+5 DO CHANGED("LKBKD",PSOLKBKD)
+6 ;
SRTBY ; - Sort By
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,2"
SET DIR("B")=PSOSRTBY
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"SRTBY")
+4 SET PSOSRTBY=Y
DO CHANGED("SRTBY",PSOSRTBY)
+5 ;
ORDER ; - Sort Order
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,3"
SET DIR("B")=PSORDER
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"ORDER")
+4 SET PSORDER=Y
DO CHANGED("ORDER",PSORDER)
+5 ;
DETDP ; - Display Details
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,10"
SET DIR("B")=$SELECT(PSODETDP:"YES",1:"NO")
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"DETDP")
+4 SET PSODETDP=Y
DO CHANGED("DETDP",PSODETDP)
+5 ;
INCCS ; - Include CS/Non-CS
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,8"
SET DIR("B")=PSOCSERX
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"ORDER")
+4 SET PSOCSERX=Y
DO CHANGED("INCCS",PSOCSERX)
+5 ;
CSSCH ; - CS Schedule
+1 IF PSOCSERX="Non-CS"
GOTO MAXQSIZ
+2 KILL DIR,DIRUT,DIROUT,X,Y
+3 SET DIR(0)="52.353,9"
SET DIR("B")=$SELECT(PSOCSSCH=1:"SCHEDULE II ONLY",PSOCSSCH=2:"SCHEDULES III - V",1:"SCHEDULES II - V")
+4 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"ORDER")
+5 SET PSOCSSCH=Y
DO CHANGED("CSSCH",PSOCSSCH)
+6 ;
GRPCS ; - Group By CS/Non-CS
+1 IF PSOCSERX="Non-CS"
GOTO MAXQSIZ
+2 KILL DIR,DIRUT,DIROUT,X,Y
+3 SET DIR(0)="52.353,4"
SET DIR("B")=$SELECT(PSOCSGRP:"YES",1:"NO")
+4 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"ORDER")
+5 SET PSOCSGRP=Y
DO CHANGED("GRPCS",PSOCSGRP)
+6 ;
ALLST ; - Display All Statuses
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,5"
SET DIR("B")=$SELECT(PSOALLST:"YES",1:"NO")
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"ALLST")
+4 SET PSOALLST=Y
DO CHANGED("ALLST",PSOALLST)
+5 ;
MAXQSIZ ; - Maximum Queue Size
+1 KILL DIR,DIRUT,DIROUT,X,Y
+2 SET DIR(0)="52.353,7"
SET DIR("B")=PSOMAXQS
+3 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)
GOTO @$$GOTO(X,"MAXQSIZ")
+4 SET PSOMAXQS=Y
DO CHANGED("MAXQSIZ",PSOMAXQS)
+5 ;
EXIT ; Exit
+1 ;
+2 ; - Save view?
+3 IF $GET(PSOCHNG)
Begin DoDot:1
+4 SET PSORFRSH=1
+5 WRITE !
SET DIR(0)="YA"
SET DIR("B")="NO"
SET DIR("A")="Save as your default view? "
+6 DO ^DIR
IF $DATA(DIRUT)!$DATA(DIROUT)!(Y=0)
QUIT
+7 DO SAVE
End DoDot:1
+8 ;
+9 SET VALMBCK="R"
+10 ;
END QUIT
+1 ;
DISPLAY ; - Displays the current view
+1 NEW LN,PSOPRIEN,PRFDAT,PREFS
+2 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+3 ;
+4 IF $DATA(^PS(52.35,PSOPRIEN,"RXV",DUZ))
Begin DoDot:1
+5 DO GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9;10","IE","PRFDAT")
+6 MERGE PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
+7 WRITE !?5,"Your saved default view:"
+8 SET $PIECE(LN,"-",24)=""
WRITE !?5,LN
+9 WRITE !?5,"LOOK BACK DAYS : ",$GET(PREFS(1,"E"))," DAYS"
+10 WRITE !?5,"SORT BY : ",$GET(PREFS(2,"E"))
+11 WRITE !?5,"SORT ORDER : ",$GET(PREFS(3,"E"))
+12 WRITE !?5,"DISPLAY DETAILS : ",$GET(PREFS(10,"E"))
+13 WRITE !?5,"INCLUDE CS/NON-CS : ",$GET(PREFS(8,"E"))
+14 IF $GET(PREFS(8,"I"))'="Non-CS"
Begin DoDot:2
+15 WRITE !?5,"CS SCHEDULE : ",$GET(PREFS(9,"E"))
+16 WRITE !?5,"GROUP BY CS/NON-CS : ",$GET(PREFS(4,"E"))
End DoDot:2
+17 WRITE !?5,"INCLUDE ALL STATUSES: ",$GET(PREFS(5,"E"))
+18 WRITE !?5,"MAXIMUM QUEUE SIZE : ",$GET(PREFS(7,"E"))
+19 WRITE !
End DoDot:1
+20 QUIT
+21 ;
GOTO(INPUT,HOME) ; - Directed up-arrow
+1 NEW GOTO,TAG,TRGT
+2 IF $PIECE(INPUT,"^",2)=""
SET PSOQUIT=1
QUIT "EXIT"
+3 ;
+4 SET TRGT=$PIECE(INPUT,"^",2)
+5 SET TAG("LOOK BACK DAYS")="LKBKD"
+6 SET TAG("SORT BY")="SRTBY"
+7 SET TAG("SORT ORDER")="ORDER"
+8 SET TAG("DISPLAY DETAILS")="DETDP"
+9 SET TAG("INCLUDE CS/NON-CS")="INCCS"
+10 SET TAG("CS SCHEDULE")="CSSCH"
+11 SET TAG("GROUP BY CS/NON-CS")="GRPCS"
+12 SET TAG("INCLUDE ALL STATUSES")="ALLST"
+13 SET TAG("MAXIMUM QUEUE SIZE")="MAXQSIZ"
+14 ;
+15 SET GOTO=HOME
+16 SET TAG=""
FOR
SET TAG=$ORDER(TAG(TAG))
if TAG=""
QUIT
IF $EXTRACT(TAG,1,$LENGTH(TRGT))=TRGT
SET GOTO=TAG(TAG)
QUIT
+17 IF GOTO=HOME
WRITE " ??",$CHAR(7)
+18 ;
+19 QUIT GOTO
+20 ;
LOAD ; Loading Factory/Division/User preferences for Single Patient View
+1 ;Output: PSOLKBKD - Look Back Days
+2 ; PSOSRTBY - Sort By
+3 ; PSORDER - Sort Order ("A":Asc,"D":Desc)
+4 ; PSODETDP - Display Details (1:ON/0:OFF)
+5 ; PSOCSERX - Include CS/Non-CS (C:CS Only/N:Non-CS Only/B:Both)
+6 ; PSOSCSCH - CS Schedule (1:II Only/2:III-V/3:II-V)
+7 ; PSOCSGRP - Group by CS/Non-CS (1:YES/0:NO)
+8 ; PSOALLST - Include All Statuses (1:YES/0:NO)
+9 ; PSOMAXQS - Maximum Queue Size
+10 ; - 'Factory' Defaults
+11 IF $GET(RESETLBD)!'$GET(PSOLKBKD)
Begin DoDot:1
+12 SET PSOLKBKD=365
+13 IF $$GET1^DIQ(59,PSOSITE,10.2)
SET PSOLKBKD=$$GET1^DIQ(59,PSOSITE,10.2)
End DoDot:1
+14 SET PSOSRTBY="RE"
SET PSORDER="A"
SET PSOCSERX="B"
SET PSOCSSCH=3
SET (PSOCSGRP,PSOALLST,PSODETDP)=0
SET PSOMAXQS=999
+15 ;
+16 NEW PSOPRIEN
+17 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+18 ;
+19 ; - User's preferences
+20 IF $DATA(^PS(52.35,PSOPRIEN,"RXV",DUZ,0))
DO SET
QUIT
+21 ;
+22 QUIT
+23 ;
CHANGED(FIELD,VALUE) ; - Sets PSOCHNG so the list can be refreshed
+1 ; FIELD - Field to be checked if was changed/edited
+2 ; VALUE - New Value for the field
+3 IF $GET(PSOCHNG)
QUIT
+4 ;
+5 NEW PSOPRIEN,PRFDAT,PREFS
+6 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+7 ; - Saved User's preferences
+8 DO GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9","IE","PRFDAT")
+9 MERGE PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
+10 ;
+11 IF FIELD="LKBKD"
IF VALUE'=$GET(PREFS(1,"I"))
SET PSOCHNG=1
QUIT
+12 IF FIELD="SRTBY"
IF VALUE'=$GET(PREFS(2,"I"))
SET PSOCHNG=1
QUIT
+13 IF FIELD="ORDER"
IF VALUE'=$GET(PREFS(3,"I"))
SET PSOCHNG=1
QUIT
+14 IF FIELD="DETDP"
IF VALUE'=$GET(PREFS(10,"I"))
SET PSOCHNG=1
QUIT
+15 IF FIELD="INCCS"
IF VALUE'=$GET(PREFS(8,"I"))
SET PSOCHNG=1
QUIT
+16 IF FIELD="CSSCH"
IF VALUE'=$GET(PREFS(9,"I"))
SET PSOCHNG=1
QUIT
+17 IF FIELD="GRPCS"
IF VALUE'=$GET(PREFS(4,"I"))
SET PSOCHNG=1
QUIT
+18 IF FIELD="ALLST"
IF VALUE'=$GET(PREFS(5,"I"))
SET PSOCHNG=1
QUIT
+19 IF FIELD="MSGTYPE"
IF VALUE'=$GET(PREFS(6,"I"))
SET PSOCHNG=1
QUIT
+20 IF FIELD="MAXQSIZ"
IF VALUE'=$GET(PREFS(7,"I"))
SET PSOCHNG=1
QUIT
+21 ;
+22 QUIT
+23 ;
SET ; Sets Preferences Variables
+1 NEW PSOPRIEN,PRFDAT,PREFS
+2 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+3 DO GETS^DIQ(52.353,DUZ_","_PSOPRIEN_",","1;2;3;4;5;6;7;8;9;10","I","PRFDAT")
+4 MERGE PREFS=PRFDAT(52.353,DUZ_","_PSOPRIEN_",")
+5 IF $GET(RESETLBD)
SET X=$GET(PREFS(1,"I"))
IF X'=""
SET PSOLKBKD=X
+6 SET X=$GET(PREFS(2,"I"))
IF X'=""
SET PSOSRTBY=X
+7 SET X=$GET(PREFS(3,"I"))
IF X'=""
SET PSORDER=X
+8 SET X=$GET(PREFS(8,"I"))
IF X'=""
SET PSOCSERX=X
+9 SET X=$GET(PREFS(9,"I"))
IF X'=""
SET PSOCSSCH=X
+10 SET X=$GET(PREFS(4,"I"))
IF X'=""
SET PSOCSGRP=X
+11 SET X=$GET(PREFS(5,"I"))
IF X'=""
SET PSOALLST=X
+12 SET X=$GET(PREFS(7,"I"))
IF X'=""
SET PSOMAXQS=X
+13 SET X=$GET(PREFS(10,"I"))
IF X'=""
SET PSODETDP=X
+14 QUIT
+15 ;
SAVE ; - Saves User's Preferences
+1 NEW DIE,DR,DA,PSOPRIEN
+2 ;
+3 SET PSOPRIEN=+$ORDER(^PS(52.35,"B","ERX HOLDING QUEUE PREFERENCES",0))
IF 'PSOPRIEN
QUIT
+4 ;
+5 WRITE !!,"Saving..."
+6 ;
+7 IF '$DATA(^PS(52.35,PSOPRIEN,"RXV",DUZ,0))
Begin DoDot:1
+8 NEW %,DIC,DR,DA,X,DINUM,DLAYGO,DD,DO
+9 SET DIC="^PS(52.35,"_PSOPRIEN_",""RXV"","
+10 SET DA(1)=PSOPRIEN
SET (DINUM,X)=DUZ
SET DIC(0)=""
+11 KILL DD,DO
DO FILE^DICN
KILL DD,DO
End DoDot:1
+12 ;
+13 SET DR="1///"_PSOLKBKD_";2///"_PSOSRTBY_";3///"_PSORDER_";8///"_PSOCSERX
+14 SET DR=DR_";9///"_$SELECT(PSOCSERX'="Non-CS":PSOCSSCH,1:"@")_";4///"_$SELECT(PSOCSERX'="Non-CS":PSOCSGRP,1:"@")
+15 SET DR=DR_";5///"_PSOALLST_";7///"_PSOMAXQS_";10///"_PSODETDP
+16 ;
+17 SET DIE="^PS(52.35,"_PSOPRIEN_",""RXV"","
SET DA(1)=PSOPRIEN
SET DA=DUZ
+18 DO ^DIE
HANG 1
WRITE "OK!"
HANG .5
+19 QUIT
+20 ;
DELETE ; - Deletes user/division preferences
+1 NEW DIK,DA,DIE,DR
+2 ;
+3 WRITE !!,"Deleting..."
+4 ;
+5 SET DIK="^PS(52.35,"_PSOPRIEN_",""RXV"","
SET DA(1)=PSOPRIEN
SET DA=DUZ
+6 DO ^DIK
HANG 1
WRITE "OK!"
+7 QUIT