VistA-WorldVistAEHR/r/NOIS-FSC/FSCLMPNF.m

57 lines
1.9 KiB
Mathematica
Raw Normal View History

2009-11-29 13:37:14 -05:00
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