OOPSSUP1 ;HINES/WAA-S/E Supervisor Edit routine ;04/17/1998
;;2.0;ASISTS;;Jun 03, 2002
;;
EN1(CALLER) ; Main Entry Point
S CALLER=$G(CALLER,"S") ; check CALLER
N SSN,IEN,EDIT,OUT,FORM,SUP,SER
S EDIT=""
S (OUT,IEN)=0
Q:DUZ<1
Q:$G(^VA(200,DUZ,1))=""
D INCIDENT(CALLER) Q:IEN<1 ; Select a Employee
D ^OOPSDIS ; Display header information
D SELECT ; Select the form to be processed.
Q:EDIT=""
D FORMS ; Process the forms that ther user selected
L -^OOPS(2260,IEN)
Q
SELECT ; Select a form
; Injury (2162,CA1)
; Illness (2162,CA2)
; VA form 2162
; Get the type of incident
; If the supporting global doesn't exist force the
; Supervisor to fill both the 2162 and supporting form.
N SIGN,INC,SAFE,CAT,INCTYP
S EDIT=""
S SIGN=$$EDSTA^OOPSUTL1(IEN,"S")
S INC=$$GET1^DIQ(2260,IEN,52,"I")
S SAFE=+$$EDSTA^OOPSUTL1(IEN,"O")
; Allow Non-PAID employee - CAT=6
S CAT=$$GET1^DIQ(2260,IEN,2,"I")
; Patch 5 - change logic for other Personnel Types
I '$$ISEMP^OOPSUTL4(IEN),'SAFE S EDIT="2162" Q ;Person not EMP/NONPAID
I SAFE S EDIT=$P("CA1^CA2",U,INC) Q
; ^...The safety officer has sign and ca1 or ca2 can be edited
S INCTYP=$P("CA1^CA2",U,INC)
I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,INC),$P($$EDSTA^OOPSUTL1(IEN,"S"),U,INC) S EDIT="2162" Q
I '$$CHECK^OOPSUTL3(IEN,INCTYP) S EDIT="2162^"_INCTYP Q
; No data has been entered for the ca1/2
; ^^^ Force the Super to edit both and once.
S EDIT=""
I '$P(SIGN,U,3)
N DIR,Y
N PROMPT1,PROMPT2,SEL1,SEL2
S PROMPT1="1) VA FORM 2162 "
S PROMPT2=" 2) "_$S(INC=1:"Injury (CA1",INC=2:"Illness (CA2",1:"")_")"
W !," Select form: ",PROMPT1
W !,PROMPT2
S DIR(0)="SAO^1:2162;2:"_$S(INC=1:"CA1",INC=2:"CA2",1:"")
S DIR("A")=" Select form: "
S DIR("?")=" Select the form to be edited."
D ^DIR
I '$D(Y(0)) S EDIT="" Q
S EDIT=Y(0)
K MAX,MAX1
Q
INCIDENT(CALLER) ; Select a case
N DIC,X
S DIC="^OOPS(2260,"
I CALLER="S" S DIC("S")="I $$SUP^OOPSSUP1(Y)"
I CALLER="O" S DIC("S")="I $$SAFETY^OOPSSUP1(Y)"
S DIC(0)="AEMNZ",DIC("A")=" Select Case: "
D ^DIC
Q:Y<1
Q:$D(DTOUT)!($D(DUOUT))
S IEN=$P(Y,U)
Q
SUP(IEN) ; Supervisor Screen
N VIEW,ISEMP
S VIEW=1
I $$GET1^DIQ(2260,IEN,51,"I") S VIEW=0 ; Case is not open
I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ S VIEW=0 ; Not the Super or Alternate Super
; Patch 5 - new $$ for determining if employee
S ISEMP=$$ISEMP^OOPSUTL4(IEN)
I 'ISEMP D ; person is not an employee
.I +$$EDSTA^OOPSUTL1(IEN,"O") S VIEW=0 Q ; Safety has signed
.Q
I ISEMP D ; filters emps who have sign, sup who sign & safety who sign
.S INC=$$GET1^DIQ(2260,IEN,52,"I")
.I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,INC),$P($$EDSTA^OOPSUTL1(IEN,"S"),U,INC),+$$EDSTA^OOPSUTL1(IEN,"O") S VIEW=0
.Q
Q VIEW
SAFETY(IEN) ; Safety officer screen
N VIEW,INC,ISEMP
S VIEW=1
S INC=$$GET1^DIQ(2260,IEN,52,"I")
I $$GET1^DIQ(2260,IEN,51,"I") S VIEW=0 ; Case is not open
S ISEMP=$$ISEMP^OOPSUTL4(IEN)
I 'ISEMP D ; person is not an employee
.I +$$EDSTA^OOPSUTL1(IEN,"O") S VIEW=0 Q ; Safety has signed
.Q
I ISEMP D ; This will filter emps who have sign, sup who sign and safety who sign
.I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,INC),$P($$EDSTA^OOPSUTL1(IEN,"S"),U,INC),+$$EDSTA^OOPSUTL1(IEN,"O") S VIEW=0
.Q
I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ D
.I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,INC),$P($$EDSTA^OOPSUTL1(IEN,"S"),U,INC),$P($$EDSTA^OOPSUTL1(IEN,"S"),U,3) S VIEW=0
.Q
Q VIEW
FORMS ; Process Form
N I
;Patch 7 - new variables used
N AIEN,AGN,ADD,CITY,STATE,ZIP,PNAME,PADD,PCITY,PSTATE,PZIP,STAT,SIEN
N FLD,PAY,RET,SAL
; Get default fields from PAID
S FLD=28,SAL=""
S SAL=$$PAID^OOPSUTL1(IEN,FLD)
S FLD=26,RET=""
S RET=$$PAID^OOPSUTL1(IEN,FLD)
S RET=$S(RET="FULL CSRS":"CSRS",RET="FERS":"FERS",1:"OTHER")
S FLD=19,PAY=""
S PAY=$$PAID^OOPSUTL1(IEN,FLD)
S PAY=$S(PAY="PER ANNUM":"ANNUAL",PAY="PER HOUR":"HOURLY","PER DIEM":"DAILY","BIWEEKLY":"BI-WEEKLY",1:"")
F I=1:1 S FORM=$P(EDIT,U,I) Q:FORM="" D Q:OUT
.N DR,DIE,SIGN,EDIT,I
.I (CALLER="S"),($$GET1^DIQ(2260,IEN,53,"I")=DUZ!($$GET1^DIQ(2260,IEN,53.1,"I")=DUZ)) D CLRES^OOPSUTL1(IEN,"S",FORM)
.I FORM="2162" D ASIST^OOPSSUP3 Q:OUT
.I FORM="CA1" D CA1^OOPSSUPB Q:OUT
.I FORM="CA2" D CA2^OOPSSUP2 Q:OUT
.S DIE="^OOPS(2260,",DA=IEN
.L +^OOPS(2260,IEN):2
.E W !!?5,"Another user is editing this entry. Try later." S OUT=1 Q
.D ^DIE
.I ($D(Y)'=0)!($G(DIRUT)=1) S OUT=1 Q ; Quit if user exits
.I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ Q
.D SIGNS(FORM) ; Sign/validate Document
.Q:'$P(SIGN,U) ; Quit if user doesn't sign
.D FILE ; User Signs and files
.Q
Q
SIGNS(FORM) ; Sign/validate Document
N EMP,INC,VALID
S VALID=0,SIGN=""
S EMP=$$EDSTA^OOPSUTL1(IEN,"E")
S INC=$$GET1^DIQ(2260,IEN,52,"I")
D VALIDATE^OOPSUTL4(IEN,FORM,"S",.VALID)
I FORM'="2162",'$P(EMP,U,INC) D Q ;Employee has not signed yet
.W !,?10,"The employee has not signed the ",FORM,"." Q
.Q
I FORM=2162,CALLER="O",('$P($$EDSTA^OOPSUTL1(IEN,"S"),U,3)) D Q
.W !?10,"Supervisor must sign before Safety Officer"
I 'VALID Q
S SIGN=$$SIG^OOPSESIG(DUZ,IEN)
Q
FILE ;File the ES and send a bull
I FORM="2162" D
. I CALLER="S" S $P(^OOPS(2260,IEN,"2162ES"),U,1,3)=SIGN D SAFETY^OOPSMBUL(IEN)
. I CALLER="O" S $P(^OOPS(2260,IEN,"2162ES"),U,4,6)=SIGN
I FORM="CA1" S $P(^OOPS(2260,IEN,"CA1ES"),U,4,6)=SIGN D SUPS^OOPSMBUL(IEN),UNION^OOPSMBUL(IEN)
I FORM="CA2" S $P(^OOPS(2260,IEN,"CA2ES"),U,4,6)=SIGN D SUPS^OOPSMBUL(IEN),UNION^OOPSMBUL(IEN)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSSUP1 5645 printed Dec 13, 2024@01:39:40 Page 2
OOPSSUP1 ;HINES/WAA-S/E Supervisor Edit routine ;04/17/1998
+1 ;;2.0;ASISTS;;Jun 03, 2002
+2 ;;
EN1(CALLER) ; Main Entry Point
+1 ; check CALLER
SET CALLER=$GET(CALLER,"S")
+2 NEW SSN,IEN,EDIT,OUT,FORM,SUP,SER
+3 SET EDIT=""
+4 SET (OUT,IEN)=0
+5 if DUZ<1
QUIT
+6 if $GET(^VA(200,DUZ,1))=""
QUIT
+7 ; Select a Employee
DO INCIDENT(CALLER)
if IEN<1
QUIT
+8 ; Display header information
DO ^OOPSDIS
+9 ; Select the form to be processed.
DO SELECT
+10 if EDIT=""
QUIT
+11 ; Process the forms that ther user selected
DO FORMS
+12 LOCK -^OOPS(2260,IEN)
+13 QUIT
SELECT ; Select a form
+1 ; Injury (2162,CA1)
+2 ; Illness (2162,CA2)
+3 ; VA form 2162
+4 ; Get the type of incident
+5 ; If the supporting global doesn't exist force the
+6 ; Supervisor to fill both the 2162 and supporting form.
+7 NEW SIGN,INC,SAFE,CAT,INCTYP
+8 SET EDIT=""
+9 SET SIGN=$$EDSTA^OOPSUTL1(IEN,"S")
+10 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+11 SET SAFE=+$$EDSTA^OOPSUTL1(IEN,"O")
+12 ; Allow Non-PAID employee - CAT=6
+13 SET CAT=$$GET1^DIQ(2260,IEN,2,"I")
+14 ; Patch 5 - change logic for other Personnel Types
+15 ;Person not EMP/NONPAID
IF '$$ISEMP^OOPSUTL4(IEN)
IF 'SAFE
SET EDIT="2162"
QUIT
+16 IF SAFE
SET EDIT=$PIECE("CA1^CA2",U,INC)
QUIT
+17 ; ^...The safety officer has sign and ca1 or ca2 can be edited
+18 SET INCTYP=$PIECE("CA1^CA2",U,INC)
+19 IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,INC)
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,INC)
SET EDIT="2162"
QUIT
+20 IF '$$CHECK^OOPSUTL3(IEN,INCTYP)
SET EDIT="2162^"_INCTYP
QUIT
+21 ; No data has been entered for the ca1/2
+22 ; ^^^ Force the Super to edit both and once.
+23 SET EDIT=""
+24 IF '$PIECE(SIGN,U,3)
+25 NEW DIR,Y
+26 NEW PROMPT1,PROMPT2,SEL1,SEL2
+27 SET PROMPT1="1) VA FORM 2162 "
+28 SET PROMPT2=" 2) "_$SELECT(INC=1:"Injury (CA1",INC=2:"Illness (CA2",1:"")_")"
+29 WRITE !," Select form: ",PROMPT1
+30 WRITE !,PROMPT2
+31 SET DIR(0)="SAO^1:2162;2:"_$SELECT(INC=1:"CA1",INC=2:"CA2",1:"")
+32 SET DIR("A")=" Select form: "
+33 SET DIR("?")=" Select the form to be edited."
+34 DO ^DIR
+35 IF '$DATA(Y(0))
SET EDIT=""
QUIT
+36 SET EDIT=Y(0)
+37 KILL MAX,MAX1
+38 QUIT
INCIDENT(CALLER) ; Select a case
+1 NEW DIC,X
+2 SET DIC="^OOPS(2260,"
+3 IF CALLER="S"
SET DIC("S")="I $$SUP^OOPSSUP1(Y)"
+4 IF CALLER="O"
SET DIC("S")="I $$SAFETY^OOPSSUP1(Y)"
+5 SET DIC(0)="AEMNZ"
SET DIC("A")=" Select Case: "
+6 DO ^DIC
+7 if Y<1
QUIT
+8 if $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+9 SET IEN=$PIECE(Y,U)
+10 QUIT
SUP(IEN) ; Supervisor Screen
+1 NEW VIEW,ISEMP
+2 SET VIEW=1
+3 ; Case is not open
IF $$GET1^DIQ(2260,IEN,51,"I")
SET VIEW=0
+4 ; Not the Super or Alternate Super
IF $$GET1^DIQ(2260,IEN,53,"I")'=DUZ
IF $$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ
SET VIEW=0
+5 ; Patch 5 - new $$ for determining if employee
+6 SET ISEMP=$$ISEMP^OOPSUTL4(IEN)
+7 ; person is not an employee
IF 'ISEMP
Begin DoDot:1
+8 ; Safety has signed
IF +$$EDSTA^OOPSUTL1(IEN,"O")
SET VIEW=0
QUIT
+9 QUIT
End DoDot:1
+10 ; filters emps who have sign, sup who sign & safety who sign
IF ISEMP
Begin DoDot:1
+11 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+12 IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,INC)
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,INC)
IF +$$EDSTA^OOPSUTL1(IEN,"O")
SET VIEW=0
+13 QUIT
End DoDot:1
+14 QUIT VIEW
SAFETY(IEN) ; Safety officer screen
+1 NEW VIEW,INC,ISEMP
+2 SET VIEW=1
+3 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+4 ; Case is not open
IF $$GET1^DIQ(2260,IEN,51,"I")
SET VIEW=0
+5 SET ISEMP=$$ISEMP^OOPSUTL4(IEN)
+6 ; person is not an employee
IF 'ISEMP
Begin DoDot:1
+7 ; Safety has signed
IF +$$EDSTA^OOPSUTL1(IEN,"O")
SET VIEW=0
QUIT
+8 QUIT
End DoDot:1
+9 ; This will filter emps who have sign, sup who sign and safety who sign
IF ISEMP
Begin DoDot:1
+10 IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,INC)
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,INC)
IF +$$EDSTA^OOPSUTL1(IEN,"O")
SET VIEW=0
+11 QUIT
End DoDot:1
+12 IF $$GET1^DIQ(2260,IEN,53,"I")'=DUZ
IF $$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ
Begin DoDot:1
+13 IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,INC)
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,INC)
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,3)
SET VIEW=0
+14 QUIT
End DoDot:1
+15 QUIT VIEW
FORMS ; Process Form
+1 NEW I
+2 ;Patch 7 - new variables used
+3 NEW AIEN,AGN,ADD,CITY,STATE,ZIP,PNAME,PADD,PCITY,PSTATE,PZIP,STAT,SIEN
+4 NEW FLD,PAY,RET,SAL
+5 ; Get default fields from PAID
+6 SET FLD=28
SET SAL=""
+7 SET SAL=$$PAID^OOPSUTL1(IEN,FLD)
+8 SET FLD=26
SET RET=""
+9 SET RET=$$PAID^OOPSUTL1(IEN,FLD)
+10 SET RET=$SELECT(RET="FULL CSRS":"CSRS",RET="FERS":"FERS",1:"OTHER")
+11 SET FLD=19
SET PAY=""
+12 SET PAY=$$PAID^OOPSUTL1(IEN,FLD)
+13 SET PAY=$SELECT(PAY="PER ANNUM":"ANNUAL",PAY="PER HOUR":"HOURLY","PER DIEM":"DAILY","BIWEEKLY":"BI-WEEKLY",1:"")
+14 FOR I=1:1
SET FORM=$PIECE(EDIT,U,I)
if FORM=""
QUIT
Begin DoDot:1
+15 NEW DR,DIE,SIGN,EDIT,I
+16 IF (CALLER="S")
IF ($$GET1^DIQ(2260,IEN,53,"I")=DUZ!($$GET1^DIQ(2260,IEN,53.1,"I")=DUZ))
DO CLRES^OOPSUTL1(IEN,"S",FORM)
+17 IF FORM="2162"
DO ASIST^OOPSSUP3
if OUT
QUIT
+18 IF FORM="CA1"
DO CA1^OOPSSUPB
if OUT
QUIT
+19 IF FORM="CA2"
DO CA2^OOPSSUP2
if OUT
QUIT
+20 SET DIE="^OOPS(2260,"
SET DA=IEN
+21 LOCK +^OOPS(2260,IEN):2
+22 IF '$TEST
WRITE !!?5,"Another user is editing this entry. Try later."
SET OUT=1
QUIT
+23 DO ^DIE
+24 ; Quit if user exits
IF ($DATA(Y)'=0)!($GET(DIRUT)=1)
SET OUT=1
QUIT
+25 IF $$GET1^DIQ(2260,IEN,53,"I")'=DUZ
IF $$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ
QUIT
+26 ; Sign/validate Document
DO SIGNS(FORM)
+27 ; Quit if user doesn't sign
if '$PIECE(SIGN,U)
QUIT
+28 ; User Signs and files
DO FILE
+29 QUIT
End DoDot:1
if OUT
QUIT
+30 QUIT
SIGNS(FORM) ; Sign/validate Document
+1 NEW EMP,INC,VALID
+2 SET VALID=0
SET SIGN=""
+3 SET EMP=$$EDSTA^OOPSUTL1(IEN,"E")
+4 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+5 DO VALIDATE^OOPSUTL4(IEN,FORM,"S",.VALID)
+6 ;Employee has not signed yet
IF FORM'="2162"
IF '$PIECE(EMP,U,INC)
Begin DoDot:1
+7 WRITE !,?10,"The employee has not signed the ",FORM,"."
QUIT
+8 QUIT
End DoDot:1
QUIT
+9 IF FORM=2162
IF CALLER="O"
IF ('$PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,3))
Begin DoDot:1
+10 WRITE !?10,"Supervisor must sign before Safety Officer"
End DoDot:1
QUIT
+11 IF 'VALID
QUIT
+12 SET SIGN=$$SIG^OOPSESIG(DUZ,IEN)
+13 QUIT
FILE ;File the ES and send a bull
+1 IF FORM="2162"
Begin DoDot:1
+2 IF CALLER="S"
SET $PIECE(^OOPS(2260,IEN,"2162ES"),U,1,3)=SIGN
DO SAFETY^OOPSMBUL(IEN)
+3 IF CALLER="O"
SET $PIECE(^OOPS(2260,IEN,"2162ES"),U,4,6)=SIGN
End DoDot:1
+4 IF FORM="CA1"
SET $PIECE(^OOPS(2260,IEN,"CA1ES"),U,4,6)=SIGN
DO SUPS^OOPSMBUL(IEN)
DO UNION^OOPSMBUL(IEN)
+5 IF FORM="CA2"
SET $PIECE(^OOPS(2260,IEN,"CA2ES"),U,4,6)=SIGN
DO SUPS^OOPSMBUL(IEN)
DO UNION^OOPSMBUL(IEN)
+6 QUIT