FSCTASKU ;SLC/STAFF-NOIS Task Update ;1/17/98 16:52
;;1.1;NOIS;;Sep 06, 1998
;
UPDATE ; dequeued from FSCTASK
; FSCCALL is saved
I $D(ZTQUEUED) S ZTREQ="@"
S FSCDEV=1
D UPDATE^FSCTASKA(FSCCALL)
D LOCATION(FSCCALL)
D SPEC(FSCCALL)
D AFFL(FSCCALL)
D UPDATE^FSCLP(FSCCALL)
D NOTIFY^FSCNOTS(FSCCALL)
Q
;
LOCATION(CALL) ;
N LOC,STATUS
S LOC=$P(^FSCD("CALL",CALL,0),U,5),STATUS=$P(^(0),U,2)
Q:'$L($P(^FSC("SITE",LOC,0),U,4)) I $P(^(0),U,5)="CLOSED",STATUS'=2 Q
I $D(^FSCD("NOTIFY","ACLOC",CALL,LOC)) Q
D SETUP^FSCNOT(CALL,,LOC)
Q
;
SPEC(CALL) ;
N EVENT,METHOD,SPEC
S SPEC=$P(^FSCD("CALL",CALL,0),U,9) I 'SPEC Q
S METHOD=$P(^FSC("SPEC",SPEC,0),U,14),EVENT=$P(^(0),U,15) Q:'$L(METHOD) Q:'$L(EVENT)
I $D(^FSCD("NOTIFY","ACUSER",CALL,SPEC)) Q
D SETUP^FSCNOT(CALL,,,SPEC,METHOD,EVENT)
Q
;
AFFL(CALL) ; from FSCTASKA
N MISC,ONETW,PACK,PACKGP,RTD,ZERO
S ZERO=$G(^FSCD("CALL",CALL,0)),ONETW=$G(^(120))
S PACK=$P(ONETW,U,9),PACKGP=$P(ONETW,U,13),MISC=$S($P(ZERO,U,10)=5:1,1:""),RTD=$S($P(ZERO,U,17):1,1:"")
I RTD D AFFLCHK(CALL,2,PACK,PACKGP)
I 'MISC D AFFLCHK(CALL,1,PACK,PACKGP)
Q
;
AFFLCHK(CALL,TYPE,PACK,PACKGP) ;
N EVENT,METHOD,USER
S USER=0 F S USER=$O(^FSC("SPEC","AF",TYPE,USER)) Q:USER'>0 D
.I $$CHECK(CALL,USER,PACK,PACKGP) D
..S METHOD=$P(^FSC("SPEC",USER,0),U,14),EVENT=$P(^(0),U,15) Q:'$L(METHOD) Q:'$L(EVENT)
..D SETUP^FSCNOT(CALL,,,USER,METHOD,EVENT)
Q
;
CHECK(CALL,USER,PACK,PACKGP) ; $$(call,user,package,package group) -> 0 or 1 if ok to tag for notify
I $D(^FSCD("NOTIFY","ACUSER",CALL,USER)) Q 0
I PACKGP,$P($G(^FSC("SPEC",USER,20,+$O(^FSC("SPEC","AG",PACKGP,USER,0)),0)),U,3) Q 1
I PACK,$O(^FSC("SPEC","AP",PACK,USER,0)) Q 1
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCTASKU 1738 printed Dec 13, 2024@02:20:19 Page 2
FSCTASKU ;SLC/STAFF-NOIS Task Update ;1/17/98 16:52
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
UPDATE ; dequeued from FSCTASK
+1 ; FSCCALL is saved
+2 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 SET FSCDEV=1
+4 DO UPDATE^FSCTASKA(FSCCALL)
+5 DO LOCATION(FSCCALL)
+6 DO SPEC(FSCCALL)
+7 DO AFFL(FSCCALL)
+8 DO UPDATE^FSCLP(FSCCALL)
+9 DO NOTIFY^FSCNOTS(FSCCALL)
+10 QUIT
+11 ;
LOCATION(CALL) ;
+1 NEW LOC,STATUS
+2 SET LOC=$PIECE(^FSCD("CALL",CALL,0),U,5)
SET STATUS=$PIECE(^(0),U,2)
+3 if '$LENGTH($PIECE(^FSC("SITE",LOC,0),U,4))
QUIT
IF $PIECE(^(0),U,5)="CLOSED"
IF STATUS'=2
QUIT
+4 IF $DATA(^FSCD("NOTIFY","ACLOC",CALL,LOC))
QUIT
+5 DO SETUP^FSCNOT(CALL,,LOC)
+6 QUIT
+7 ;
SPEC(CALL) ;
+1 NEW EVENT,METHOD,SPEC
+2 SET SPEC=$PIECE(^FSCD("CALL",CALL,0),U,9)
IF 'SPEC
QUIT
+3 SET METHOD=$PIECE(^FSC("SPEC",SPEC,0),U,14)
SET EVENT=$PIECE(^(0),U,15)
if '$LENGTH(METHOD)
QUIT
if '$LENGTH(EVENT)
QUIT
+4 IF $DATA(^FSCD("NOTIFY","ACUSER",CALL,SPEC))
QUIT
+5 DO SETUP^FSCNOT(CALL,,,SPEC,METHOD,EVENT)
+6 QUIT
+7 ;
AFFL(CALL) ; from FSCTASKA
+1 NEW MISC,ONETW,PACK,PACKGP,RTD,ZERO
+2 SET ZERO=$GET(^FSCD("CALL",CALL,0))
SET ONETW=$GET(^(120))
+3 SET PACK=$PIECE(ONETW,U,9)
SET PACKGP=$PIECE(ONETW,U,13)
SET MISC=$SELECT($PIECE(ZERO,U,10)=5:1,1:"")
SET RTD=$SELECT($PIECE(ZERO,U,17):1,1:"")
+4 IF RTD
DO AFFLCHK(CALL,2,PACK,PACKGP)
+5 IF 'MISC
DO AFFLCHK(CALL,1,PACK,PACKGP)
+6 QUIT
+7 ;
AFFLCHK(CALL,TYPE,PACK,PACKGP) ;
+1 NEW EVENT,METHOD,USER
+2 SET USER=0
FOR
SET USER=$ORDER(^FSC("SPEC","AF",TYPE,USER))
if USER'>0
QUIT
Begin DoDot:1
+3 IF $$CHECK(CALL,USER,PACK,PACKGP)
Begin DoDot:2
+4 SET METHOD=$PIECE(^FSC("SPEC",USER,0),U,14)
SET EVENT=$PIECE(^(0),U,15)
if '$LENGTH(METHOD)
QUIT
if '$LENGTH(EVENT)
QUIT
+5 DO SETUP^FSCNOT(CALL,,,USER,METHOD,EVENT)
End DoDot:2
End DoDot:1
+6 QUIT
+7 ;
CHECK(CALL,USER,PACK,PACKGP) ; $$(call,user,package,package group) -> 0 or 1 if ok to tag for notify
+1 IF $DATA(^FSCD("NOTIFY","ACUSER",CALL,USER))
QUIT 0
+2 IF PACKGP
IF $PIECE($GET(^FSC("SPEC",USER,20,+$ORDER(^FSC("SPEC","AG",PACKGP,USER,0)),0)),U,3)
QUIT 1
+3 IF PACK
IF $ORDER(^FSC("SPEC","AP",PACK,USER,0))
QUIT 1
+4 QUIT 0