Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FSCTASKN

FSCTASKN.m

Go to the documentation of this file.
FSCTASKN ;SLC/STAFF-NOIS Task Notification ;1/13/98  17:11
 ;;1.1;NOIS;;Sep 06, 1998
 ;
NOTIFY ; from FSCTASKA
 N ADDRESS,ARRAY,CALL,DA,DIK,EVENT,LIST,LISTNAME,METHOD,MSG,NOTIFY,NUM,USER K ARRAY
 S LIST=0 F  S LIST=$O(^FSC("LIST","AU","A",LIST)) Q:LIST<1  D
 .Q:$P($G(^FSC("LIST",LIST,0)),U,7)'="ADDED"  Q:'$L($P(^(0),U,6))  S LISTNAME=$P(^(0),U)
 .S NUM=0 F  S NUM=$O(^FSCD("NOTIFY","ALIST",LIST,NUM)) Q:NUM<1  D
 ..S NOTIFY=$G(^FSCD("NOTIFY",NUM,0)),CALL=+NOTIFY I 'CALL Q
 ..D GET^FSCNOTS(NOTIFY,.USER,.METHOD,.EVENT,.ADDRESS)
 ..S MSG="Call added to "_LISTNAME_" "_$$FMTE^XLFDT(DT)_"."
 ..D
 ...I METHOD="MAIL" D  Q
 ....I $L(ADDRESS) S ARRAY(ADDRESS)="",ARRAY(ADDRESS,1)="I" Q
 ....S ARRAY(USER)="",ARRAY(USER,1)="I"
 ...I METHOD="ALERT" D ALERT^FSCNOTS(CALL,USER,MSG) Q
 ..S DA=NUM,DIK="^FSCD(""NOTIFY""," D ^DIK
 ..I $L($O(ARRAY(0))) D MAIL^FSCNOTS(CALL,.ARRAY,MSG) K ARRAY
 Q
 ;
CHKALERT ; from FSCTASKA
 N USER
 S USER=0 F  S USER=$O(^FSCD("ALERT","ALERT",USER)) Q:USER'>0  D NEWALERT(USER)
 Q
 ;
NEWALERT(USER) ;
 N XQA,XQADATA,XQAID,XQAMSG,XQAROU K XQA,^TMP("FSC CHKALERT",$J)
 D USER^XQALERT("^TMP(""FSC CHKALERT"",$J)",USER,2900101)
 I '$O(^TMP("FSC CHKALERT",$J,0))!'$O(^XTV(8992,USER,"XQA",0)) D
 .S XQA(USER)="",XQADATA="",XQAMSG="NOIS Calls",XQAROU="USER^FSCNAR",XQAID="FSC-A"
 .D SETUP^XQALERT
 K ^TMP("FSC CHKALERT",$J)
 Q
 ;
DELIVERY(UPDATE) ; from FSCTASKA
 N ALERT,DA,DATE,DIE,DR,NUM,XQA,XQADATA,XQAID,XQAMSG,XQAROU K XQA
 S XQAROU="ALERT^FSCNAR",DIE="^FSCD(""ALERT"","
 S DATE=0 F  S DATE=$O(^FSCD("ALERT","AD",DATE)) Q:DATE<1  Q:DATE>UPDATE  D
 .S NUM=0 F  S NUM=$O(^FSCD("ALERT","AD",DATE,NUM)) Q:NUM<1  D
 ..S ALERT=$G(^FSCD("ALERT",NUM,0)) I '$L(ALERT) Q
 ..I $P(ALERT,U,4) Q
 ..S DA=NUM,DR="3///"_$$NOW^XLFDT_";4///@"
 ..L +^FSCD("ALERT",NUM,0):30 I '$T Q  ; *** skip
 ..D ^DIE
 ..L -^FSCD("ALERT",NUM,0)
 ..S XQAROU="ALERT^FSCNAR",XQADATA=NUM,XQA(+ALERT)="",XQAMSG=$P(ALERT,U,3),XQAID="FSC-A"
 ..I $O(XQA(0)) D SETUP^XQALERT
 Q