source: FOIAVistA/tag/r/ASISTS-OOPS/OOPSGUI1.m@ 1755

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

initial load of FOIAVistA 6/30/08 version

File size: 7.1 KB
Line 
1OOPSGUI1 ;WIOFO/LLH-RPC routines ;9/3/01
2 ;;2.0;ASISTS;**4,8,7,11**;Jun 03, 2002
3 ;
4OPT(RESULTS,INP) ; Returns the ASISTS GUI Menus user has access to
5 ; INP - Input String containing the version of GUI making call
6 ; RESUTLS - return value for broker call
7 ; P1 = 1 DUZ defined
8 ; P2 = 1 Emp Health menu accessible
9 ; P3 = 1 Employee menu accessible
10 ; P4 = 1 Supervisor menu accessible
11 ; P5 = 1 Safety Officer menu accessible
12 ; P6 = 1 Union menu accessible
13 ; P7 = 1 Workers' Comp menu accessible
14 ; P8 = SSN from New Person file for user
15 ; P9 = server version #
16 ;
17 N CNT,MENU,OPT,PRIM,SM,VER
18 S CNT=1
19 I 'DUZ S RESULTS="0^^^^^^^" Q
20 S RESULTS=DUZ_"^0^0^0^0^0^0^"
21 S VER="2.11.1.0" ;Define version check patch #4
22 I $G(INP)=""!($G(INP)'=VER) Q
23 S PRIM=$$GET1^DIQ(200,DUZ,201) ; get primary menu
24 I $G(PRIM)'="" S MENU(PRIM)=""
25 S SM=0
26 F S SM=$O(^VA(200,DUZ,203,SM)) Q:SM'>0 D
27 . S OPT=$$GET1^DIQ(19,$P($G(^VA(200,DUZ,203,SM,0)),U),.01)
28 . I $G(OPT)'="" S MENU(OPT)=""
29 I $D(MENU("OOPS GUI EMPLOYEE HEALTH MENU")) S $P(RESULTS,U,2)=1
30 I $D(MENU("OOPS GUI EMPLOYEE")) S $P(RESULTS,U,3)=1
31 I $D(MENU("OOPS GUI SUPERVISOR MENU")) S $P(RESULTS,U,4)=1
32 I $D(MENU("OOPS GUI SAFETY OFFICER MENU")) S $P(RESULTS,U,5)=1
33 I $D(MENU("OOPS GUI UNION MENU")) S $P(RESULTS,U,6)=1
34 I $D(MENU("OOPS GUI WORKERS' COMP MENU")) S $P(RESULTS,U,7)=1
35 I +$$ACCESS^XQCHK(DUZ,"OOPS GUI EMPLOYEE") S $P(RESULTS,U,3)=1
36 S $P(RESULTS,U,8)=$$GET1^DIQ(200,DUZ,9)
37 S $P(RESULTS,U,9)=VER ;return the version defined above.
38 Q
39SETSIGN(RESULTS,INPUT,SIGN) ; This subroutine validates that the signature
40 ; can be entered and is valid
41 ; Input: INPUT - Contains the IEN of the ASISTS case, the form type,
42 ; and the field number. The field number is used
43 ; to trigger what validation should be preformed on
44 ; the fields in the form so that the signature can
45 ; be applied. The fourth parameter is a special flag
46 ; indicating the Workers Comp is signing for employee
47 ; Format is IEN^FORM^FIELD^WCFLAG
48 ; SIGN - contains the signature test to be encrypted.
49 ; Output: RESULTS - is an array containing a list of fields that did
50 ; not pass the data validation and must be corrected
51 ; prior to applying a signature.
52 N CALL,DTIME,FDUZ,FDT,FLD,IEN,INC,FORM,ESIG,VALID,CALLER,WOK
53 N DR,DA,DIE,WCFLG
54 S IEN=$P($G(INPUT),U),FORM=$P($G(INPUT),U,2),FLD=$P($G(INPUT),U,3)
55 I '$G(IEN)!('$G(FLD)) S RESULTS(1)="User not Authorized to sign form" Q
56 I FLD=45!(FLD=170)!(FLD=266) S CALL="S"
57 I FLD=49!(FLD=77) S CALL="O"
58 ; Patch 5 ll - added !(FLD=313)!(FLD=320)
59 I FLD=68!(FLD=313)!(FLD=320) S CALL="W"
60 I FLD=80 S CALL="H"
61 ; Patch 5 llh - added !(FLD=310)
62 I FLD=120!(FLD=222)!(FLD=310) S CALL="E"
63 S WCFLG=$P($G(INPUT),U,4)
64 I WCFLG'="W" D
65 .; Patch 5 llh - moved non fld check logic to separate line
66 .; added stuff to check if dual benefits have been signed
67 .I (FLD=120!(FLD=222)) D
68 ..I ($$GET1^DIQ(2260,IEN,71,"I")'="Y") D Q
69 ...S RESULTS(1)="Claim cannot be signed until the Bill of Rights Statement is understood."
70 ...D WCPBOR^OOPSMBUL(IEN)
71 ;..Commented out Patch 11 cvw
72 ;..I $$GET1^DIQ(2260,IEN,310)="" D Q
73 ;...S RESULTS(1)="Claim cannot be signed until the Dual Benefits form has been signed."
74 ; check to make sure PAID fields (also Service) not "", if "" get data
75 D CHKPAID
76 S VALID=0
77 S INC=$$GET1^DIQ(2260,IEN,52,"I")
78 ; Patch 5 llh - added ,(FLD'>300)
79 I (FLD'=77),(FLD'=80),(FLD'>300) D I 'VALID Q
80 .D VALIDATE^OOPSGUI9(IEN,FORM,CALL,.VALID)
81 I $G(SIGN)="" S RESULTS(1)="No Signature Entered" Q
82 S VALID=$$VALIDATE($$DECRYP^XUSRB1(SIGN))
83 I 'VALID D Q
84 .I $P($G(^VA(200,DUZ,20)),"^",4)="" S RESULTS(1)="No Electronic Signature on File" Q
85 .S RESULTS(1)="Invalid Signature Entered."
86SIGN ; All field validated, file signature
87 I FLD=77 S FDUZ=76,FDT=78 ; Safety approve WC sign
88 I FLD=80 S FDUZ=79,FDT=81 ; EH approve WC sign
89 I FLD=120 S FDUZ=119,FDT=121 ; Employee sign CA1
90 I FLD=222 S FDUZ=221,FDT=223 ; Employee sign CA2
91 I FLD=170 S FDUZ=169,FDT=171 ; Super sign CA1
92 I FLD=266 S FDUZ=265,FDT=267 ; Super sign CA2
93 I FLD=45 S FDUZ=44,FDT=46 ; Super sign 2162
94 I FLD=49 S FDUZ=48,FDT=50 ; Safety sign 2162
95 I FLD=68 S FDUZ=67,FDT=69,WOK=1 ; WC approve to DOL
96 ; patch 5 llh - added next 2 lines (may need more)
97 I FLD=310 S FDUZ=309,FDT=311 ; Emp sign Dual Benefits
98 I FLD=313 S FDUZ=312,FDT=314 ; WC sign Dual Benefits
99 D NOW^%DTC S DTIME=%
100 K DR S DIE="^OOPS(2260,",DA=IEN
101 S DR=FDUZ_"////^S X=+DUZ;"_FLD_"////^S X=ESIG;"_FDT_"////^S X=DTIME"
102 D ^DIE
103 I $G(Y)'="" Q
104 I FLD=68 D WCP^OOPSMBUL(IEN,"S")
105 I FLD=120!(FLD=222) S CALLER=CALL D EMP^OOPSVAL1
106 I FLD=45 D SAFETY^OOPSMBUL(IEN)
107 I (FLD=170)!(FLD=266) D SUPS^OOPSMBUL(IEN),UNION^OOPSMBUL(IEN)
108 Q
109VALIDATE(X) ; Validate Electronic Sign code
110 ; Input: X - contains the signature to be validated
111 ; Output: VSIGN - contains a 1 if a valid e-signature, a 0 if not valid
112 N VSIGN
113 S VSIGN=0
114 D HASH^XUSHSHP
115 I X'="",(X=$P($G(^VA(200,DUZ,20)),"^",4)) S VSIGN=1,ESIG=X
116 Q VSIGN
117CHKPAID ; check to make sure PAID fields have data, if not populate
118 ; this subroutine can be removed when go completely to GUI
119 N DA,DIE,DR,CAT,FLD,IEN200,OCCD,PAY,PAYP,RET,SAL,SERV,SSN
120 I $$GET1^DIQ(2260,IEN,60)="" D
121 .S FLD=26,RET="",RET=$$PAID^OOPSUTL1(IEN,FLD)
122 .S RET=$S(RET="FULL CSRS":"CSRS",RET="FERS":"FERS",1:"OTHER")
123 .S DIE="^OOPS(2260,",DA=IEN,DR="60///^S X=RET" D ^DIE
124 I $$GET1^DIQ(2260,IEN,86)="" D
125 .S SERV="",SSN=$$GET1^DIQ(2260,IEN,5,"I")
126 .I $G(SSN) S IEN200=$O(^VA(200,"SSN",SSN,""))
127 .I $G(IEN200) S SERV=$$GET1^DIQ(200,IEN200,29)
128 .S DIE="^OOPS(2260,",DA=IEN,DR="86///^S X=SERV" D ^DIE
129 I $$GET1^DIQ(2260,IEN,166)="" D
130 .S FLD=28,SAL="",SAL=$$PAID^OOPSUTL1(IEN,FLD)
131 .S DIE="^OOPS(2260,",DA=IEN,DR="166///^S X=SAL" D ^DIE
132 I $$GET1^DIQ(2260,IEN,167)="" D
133 .S FLD=19,PAY="",PAY=$$PAID^OOPSUTL1(IEN,FLD)
134 .S PAY=$S(PAY="PER ANNUM":"ANNUAL",PAY="PER HOUR":"HOURLY","PER DIEM":"DAILY","BIWEEKLY":"BI-WEEKLY",1:"")
135 .S DIE="^OOPS(2260,",DA=IEN,DR="167///^S X=PAY" D ^DIE
136 I $$GET1^DIQ(2260,IEN,63)="",($$GET1^DIQ(2260,IEN,2,"I")<3) D
137 .S CAT=$$GET1^DIQ(2260,IEN,2,"I")
138 .I CAT=1 S PAYP=$$PAID^OOPSUTL1(IEN,20) I $G(PAYP)'="" S PAYP=$$PAYP^OOPSUTL1(PAYP)
139 .I CAT=2 S PAYP="VO"
140 .S DIE="^OOPS(2260,",DA=IEN,DR="63///^S X=PAYP" D ^DIE
141 I $$GET1^DIQ(2260,IEN,111)="" D
142 .S FLD=16,OCCD="",OCCD=$$PAID^OOPSUTL1(IEN,FLD)
143 .S DIE="^OOPS(2260,",DA=IEN,DR="111///^S X=OCCD" D ^DIE
144 Q
145VALEMP(RESULTS,INPUT) ; This broker call should be used if the Pay
146 ; Plan = "OT" (other) to determine if the claim
147 ; can be successfully submitted to DOL. The PERSONNEL
148 ; STATUS is assumed to equal 1 (employee)
149 S IEN=$P($G(INPUT),U,2),FORM=$P($G(INPUT),U)
150 I '$G(IEN)!($G(FORM)="") S RESULTS="Invalid Input, cannot continue." Q
151 I $$VALEMP^OOPSUTL6 S RESULTS="Valid" Q
152 S RESULTS="Invalid data on claim"
153 Q
Note: See TracBrowser for help on using the repository browser.