ENY2VACO ;;(WIRMFO)/DH-Y2K Activity Report ;10.9.98
;;7.0;ENGINEERING;**55,58**;August 17, 1993
EN ; national roll-up of Y2K information
; may be selected manually or scheduled to run automatically
; at a user specified frequency
N %DT
W @IOF,!,?20,"NATIONAL ROLL-UP OF Y2K INFORMATION"
I $P($G(^DIC(6910,1,0)),U,2)']"" W !!,"There is no STATION NUMBER in your Engineering Init Parameters file.",!,"Can't proceed.",*7 D HOLD Q
I '$D(^XUSEC("ENY2K_ROLL_UP",DUZ)) W !!,"You must hold security key ENY2K_ROLL_UP in order to execute this option.",*7 D HOLD Q
;
ACT1 W !!,"Please enter starting and stopping dates for activity reporting",!," (or '^' to escape...)",!
S %DT="AEP",%DT("A")="Starting date: ",%DT(0)=-DT
S Y=$E(DT,1,5)-1 S:$E(Y,4,5)="00" Y=($E(Y,1,3)-1)_12 S Y=Y_"01"
X ^DD("DD") S %DT("B")=Y
D ^%DT Q:Y'>0
S Y=$P(Y,"."),ENDATE("STARTI")=Y X ^DD("DD") S ENDATE("STARTE")=Y
ACT2 S Y=$$EOM^ENUTL(ENDATE("STARTI")) X ^DD("DD") S %DT("B")=Y
S %DT("A")="Stopping date: " K %DT(0)
D ^%DT Q:Y'>0 S Y=$P(Y,"."),ENDATE("STOPI")=Y_".9" X ^DD("DD") S ENDATE("STOPE")=Y
I ENDATE("STOPI")'>ENDATE("STARTI") W !!,"STOPPING DATE must follow the STARTING DATE",*7 G ACT2
S X=$P($O(^ENG(6918,"C",ENDATE("STARTI"))),".") I X=""!(X>ENDATE("STOPI")) W !!,"There was no Y2K activity between "_ENDATE("STARTE")_" and "_ENDATE("STOPE")_".",!,"Cumulative information will be transmitted anyway.",*7
I $P(ENDATE("STOPI"),".",2)="" S ENDATE("STOPI")=ENDATE("STOPI")_".99"
W !!,"The system is now prepared to send a Y2K report to VACO."
S DIR("A")="Is that what you want to do",DIR(0)="Y",DIR("B")="YES"
D ^DIR K DIR I $D(DIRUT)!('Y) K ENDATE Q ; confirm the transaction
S ZTRTN="DEQVACO^ENY2VACO",ZTIO=""
F J="ENDATE(""STARTI"")","ENDATE(""STOPI"")" S ZTSAVE(J)=""
S ZTDESC="Y2K National Roll-up (equipment)"
S ZTDTH=$H D ^%ZTLOAD,HOME^%ZIS K ZTSK
W !!,"A national roll-up of Y2K information has been tasked to run via NetWork",!,"Mail. You will receive a copy of the message."
K ENDATE
Q
;
DEQVACO ; use ENX( as root of NetWork mail message
K ^TMP($J)
I $G(ENDATE("STARTI"))="" D
. S Y=$E(DT,1,5)-1 S:$E(Y,4,5)="00" Y=($E(Y,1,3)-1)_12 S Y=Y_"01"
. S Y=$P(Y,"."),ENDATE("STARTI")=Y
. S ENDATE("STOPI")=$$EOM^ENUTL(ENDATE("STARTI"))_".99"
N DA,CAT,EN,ENX,ENY,TOTAL,STATION,COST,COUNT,ALLSTN,ENSTN,KOUNT,ENCLASS
D NOW^%DTC S ENY=$P(%,".",2)
S ENC(1,0)="ENG^"_$E(1000+$E($P(^DIC(6910,1,0),U,2),1,3),2,4)_"^Y2K^"_(%+17000000\1)_U_ENY_$E("000000",1,6-$L(ENY))_U_$$LTZ^ENPLUTL_"^001^|",KOUNT=1
S (ALLSTN,ENSTN)=0,ENY2K("VACO")=1,ENCLASS=1 D CNTACT^ENY2REP,ROLLACT
K COUNT,TOTAL
K ^TMP($J)
D DEQ1^ENY2REP4,ROLLCUM^ENY2VAC1
K COUNT,TOTAL
D DEQ1^ENY2REPA,ROLLFC^ENY2VAC2
K COUNT,TOTAL
D SUM1^ENY2USRS,ROLLUTL^ENY2VAC2
S KOUNT=KOUNT+1,ENC(KOUNT,0)="$"
D SEND
G EXIT
;
ROLLACT ; add Y2K activity to national roll-up
S STATION=0 F S STATION=$O(^TMP($J,"ENY2B",STATION)) Q:STATION="" D
. S ENC(2,0)="A1^"_($P(ENDATE("STARTI"),".")+17000000\1)_U_($P(ENDATE("STOPI"),".")+17000000\1)_U_"|",COUNT=1,KOUNT=2
. F J=0,"FC","NC","CC","NA" F K=0,"FC","NC","CC","NA" I '(J=0&(K=0)) D
.. S COUNT=COUNT+1 Q:'^TMP($J,"ENY2B",STATION,J,K,"COUNT")
.. S KOUNT=KOUNT+1,ENC(KOUNT,0)="A"_COUNT_U_J_U_K_U_^TMP($J,"ENY2B",STATION,J,K,"COUNT")_U_^("EST")_U_^("ACT")_U_^("REST")_U_$S($D(COUNT(STATION,J,K,"EST")):COUNT(STATION,J,K,"EST"),1:"")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_U_^TMP($J,"ENY2B",STATION,J,K,"RACT")_U_$S($D(COUNT(STATION,J,K,"ACT")):COUNT(STATION,J,K,"ACT"),1:"")_U_"|"
Q
;
SEND ; send NetWork mail
S XMY(DUZ)="",XMY("S.EN_UPDATE_Y2K@DOMAIN.EXT")="",XMDUZ=.5
;S XMY(DUZ)="",XMDUZ=.5
S XMSUB="Roll-up of Y2K Information",XMTEXT="ENC("
D ^XMD
K XMY,XMDUZ,XMSUB,XMTEXT
Q
;
HOLD Q:$E(IOST,1,2)'="C-"
R !!,"Press <RETURN> to continue...",X:DTIME
Q
EXIT ;
K ^TMP($J)
D ^%ZISC,HOME^%ZIS
I $D(ZTQUEUED) S ZTREQN="@"
K J,K,X,ENDATE,ENSTN
Q
;ENY2VACO
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2VACO 3966 printed Oct 16, 2024@17:58:29 Page 2
ENY2VACO ;;(WIRMFO)/DH-Y2K Activity Report ;10.9.98
+1 ;;7.0;ENGINEERING;**55,58**;August 17, 1993
EN ; national roll-up of Y2K information
+1 ; may be selected manually or scheduled to run automatically
+2 ; at a user specified frequency
+3 NEW %DT
+4 WRITE @IOF,!,?20,"NATIONAL ROLL-UP OF Y2K INFORMATION"
+5 IF $PIECE($GET(^DIC(6910,1,0)),U,2)']""
WRITE !!,"There is no STATION NUMBER in your Engineering Init Parameters file.",!,"Can't proceed.",*7
DO HOLD
QUIT
+6 IF '$DATA(^XUSEC("ENY2K_ROLL_UP",DUZ))
WRITE !!,"You must hold security key ENY2K_ROLL_UP in order to execute this option.",*7
DO HOLD
QUIT
+7 ;
ACT1 WRITE !!,"Please enter starting and stopping dates for activity reporting",!," (or '^' to escape...)",!
+1 SET %DT="AEP"
SET %DT("A")="Starting date: "
SET %DT(0)=-DT
+2 SET Y=$EXTRACT(DT,1,5)-1
if $EXTRACT(Y,4,5)="00"
SET Y=($EXTRACT(Y,1,3)-1)_12
SET Y=Y_"01"
+3 XECUTE ^DD("DD")
SET %DT("B")=Y
+4 DO ^%DT
if Y'>0
QUIT
+5 SET Y=$PIECE(Y,".")
SET ENDATE("STARTI")=Y
XECUTE ^DD("DD")
SET ENDATE("STARTE")=Y
ACT2 SET Y=$$EOM^ENUTL(ENDATE("STARTI"))
XECUTE ^DD("DD")
SET %DT("B")=Y
+1 SET %DT("A")="Stopping date: "
KILL %DT(0)
+2 DO ^%DT
if Y'>0
QUIT
SET Y=$PIECE(Y,".")
SET ENDATE("STOPI")=Y_".9"
XECUTE ^DD("DD")
SET ENDATE("STOPE")=Y
+3 IF ENDATE("STOPI")'>ENDATE("STARTI")
WRITE !!,"STOPPING DATE must follow the STARTING DATE",*7
GOTO ACT2
+4 SET X=$PIECE($ORDER(^ENG(6918,"C",ENDATE("STARTI"))),".")
IF X=""!(X>ENDATE("STOPI"))
WRITE !!,"There was no Y2K activity between "_ENDATE("STARTE")_" and "_ENDATE("STOPE")_".",!,"Cumulative information will be transmitted anyway.",*7
+5 IF $PIECE(ENDATE("STOPI"),".",2)=""
SET ENDATE("STOPI")=ENDATE("STOPI")_".99"
+6 WRITE !!,"The system is now prepared to send a Y2K report to VACO."
+7 SET DIR("A")="Is that what you want to do"
SET DIR(0)="Y"
SET DIR("B")="YES"
+8 ; confirm the transaction
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!('Y)
KILL ENDATE
QUIT
+9 SET ZTRTN="DEQVACO^ENY2VACO"
SET ZTIO=""
+10 FOR J="ENDATE(""STARTI"")","ENDATE(""STOPI"")"
SET ZTSAVE(J)=""
+11 SET ZTDESC="Y2K National Roll-up (equipment)"
+12 SET ZTDTH=$HOROLOG
DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
+13 WRITE !!,"A national roll-up of Y2K information has been tasked to run via NetWork",!,"Mail. You will receive a copy of the message."
+14 KILL ENDATE
+15 QUIT
+16 ;
DEQVACO ; use ENX( as root of NetWork mail message
+1 KILL ^TMP($JOB)
+2 IF $GET(ENDATE("STARTI"))=""
Begin DoDot:1
+3 SET Y=$EXTRACT(DT,1,5)-1
if $EXTRACT(Y,4,5)="00"
SET Y=($EXTRACT(Y,1,3)-1)_12
SET Y=Y_"01"
+4 SET Y=$PIECE(Y,".")
SET ENDATE("STARTI")=Y
+5 SET ENDATE("STOPI")=$$EOM^ENUTL(ENDATE("STARTI"))_".99"
End DoDot:1
+6 NEW DA,CAT,EN,ENX,ENY,TOTAL,STATION,COST,COUNT,ALLSTN,ENSTN,KOUNT,ENCLASS
+7 DO NOW^%DTC
SET ENY=$PIECE(%,".",2)
+8 SET ENC(1,0)="ENG^"_$EXTRACT(1000+$EXTRACT($PIECE(^DIC(6910,1,0),U,2),1,3),2,4)_"^Y2K^"_(%+17000000\1)_U_ENY_$EXTRACT("000000",1,6-$LENGTH(ENY))_U_$$LTZ^ENPLUTL_"^001^|"
SET KOUNT=1
+9 SET (ALLSTN,ENSTN)=0
SET ENY2K("VACO")=1
SET ENCLASS=1
DO CNTACT^ENY2REP
DO ROLLACT
+10 KILL COUNT,TOTAL
+11 KILL ^TMP($JOB)
+12 DO DEQ1^ENY2REP4
DO ROLLCUM^ENY2VAC1
+13 KILL COUNT,TOTAL
+14 DO DEQ1^ENY2REPA
DO ROLLFC^ENY2VAC2
+15 KILL COUNT,TOTAL
+16 DO SUM1^ENY2USRS
DO ROLLUTL^ENY2VAC2
+17 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="$"
+18 DO SEND
+19 GOTO EXIT
+20 ;
ROLLACT ; add Y2K activity to national roll-up
+1 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,"ENY2B",STATION))
if STATION=""
QUIT
Begin DoDot:1
+2 SET ENC(2,0)="A1^"_($PIECE(ENDATE("STARTI"),".")+17000000\1)_U_($PIECE(ENDATE("STOPI"),".")+17000000\1)_U_"|"
SET COUNT=1
SET KOUNT=2
+3 FOR J=0,"FC","NC","CC","NA"
FOR K=0,"FC","NC","CC","NA"
IF '(J=0&(K=0))
Begin DoDot:2
+4 SET COUNT=COUNT+1
if '^TMP($JOB,"ENY2B",STATION,J,K,"COUNT")
QUIT
+5 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="A"_COUNT_U_J_U_K_U_^TMP($JOB,"ENY2B",STATION,J,K,"COUNT")_U_^("EST")_U_^("ACT")_U_^("REST")_U_$SELECT($DATA(COUNT(STATION,J,K,"EST")):COUNT(STATION,J,K,"EST"),1:"")
+6 SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_^TMP($JOB,"ENY2B",STATION,J,K,"RACT")_U_$SELECT($DATA(COUNT(STATION,J,K,"ACT")):COUNT(STATION,J,K,"ACT"),1:"")_U_"|"
End DoDot:2
End DoDot:1
+7 QUIT
+8 ;
SEND ; send NetWork mail
+1 SET XMY(DUZ)=""
SET XMY("S.EN_UPDATE_Y2K@DOMAIN.EXT")=""
SET XMDUZ=.5
+2 ;S XMY(DUZ)="",XMDUZ=.5
+3 SET XMSUB="Roll-up of Y2K Information"
SET XMTEXT="ENC("
+4 DO ^XMD
+5 KILL XMY,XMDUZ,XMSUB,XMTEXT
+6 QUIT
+7 ;
HOLD if $EXTRACT(IOST,1,2)'="C-"
QUIT
+1 READ !!,"Press <RETURN> to continue...",X:DTIME
+2 QUIT
EXIT ;
+1 KILL ^TMP($JOB)
+2 DO ^%ZISC
DO HOME^%ZIS
+3 IF $DATA(ZTQUEUED)
SET ZTREQN="@"
+4 KILL J,K,X,ENDATE,ENSTN
+5 QUIT
+6 ;ENY2VACO