source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENFSA2.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1ENFSA2 ;(WASH ISC)/JED-Accident Reports ;4.23.98
2V ;;7.0;ENGINEERING;**48,51**;Aug 17, 1993
3 ;CALLS FYQTS^ENLIB,FYSONLY^ENLIB,DIC, CALLED BY ENFSA1
4INT ;GET INTERVAL
5 W @IOF,!!!,"This option will generate a summary by",ENHD
6 S F="",ENAR="ACCIDENT REPORT",ENQ="W !!,"" DO YOU WANT ALL "",ENH,""S LISTED? (Y/N)"" S %=2 D YN^DICN"
7 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
8 K ^DOPT($P(O,S,5))
9 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)=""
10 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)
11IN I $P(O,S,6)'="" D @($P(O,S,6))
12PR S O=$T(OPT),S=";" S IOP="HOME" D ^%ZIS K IOP
13 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)
14RE 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
15 ;
16HDR W !!!!,?12,"ACCIDENT REPORT INTERVAL",! Q
17 ;
18MN W ! D FYSONLY^ENLIB G:'$D(ENFY) ABORT D RDMNTH^ENLIB1 G:ENMN=-1 ABORT
19 S:$L(ENMN)=1 ENMN="0"_ENMN
20 N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFR=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY_ENMN_"01"
21 S ENTO=$$EOM^ENUTL(ENFR)
22 Q
23 ;
24QT D FYQTS^ENLIB G:'$D(ENQT) ABORT
25 N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFY(3)=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY
26 I ENQT=1 S ENFR=(ENFY(3)-1)_1001,ENTO=(ENFY(3)-1)_1231 Q
27 I ENQT=2 S ENFR=ENFY(3)_"0101",ENTO=ENFY(3)_"0331" Q
28 I ENQT=3 S ENFR=ENFY(3)_"0401",ENTO=ENFY(3)_"0630" Q
29 S ENFR=ENFY(3)_"0701",ENTO=ENFY(3)_"0930"
30 Q
31 ;
32YR D FYSONLY^ENLIB G:'$D(ENFY) ABORT
33 N DELYR S DELYR=$E(DT,2,3)-ENFY,ENFY(3)=$E(DT)+$S(DELYR>79:1,DELYR<-20:-1,1:0)_ENFY
34 S ENFR=(ENFY(3)-1)_1001,ENTO=ENFY(3)_"0930"
35 Q
36 ;
37AR S ENFR=0 Q
38 ;
39ABORT S F=1 W !!,"USER ABORT",*7,!,"<cr> to continue " R R:DTIME Q
40 ;
41OPT ;;ACCIDENT REPORTING MODULE;ACCIDENT REPORT INTERVAL;ENFSA1;
42 ;;MONTHLY;MN
43 ;;QUARTERLY;QT
44 ;;YEARLY;YR
45 ;;ALL REPORTS;AR
Note: See TracBrowser for help on using the repository browser.