source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSWCSE.m@ 1005

Last change on this file since 1005 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1OOPSWCSE ;WIOFO/LLH-Workers' Comp Sign for Employee ;01/20/01
2 ;;2.0;ASISTS;;Jun 03, 2002
3 ;
4EN1(CALLER) ; Entry point for routine
5 ; Input: CALLER = "S" for Safety Officer
6 ; "H" for Employee Health
7 ; "W" for Workers' Comp
8 ;
9 N DIC,IEN,FORM,PRM1,PRM2,SIGN,VALID,Y
10 Q:DUZ<1
11 Q:$G(^VA(200,DUZ,1))=""
12 S IEN=0
13 S DIC="^OOPS(2260,"
14 S DIC("S")="I $$SCR^OOPSWCSE(Y)"_",'$$GET1^DIQ(2260,Y,51,""I"")"
15 S DIC(0)="AEMNZ",DIC("A")=" Select Case: "
16 D ^DIC
17 I (Y<1)!$D(DTOUT)!($D(DUOUT)) Q
18 S IEN=$P(Y,U)
19 S FORM=$$GET1^DIQ(2260,IEN,52,"I")
20 S FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
21 I $G(FORM)="" Q
22 D ^OOPSDIS
23 S PRM1=$S(CALLER="S":"Safety Officer",CALLER="H":"Employee Health",1:0)
24 S PRM2=PRM1_" approves the WCP signing for the Employee: "
25 S SIGN=""
26 I CALLER="W" G WCPS4E
27 I $$VALID^OOPSWCSE() D
28 . W !,PRM2
29 . S SIGN=$$SIG^OOPSESIG(DUZ,IEN)
30 . Q:+SIGN=0 ; form not signed
31 . I CALLER="S" S $P(^OOPS(2260,IEN,"WCSE"),U,1,3)=SIGN
32 . I CALLER="H" S $P(^OOPS(2260,IEN,"WCSE"),U,4,6)=SIGN
33 G EXIT
34WCPS4E ; allow WCP to sign for employee if all approvals given
35 N CONT,EHS,SIGN,SOS,VALID,VIEW
36 S SIGN=0,VALID=0,VIEW=1
37 S SOS=$$GET1^DIQ(2260,IEN,76,"I")
38 S EHS=$$GET1^DIQ(2260,IEN,79,"I")
39 S CONT=$S(DUZ=SOS:"S",DUZ=EHS:"H",1:"")
40 I (CONT="S")!(CONT="H") D
41 . W !,"You have approved as "_$S(CONT="S":"Safety Officer",CONT="H":"Emp Health Rep",1:"")
42 . W " and cannot sign as Employee."
43 . W !,"Three different individuals must be involved."
44 . S VIEW=0
45 I '$G(SOS) S VIEW=0 W !,"Safety Officer has not approved WCP signing for employee."
46 I '$G(EHS) S VIEW=0 W !,"Employee Health has not approved WCP signing for employee."
47 I VIEW D
48 . ; Allow clearing WCP signature, employee may be able to sign
49 . I $$GET1^DIQ(2260,IEN,119,"I") D CLRES^OOPSUTL1(IEN,"E",FORM)
50 . W ! D VALIDATE^OOPSUTL4(IEN,FORM,"E",.VALID)
51 . I 'VALID Q
52 . S SIGN=$$SIG^OOPSESIG(DUZ,IEN)
53 . Q:+SIGN=0
54 . D EMP^OOPSVAL1
55EXIT ;
56 K DTOUT,DUOUT,SUP ; left over from OOPSDIS
57 Q
58VALID() ; make sure same person is not signing for both safety and EH and if
59 ; signed from menu option being called not needed again - so quit
60 N CONT,EHAPP,ERR,SOAPP,VALID
61 S VALID=1,ERR=0
62 S SOAPP=$P($G(^OOPS(2260,IEN,"WCSE")),U)
63 S EHAPP=$P($G(^OOPS(2260,IEN,"WCSE")),U,4)
64 S CONT=$S(DUZ=SOAPP:"S",DUZ=EHAPP:"H",1:"")
65 I CALLER="S" D
66 . I CONT="S" S ERR=1
67 . I $G(EHAPP)=DUZ S ERR=2
68 . I $G(SOAPP)&($G(CONT)="") S ERR=3
69 I CALLER="H" D
70 . I CONT="H" S ERR=1
71 . I $G(SOAPP)=DUZ S ERR=2
72 . I $G(EHAPP)&($G(CONT)="") S ERR=3
73 I ERR=1 D
74 . W !,"You have signed as "_PRM1_" if you continue, your ES will be removed"
75 . N DIR,FLD,Y
76 . W !
77 . S DIR("A")="Continue",DIR(0)="SBM^Y:Yes;N:No"
78 . D ^DIR
79 . I Y="Y" D
80 .. S FLD=$S(CALLER="S":"1,3",CALLER="H":"4,6",1:"")
81 .. F I=$P(FLD,","):1:$P(FLD,",",2) S $P(^OOPS(2260,IEN,"WCSE"),U,I)=""
82 . I Y'="Y" S VALID=0
83 I ERR=2 D
84 . W !,"You have already signed as "
85 . W $S(CALLER="S":"Employee Health",CALLER="H":"Safety Officer",1:0)
86 . W ".",!,"Both signatures cannot be made by the same person."
87 . S VALID=0
88 I ERR=3 D
89 . W !,PRM1_" has already signed, re-signing is not required."
90 . S VALID=0
91 Q VALID
92SCR(IEN) ; Screen to allow access to claims that have not been
93 ; signed by the Employee
94 ; Input: IEN = Internal record number of claim
95 N VIEW,EES,ESTAT,FORM,FLD
96 S VIEW=1
97 S FORM=$$GET1^DIQ(2260,IEN,52,"I")
98 I '$$ISEMP^OOPSUTL4(IEN) S VIEW=0 ; not emp, can't sign
99 S ESTAT=$$EDSTA^OOPSUTL1(IEN,"E") ; employee signed?
100 I CALLER'="W",$P(ESTAT,U,FORM) S VIEW=0 ; employee signed
101 I CALLER="W" D ; from WC menu
102 . S FLD=$S(FORM=1:119,FORM=2:221,1:"")
103 . I 'FLD S VIEW=0 Q
104 . S EES=$$GET1^DIQ(2260,IEN,FLD,"I")
105 . I 'EES Q ; not signed by emp
106 . I EES'=DUZ S VIEW=0 Q ; signer = user
107 . I $P($$EDSTA^OOPSUTL1(IEN,"S"),U,FORM) S VIEW=0 ; Super Signed
108 Q VIEW
Note: See TracBrowser for help on using the repository browser.