Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: OOPSUTL1

OOPSUTL1.m

Go to the documentation of this file.
  1. OOPSUTL1 ;HINES/WAA-Utilities Routines ;3/24/98
  1. ;;2.0;ASISTS;**8**;Jun 03, 2002
  1. ;;
  1. EMP(IEN,SSN,OPEN) ; DIC filter for Employee enter edit
  1. ;This is a screening routine that will filter
  1. ; out those entries that the user cannot see.
  1. ; Input:
  1. ; IEN is the internal entry number for the entry in 2260.
  1. ; SSN is the Employee Number in file 200
  1. ;=========================================
  1. ; VIEW is an indicator telling if the user can enter/edit
  1. ; this entry
  1. ;
  1. N VIEW
  1. S VIEW=0
  1. S OPEN=$G(OPEN,0)
  1. I $$OPEN(IEN,OPEN) D ;Record
  1. .I $$GET1^DIQ(2260,IEN,5,"I")=SSN D ; Is this record for this employee
  1. ..N SIG,INC
  1. ..S SIG=$$EDSTA^OOPSUTL1(IEN,"S")
  1. ..S INC=$$GET1^DIQ(2260,IEN,52,"I")
  1. ..I '$P(SIG,U,INC) S VIEW=1 ; Super has not signed
  1. ..I $$GET1^DIQ(2260,IEN,67)'="" S VIEW=0 ; Patch 8, no edit if to DOL
  1. .Q
  1. Q VIEW
  1. WS ; The following 4 subroutines are added with Patch 8 - DOL project
  1. ; Sets the "W" xref. A routine call is used to prevent the inadvertent
  1. ; re-indexing of xref. Xref is used for determining which records
  1. ; should be included in transmission of claims to DOL. When the record
  1. ; is placed in a Mailman message (WC xref set) this xref is killed.
  1. ; Variables
  1. ; WOK = set in OOPSWCE, used to prevent inadvertent
  1. ; re-indexing of ^OOPS(2260,"AW",X,IEN)
  1. ; IEN = uses IEN for DA of file 2260
  1. ; X = field 67 (DUZ)
  1. I '$D(WOK) Q
  1. I '$D(IEN) D Q
  1. . S MSG("DIHELP",1)="Required Cross Reference (""AW"") was not set up, call your IRM."
  1. . D MSG^DIALOG("WH","","","","MSG")
  1. S ^OOPS(2260,"AW",X,IEN)=""
  1. Q
  1. WK ; Kills the "AW" xref. See above as reason for manually setting
  1. ; WOK = set in OOPSWCE, used to prevent inadvertent reindex
  1. ; IEN = uses IEN for DA of file 2260
  1. ; X = field 67, file 2260 = DUZ
  1. N WCDUZ
  1. I '$D(WOK) Q
  1. I '$D(IEN) D Q
  1. . S MSG("DIHELP",1)="Required Cross Reference (""AW"") was not properly destroyed, call your IRM."
  1. . D MSG^DIALOG("WH","","","","MSG")
  1. ; V2.0 temp fix to keep duplicate entries out of x-ref
  1. S WCDUZ=""
  1. F S WCDUZ=$O(^OOPS(2260,"AW",WCDUZ)) Q:WCDUZ="" D
  1. . I $D(^OOPS(2260,"AW",WCDUZ,IEN)) K ^OOPS(2260,"AW",WCDUZ,IEN)
  1. Q
  1. WCS ; Sets the "AWC" xref. A routine call is used to prevent inadvertent
  1. ; re-indexing of the xref. Xref is used for determining which records
  1. ; were included in Mailman messages that transmitted claims to DOL
  1. ; Variables
  1. ; WOK = set in OOPSWCE, used to prevent inadvertent
  1. ; re-indexing of ^OOPS(2260,"AW",DUZ,IEN)
  1. ; IEN = record ID file 2260
  1. ; X = field 66 - Date Transmitted to DOL
  1. N WCDUZ
  1. I '$D(WOK) Q
  1. I '$D(IEN) D Q
  1. . S MSG("DIHELP",1)="Required Cross Reference (""AWC"") was not set up, call your IRM."
  1. . D MSG^DIALOG("WH","","","","MSG")
  1. S ^OOPS(2260,"AWC",X,IEN)=""
  1. ; V2.0 temp fix to keep duplicate entries out of x-ref
  1. S WCDUZ=""
  1. F S WCDUZ=$O(^OOPS(2260,"AW",WCDUZ)) Q:WCDUZ="" D
  1. . I $D(^OOPS(2260,"AW",WCDUZ,IEN)) K ^OOPS(2260,"AW",WCDUZ,IEN)
  1. Q
  1. WCK ; Kills the "AWC" xref. See above as reason for manually setting
  1. ; WOK = set in OOPSWCE, used to prevent inadvertent reindex
  1. ; IEN = uses IEN for DA of file 2260
  1. ; X = field 66 - Date Transmitted to DOL
  1. I '$D(WOK) Q
  1. I '$D(IEN) D Q
  1. . S MSG("DIHELP",1)="Required Cross Reference (""AWC"") was not properly destroyed, call your IRM."
  1. . D MSG^DIALOG("WH","","","","MSG")
  1. K ^OOPS(2260,"AWC",X,IEN)
  1. Q
  1. OPEN(IEN,OPEN) ; Determine if record is open
  1. N VIEW
  1. S OPEN=$G(OPEN,0)
  1. S VIEW=0
  1. I $G(^OOPS(2260,IEN,0))="" Q VIEW
  1. I 'OPEN,'$P(^OOPS(2260,IEN,0),U,6) S VIEW=1
  1. I OPEN,$P(^OOPS(2260,IEN,0),U,6)'=2 S VIEW=1
  1. Q VIEW
  1. EDSTA(IEN,CALLER) ; Gives the status of form to allows the user to
  1. ;Inputs:
  1. ; IEN is the internal entry number for the entry in 2260.
  1. ; CALLER is the type of user who is calling the routine.
  1. ; "E" = EMPLOYEE
  1. ; "S" = SUPERVISOR
  1. ; "O" = SAFETY
  1. ; "V" = VOLUNTEER
  1. ;
  1. ; ======================================
  1. ;Outputs
  1. ; If the Caller is Employee:
  1. ; SELECT=1^1 Both FORMS have been signed
  1. ; 0^0 Neither form has been signed
  1. ; 1^0 CA1 has been signed
  1. ; 0^1 CA2 has been signed
  1. ; If caller is Supervisor:
  1. ; SELECT=1^1^1 all FORMS have been signed
  1. ; 0^0^0 no form has been signed
  1. ; 1^0^0 CA1 has been signed
  1. ; 0^1^0 CA2 has been signed
  1. ; 0^0^1 2162 has been signed
  1. ; If caller is Safety Officer
  1. ; SELECT=1 File has been signed
  1. ; 0 File has not been signed
  1. ; If caller is Volunteer Supervisor
  1. ; SELECT=1 File has been signed
  1. ; 0 File has not been signed
  1. N SELECT,CA1,CA2,ACCD
  1. S SELECT=""
  1. I CALLER="S" D
  1. .N LINE
  1. .S LINE=""
  1. .F I=170,266,45 D
  1. ..S LINE=LINE_$S($$GET1^DIQ(2260,IEN,I,"I")'="":1,1:0)_U
  1. ..Q
  1. .S SELECT=$P(LINE,U,1,3)
  1. .Q
  1. I CALLER="E" S SELECT=$S($$GET1^DIQ(2260,IEN,120,"I")'="":1,1:0)_U_$S($$GET1^DIQ(2260,IEN,222,"I")'="":1,1:0)
  1. I CALLER="O" S SELECT=$S($$GET1^DIQ(2260,IEN,49,"I")'="":1,1:0)_U
  1. Q SELECT
  1. ;
  1. EDSEL(IEN,CALLER) ; Allow you to select the form part to edit
  1. ;
  1. ;
  1. ; IEN is the internal entry number for the entry in 2260.
  1. ; CALLER is the type of user who is calling the routine.
  1. ; "E" = EMPLOYEE
  1. ; "S" = SUPERVISOR
  1. ; "O" = SAFETY OFFICER
  1. ;
  1. ;
  1. N SELECT,EEFORM,CNT,Y,SEC
  1. S CNT=0
  1. S SELECT="",SEC="0^0",FORM=""
  1. S EEFORM=$$EDSTA(IEN,CALLER)
  1. I CALLER="E" S SEC=$$EDSTA^OOPSUTL1(IEN,"S")
  1. W @IOF,!!,?10,"Select Forms: "
  1. I CALLER="S" S CNT=CNT+1 W !,?20,CNT,") Form 2162" S FORM=FORM_"2162^"
  1. I '$P(SEC,U,1) S CNT=CNT+1 W !,?20,CNT,") ",$S($P(EEFORM,U)=1:"Edit",1:"Enter")," form CA1 (Injury)" S FORM=FORM_"CA1^"
  1. I '$P(SEC,U,2) S CNT=CNT+1 W !,?20,CNT,") ",$S($P(EEFORM,U,2)=1:"Edit",1:"Enter")," form CA2 (Illness)" S FORM=FORM_"CA2^"
  1. I CNT=1 S Y="1,"
  1. E D
  1. .W !!!
  1. .N DIR
  1. .S DIR("A")=" Select Forms"
  1. .S DIR(0)="L^1:"_CNT
  1. .D ^DIR
  1. I +Y F I=1:1 Q:$P(Y,",",I)<1 S SELECT=SELECT_$P(FORM,U,$P(Y,",",I))_"^"
  1. Q SELECT
  1. CLRES(IEN,CALLER,FORM) ; Clean out electronic SIG
  1. ;Input
  1. ; IEN = Internal Entry Number from file 2260
  1. ; CALLER is the type of user who is calling the routine.
  1. ; "E" = EMPLOYEE
  1. ; "S" = SUPERVISOR
  1. ; "O" = SAFETY OFFICER
  1. ; "W" = WORKER'S COMP OFFICIAL
  1. ; FORM Is the form to clear out ES
  1. ; Safety Officer = 2162
  1. ; Supervisor = CA1,CA2 and 2162
  1. ; Employee = CA1 and CA2, DUAL ;patch 5 added DUAL
  1. ; Workers Comp = CA1 and CA2, DUAL
  1. ;
  1. ; DOL = 1 if call from ^OOPSUTL6 to suppress printing cleared msg.
  1. ;
  1. N SIG,NODE,FIELD,FLG,CALL
  1. Q:FORM=""
  1. S FLG=""
  1. ; patch 5 llh - added D block logic and new form DUAL
  1. I CALLER="W" D
  1. . S SIG="WCES;1,3"
  1. . I FORM="DUAL" S SIG="DUAL;10,12"
  1. I CALLER="O" S SIG=$S(FORM="2162":"2162ES;4,6",1:"")
  1. S:CALLER="S" SIG=$S(FORM="CA1":"CA1ES;4,6",FORM="CA2":"CA2ES;4,6",FORM="2162":"2162ES;1,3",1:"")
  1. ; patch 5 llh - added logic for DUAL
  1. S:CALLER="E" SIG=$S(FORM="CA1":"CA1ES;1,3",FORM="CA2":"CA2ES;1,3",FORM="DUAL":"DUAL;7,9",1:"")
  1. Q:SIG=""
  1. S NODE=$P(SIG,";") Q:NODE=""
  1. S FIELD=$P(SIG,";",2)
  1. S CALL=$S(CALLER="W":2,CALLER="O":1,CALLER="S":1,CALLER="E":2,1:"")
  1. I 'CALL Q
  1. I '$D(^OOPS(2260,IEN,NODE)) Q
  1. I CALL=1,$P(^OOPS(2260,IEN,NODE),U,5)'="" S FLG=1
  1. I CALL=2,$P(^OOPS(2260,IEN,NODE),U,2)'="" S FLG=1
  1. ; patch 5 llh - added reset flag if form = DUAL
  1. I FORM="DUAL" S FLG=""
  1. F I=$P(FIELD,","):1:$P(FIELD,",",2) S $P(^OOPS(2260,IEN,NODE),U,I)=""
  1. I FLG&('$G(DOL)) D
  1. . ; Added '$$BROKER^XWBLIB to line below ASISTS V2.0 11/09/01 LLH
  1. . I '$$BROKER^XWBLIB W !!,"Your ES has been cleared. You will need to resign.",!
  1. . ;PATCH 11 CLEAR DATE SENT TO NDB IF SAFETY SIGNATURE REMOVED
  1. . I CALLER="O" S $P(^OOPS(2260,IEN,0),U,11)=""
  1. ; Security on ES - late in patch 8
  1. ; clears checksums set when emp portion of claim signed by emp
  1. ; patch 5 llh - added form DUAL
  1. I CALLER="E"&('$G(DOL)),(FORM'="DUAL") D
  1. . N RECORD
  1. . S RECORD=$G(^OOPS(2260,IEN,"CA"))
  1. . S $P(RECORD,U,7)="",$P(RECORD,U,9)="",^OOPS(2260,IEN,"CA")=RECORD
  1. Q
  1. ; Input - IEN internal entry number of case in file 2260
  1. ; - FLD the PAID field number to retrieve
  1. ; - NAME Name of Person Involved, used to get PAID IEN
  1. ; - VAL Data value from the PAID #450, field #FLD
  1. ; Output - DESC Description from Paid, if there
  1. ;
  1. N DESC,IEN450,NAME,LP
  1. S DESC="",LP=0
  1. S NAME=$$GET1^DIQ(2260,IEN,1)
  1. D FIND^DIC(450,,"@;8","MPS",NAME,100)
  1. I $G(DIERR) D CLEAN^DILF Q
  1. F S LP=$O(^TMP("DILIST",$J,LP)) Q:LP="" D
  1. . I $$GET1^DIQ(2260,IEN,5)=$P(^TMP("DILIST",$J,LP,0),U,2) D
  1. .. S IEN450=$P(^TMP("DILIST",$J,LP,0),U)
  1. .. S DESC=$$GET1^DIQ(450,IEN450,FLD)
  1. Q DESC
  1. ;
  1. PAYP(PAY) ; Map PAID Pay Plan to higher category for DOL project
  1. ;
  1. ; Input - PLAN This is the PAID Pay Plan Description
  1. ; from file 454, not the PAID Code
  1. ; Output - PPLAN Pay Plan that PAID Code maps to
  1. ;
  1. N PPLAN
  1. S PPLAN=$S($E(PAY)="G":"GS",$E(PAY)="W":"WG",$E(PAY)="N":"WG",$E(PAY)="V":PAY,PAY="AD":PAY,$E(PAY)="E":PAY,$E(PAY)="S":PAY,1:"OT")
  1. Q PPLAN