ORLSTVIZ ; SLC/WAT - Editing Team List Visibility ;9/14/06 14:00
;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
;
;PROMPT THE USER FOR A LIST OR LISTS FOR WHICH TO SET VISIBILITY
;SHOW THE POSSIBLE OPTIONS FOR VISIBILITY:
; '0' = NOBODY
; '1' = ALLUSERS
;DIC,DIR,DIE - FileMan call
; DA - input variable to ^DIE - internal entry number of the file entry to be edited
; DR - input variable to ^DIE - as used here it's the field number in file stuffed with user-chosen VISBILITY value
; DTOUT - output from ^DIC-only defined when DIC times out
; DUOUT - output from ^DIC-only defined when user enters carat
; DIRUT - output from ^DIR-defined when user enters carat, presses Return/Enter, or times out
; Y - Returned from FM call-returns "-1" is lookup was unsuccessful
; Y(0) - Returned from ^DIC-hold external value of chosen VISIBILITY by user
; IEN - IEN of list from 100.21
; VIS - VISIBILITY value from 100.21
; CNT - counter/array index position
; LIST - NAME value from 100.21
; VIS - VISIBILITY value from 100.21
N DIC,DIR,DIE,DA,DR,DTOUT,DUOUT,DIRUT,Y,LIST,VIS,CNT,IEN,VAL
K ^TMP("ORLST",$J)
S DIC="^OR(100.21,",DIC(0)="AEQZ",CNT=0
W !,"You may set the VISIBILITY for one or more lists."
W !,"Please enter your selection(s) below."
LKUP F D ^DIC Q:$D(DTOUT)!($D(DUOUT))!(Y=-1) I Y>0 S ^TMP("ORLST",$J,CNT)=$P(Y,U,1) S ^TMP("ORLST",$J,CNT,CNT+1)=$P(Y,U,2) S ^TMP("ORLST",$J,CNT,CNT+1,CNT+2)=$$GET1^DIQ(100.21,^TMP("ORLST",$J,0),11) S CNT=CNT+1
Q:$D(DTOUT)!($D(DUOUT))
Q:'$D(^TMP("ORLST",$J,0))
;*********For each selected list(s), display current NAME and VISIBILITY*******
W !!,"You have chosen to update the following list(s):"
S (IEN,LIST,VIS)=""
F S IEN=$O(^TMP("ORLST",$J,IEN)) Q:IEN="" D
. S LIST=$O(^TMP("ORLST",$J,IEN,LIST)) Q:LIST="" W !?5,^TMP("ORLST",$J,IEN,LIST) D
. .S VIS=$O(^TMP("ORLST",$J,IEN,LIST,VIS)) Q:VIS="" W ?37,"Current value: "_^TMP("ORLST",$J,IEN,LIST,VIS)
W !!,""
;
READER S DIR(0)="100.21,11",DIR("B")="ALLUSERS"
D ^DIR Q:$D(DIRUT)
;
S VAL=Y(0) ;capture user-selected VISIBILTY value
EDIT S IEN="",DIE=DIC,DR="11///^S X=VAL" ; 11 is VISIBILITY field in 100.21
F S IEN=$O(^TMP("ORLST",$J,IEN)) Q:IEN="" D
.S DA=^TMP("ORLST",$J,IEN)
.D ^DIE
K ^TMP("ORLST",$J)
W @IOF
W !!,"Update Complete"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORLSTVIZ 2465 printed Nov 22, 2024@17:41:38 Page 2
ORLSTVIZ ; SLC/WAT - Editing Team List Visibility ;9/14/06 14:00
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
+2 ;
+3 ;PROMPT THE USER FOR A LIST OR LISTS FOR WHICH TO SET VISIBILITY
+4 ;SHOW THE POSSIBLE OPTIONS FOR VISIBILITY:
+5 ; '0' = NOBODY
+6 ; '1' = ALLUSERS
+7 ;DIC,DIR,DIE - FileMan call
+8 ; DA - input variable to ^DIE - internal entry number of the file entry to be edited
+9 ; DR - input variable to ^DIE - as used here it's the field number in file stuffed with user-chosen VISBILITY value
+10 ; DTOUT - output from ^DIC-only defined when DIC times out
+11 ; DUOUT - output from ^DIC-only defined when user enters carat
+12 ; DIRUT - output from ^DIR-defined when user enters carat, presses Return/Enter, or times out
+13 ; Y - Returned from FM call-returns "-1" is lookup was unsuccessful
+14 ; Y(0) - Returned from ^DIC-hold external value of chosen VISIBILITY by user
+15 ; IEN - IEN of list from 100.21
+16 ; VIS - VISIBILITY value from 100.21
+17 ; CNT - counter/array index position
+18 ; LIST - NAME value from 100.21
+19 ; VIS - VISIBILITY value from 100.21
+20 NEW DIC,DIR,DIE,DA,DR,DTOUT,DUOUT,DIRUT,Y,LIST,VIS,CNT,IEN,VAL
+21 KILL ^TMP("ORLST",$JOB)
+22 SET DIC="^OR(100.21,"
SET DIC(0)="AEQZ"
SET CNT=0
+23 WRITE !,"You may set the VISIBILITY for one or more lists."
+24 WRITE !,"Please enter your selection(s) below."
LKUP FOR
DO ^DIC
if $DATA(DTOUT)!($DATA(DUOUT))!(Y=-1)
QUIT
IF Y>0
SET ^TMP("ORLST",$JOB,CNT)=$PIECE(Y,U,1)
SET ^TMP("ORLST",$JOB,CNT,CNT+1)=$PIECE(Y,U,2)
SET ^TMP("ORLST",$JOB,CNT,CNT+1,CNT+2)=$$GET1^DIQ(100.21,^TMP("ORLST",$JOB,0),11)
SET CNT=CNT+1
+1 if $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+2 if '$DATA(^TMP("ORLST",$JOB,0))
QUIT
+3 ;*********For each selected list(s), display current NAME and VISIBILITY*******
+4 WRITE !!,"You have chosen to update the following list(s):"
+5 SET (IEN,LIST,VIS)=""
+6 FOR
SET IEN=$ORDER(^TMP("ORLST",$JOB,IEN))
if IEN=""
QUIT
Begin DoDot:1
+7 SET LIST=$ORDER(^TMP("ORLST",$JOB,IEN,LIST))
if LIST=""
QUIT
WRITE !?5,^TMP("ORLST",$JOB,IEN,LIST)
Begin DoDot:2
+8 SET VIS=$ORDER(^TMP("ORLST",$JOB,IEN,LIST,VIS))
if VIS=""
QUIT
WRITE ?37,"Current value: "_^TMP("ORLST",$JOB,IEN,LIST,VIS)
End DoDot:2
End DoDot:1
+9 WRITE !!,""
+10 ;
READER SET DIR(0)="100.21,11"
SET DIR("B")="ALLUSERS"
+1 DO ^DIR
if $DATA(DIRUT)
QUIT
+2 ;
+3 ;capture user-selected VISIBILTY value
SET VAL=Y(0)
EDIT ; 11 is VISIBILITY field in 100.21
SET IEN=""
SET DIE=DIC
SET DR="11///^S X=VAL"
+1 FOR
SET IEN=$ORDER(^TMP("ORLST",$JOB,IEN))
if IEN=""
QUIT
Begin DoDot:1
+2 SET DA=^TMP("ORLST",$JOB,IEN)
+3 DO ^DIE
End DoDot:1
+4 KILL ^TMP("ORLST",$JOB)
+5 WRITE @IOF
+6 WRITE !!,"Update Complete"
+7 QUIT