OOPSPRT2 ;HINES/WAA-Print CA1/CA2 Routines ;3/24/98
;;2.0;ASISTS;;Jun 03, 2002
;;
; This routine is to display all the report that a person has
; access to.
EN1(CALLER) ;
; Input:
; Caller O = Safety Officer
; S = Supervisor
; E = Employee
;
N OUT,CASE,FORM
S OUT=0
S IEN=$$SELECT(CALLER) Q:IEN="0"
I IEN="-1" S CASE="",FORM=$$FORM Q:FORM="-1"
E S CASE=$P(IEN,U,2),FORM="CA"_$$GET1^DIQ(2260,+IEN,52,"I")
D PRINT
D EXIT
Q
EXIT ;
K IO("Q")
Q
FORM() ;Select a form to print
N FORM
; Injury CA1
; Illness CA2
N DIR,Y
W !," 1) Injury (CA1)"
W !," 2) Illness (CA2)"
W !
S DIR(0)="SAO^1:CA1;2:CA2"
S DIR("A")="Select Form: "
S DIR("?")="Select the form to be printed."
D ^DIR
I '$D(Y(0)) S FORM="-1"
E S FORM=Y(0)
Q FORM
SELECT(CALLER) ; Select a case to print
;INPUT:
; CALLER = "E" FOR EMPLOYEE
; = "S" FOR SUPERVISOR
; = "O" FOR SAFETY OFFICER
N SSN,IEN,CASE
S IEN=0,CASE=""
I $G(DUZ)<1 Q "0" ; Bad or no DUZ
I $G(^VA(200,DUZ,1))="" Q "0" ; Person is not a valid user in 200
I CALLER="E" D I CASE="0" Q "0" ; Setup SSN
.S SSN=$P(^VA(200,DUZ,1),U,9)
.I $D(^OOPS(2260,"SSN",SSN))<1 S CASE="0" ; Ensure entry is in 2260
.Q
D
.N DIC,X,Y
.S DIC="^OOPS(2260,"
.I CALLER="E" S DIC("S")="I $$EMP^OOPSPRT2(Y)"
.I CALLER="S" S DIC("S")="I $$SUP^OOPSPRT2(Y)"
.I CALLER="O" S DIC("S")="I $$SAF^OOPSPRT2(Y)"
.S DIC(0)="AEMNZ",DIC("A")=" Select Case: "
.D ^DIC
.I $D(DTOUT)!($D(DUOUT)) S Y=0
.S CASE=Y
.Q
Q CASE
EMP(IEN) ; Employee
N VIEW
S VIEW=1
I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
I '$$EMP^OOPSUTL1(IEN,SSN,1) S VIEW=0
Q VIEW
SUP(IEN) ; Supervisor
N VIEW
S VIEW=1
I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ S VIEW=0
Q VIEW
SAF(IEN) ; Safety Officer
N VIEW
S VIEW=1
I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
Q VIEW
DEVICE ; This is the device selection routine.
;
S %ZIS="QM" D ^%ZIS I POP S OUT=1 Q
I $D(IO("Q")) D Q
.S ZTRTN="PRINT^OOPSPRT2",ZTDESC="Print a "_FORM
.S ZTSAVE("OUT")=""
.S ZTSAVE("CASE")=""
.S ZTSAVE("FORM")=""
.D ^%ZTLOAD D HOME^%ZIS Q
.Q
Q
PRINT ; This is the main print portion of the routine
I FORM="CA1" S FORM="CA-1"
I FORM="CA2" S FORM="CA-2"
D EN1^OOPSPCA(CASE,FORM)
Q
END ; exit the report
D ^%ZISC
S:$D(ZTQUEUED) ZTREQ="@"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSPRT2 2486 printed Dec 13, 2024@01:39:36 Page 2
OOPSPRT2 ;HINES/WAA-Print CA1/CA2 Routines ;3/24/98
+1 ;;2.0;ASISTS;;Jun 03, 2002
+2 ;;
+3 ; This routine is to display all the report that a person has
+4 ; access to.
EN1(CALLER) ;
+1 ; Input:
+2 ; Caller O = Safety Officer
+3 ; S = Supervisor
+4 ; E = Employee
+5 ;
+6 NEW OUT,CASE,FORM
+7 SET OUT=0
+8 SET IEN=$$SELECT(CALLER)
if IEN="0"
QUIT
+9 IF IEN="-1"
SET CASE=""
SET FORM=$$FORM
if FORM="-1"
QUIT
+10 IF '$TEST
SET CASE=$PIECE(IEN,U,2)
SET FORM="CA"_$$GET1^DIQ(2260,+IEN,52,"I")
+11 DO PRINT
+12 DO EXIT
+13 QUIT
EXIT ;
+1 KILL IO("Q")
+2 QUIT
FORM() ;Select a form to print
+1 NEW FORM
+2 ; Injury CA1
+3 ; Illness CA2
+4 NEW DIR,Y
+5 WRITE !," 1) Injury (CA1)"
+6 WRITE !," 2) Illness (CA2)"
+7 WRITE !
+8 SET DIR(0)="SAO^1:CA1;2:CA2"
+9 SET DIR("A")="Select Form: "
+10 SET DIR("?")="Select the form to be printed."
+11 DO ^DIR
+12 IF '$DATA(Y(0))
SET FORM="-1"
+13 IF '$TEST
SET FORM=Y(0)
+14 QUIT FORM
SELECT(CALLER) ; Select a case to print
+1 ;INPUT:
+2 ; CALLER = "E" FOR EMPLOYEE
+3 ; = "S" FOR SUPERVISOR
+4 ; = "O" FOR SAFETY OFFICER
+5 NEW SSN,IEN,CASE
+6 SET IEN=0
SET CASE=""
+7 ; Bad or no DUZ
IF $GET(DUZ)<1
QUIT "0"
+8 ; Person is not a valid user in 200
IF $GET(^VA(200,DUZ,1))=""
QUIT "0"
+9 ; Setup SSN
IF CALLER="E"
Begin DoDot:1
+10 SET SSN=$PIECE(^VA(200,DUZ,1),U,9)
+11 ; Ensure entry is in 2260
IF $DATA(^OOPS(2260,"SSN",SSN))<1
SET CASE="0"
+12 QUIT
End DoDot:1
IF CASE="0"
QUIT "0"
+13 Begin DoDot:1
+14 NEW DIC,X,Y
+15 SET DIC="^OOPS(2260,"
+16 IF CALLER="E"
SET DIC("S")="I $$EMP^OOPSPRT2(Y)"
+17 IF CALLER="S"
SET DIC("S")="I $$SUP^OOPSPRT2(Y)"
+18 IF CALLER="O"
SET DIC("S")="I $$SAF^OOPSPRT2(Y)"
+19 SET DIC(0)="AEMNZ"
SET DIC("A")=" Select Case: "
+20 DO ^DIC
+21 IF $DATA(DTOUT)!($DATA(DUOUT))
SET Y=0
+22 SET CASE=Y
+23 QUIT
End DoDot:1
+24 QUIT CASE
EMP(IEN) ; Employee
+1 NEW VIEW
+2 SET VIEW=1
+3 IF $$GET1^DIQ(2260,Y,51,"I")=2
SET VIEW=0
+4 IF '$$EMP^OOPSUTL1(IEN,SSN,1)
SET VIEW=0
+5 QUIT VIEW
SUP(IEN) ; Supervisor
+1 NEW VIEW
+2 SET VIEW=1
+3 IF $$GET1^DIQ(2260,Y,51,"I")=2
SET VIEW=0
+4 IF $$GET1^DIQ(2260,IEN,53,"I")'=DUZ
IF $$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ
SET VIEW=0
+5 QUIT VIEW
SAF(IEN) ; Safety Officer
+1 NEW VIEW
+2 SET VIEW=1
+3 IF $$GET1^DIQ(2260,Y,51,"I")=2
SET VIEW=0
+4 QUIT VIEW
DEVICE ; This is the device selection routine.
+1 ;
+2 SET %ZIS="QM"
DO ^%ZIS
IF POP
SET OUT=1
QUIT
+3 IF $DATA(IO("Q"))
Begin DoDot:1
+4 SET ZTRTN="PRINT^OOPSPRT2"
SET ZTDESC="Print a "_FORM
+5 SET ZTSAVE("OUT")=""
+6 SET ZTSAVE("CASE")=""
+7 SET ZTSAVE("FORM")=""
+8 DO ^%ZTLOAD
DO HOME^%ZIS
QUIT
+9 QUIT
End DoDot:1
QUIT
+10 QUIT
PRINT ; This is the main print portion of the routine
+1 IF FORM="CA1"
SET FORM="CA-1"
+2 IF FORM="CA2"
SET FORM="CA-2"
+3 DO EN1^OOPSPCA(CASE,FORM)
+4 QUIT
END ; exit the report
+1 DO ^%ZISC
+2 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 QUIT