38 lines
1.8 KiB
Mathematica
38 lines
1.8 KiB
Mathematica
|
PRCBRCP ;WISC@ALTOONA/CTB/DL-RECALCULATE ALL CONTROL POINT BALANCES FOR FISCAL ; 1/29/98 1245
|
||
|
V ;;5.1;IFCAP;;Oct 20, 2000
|
||
|
;Per VHA Directive 10-93-142, this routine should not be modified.
|
||
|
N PRCDUZ
|
||
|
S PRCDUZ=DUZ
|
||
|
I $D(ZTQUEUED) D ALLCP,KILL^%ZTLOAD QUIT
|
||
|
D NOW^%DTC S A=$E(X,2,3),B=$E(X,4,5),PRC("FY")=$E(100+$S(+B>9:A+1,1:A),2,3) K A,B,%,%I,X
|
||
|
D FY^PRCSUT QUIT:PRC("FY")["^"
|
||
|
D EN^DDIOL("Recalculate all stations/control points balances for fiscal year: "_PRC("FY"))
|
||
|
D QT^PRCSUT G V:PRC("QTR")["^"
|
||
|
D YN^PRC0A(.X,.Y,"Submit RECALCULATE ALL CONTROL POINT BALANCES to the TASK MANAGER","O","YES")
|
||
|
QUIT:X["^"!(X="")!(Y<0)
|
||
|
I Y=0 D ALLCP^PRCBRCP QUIT
|
||
|
S A=$$TASK^PRC0B2("ALLCP^PRCBRCP~RECALCULATE ALL CONTROL POINT BALANCES","PRCDUZ~PRC*",1)
|
||
|
I A D EN^DDIOL("RECALCULATE ALL CONTROL POINT BALANCES HAS TASK NUMBER "_$P(A,"^"))
|
||
|
QUIT
|
||
|
;
|
||
|
MM(PRCA) ;prca free text in the message
|
||
|
N X,Y
|
||
|
S X(1)="IFCAP RECALCULATE "_PRCA_" CONTROL POINT BALANCES DONE!"
|
||
|
S Y(.5)="",Y(PRCDUZ)=""
|
||
|
D MM^PRC0B2("IFCAP RECAL "_PRCA_" FCP BALANCES DONE^Task Manager","X(",.Y)
|
||
|
QUIT
|
||
|
;
|
||
|
ALLCP ;RECALCULATE ALL CONTROL POINTS FOR CURRENT FISCAL YEAR
|
||
|
W:'$D(ZTQUEUED) @IOF,"RECALCULATING CONTROL POINT BALANCES",!
|
||
|
I $G(PRC("FY"))=""!($G(PRC("QTR"))="") S A=$$DATE^PRC0C(+$H,"H"),PRC("FY")=$E(A,3,4),PRC("QTR")=$P(A,"^",2)
|
||
|
STA F PRC("SITE")=0:0 S PRC("SITE")=$O(^PRC(420,PRC("SITE"))) Q:+PRC("SITE")=0 W:'$D(ZTQUEUED) !,PRC("SITE") D CP
|
||
|
S X="< Recalculation Completed>*" D:'$D(ZTQUEUED) MSG^PRCFQ
|
||
|
D:$D(ZTQUEUED) MM("FY: "_PRC("FY")_" QTR: "_PRC("QTR")_" ALL")
|
||
|
K PRC
|
||
|
QUIT
|
||
|
;
|
||
|
CP F PRC("CPN")=0:0 S PRC("CPN")=$O(^PRC(420,PRC("SITE"),1,PRC("CPN"))),PRC("CP")="" Q:+PRC("CPN")=0!(PRC("CPN")=9999) I $D(^(PRC("CPN"),0)) S PRC("CP")=$P(^(0)," ") Q:PRC("CP")="" W:'$D(ZTQUEUED) " ",+PRC("CP") D QTR
|
||
|
Q
|
||
|
QTR S N0=PRC("SITE")_"-"_PRC("FY") D CPOBAL^PRCSP1D
|
||
|
Q
|