FSCLMPNF ;SLC/STAFF NOIS List Manager Protocol Notification Find ;1/13/98 12:58
;;1.1;NOIS;;Sep 06, 1998
;
NOTIFY ; from FSCLMPN
N OK,TYPE,USER,USERNAME K ^TMP("FSC LIST",$J)
S USER=DUZ D USER(.USER,.USERNAME,.OK)
I 'OK Q
S TYPE="ONLY" D CALLS(.TYPE,USERNAME,.OK)
I 'OK Q
I TYPE="ALL" D ALL(USER)
I TYPE="ONLY" D ONLY(USER)
S FSCQUERY=1 S:FSCLNAME'["(MODIFIED)" FSCLNAME=FSCLNAME_" (MODIFIED)"
S VALMBG=1 K VALMQUIT D ENTRY^FSCLML I $D(VALMQUIT) S VALMBCK="Q" Q
D HEADER^FSCLML
Q
;
USER(USER,USERNAME,OK) ;
N DIC,X,Y K DIC S OK=0
S DIC=200,DIC(0)="AEMQ",DIC("A")="Notification user: ",DIC("B")=$$VALUE^FSCGET(USER,7100,2.1)
D ^DIC K DIC
I Y<1 Q
S USER=+Y,USERNAME=$P(Y,U,2),OK=1
Q
;
CALLS(TYPE,USERNAME,OK) ;
N DIR,X,Y K DIR S OK=0
S DIR(0)="SAMO^ALL:ALL;ONLY:ONLY"
S DIR("A")="Find (A)ll calls for "_USERNAME_" or (O)nly those calls on this list? ",DIR("B")=TYPE
S DIR("?",1)="Enter ALL to find all calls scheduled for this person."
S DIR("?",2)="Enter ONLY to find only those calls scheduled for this person"
S DIR("?",3)="that are on this list."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DTOUT)!$D(DUOUT) Q
S TYPE=Y,OK=1
Q
;
ALL(USER) ; from FSCRPCN
N CALL,LNUM,NUM
S NUM=0 F S NUM=$O(^FSCD("NOTIFY","AUSER",USER,NUM)) Q:NUM<1 D
.S CALL=+$G(^FSCD("NOTIFY",NUM,0)) I 'CALL Q
.S ^TMP("FSC LIST",$J,CALL)=""
S LNUM=0 F S LNUM=$O(^FSC("LIST","C",USER,LNUM)) Q:LNUM<1 D
.S NUM=0 F S NUM=$O(^FSCD("NOTIFY","ALIST",LNUM,NUM)) Q:NUM<1 D
..S CALL=+$G(^FSCD("NOTIFY",NUM,0)) I 'CALL Q
..S ^TMP("FSC LIST",$J,CALL)=""
Q
;
ONLY(USER) ;
N CALL,DONE,LNUM
S CALL=0 F S CALL=$O(^TMP("FSC LIST CALLS",$J,"CX",CALL)) Q:CALL<1 D
.I $D(^FSCD("NOTIFY","ACUSER",CALL,USER)) S ^TMP("FSC LIST",$J,CALL)="" Q
.S (DONE,LNUM)=0 F S LNUM=$O(^FSCD("NOTIFY","ACLIST",CALL,LNUM)) Q:LNUM<1 D Q:DONE
..I $D(^FSC("LIST","C",USER,LNUM)) S ^TMP("FSC LIST",$J,CALL)="",DONE=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCLMPNF 1996 printed Dec 13, 2024@02:18:22 Page 2
FSCLMPNF ;SLC/STAFF NOIS List Manager Protocol Notification Find ;1/13/98 12:58
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
NOTIFY ; from FSCLMPN
+1 NEW OK,TYPE,USER,USERNAME
KILL ^TMP("FSC LIST",$JOB)
+2 SET USER=DUZ
DO USER(.USER,.USERNAME,.OK)
+3 IF 'OK
QUIT
+4 SET TYPE="ONLY"
DO CALLS(.TYPE,USERNAME,.OK)
+5 IF 'OK
QUIT
+6 IF TYPE="ALL"
DO ALL(USER)
+7 IF TYPE="ONLY"
DO ONLY(USER)
+8 SET FSCQUERY=1
if FSCLNAME'["(MODIFIED)"
SET FSCLNAME=FSCLNAME_" (MODIFIED)"
+9 SET VALMBG=1
KILL VALMQUIT
DO ENTRY^FSCLML
IF $DATA(VALMQUIT)
SET VALMBCK="Q"
QUIT
+10 DO HEADER^FSCLML
+11 QUIT
+12 ;
USER(USER,USERNAME,OK) ;
+1 NEW DIC,X,Y
KILL DIC
SET OK=0
+2 SET DIC=200
SET DIC(0)="AEMQ"
SET DIC("A")="Notification user: "
SET DIC("B")=$$VALUE^FSCGET(USER,7100,2.1)
+3 DO ^DIC
KILL DIC
+4 IF Y<1
QUIT
+5 SET USER=+Y
SET USERNAME=$PIECE(Y,U,2)
SET OK=1
+6 QUIT
+7 ;
CALLS(TYPE,USERNAME,OK) ;
+1 NEW DIR,X,Y
KILL DIR
SET OK=0
+2 SET DIR(0)="SAMO^ALL:ALL;ONLY:ONLY"
+3 SET DIR("A")="Find (A)ll calls for "_USERNAME_" or (O)nly those calls on this list? "
SET DIR("B")=TYPE
+4 SET DIR("?",1)="Enter ALL to find all calls scheduled for this person."
+5 SET DIR("?",2)="Enter ONLY to find only those calls scheduled for this person"
+6 SET DIR("?",3)="that are on this list."
+7 SET DIR("?")="^D HELP^FSCU(.DIR)"
+8 SET DIR("??")="FSC U1 NOIS"
+9 DO ^DIR
KILL DIR
+10 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+11 SET TYPE=Y
SET OK=1
+12 QUIT
+13 ;
ALL(USER) ; from FSCRPCN
+1 NEW CALL,LNUM,NUM
+2 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("NOTIFY","AUSER",USER,NUM))
if NUM<1
QUIT
Begin DoDot:1
+3 SET CALL=+$GET(^FSCD("NOTIFY",NUM,0))
IF 'CALL
QUIT
+4 SET ^TMP("FSC LIST",$JOB,CALL)=""
End DoDot:1
+5 SET LNUM=0
FOR
SET LNUM=$ORDER(^FSC("LIST","C",USER,LNUM))
if LNUM<1
QUIT
Begin DoDot:1
+6 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("NOTIFY","ALIST",LNUM,NUM))
if NUM<1
QUIT
Begin DoDot:2
+7 SET CALL=+$GET(^FSCD("NOTIFY",NUM,0))
IF 'CALL
QUIT
+8 SET ^TMP("FSC LIST",$JOB,CALL)=""
End DoDot:2
End DoDot:1
+9 QUIT
+10 ;
ONLY(USER) ;
+1 NEW CALL,DONE,LNUM
+2 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC LIST CALLS",$JOB,"CX",CALL))
if CALL<1
QUIT
Begin DoDot:1
+3 IF $DATA(^FSCD("NOTIFY","ACUSER",CALL,USER))
SET ^TMP("FSC LIST",$JOB,CALL)=""
QUIT
+4 SET (DONE,LNUM)=0
FOR
SET LNUM=$ORDER(^FSCD("NOTIFY","ACLIST",CALL,LNUM))
if LNUM<1
QUIT
Begin DoDot:2
+5 IF $DATA(^FSC("LIST","C",USER,LNUM))
SET ^TMP("FSC LIST",$JOB,CALL)=""
SET DONE=1
End DoDot:2
if DONE
QUIT
End DoDot:1
+6 QUIT