OOPSGUI1 ;WIOFO/LLH - RPC routines ;9/3/01
;;2.0;ASISTS;**4,8,7,11,15,18,20,21,23,28,29,30,31,32**;Jun 03, 2002;Build 1
;
OPT(RESULTS,INP) ; Returns the ASISTS GUI Menus user has access to
; INP - Input String containing the version of GUI making call
; RESUTLS - return value for broker call
; P1 = 1 DUZ defined
; P2 = 1 Emp Health menu accessible
; P3 = 1 Employee menu accessible
; P4 = 1 Supervisor menu accessible
; P5 = 1 Safety Officer menu accessible
; P6 = 1 Union menu accessible
; P7 = 1 Workers' Comp menu accessible
; P8 = SSN from New Person file for user
; P9 = server version #
;
N CNT,MENU,OPT,PRIM,SM,VER
S CNT=1
I 'DUZ S RESULTS="0^^^^^^^" Q
S RESULTS=DUZ_"^0^0^0^0^0^0^"
;V1_P29 - changed version to 31
S VER="2.31.1.0" ;Define version check patch #4
I $G(INP)=""!($G(INP)'=VER) Q
S PRIM=$$GET1^DIQ(200,DUZ,201) ; get primary menu
I $G(PRIM)'="" S MENU(PRIM)=""
S SM=0
F S SM=$O(^VA(200,DUZ,203,SM)) Q:SM'>0 D
. S OPT=$$GET1^DIQ(19,$P($G(^VA(200,DUZ,203,SM,0)),U),.01)
. I $G(OPT)'="" S MENU(OPT)=""
;I $D(MENU("OOPS GUI EMPLOYEE HEALTH MENU")) S $P(RESULTS,U,2)=1 ;OOPS*2.0*32-Disabling for decommission
;I $D(MENU("OOPS GUI EMPLOYEE")) S $P(RESULTS,U,3)=1 ;OOPS*2.0*32-Disabling for decommission
;I $D(MENU("OOPS GUI SUPERVISOR MENU")) S $P(RESULTS,U,4)=1 ;OOPS*2.0*32-Disabling for decommision
I $D(MENU("OOPS GUI SAFETY OFFICER MENU")) S $P(RESULTS,U,5)=1
;I $D(MENU("OOPS GUI UNION MENU")) S $P(RESULTS,U,6)=1 ;OOPS*2.0*32-Disabling for decommission
I $D(MENU("OOPS GUI WORKERS' COMP MENU")) S $P(RESULTS,U,7)=1
;I +$$ACCESS^XQCHK(DUZ,"OOPS GUI EMPLOYEE") S $P(RESULTS,U,3)=1 ;OOPS*2.0*32-Disabling for decommission
S $P(RESULTS,U,8)=$$GET1^DIQ(200,DUZ,9)
S $P(RESULTS,U,9)=VER ;return the version defined above.
Q
SETSIGN(RESULTS,INPUT,SIGN) ; This subroutine validates that the signature
; can be entered and is valid
; Input: INPUT - Contains the IEN of the ASISTS case, the form type,
; and the field number. The field number is used
; to trigger what validation should be preformed on
; the fields in the form so that the signature can
; be applied. The fourth parameter is a special flag
; indicating the Workers Comp is signing for employee
; Format is IEN^FORM^FIELD^WCFLAG
; SIGN - contains the signature test to be encrypted.
; Output: RESULTS - is an array containing a list of fields that did
; not pass the data validation and must be corrected
; prior to applying a signature.
N CALL,DTIME,FDUZ,FDT,FLD,IEN,INC,FORM,ESIG,VALID,CALLER,WOK
N DR,DA,DIE,WCFLG
S IEN=$P($G(INPUT),U),FORM=$P($G(INPUT),U,2),FLD=$P($G(INPUT),U,3)
I '$G(IEN)!('$G(FLD)) S RESULTS(1)="User not Authorized to sign form" Q
I FLD=45!(FLD=170)!(FLD=266) S CALL="S"
I FLD=49!(FLD=77) S CALL="O"
; Patch 5 ll - added !(FLD=313)!(FLD=320)
I FLD=68!(FLD=313)!(FLD=320) S CALL="W"
I FLD=80 S CALL="H"
; Patch 5 llh - added !(FLD=310)
I FLD=120!(FLD=222)!(FLD=310) S CALL="E"
S WCFLG=$P($G(INPUT),U,4)
I WCFLG'="W" D
.; Patch 5 llh - moved non fld check logic to separate line
.; added stuff to check if dual benefits have been signed
.I (FLD=120!(FLD=222)) D
..I ($$GET1^DIQ(2260,IEN,71,"I")'="Y") D Q
...S RESULTS(1)="Claim cannot be signed until the Bill of Rights Statement is understood."
...D WCPBOR^OOPSMBUL(IEN)
;..Commented out Patch 11 cvw
;..I $$GET1^DIQ(2260,IEN,310)="" D Q
;...S RESULTS(1)="Claim cannot be signed until the Dual Benefits form has been signed."
; check to make sure PAID fields (also Service) not "", if "" get data
D CHKPAID
S VALID=0
S INC=$$GET1^DIQ(2260,IEN,52,"I")
; Patch 5 llh - added ,(FLD'>300)
I (FLD'=77),(FLD'=80),(FLD'>300) D I 'VALID Q
.D VALIDATE^OOPSGUI9(IEN,FORM,CALL,.VALID)
I $G(SIGN)="" S RESULTS(1)="No Signature Entered" Q
S VALID=$$VALIDATE($$DECRYP^XUSRB1(SIGN))
I 'VALID D Q
.I $P($G(^VA(200,DUZ,20)),"^",4)="" S RESULTS(1)="No Electronic Signature on File" Q
.S RESULTS(1)="Invalid Signature Entered."
SIGN ; All field validated, file signature
I FLD=77 S FDUZ=76,FDT=78 ; Safety approve WC sign
I FLD=80 S FDUZ=79,FDT=81 ; EH approve WC sign
I FLD=120 S FDUZ=119,FDT=121 ; Employee sign CA1
I FLD=222 S FDUZ=221,FDT=223 ; Employee sign CA2
I FLD=170 S FDUZ=169,FDT=171 ; Super sign CA1
I FLD=266 S FDUZ=265,FDT=267 ; Super sign CA2
I FLD=45 S FDUZ=44,FDT=46 ; Super sign 2162
I FLD=49 S FDUZ=48,FDT=50 ; Safety sign 2162
I FLD=68 S FDUZ=67,FDT=69,WOK=1 ; WC approve to DOL
; patch 5 llh - added next 2 lines (may need more)
I FLD=310 S FDUZ=309,FDT=311 ; Emp sign Dual Benefits
I FLD=313 S FDUZ=312,FDT=314 ; WC sign Dual Benefits
D NOW^%DTC S DTIME=%
K DR S DIE="^OOPS(2260,",DA=IEN
S DR=FDUZ_"////^S X=+DUZ;"_FLD_"////^S X=ESIG;"_FDT_"////^S X=DTIME"
D ^DIE
I $G(Y)'="" Q
I FLD=68 D WCP^OOPSMBUL(IEN,"S")
I FLD=120!(FLD=222) S CALLER=CALL D EMP^OOPSVAL1
I FLD=45 D SAFETY^OOPSMBUL(IEN)
I (FLD=170)!(FLD=266) D SUPS^OOPSMBUL(IEN),UNION^OOPSMBUL(IEN)
Q
VALIDATE(X) ; Validate Electronic Sign code
; Input: X - contains the signature to be validated
; Output: VSIGN - contains a 1 if a valid e-signature, a 0 if not valid
N VSIGN
S VSIGN=0
D HASH^XUSHSHP
I X'="",(X=$P($G(^VA(200,DUZ,20)),"^",4)) S VSIGN=1,ESIG=X
Q VSIGN
CHKPAID ; check to make sure PAID fields have data, if not populate
; this subroutine can be removed when go completely to GUI
N DA,DIE,DR,CAT,FLD,IEN200,OCCD,PAY,PAYP,RET,SAL,SERV,SSN
I $$GET1^DIQ(2260,IEN,60)="" D
.S FLD=26,RET="",RET=$$PAID^OOPSUTL1(IEN,FLD)
.S RET=$S(RET="FULL CSRS":"CSRS",RET="FERS":"FERS",1:"OTHER")
.S DIE="^OOPS(2260,",DA=IEN,DR="60///^S X=RET" D ^DIE
I $$GET1^DIQ(2260,IEN,86)="" D
.S SERV="",SSN=$$GET1^DIQ(2260,IEN,5,"I")
.I $G(SSN) S IEN200=$O(^VA(200,"SSN",SSN,""))
.I $G(IEN200) S SERV=$$GET1^DIQ(200,IEN200,29)
.S DIE="^OOPS(2260,",DA=IEN,DR="86///^S X=SERV" D ^DIE
I $$GET1^DIQ(2260,IEN,166)="" D
.S FLD=28,SAL="",SAL=$$PAID^OOPSUTL1(IEN,FLD)
.S DIE="^OOPS(2260,",DA=IEN,DR="166///^S X=SAL" D ^DIE
I $$GET1^DIQ(2260,IEN,167)="" D
.S FLD=19,PAY="",PAY=$$PAID^OOPSUTL1(IEN,FLD)
.S PAY=$S(PAY="PER ANNUM":"ANNUAL",PAY="PER HOUR":"HOURLY","PER DIEM":"DAILY","BIWEEKLY":"BI-WEEKLY",1:"")
.S DIE="^OOPS(2260,",DA=IEN,DR="167///^S X=PAY" D ^DIE
I $$GET1^DIQ(2260,IEN,63)="",($$GET1^DIQ(2260,IEN,2,"I")<3) D
.S CAT=$$GET1^DIQ(2260,IEN,2,"I")
.I CAT=1 S PAYP=$$PAID^OOPSUTL1(IEN,20) I $G(PAYP)'="" S PAYP=$$PAYP^OOPSUTL1(PAYP)
.I CAT=2 S PAYP="VO"
.S DIE="^OOPS(2260,",DA=IEN,DR="63///^S X=PAYP" D ^DIE
I $$GET1^DIQ(2260,IEN,111)="" D
.S FLD=16,OCCD="",OCCD=$$PAID^OOPSUTL1(IEN,FLD)
.S DIE="^OOPS(2260,",DA=IEN,DR="111///^S X=OCCD" D ^DIE
Q
VALEMP(RESULTS,INPUT) ; This broker call should be used if the Pay
; Plan = "OT" (other) to determine if the claim
; can be successfully submitted to DOL. The PERSONNEL
; STATUS is assumed to equal 1 (employee)
S IEN=$P($G(INPUT),U,2),FORM=$P($G(INPUT),U)
I '$G(IEN)!($G(FORM)="") S RESULTS="Invalid Input, cannot continue." Q
I $$VALEMP^OOPSUTL6 S RESULTS="Valid" Q
S RESULTS="Invalid data on claim"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSGUI1 7692 printed Dec 13, 2024@01:38:59 Page 2
OOPSGUI1 ;WIOFO/LLH - RPC routines ;9/3/01
+1 ;;2.0;ASISTS;**4,8,7,11,15,18,20,21,23,28,29,30,31,32**;Jun 03, 2002;Build 1
+2 ;
OPT(RESULTS,INP) ; Returns the ASISTS GUI Menus user has access to
+1 ; INP - Input String containing the version of GUI making call
+2 ; RESUTLS - return value for broker call
+3 ; P1 = 1 DUZ defined
+4 ; P2 = 1 Emp Health menu accessible
+5 ; P3 = 1 Employee menu accessible
+6 ; P4 = 1 Supervisor menu accessible
+7 ; P5 = 1 Safety Officer menu accessible
+8 ; P6 = 1 Union menu accessible
+9 ; P7 = 1 Workers' Comp menu accessible
+10 ; P8 = SSN from New Person file for user
+11 ; P9 = server version #
+12 ;
+13 NEW CNT,MENU,OPT,PRIM,SM,VER
+14 SET CNT=1
+15 IF 'DUZ
SET RESULTS="0^^^^^^^"
QUIT
+16 SET RESULTS=DUZ_"^0^0^0^0^0^0^"
+17 ;V1_P29 - changed version to 31
+18 ;Define version check patch #4
SET VER="2.31.1.0"
+19 IF $GET(INP)=""!($GET(INP)'=VER)
QUIT
+20 ; get primary menu
SET PRIM=$$GET1^DIQ(200,DUZ,201)
+21 IF $GET(PRIM)'=""
SET MENU(PRIM)=""
+22 SET SM=0
+23 FOR
SET SM=$ORDER(^VA(200,DUZ,203,SM))
if SM'>0
QUIT
Begin DoDot:1
+24 SET OPT=$$GET1^DIQ(19,$PIECE($GET(^VA(200,DUZ,203,SM,0)),U),.01)
+25 IF $GET(OPT)'=""
SET MENU(OPT)=""
End DoDot:1
+26 ;I $D(MENU("OOPS GUI EMPLOYEE HEALTH MENU")) S $P(RESULTS,U,2)=1 ;OOPS*2.0*32-Disabling for decommission
+27 ;I $D(MENU("OOPS GUI EMPLOYEE")) S $P(RESULTS,U,3)=1 ;OOPS*2.0*32-Disabling for decommission
+28 ;I $D(MENU("OOPS GUI SUPERVISOR MENU")) S $P(RESULTS,U,4)=1 ;OOPS*2.0*32-Disabling for decommision
+29 IF $DATA(MENU("OOPS GUI SAFETY OFFICER MENU"))
SET $PIECE(RESULTS,U,5)=1
+30 ;I $D(MENU("OOPS GUI UNION MENU")) S $P(RESULTS,U,6)=1 ;OOPS*2.0*32-Disabling for decommission
+31 IF $DATA(MENU("OOPS GUI WORKERS' COMP MENU"))
SET $PIECE(RESULTS,U,7)=1
+32 ;I +$$ACCESS^XQCHK(DUZ,"OOPS GUI EMPLOYEE") S $P(RESULTS,U,3)=1 ;OOPS*2.0*32-Disabling for decommission
+33 SET $PIECE(RESULTS,U,8)=$$GET1^DIQ(200,DUZ,9)
+34 ;return the version defined above.
SET $PIECE(RESULTS,U,9)=VER
+35 QUIT
SETSIGN(RESULTS,INPUT,SIGN) ; This subroutine validates that the signature
+1 ; can be entered and is valid
+2 ; Input: INPUT - Contains the IEN of the ASISTS case, the form type,
+3 ; and the field number. The field number is used
+4 ; to trigger what validation should be preformed on
+5 ; the fields in the form so that the signature can
+6 ; be applied. The fourth parameter is a special flag
+7 ; indicating the Workers Comp is signing for employee
+8 ; Format is IEN^FORM^FIELD^WCFLAG
+9 ; SIGN - contains the signature test to be encrypted.
+10 ; Output: RESULTS - is an array containing a list of fields that did
+11 ; not pass the data validation and must be corrected
+12 ; prior to applying a signature.
+13 NEW CALL,DTIME,FDUZ,FDT,FLD,IEN,INC,FORM,ESIG,VALID,CALLER,WOK
+14 NEW DR,DA,DIE,WCFLG
+15 SET IEN=$PIECE($GET(INPUT),U)
SET FORM=$PIECE($GET(INPUT),U,2)
SET FLD=$PIECE($GET(INPUT),U,3)
+16 IF '$GET(IEN)!('$GET(FLD))
SET RESULTS(1)="User not Authorized to sign form"
QUIT
+17 IF FLD=45!(FLD=170)!(FLD=266)
SET CALL="S"
+18 IF FLD=49!(FLD=77)
SET CALL="O"
+19 ; Patch 5 ll - added !(FLD=313)!(FLD=320)
+20 IF FLD=68!(FLD=313)!(FLD=320)
SET CALL="W"
+21 IF FLD=80
SET CALL="H"
+22 ; Patch 5 llh - added !(FLD=310)
+23 IF FLD=120!(FLD=222)!(FLD=310)
SET CALL="E"
+24 SET WCFLG=$PIECE($GET(INPUT),U,4)
+25 IF WCFLG'="W"
Begin DoDot:1
+26 ; Patch 5 llh - moved non fld check logic to separate line
+27 ; added stuff to check if dual benefits have been signed
+28 IF (FLD=120!(FLD=222))
Begin DoDot:2
+29 IF ($$GET1^DIQ(2260,IEN,71,"I")'="Y")
Begin DoDot:3
+30 SET RESULTS(1)="Claim cannot be signed until the Bill of Rights Statement is understood."
+31 DO WCPBOR^OOPSMBUL(IEN)
End DoDot:3
QUIT
End DoDot:2
End DoDot:1
+32 ;..Commented out Patch 11 cvw
+33 ;..I $$GET1^DIQ(2260,IEN,310)="" D Q
+34 ;...S RESULTS(1)="Claim cannot be signed until the Dual Benefits form has been signed."
+35 ; check to make sure PAID fields (also Service) not "", if "" get data
+36 DO CHKPAID
+37 SET VALID=0
+38 SET INC=$$GET1^DIQ(2260,IEN,52,"I")
+39 ; Patch 5 llh - added ,(FLD'>300)
+40 IF (FLD'=77)
IF (FLD'=80)
IF (FLD'>300)
Begin DoDot:1
+41 DO VALIDATE^OOPSGUI9(IEN,FORM,CALL,.VALID)
End DoDot:1
IF 'VALID
QUIT
+42 IF $GET(SIGN)=""
SET RESULTS(1)="No Signature Entered"
QUIT
+43 SET VALID=$$VALIDATE($$DECRYP^XUSRB1(SIGN))
+44 IF 'VALID
Begin DoDot:1
+45 IF $PIECE($GET(^VA(200,DUZ,20)),"^",4)=""
SET RESULTS(1)="No Electronic Signature on File"
QUIT
+46 SET RESULTS(1)="Invalid Signature Entered."
End DoDot:1
QUIT
SIGN ; All field validated, file signature
+1 ; Safety approve WC sign
IF FLD=77
SET FDUZ=76
SET FDT=78
+2 ; EH approve WC sign
IF FLD=80
SET FDUZ=79
SET FDT=81
+3 ; Employee sign CA1
IF FLD=120
SET FDUZ=119
SET FDT=121
+4 ; Employee sign CA2
IF FLD=222
SET FDUZ=221
SET FDT=223
+5 ; Super sign CA1
IF FLD=170
SET FDUZ=169
SET FDT=171
+6 ; Super sign CA2
IF FLD=266
SET FDUZ=265
SET FDT=267
+7 ; Super sign 2162
IF FLD=45
SET FDUZ=44
SET FDT=46
+8 ; Safety sign 2162
IF FLD=49
SET FDUZ=48
SET FDT=50
+9 ; WC approve to DOL
IF FLD=68
SET FDUZ=67
SET FDT=69
SET WOK=1
+10 ; patch 5 llh - added next 2 lines (may need more)
+11 ; Emp sign Dual Benefits
IF FLD=310
SET FDUZ=309
SET FDT=311
+12 ; WC sign Dual Benefits
IF FLD=313
SET FDUZ=312
SET FDT=314
+13 DO NOW^%DTC
SET DTIME=%
+14 KILL DR
SET DIE="^OOPS(2260,"
SET DA=IEN
+15 SET DR=FDUZ_"////^S X=+DUZ;"_FLD_"////^S X=ESIG;"_FDT_"////^S X=DTIME"
+16 DO ^DIE
+17 IF $GET(Y)'=""
QUIT
+18 IF FLD=68
DO WCP^OOPSMBUL(IEN,"S")
+19 IF FLD=120!(FLD=222)
SET CALLER=CALL
DO EMP^OOPSVAL1
+20 IF FLD=45
DO SAFETY^OOPSMBUL(IEN)
+21 IF (FLD=170)!(FLD=266)
DO SUPS^OOPSMBUL(IEN)
DO UNION^OOPSMBUL(IEN)
+22 QUIT
VALIDATE(X) ; Validate Electronic Sign code
+1 ; Input: X - contains the signature to be validated
+2 ; Output: VSIGN - contains a 1 if a valid e-signature, a 0 if not valid
+3 NEW VSIGN
+4 SET VSIGN=0
+5 DO HASH^XUSHSHP
+6 IF X'=""
IF (X=$PIECE($GET(^VA(200,DUZ,20)),"^",4))
SET VSIGN=1
SET ESIG=X
+7 QUIT VSIGN
CHKPAID ; check to make sure PAID fields have data, if not populate
+1 ; this subroutine can be removed when go completely to GUI
+2 NEW DA,DIE,DR,CAT,FLD,IEN200,OCCD,PAY,PAYP,RET,SAL,SERV,SSN
+3 IF $$GET1^DIQ(2260,IEN,60)=""
Begin DoDot:1
+4 SET FLD=26
SET RET=""
SET RET=$$PAID^OOPSUTL1(IEN,FLD)
+5 SET RET=$SELECT(RET="FULL CSRS":"CSRS",RET="FERS":"FERS",1:"OTHER")
+6 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="60///^S X=RET"
DO ^DIE
End DoDot:1
+7 IF $$GET1^DIQ(2260,IEN,86)=""
Begin DoDot:1
+8 SET SERV=""
SET SSN=$$GET1^DIQ(2260,IEN,5,"I")
+9 IF $GET(SSN)
SET IEN200=$ORDER(^VA(200,"SSN",SSN,""))
+10 IF $GET(IEN200)
SET SERV=$$GET1^DIQ(200,IEN200,29)
+11 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="86///^S X=SERV"
DO ^DIE
End DoDot:1
+12 IF $$GET1^DIQ(2260,IEN,166)=""
Begin DoDot:1
+13 SET FLD=28
SET SAL=""
SET SAL=$$PAID^OOPSUTL1(IEN,FLD)
+14 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="166///^S X=SAL"
DO ^DIE
End DoDot:1
+15 IF $$GET1^DIQ(2260,IEN,167)=""
Begin DoDot:1
+16 SET FLD=19
SET PAY=""
SET PAY=$$PAID^OOPSUTL1(IEN,FLD)
+17 SET PAY=$SELECT(PAY="PER ANNUM":"ANNUAL",PAY="PER HOUR":"HOURLY","PER DIEM":"DAILY","BIWEEKLY":"BI-WEEKLY",1:"")
+18 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="167///^S X=PAY"
DO ^DIE
End DoDot:1
+19 IF $$GET1^DIQ(2260,IEN,63)=""
IF ($$GET1^DIQ(2260,IEN,2,"I")<3)
Begin DoDot:1
+20 SET CAT=$$GET1^DIQ(2260,IEN,2,"I")
+21 IF CAT=1
SET PAYP=$$PAID^OOPSUTL1(IEN,20)
IF $GET(PAYP)'=""
SET PAYP=$$PAYP^OOPSUTL1(PAYP)
+22 IF CAT=2
SET PAYP="VO"
+23 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="63///^S X=PAYP"
DO ^DIE
End DoDot:1
+24 IF $$GET1^DIQ(2260,IEN,111)=""
Begin DoDot:1
+25 SET FLD=16
SET OCCD=""
SET OCCD=$$PAID^OOPSUTL1(IEN,FLD)
+26 SET DIE="^OOPS(2260,"
SET DA=IEN
SET DR="111///^S X=OCCD"
DO ^DIE
End DoDot:1
+27 QUIT
VALEMP(RESULTS,INPUT) ; This broker call should be used if the Pay
+1 ; Plan = "OT" (other) to determine if the claim
+2 ; can be successfully submitted to DOL. The PERSONNEL
+3 ; STATUS is assumed to equal 1 (employee)
+4 SET IEN=$PIECE($GET(INPUT),U,2)
SET FORM=$PIECE($GET(INPUT),U)
+5 IF '$GET(IEN)!($GET(FORM)="")
SET RESULTS="Invalid Input, cannot continue."
QUIT
+6 IF $$VALEMP^OOPSUTL6
SET RESULTS="Valid"
QUIT
+7 SET RESULTS="Invalid data on claim"
+8 QUIT