source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSUTL6.m@ 861

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

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1OOPSUTL6 ;WOIFO/LLH-Utilities Routines ;11/21/00
2 ;;2.0;ASISTS;;Jun 03, 2002
3 ;;
4 Q
5VERIFY(IEN) ; Verify Employee data has not been altered since thier signing
6 ;
7 ; Input IEN - Internal Record Number of Case
8 ; Code expects Employee, Supervisor, and WCP e-signatures
9 ;
10 N CALL,DOL,FORM,RECORD,SIG,STR,VALID,VER,X,X1,X2,WCP
11 S VALID=1
12 S FORM="CA"_$$GET1^DIQ(2260,IEN,52,"I")
13 S RECORD=$G(^OOPS(2260,IEN,"CA"))
14 S VER=$P(RECORD,U,9),X=$P(RECORD,U,7)
15 I '$G(VER)&('$G(X)) Q 1 ; employee signed before patch, change??
16 I VER'=1 Q ""
17 I FORM="CA1" S X1=$$GET1^DIQ(2260,IEN,119,"I"),X2=$$CA1SUM^OOPSUTL6()
18 I FORM="CA2" S X1=$$GET1^DIQ(2260,IEN,221,"I"),X2=$$CA2SUM^OOPSUTL6()
19 D DE^XUSHSHP
20 I $G(X1)="" Q ""
21 S VALID=(X=$P($G(^VA(200,X1,20)),U,2))
22 I 'VALID D
23 . K XMY,XMB
24 . S DOL=1
25 . S WCP="" F S WCP=$O(^OOPS(2260,"AW",WCP)) Q:WCP="" I $D(^OOPS(2260,"AW",WCP,IEN)) K ^OOPS(2260,"AW",WCP,IEN)
26 . S STR=$G(^OOPS(2260,IEN,FORM_"ES")) ; send bulletins to
27 . I $P(STR,U)=""!($P(STR,U,4)="") Q
28 . S XMB="OOPS SIGNATURE SECURITY"
29 . S XMB(2)=$P($G(^OOPS(2260,IEN,0)),U) ; claim number
30 . S XMY($P(STR,U))="",XMY($P(STR,U,4))="" ; emp, supervisor, WCP
31 . S XMY($P($G(^OOPS(2260,IEN,"WCES")),U))=""
32 . D ^XMB K XMB,XMY,XMM,XMDT
33 . F CALL="E","S","W" D CLRES^OOPSUTL1(IEN,CALL,FORM)
34 Q VALID
35CA1SUM() ; Calculate Checksum for CA1 for all employee fields on page 1
36 N I,J,K,OOPS,STR,SUM,WITN,X
37 S J=1
38 S OOPS(0)=$G(^OOPS(2260,IEN,0))
39 S OOPS("2162A")=$G(^OOPS(2260,IEN,"2162A"))
40 S OOPS("CA1A")=$G(^OOPS(2260,IEN,"CA1A"))
41 S OOPS("CA1B")=$P($G(^OOPS(2260,IEN,"CA1B")),U)
42 S OOPS("CA1C")=$P($G(^OOPS(2260,IEN,"CA1C")),U)
43 S OOPS("CA1N")=$G(^OOPS(2260,IEN,"CA1N"))
44 S STR(J)=$P(OOPS(0),U,2),J=J+1
45 F I=1,2,3,8,12,13,4,5,6,7 S STR(J)=$P(OOPS("2162A"),U,I),J=J+1
46 F I=8,9,10 S STR(J)=$P(OOPS("CA1A"),U,I),J=J+1
47 F I=1:1:3 S STR(J)=$P(OOPS("CA1N"),U,I),J=J+1
48 S STR(J)=$P(OOPS(0),U,5),J=J+1
49 F I=11,12 S STR(J)=$P(OOPS("CA1A"),U,I),J=J+1
50 S STR(J)=OOPS("CA1B"),J=J+1
51 S STR(J)=$P($G(^OOPS(2260,IEN,"CA")),U),J=J+1
52 S STR(J)=OOPS("CA1C"),J=J+1
53 S STR(J)=$P(OOPS("CA1A"),U,13),J=J+1
54 S SUM=0 F K=1:1:J I $D(STR(K)) F I=1:1:$L(STR(K)) S SUM=$A(STR(K),I)*I+SUM
55 Q SUM
56CA2SUM() ; Calculate Checksum for CA2
57 N I,J,K,OPFLD,OOPS,STR,SUM,X
58 S J=1
59 S OOPS(0)=$G(^OOPS(2260,IEN,0))
60 S OOPS("2162A")=$G(^OOPS(2260,IEN,"2162A"))
61 S OOPS("CA2A")=$G(^OOPS(2260,IEN,"CA2A"))
62 S OOPS("CA2B")=$G(^OOPS(2260,IEN,"CA2B"))
63 S STR(J)=$P(OOPS(0),U,2),J=J+1
64 F I=1,2,3,8,12,13,4,5,6,7 S STR(J)=$P(OOPS("2162A"),U,I),J=J+1
65 F I=8,9 S STR(J)=$P(OOPS("CA2A"),U,I),J=J+1
66 F I=1:1:7 S STR(J)=$P(OOPS("CA2B"),U,I),J=J+1
67 S STR(J)=$P($G(^OOPS(2260,IEN,"CA")),U),J=J+1
68 F OPFLD=216,217,218,219,220 D WP
69 S SUM=0 F K=1:1:J I $D(STR(K)) F I=1:1:$L(STR(K)) S SUM=$A(STR(K),I)*I+SUM
70 Q SUM
71VALEMP() ; check to make sure claim is ok to send to DOL if pay plan = "OT"
72 ; this subroutine assumes that the variable FORM will be defined
73 N IEN450,LP,NA,SAL,VALID
74 S VALID=1,LP=0
75 S NA=$$GET1^DIQ(2260,IEN,1)
76 S SAL=$$GET1^DIQ(2260,IEN,166)
77 I $$GET1^DIQ(2260,IEN,60,"I")'=3 S VALID=0
78 I $$GET1^DIQ(2260,IEN,16,"I")'="00" S VALID=0
79 I $$GET1^DIQ(2260,IEN,17,"I")'="N" S VALID=0
80 I (FORM="CA1")&(('SAL)!(SAL>999.99)) S VALID=0
81 D FIND^DIC(450,,"@;8","MPS",NA,100)
82 I $G(DIERR) D CLEAN^DILF S VALID=0 Q VALID
83 F S LP=$O(^TMP("DILIST",$J,LP)) Q:LP="" D
84 .I $$GET1^DIQ(2260,IEN,5)=$P(^TMP("DILIST",$J,LP,0),U,2) D
85 ..S IEN450=$P(^TMP("DILIST",$J,LP,0),U)
86 ..I '$G(IEN450) S VALID=0 Q
87 ..I $$GET1^DIQ(450,IEN450,20,"I")'="F" S VALID=0
88 Q VALID
89 ;
90WP ;Process Word Processing Fields
91 N DIWL,DIWR,DIWF,OPGLB,OPI,OPNODE,OPT,OPC,X
92 K ^UTILITY($J,"W")
93 S DIWL=1,DIWR="",DIWF="|C132"
94 S OPNODE=$P($$GET1^DID(2260,OPFLD,"","GLOBAL SUBSCRIPT LOCATION"),";")
95 S OPGLB="^OOPS(2260,IEN,OPNODE,OPI)"
96 S OPI=0 F S OPI=$O(@OPGLB) Q:'OPI S X=$G(^(OPI,0)) D
97 . I $TR(X," ","")="" Q
98 . I X]"" D ^DIWP
99 S OPT=$G(^UTILITY($J,"W",1))+0
100 I OPT S OPI=0 F OPC=1:1 S OPI=$O(^UTILITY($J,"W",1,OPI)) Q:'OPI D
101 . S STR(J)=^UTILITY($J,"W",1,OPI,0),J=J+1
102 K ^UTILITY($J,"W")
103 Q
Note: See TracBrowser for help on using the repository browser.