43 lines
2.4 KiB
Mathematica
43 lines
2.4 KiB
Mathematica
ENFSA1 ;(WASH ISC)/JED-Accident Reports ;5-29-93
|
|
;;7.0;ENGINEERING;;Aug 17, 1993
|
|
;EXPECTS IOF,U, CALLS ^%ZIS,^DIC,EN1^DIP,ENFSA2,ENLIB CALLED BY ENFSA
|
|
P10 ;Report by SERVICE/DIVISION
|
|
S ENH=" SERVICE",ENHD=" SERVICE/DIVISION" D INT^ENFSA2 G:F=1 EXIT X ENQ G:%=1&(ENFR=0) P11
|
|
S BY="SERVICE/DIVISION #,OCCURRENCE DATE" G:%=1 PS3
|
|
S DIC="^ENG(6924.3,",DIC(0)="AEQM" D ^DIC G:Y<0 EXIT S X=$P(^ENG(6924.3,+Y,0),U,1),(ENFR1,ENTO1)=X G:ENFR=0 PS2 G PS1
|
|
P11 S BY=25,FR="",TO="",DHD="ALL "_ENAR_"S BY"_ENHD G PS4
|
|
;
|
|
P20 ;Report by INJURY CAUSE
|
|
S ENH=" CAUSE",ENHD=" CAUSE OF INJURY" D INT^ENFSA2 G:F=1 EXIT X ENQ G:%=1&(ENFR=0) P22
|
|
S BY="CAUSE OF INJURY,OCCURRENCE DATE" G:%=1 PS3
|
|
I $D(^DD(6924,32,0)) S ENHDR=$P(^(0),U,1),ENMEN=$P(^(0),U,3)
|
|
W !!?10,ENHDR,!! F I=1:1:12 W ?10,I,?14,$P(ENMEN,";",I),!
|
|
P21 W !!?5,"Select CAUSE NUMBER: " R X:DTIME G:X=""!(X="^") EXIT G:X<1!(X>12) P21
|
|
S X=$P($P(ENMEN,";",X),":",2),(ENFR1,ENTO1)=X G:ENFR=0 PS2 G PS1
|
|
P22 S BY=32,FR="",TO="",DHD=ENAR_" BY"_ENHD G PS4
|
|
;
|
|
P30 ;Report by ACCIDENT NATURE
|
|
S ENH=" NATURE",ENHD=" INJURY/ILLNESS NATURE" D INT^ENFSA2 G:F=1 EXIT X ENQ G:%=1&(ENFR=0) P31
|
|
S BY=30_","_5 G:%=1 PS3
|
|
S DIC="^ENG(6924.2,",DIC(0)="AEQM" D ^DIC G:Y<0 EXIT S X=^ENG(6924.2,+Y,0),(ENFR1,ENTO1)=X G:ENFR=0 PS2 G PS1
|
|
P31 S BY=30,FR="",TO="",DHD="ALL "_ENAR_"S BY"_ENHD G PS4
|
|
;
|
|
P40 ;Report by LOCATION
|
|
S ENH=" LOCATION",ENHD=" SPECIFIC LOCATION" D INT^ENFSA2 G:F=1 EXIT X ENQ G:%<0 EXIT G:%=0 P40 G:%=1&(ENFR=0) P42
|
|
S BY="SPECIFIC LOCATION,OCCURRENCE DATE" G:%=1 PS3
|
|
P41 W !!?10,"Enter",ENHD,": " R X:DTIME S:X["??" X="?" I X=""!(X="^") G EXIT
|
|
I $E(X)="?"!($L(X)>25) W *7,!!?5,"UP TO 25 CHARACTERS PLEASE" G P41
|
|
S (ENFR1,ENTO1)=X G:ENFR=0 PS2 G PS1
|
|
P42 S BY=7.5,FR="",TO="",DHD=ENAR_" BY"_ENHD G PS4
|
|
;SET UP COMMON PRINT VARIABLES FOR FM
|
|
PS1 D DAT S FR=ENFR1_","_ENFR,TO=ENTO1_","_ENTO,DHD=ENAR_" SUMMARY: "_ENFR1_ENH_" FROM: "_ENFH_" TO: "_ENTH G PS4
|
|
PS2 S FR=ENFR1_","_"",TO=ENTO1_","_"",DHD=ENAR_" SUMMARY: "_ENFR1_ENH G PS4
|
|
PS3 D DAT S FR=""_","_ENFR,TO=""_","_ENTO,DHD=ENAR_" SUMMARY BY: "_ENH_" FROM: "_ENFH_" TO: "_ENTH
|
|
PS4 I $D(^ENG(6910.2,3,0)),$P(^(0),U,2)="L",$D(^DIPT("B","ENZFSA1")) S FLDS="[ENZFSA1]"
|
|
E S FLDS="[ENFSA1]"
|
|
S DIC="^ENG(""FSA"",",L=0,DIOEND="I IOST[""C-"" R !!,""Press <RETURN> to continue"",X:DTIME" D EN1^DIP G EXIT
|
|
EXIT K %,%IS,BY,DHD,DIC,FLDS,FR,TO,F,I,J,K,L,R,X,Y
|
|
K ENAR,ENDY,ENFH,ENFR,ENFR1,ENFY,ENH,ENHD,ENHDR,ENMEN,ENMN,ENQ,ENQT,ENTH,ENTO,ENTO1 Q
|
|
DAT S Y=ENFR X ^DD("DD") S ENFH=Y,Y=ENTO X ^DD("DD") S ENTH=Y K Y Q
|
|
;
|