source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSEMP1.m@ 700

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

initial load of WorldVistAEHR

File size: 4.3 KB
RevLine 
[613]1OOPSEMP1 ;HINES/WAA,GTD-E/E Employee data Routines ;3/25/98
2 ;;2.0;ASISTS;;Jun 03, 2002
3 ;;
4 ; Employee/Person Address is now only stored in the 2162A node
5 ; of file 2260. Prior to patch 3 it was stored in the CA1A and
6 ; CA2A nodes depending on which form was entered. The address
7 ; is only 'pulled' from this location when printing either form.
8 ;
9EN1(CALLER) ; Main Entry Point
10 ;INPUT:
11 ; CALLER = "E" FOR EMPLOYEE
12 ; = "S" FOR SUPERVISOR
13 ; = "O" FOR SAFETY OFFICER
14 ; = "W" FOR WORKERS COMP
15 ;
16 N SSN,IEN,FLD,ODESC,CAT,PAYP,OUT
17 S IEN=0,MAX1=528
18 Q:DUZ<1
19 Q:$G(^VA(200,DUZ,1))=""
20 I CALLER="E" D Q:$G(SSN)="" Q:$D(^OOPS(2260,"SSN",SSN))<1
21 .S SSN=$P(^VA(200,DUZ,1),U,9)
22 .I '$G(SSN) W !!,"No SSN on file for this Employee" Q
23 .I $D(^OOPS(2260,"SSN",SSN))<1 D
24 ..W !!,"An Accident Report has not been created for this Employee"
25 D Q:IEN<1
26 .N DIC,X,INT
27 .S DIC="^OOPS(2260,"
28 .I CALLER="E" S DIC("S")="I $$EMP^OOPSUTL1(Y,SSN)"
29 .I CALLER="S" S DIC("S")="I $$SUP^OOPSEMP1(DUZ,Y)"
30 .I CALLER="O" S DIC("S")="I $$SAFE^OOPSEMP1(Y)"
31 .; PATCH 10
32 .I CALLER="W" S DIC("S")="I $$SCR^OOPSWCSE(Y)"
33 . ; Patch 5 - new Personnel status logic, make sure it's an employee
34 .S DIC("S")=DIC("S")_",$$ISEMP^OOPSUTL4(Y)"
35 .S DIC(0)="AEMNZ",DIC("A")=" Select Case: "
36 .D ^DIC
37 .Q:Y<1
38 .Q:$D(DTOUT)!($D(DUOUT))
39 .S IEN=$P(Y,U)
40 .Q
41FORM S FORM=$$GET1^DIQ(2260,IEN,52,"I")
42 S FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
43 Q:FORM=""
44 ; Patch 8 - changed call from local subroutine, only Signature that
45 ; can be cleared is Employee.
46 I CALLER="E" D CLRES^OOPSUTL1(IEN,CALLER,FORM)
47 ; Patch 8 - Get Occupation Desc from paid, only call if employee
48 S FLD=16,ODESC=""
49 I $$GET1^DIQ(2260,IEN,2,"I")=1 S ODESC=$$PAID^OOPSUTL1(IEN,FLD)
50 ; Get Pay Plan from PAID, if Per Status (CAT) = 2 Set PAYP = "VO"
51 S PAYP="",CAT=""
52 S CAT=$$GET1^DIQ(2260,IEN,2,"I")
53 I CAT<3 D
54 . I CAT=1 S PAYP=$$PAID^OOPSUTL1(IEN,20) I $G(PAYP)'="" S PAYP=$$PAYP^OOPSUTL1(PAYP)
55 . I CAT=2 S PAYP="VO"
56 ; patch 10 - Bill of Rights enhancement
57 I CALLER="E" S OUT="" D I OUT G EXIT ; if OUT, ^'d out of option
58 . I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D BOR
59 . I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D WCPBOR^OOPSMBUL(IEN)
60 . Q:OUT
61 N DR,DIE,SIGN2,OOPS
62 ; Patch 8 - had to split routine due to size
63 I FORM="CA1" D ^OOPSEMPB
64 I FORM="CA2" D ^OOPSEMP2
65 S DIE="^OOPS(2260,",DA=IEN
66 D ^DIE
67 I $D(Y)'=0 G EXIT
68 I CALLER="E" D
69 . N SIGN
70 . ; patch 10 - bill of rights enhancement
71 . I $$GET1^DIQ(2260,IEN,71,"I")'="Y" D Q
72 .. W !?5,"Claim cannot be signed until the Bill of Rights Statement is understood."
73 . D SIGN(FORM)
74 . Q:$G(SIGN)=""
75 . I $P(SIGN,U) D EMP^OOPSVAL1 ; new call patch 8
76 I CALLER="W" D
77 . W !!,"Checking for Safety and Emp Health Ok to sign for Employee."
78 . D WCPS4E^OOPSWCSE
79EXIT ; quit the routine
80 K HSA,CIT,MAX,MAX1,STA,ZIP
81 Q
82SAFE(IEN) ; Safety Officer Screen
83 N VIEW,FORM,TYPE
84 S VIEW=1
85 S (TYPE,FORM)=$$GET1^DIQ(2260,IEN,52,"I"),FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
86 ; Patch 8 - if ok to send to DOL cant edit
87 I $$GET1^DIQ(2260,IEN,67)'="" S VIEW=0
88 I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,TYPE) S VIEW=0 ;Emp Signed
89 I $P($$EDSTA^OOPSUTL1(IEN,"S"),U,TYPE) S VIEW=0 ;Super Signed
90 I $$GET1^DIQ(2260,IEN,51,"I")'=0 S VIEW=0 ;Case not open
91 Q VIEW
92SUP(DUZ,IEN) ; Supervisor Screen
93 N VIEW,FORM,SIGN,FORMS
94 S VIEW=1
95 S (FORMS,FORM)=$$GET1^DIQ(2260,IEN,52,"I"),FORM=$S(FORM=1:"CA1",FORM=2:"CA2",1:"")
96 I $P($$EDSTA^OOPSUTL1(IEN,"E"),U,FORMS) S VIEW=0 ; Employee Signed
97 I $P($$EDSTA^OOPSUTL1(IEN,"S"),U,FORMS) S VIEW=0 ; Super Signed
98 I $$GET1^DIQ(2260,IEN,51,"I")'=0 S VIEW=0 ; Case is not open
99 ; Patch 8 - if ok to send to DOL cant edit
100 I $$GET1^DIQ(2260,IEN,67)'="" S VIEW=0
101 I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ S VIEW=0 ; Not Supervisor for case
102 Q VIEW
103SIGN(FORM) ; Sign/validate Document
104 N EMP,INC,VALID
105 S VALID=0,SIGN=""
106 S INC=$$GET1^DIQ(2260,IEN,52,"I")
107 W ! D VALIDATE^OOPSUTL4(IEN,FORM,"E",.VALID)
108 I 'VALID Q
109 I CALLER="E" D
110 . I $$GET1^DIQ(200,DUZ,20.4)="" D
111 .. W !!,"Please enter a Signature Code.",!
112 .. D ^XUSESIG
113 . S SIGN=$$SIG^OOPSESIG(DUZ,IEN)
114 Q
115BOR ; patch 10 - does employee understand Bill of Rights
116 N DIE,DA,DR
117 S DA=IEN,DIE="^OOPS(2260,",DR=""
118 W !
119 S DR(1,2260,1)="71I have read and understood the Employee Bill of Rights:"
120 D ^DIE I $D(Y) S OUT=1
121 Q
Note: See TracBrowser for help on using the repository browser.