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

44 lines
1.3 KiB
Mathematica

FSCRPCAP ;SLC/STAFF-NOIS RPC Alert Process ;1/11/98 18:48
;;1.1;NOIS;;Sep 06, 1998
;
ALERT(XQADATA) ; from FSCRPCA
I '$O(^FSCD("SEND","B",+XQADATA,0)) Q
N CALL,LNUM,NUM
K ^TMP("FSC CURRENT LIST",$J)
K ^TMP("FSC LIST CLEANUP",$J)
S LNUM=0
S NUM=0 F S NUM=$O(^FSCD("SEND","B",+XQADATA,NUM)) Q:NUM<1 D
.S CALL=+$P($G(^FSCD("SEND",NUM,0)),U,2)
.D SETUP(CALL,$P($G(^FSCD("ALERT",+XQADATA,0)),U,3))
.D MRA^FSCMR(DUZ,CALL)
.S LNUM=LNUM+1
.S ^TMP("FSC LIST CLEANUP",$J,LNUM)=$P($G(^FSCD("ALERT",+XQADATA,0)),U,3)
.D OUTPUT^FSCRPCA
S NUM=0 F S NUM=$O(^FSCD("SEND","B",+XQADATA,NUM)) Q:NUM<1 D
.I '$L($P($G(^FSCD("SEND",NUM,0)),U,3)) S $P(^(0),U,3)=DT
Q
;
USER ; from FSCRPCA
N CALL,DA,DIK,LNUM,NUM,X,Y
K ^FSCD("ALERT","ALERT",DUZ)
K ^TMP("FSC CURRENT LIST",$J)
K ^TMP("FSC LIST CLEANUP",$J)
S LNUM=0
S DIK="^FSCD(""ALERT"","
S CALL=0 F S CALL=$O(^FSCD("ALERT","AUC",DUZ,CALL)) Q:CALL<1 S NUM=^(CALL) D
.D SETUP(CALL,$P($G(^FSCD("ALERT",NUM,0)),U,3))
.D MRA^FSCMR(DUZ,CALL)
.S LNUM=LNUM+1
.S ^TMP("FSC LIST CLEANUP",$J,LNUM)=$P(^FSCD("ALERT",NUM,0),U,3)
.S DA=+NUM D ^DIK
.D OUTPUT^FSCRPCA
Q
;
SETUP(CALL,MSG) ;
N LNUM
S LNUM=1+$O(^TMP("FSC CURRENT LIST",$J,"A"),-1)
I LNUM<1000 S LNUM=LNUM+1000
S ^TMP("FSC CURRENT LIST",$J,LNUM)=CALL_U_$$SHORT^FSCRPXUS(CALL,DUZ)_" ("_MSG_")"
S ^TMP("FSC CURRENT LIST",$J,"C",CALL)=LNUM
Q