OOPSEMP1 ;HINES/WAA,GTD-E/E Employee data Routines ;3/25/98
;;2.0;ASISTS;;Jun 03, 2002
;;
; Employee/Person Address is now only stored in the 2162A node
; of file 2260. Prior to patch 3 it was stored in the CA1A and
; CA2A nodes depending on which form was entered. The address
; is only 'pulled' from this location when printing either form.
;
EN1(CALLER) ; Main Entry Point
;INPUT:
; CALLER = "E" FOR EMPLOYEE
; = "S" FOR SUPERVISOR
; = "O" FOR SAFETY OFFICER
; = "W" FOR WORKERS COMP
;
N SSN,IEN,FLD,ODESC,CAT,PAYP,OUT
S IEN=0,MAX1=528
Q:DUZ<1
Q:$G(^VA(200,DUZ,1))=""
I CALLER="E" D Q:$G(SSN)="" Q:$D(^OOPS(2260,"SSN",SSN))<1
.S SSN=$P(^VA(200,DUZ,1),U,9)
.I '$G(SSN) W !!,"No SSN on file for this Employee" Q
.I $D(^OOPS(2260,"SSN",SSN))<1 D
..W !!,"An Accident Report has not been created for this Employee"
D Q:IEN<1
.N DIC,X,INT
.S DIC="^OOPS(2260,"
.I CALLER="E" S DIC("S")="I $$EMP^OOPSUTL1(Y,SSN)"
.I CALLER="S" S DIC("S")="I $$SUP^OOPSEMP1(DUZ,Y)"
.I CALLER="O" S DIC("S")="I $$SAFE^OOPSEMP1(Y)"
.; PATCH 10
.I CALLER="W" S DIC("S")="I $$SCR^OOPSWCSE(Y)"
. ; Patch 5 - new Personnel status logic, make sure it's an employee
.S DIC("S")=DIC("S")_",$$ISEMP^OOPSUTL4(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
FORM S FORM=$$GET1^DIQ(2260,IEN,52,"I")
S FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
Q:FORM=""
; Patch 8 - changed call from local subroutine, only Signature that
; can be cleared is Employee.
I CALLER="E" D CLRES^OOPSUTL1(IEN,CALLER,FORM)
; Patch 8 - Get Occupation Desc from paid, only call if employee
S FLD=16,ODESC=""
I $$GET1^DIQ(2260,IEN,2,"I")=1 S ODESC=$$PAID^OOPSUTL1(IEN,FLD)
; Get Pay Plan from PAID, if Per Status (CAT) = 2 Set PAYP = "VO"
S PAYP="",CAT=""
S CAT=$$GET1^DIQ(2260,IEN,2,"I")
I CAT<3 D
. I CAT=1 S PAYP=$$PAID^OOPSUTL1(IEN,20) I $G(PAYP)'="" S PAYP=$$PAYP^OOPSUTL1(PAYP)
. I CAT=2 S PAYP="VO"
; patch 10 - Bill of Rights enhancement
I CALLER="E" S OUT="" D I OUT G EXIT ; if OUT, ^'d out of option
. I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D BOR
. I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D WCPBOR^OOPSMBUL(IEN)
. Q:OUT
N DR,DIE,SIGN2,OOPS
; Patch 8 - had to split routine due to size
I FORM="CA1" D ^OOPSEMPB
I FORM="CA2" D ^OOPSEMP2
S DIE="^OOPS(2260,",DA=IEN
D ^DIE
I $D(Y)'=0 G EXIT
I CALLER="E" D
. N SIGN
. ; patch 10 - bill of rights enhancement
. I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D Q
.. W !?5,"Claim cannot be signed until the Bill of Rights Statement is understood."
. D SIGN(FORM)
. Q:$G(SIGN)=""
. I $P(SIGN,U) D EMP^OOPSVAL1 ; new call patch 8
I CALLER="W" D
. W !!,"Checking for Safety and Emp Health Ok to sign for Employee."
. D WCPS4E^OOPSWCSE
EXIT ; quit the routine
K HSA,CIT,MAX,MAX1,STA,ZIP
Q
SAFE(IEN) ; Safety Officer Screen
N VIEW,FORM,TYPE
S VIEW=1
S (TYPE,FORM)=$$GET1^DIQ(2260,IEN,52,"I"),FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
; Patch 8 - if ok to send to DOL cant edit
I $$GET1^DIQ(2260,IEN,67)'="" S VIEW=0
I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,TYPE) S VIEW=0 ;Emp Signed
I $P($$EDSTA^OOPSUTL1(IEN,"S"),U,TYPE) S VIEW=0 ;Super Signed
I $$GET1^DIQ(2260,IEN,51,"I")'=0 S VIEW=0 ;Case not open
Q VIEW
SUP(DUZ,IEN) ; Supervisor Screen
N VIEW,FORM,SIGN,FORMS
S VIEW=1
S (FORMS,FORM)=$$GET1^DIQ(2260,IEN,52,"I"),FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,FORMS) S VIEW=0 ; Employee Signed
I $P($$EDSTA^OOPSUTL1(IEN,"S"),U,FORMS) S VIEW=0 ; Super Signed
I $$GET1^DIQ(2260,IEN,51,"I")'=0 S VIEW=0 ; Case is not open
; Patch 8 - if ok to send to DOL cant edit
I $$GET1^DIQ(2260,IEN,67)'="" S VIEW=0
I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ S VIEW=0 ; Not Supervisor for case
Q VIEW
SIGN(FORM) ; Sign/validate Document
N EMP,INC,VALID
S VALID=0,SIGN=""
S INC=$$GET1^DIQ(2260,IEN,52,"I")
W ! D VALIDATE^OOPSUTL4(IEN,FORM,"E",.VALID)
I 'VALID Q
I CALLER="E" D
. I $$GET1^DIQ(200,DUZ,20.4)="" D
.. W !!,"Please enter a Signature Code.",!
.. D ^XUSESIG
. S SIGN=$$SIG^OOPSESIG(DUZ,IEN)
Q
BOR ; patch 10 - does employee understand Bill of Rights
N DIE,DA,DR
S DA=IEN,DIE="^OOPS(2260,",DR=""
W !
S DR(1,2260,1)="71I have read and understood the Employee Bill of Rights:"
D ^DIE I $D(Y) S OUT=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSEMP1 4483 printed Dec 13, 2024@01:38:51 Page 2
OOPSEMP1 ;HINES/WAA,GTD-E/E Employee data Routines ;3/25/98
+1 ;;2.0;ASISTS;;Jun 03, 2002
+2 ;;
+3 ; Employee/Person Address is now only stored in the 2162A node
+4 ; of file 2260. Prior to patch 3 it was stored in the CA1A and
+5 ; CA2A nodes depending on which form was entered. The address
+6 ; is only 'pulled' from this location when printing either form.
+7 ;
EN1(CALLER) ; Main Entry Point
+1 ;INPUT:
+2 ; CALLER = "E" FOR EMPLOYEE
+3 ; = "S" FOR SUPERVISOR
+4 ; = "O" FOR SAFETY OFFICER
+5 ; = "W" FOR WORKERS COMP
+6 ;
+7 NEW SSN,IEN,FLD,ODESC,CAT,PAYP,OUT
+8 SET IEN=0
SET MAX1=528
+9 if DUZ<1
QUIT
+10 if $GET(^VA(200,DUZ,1))=""
QUIT
+11 IF CALLER="E"
Begin DoDot:1
+12 SET SSN=$PIECE(^VA(200,DUZ,1),U,9)
+13 IF '$GET(SSN)
WRITE !!,"No SSN on file for this Employee"
QUIT
+14 IF $DATA(^OOPS(2260,"SSN",SSN))<1
Begin DoDot:2
+15 WRITE !!,"An Accident Report has not been created for this Employee"
End DoDot:2
End DoDot:1
if $GET(SSN)=""
QUIT
if $DATA(^OOPS(2260,"SSN",SSN))<1
QUIT
+16 Begin DoDot:1
+17 NEW DIC,X,INT
+18 SET DIC="^OOPS(2260,"
+19 IF CALLER="E"
SET DIC("S")="I $$EMP^OOPSUTL1(Y,SSN)"
+20 IF CALLER="S"
SET DIC("S")="I $$SUP^OOPSEMP1(DUZ,Y)"
+21 IF CALLER="O"
SET DIC("S")="I $$SAFE^OOPSEMP1(Y)"
+22 ; PATCH 10
+23 IF CALLER="W"
SET DIC("S")="I $$SCR^OOPSWCSE(Y)"
+24 ; Patch 5 - new Personnel status logic, make sure it's an employee
+25 SET DIC("S")=DIC("S")_",$$ISEMP^OOPSUTL4(Y)"
+26 SET DIC(0)="AEMNZ"
SET DIC("A")=" Select Case: "
+27 DO ^DIC
+28 if Y<1
QUIT
+29 if $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+30 SET IEN=$PIECE(Y,U)
+31 QUIT
End DoDot:1
if IEN<1
QUIT
FORM SET FORM=$$GET1^DIQ(2260,IEN,52,"I")
+1 SET FORM=$SELECT(FORM=1:"CA1",FORM=2:"CA2",1:"")
+2 if FORM=""
QUIT
+3 ; Patch 8 - changed call from local subroutine, only Signature that
+4 ; can be cleared is Employee.
+5 IF CALLER="E"
DO CLRES^OOPSUTL1(IEN,CALLER,FORM)
+6 ; Patch 8 - Get Occupation Desc from paid, only call if employee
+7 SET FLD=16
SET ODESC=""
+8 IF $$GET1^DIQ(2260,IEN,2,"I")=1
SET ODESC=$$PAID^OOPSUTL1(IEN,FLD)
+9 ; Get Pay Plan from PAID, if Per Status (CAT) = 2 Set PAYP = "VO"
+10 SET PAYP=""
SET CAT=""
+11 SET CAT=$$GET1^DIQ(2260,IEN,2,"I")
+12 IF CAT<3
Begin DoDot:1
+13 IF CAT=1
SET PAYP=$$PAID^OOPSUTL1(IEN,20)
IF $GET(PAYP)'=""
SET PAYP=$$PAYP^OOPSUTL1(PAYP)
+14 IF CAT=2
SET PAYP="VO"
End DoDot:1
+15 ; patch 10 - Bill of Rights enhancement
+16 ; if OUT, ^'d out of option
IF CALLER="E"
SET OUT=""
Begin DoDot:1
+17 IF $$GET1^DIQ(2260,IEN,71,"I")'="Y"
DO BOR
+18 IF $$GET1^DIQ(2260,IEN,71,"I")'="Y"
DO WCPBOR^OOPSMBUL(IEN)
+19 if OUT
QUIT
End DoDot:1
IF OUT
GOTO EXIT
+20 NEW DR,DIE,SIGN2,OOPS
+21 ; Patch 8 - had to split routine due to size
+22 IF FORM="CA1"
DO ^OOPSEMPB
+23 IF FORM="CA2"
DO ^OOPSEMP2
+24 SET DIE="^OOPS(2260,"
SET DA=IEN
+25 DO ^DIE
+26 IF $DATA(Y)'=0
GOTO EXIT
+27 IF CALLER="E"
Begin DoDot:1
+28 NEW SIGN
+29 ; patch 10 - bill of rights enhancement
+30 IF $$GET1^DIQ(2260,IEN,71,"I")'="Y"
Begin DoDot:2
+31 WRITE !?5,"Claim cannot be signed until the Bill of Rights Statement is understood."
End DoDot:2
QUIT
+32 DO SIGN(FORM)
+33 if $GET(SIGN)=""
QUIT
+34 ; new call patch 8
IF $PIECE(SIGN,U)
DO EMP^OOPSVAL1
End DoDot:1
+35 IF CALLER="W"
Begin DoDot:1
+36 WRITE !!,"Checking for Safety and Emp Health Ok to sign for Employee."
+37 DO WCPS4E^OOPSWCSE
End DoDot:1
EXIT ; quit the routine
+1 KILL HSA,CIT,MAX,MAX1,STA,ZIP
+2 QUIT
SAFE(IEN) ; Safety Officer Screen
+1 NEW VIEW,FORM,TYPE
+2 SET VIEW=1
+3 SET (TYPE,FORM)=$$GET1^DIQ(2260,IEN,52,"I")
SET FORM=$SELECT(FORM=1:"CA1",FORM=2:"CA2",1:"")
+4 ; Patch 8 - if ok to send to DOL cant edit
+5 IF $$GET1^DIQ(2260,IEN,67)'=""
SET VIEW=0
+6 ;Emp Signed
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,TYPE)
SET VIEW=0
+7 ;Super Signed
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,TYPE)
SET VIEW=0
+8 ;Case not open
IF $$GET1^DIQ(2260,IEN,51,"I")'=0
SET VIEW=0
+9 QUIT VIEW
SUP(DUZ,IEN) ; Supervisor Screen
+1 NEW VIEW,FORM,SIGN,FORMS
+2 SET VIEW=1
+3 SET (FORMS,FORM)=$$GET1^DIQ(2260,IEN,52,"I")
SET FORM=$SELECT(FORM=1:"CA1",FORM=2:"CA2",1:"")
+4 ; Employee Signed
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"E"),U,FORMS)
SET VIEW=0
+5 ; Super Signed
IF $PIECE($$EDSTA^OOPSUTL1(IEN,"S"),U,FORMS)
SET VIEW=0
+6 ; Case is not open
IF $$GET1^DIQ(2260,IEN,51,"I")'=0
SET VIEW=0
+7 ; Patch 8 - if ok to send to DOL cant edit
+8 IF $$GET1^DIQ(2260,IEN,67)'=""
SET VIEW=0
+9 ; Not Supervisor for case
IF $$GET1^DIQ(2260,IEN,53,"I")'=DUZ
IF $$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ
SET VIEW=0
+10 QUIT VIEW
SIGN(FORM) ; Sign/validate Document
+1 NEW EMP,INC,VALID
+2 SET VALID=0
SET SIGN=""
+3 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+4 WRITE !
DO VALIDATE^OOPSUTL4(IEN,FORM,"E",.VALID)
+5 IF 'VALID
QUIT
+6 IF CALLER="E"
Begin DoDot:1
+7 IF $$GET1^DIQ(200,DUZ,20.4)=""
Begin DoDot:2
+8 WRITE !!,"Please enter a Signature Code.",!
+9 DO ^XUSESIG
End DoDot:2
+10 SET SIGN=$$SIG^OOPSESIG(DUZ,IEN)
End DoDot:1
+11 QUIT
BOR ; patch 10 - does employee understand Bill of Rights
+1 NEW DIE,DA,DR
+2 SET DA=IEN
SET DIE="^OOPS(2260,"
SET DR=""
+3 WRITE !
+4 SET DR(1,2260,1)="71I have read and understood the Employee Bill of Rights:"
+5 DO ^DIE
IF $DATA(Y)
SET OUT=1
+6 QUIT