46 lines
2.0 KiB
Mathematica
46 lines
2.0 KiB
Mathematica
ENFSA2 ;(WASH ISC)/JED-Accident Reports ;4.23.98
|
|
V ;;7.0;ENGINEERING;**48,51**;Aug 17, 1993
|
|
;CALLS FYQTS^ENLIB,FYSONLY^ENLIB,DIC, CALLED BY ENFSA1
|
|
INT ;GET INTERVAL
|
|
W @IOF,!!!,"This option will generate a summary by",ENHD
|
|
S F="",ENAR="ACCIDENT REPORT",ENQ="W !!,"" DO YOU WANT ALL "",ENH,""S LISTED? (Y/N)"" S %=2 D YN^DICN"
|
|
D:'$D(DT) DT^DICRW S U="^",S=";",O=$T(OPT) I $D(^DOPT($P(O,S,5),"VERSION")),($P($T(V),S,3)=^DOPT($P(O,S,5),"VERSION")) G IN
|
|
K ^DOPT($P(O,S,5))
|
|
F I=1:1 Q:$T(OPT+I)="" S ^DOPT($P(O,S,5),I,0)=$P($T(OPT+I),S,3),^DOPT($P(O,S,5),"B",$P($P($T(OPT+I),S,3),"^",1),I)=""
|
|
S K=I-1,^DOPT($P(O,S,5),0)=$P(O,S,4)_U_1_U_K_U_K K I,K,X S ^DOPT($P(O,S,5),"VERSION")=$P($T(V),S,3)
|
|
IN I $P(O,S,6)'="" D @($P(O,S,6))
|
|
PR S O=$T(OPT),S=";" S IOP="HOME" D ^%ZIS K IOP
|
|
D HDR F J=1:1 Q:'$D(^DOPT($P(O,S,5),J,0)) W !,?15,J,". ",$P(^DOPT($P(O,S,5),J,0),U,1)
|
|
RE S DIC("A")="Select "_$P($T(OPT),S,4)_": EXIT// ",DIC="^DOPT("_""""_$P($T(OPT),S,5)_""""_",",DIC(0)="AEQMN" D ^DIC G:X=""!(X=U) ABORT G:Y<0 RE K DIC,J,O D @($P($T(OPT+Y),S,4)) Q
|
|
;
|
|
HDR W !!!!,?12,"ACCIDENT REPORT INTERVAL",! Q
|
|
;
|
|
MN W ! D FYSONLY^ENLIB G:'$D(ENFY) ABORT D RDMNTH^ENLIB1 G:ENMN=-1 ABORT
|
|
S:$L(ENMN)=1 ENMN="0"_ENMN
|
|
N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFR=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY_ENMN_"01"
|
|
S ENTO=$$EOM^ENUTL(ENFR)
|
|
Q
|
|
;
|
|
QT D FYQTS^ENLIB G:'$D(ENQT) ABORT
|
|
N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFY(3)=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY
|
|
I ENQT=1 S ENFR=(ENFY(3)-1)_1001,ENTO=(ENFY(3)-1)_1231 Q
|
|
I ENQT=2 S ENFR=ENFY(3)_"0101",ENTO=ENFY(3)_"0331" Q
|
|
I ENQT=3 S ENFR=ENFY(3)_"0401",ENTO=ENFY(3)_"0630" Q
|
|
S ENFR=ENFY(3)_"0701",ENTO=ENFY(3)_"0930"
|
|
Q
|
|
;
|
|
YR D FYSONLY^ENLIB G:'$D(ENFY) ABORT
|
|
N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFY(3)=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY
|
|
S ENFR=(ENFY(3)-1)_1001,ENTO=ENFY(3)_"0930"
|
|
Q
|
|
;
|
|
AR S ENFR=0 Q
|
|
;
|
|
ABORT S F=1 W !!,"USER ABORT",*7,!,"<cr> to continue " R R:DTIME Q
|
|
;
|
|
OPT ;;ACCIDENT REPORTING MODULE;ACCIDENT REPORT INTERVAL;ENFSA1;
|
|
;;MONTHLY;MN
|
|
;;QUARTERLY;QT
|
|
;;YEARLY;YR
|
|
;;ALL REPORTS;AR
|