source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSGUI0.m@ 1134

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

initial load of WorldVistAEHR

File size: 6.8 KB
Line 
1OOPSGUI0 ;WIOFO/LLH-RPC routines ;01/02/02
2 ;;2.0;ASISTS;**2,4,7**;Jun 03, 2002
3 ;
4GETCASE(RESULTS,PERSON,CSTAT,PSTAT,CALL,OPT) ; Subroutine for Case Selection
5 ; Returns a list of cases that can be displayed for selection
6 ; RESULTS = return array containing, CASE#^IEN^NAME^DATE TIME OCCUR
7 ; PERSON = 0^ if no person selected
8 ; 1^PERSON INVOLVED NAME
9 ; 2^SUPERVISOR DUZ
10 ; 3^USER SSN
11 ; 4^CASE NUMBER
12 ; CSTAT = #^#^#^# 0^1^2^3 0=open, 1=closed, 2=deleted, 3=replaced
13 ; 99^ if all Case Status should be included
14 ; CSTAT is only set programatically
15 ; PSTAT = 0^ if all personnel status types should be included
16 ; #^#^#^ for each personnel status selected
17 ; CALL = Calling menu, used to assure proper access
18 ; OPT = Option called from, used to assure proper access
19 ;
20 K ^TMP("OOPSCASE",DUZ)
21 N ARR,CNUM,OOPSDA,PER,STA,SUP,VIEWSUP,VIEWEMP,VALSSN
22 I $G(PERSON)="" Q
23 I +PERSON=1 D GETPER,SORT G EXIT
24 I +PERSON=4 D G EXIT
25 . S CNUM=$P($G(PERSON),U,2) I '$G(CNUM) Q
26 . S OOPSDA=$O(^OOPS(2260,"B",CNUM,"")) I '$G(OOPSDA) D Q
27 .. S ^TMP("OOPSCASE",DUZ,1)="No Cases Selectable"
28 .. S RESULTS=$NA(^TMP("OOPSCASE",DUZ))
29 ..; S RESULTS(0)="No Cases Selectable"
30 . S STA=$$GET1^DIQ(2260,OOPSDA,51,"I")
31 . I +CSTAT'=99,(CSTAT'[STA_"^") Q ;allow only selected case status
32 . I $$CALLER() S ARR(CNUM)=OOPSDA
33 . D SORT
34 S CNUM=0
35 F S CNUM=$O(^OOPS(2260,"B",CNUM)) Q:CNUM="" D
36 . S OOPSDA=""
37 . F S OOPSDA=$O(^OOPS(2260,"B",CNUM,OOPSDA)) Q:OOPSDA="" D
38 .. I +PERSON=3 D Q:'VIEWEMP
39 ... S VIEWEMP=1,VALSSN=$P($G(PERSON),U,2)
40 ... I $$GET1^DIQ(2260,OOPSDA,5,"I")'=VALSSN D
41 .... S VIEWEMP=0
42 .... S ^TMP("OOPSCASE",DUZ,1)="No Cases Selectable"
43 .... S RESULTS=$NA(^TMP("OOPSCASE",DUZ))
44 .. S STA=$$GET1^DIQ(2260,OOPSDA,51,"I")
45 .. I +CSTAT'=99,(CSTAT'[STA_"^") Q ;allow only selected case status
46 .. S PER=$$GET1^DIQ(2260,OOPSDA,2,"I")
47 .. I (+PSTAT)&(PSTAT'[(PER_"^")) Q ;allow only selected per status
48 .. I +PERSON=2 D Q:'VIEWSUP
49 ... S VIEWSUP=1,SUP=$P(PERSON,U,2)
50 ... I $$GET1^DIQ(2260,OOPSDA,53,"I")'=SUP,($$GET1^DIQ(2260,OOPSDA,53.1,"I")'=SUP) D Q
51 ....; S RESULTS(0)="No Cases Selectable",VIEWSUP=0
52 .... S ^TMP("OOPSCASE",DUZ,1)="No Cases Selectable",VIEWSUP=0
53 .... S RESULTS=$NA(^TMP("OOPSCASE",DUZ))
54 .. I $$CALLER() S CNUM=$$GET1^DIQ(2260,OOPSDA,.01),ARR(CNUM)=OOPSDA
55 D SORT
56EXIT ; quit the routine
57 Q
58GETPER ; Person Name passed in, match
59 ; See above for documentation
60 N NM
61 S OOPSDA="",NM=$P(PERSON,U,2)
62 F S OOPSDA=$O(^OOPS(2260,"C",NM,OOPSDA)) Q:OOPSDA="" D
63 . S STA=$$GET1^DIQ(2260,OOPSDA,51,"I")
64 . I +CSTAT'=99,(CSTAT'[STA_"^") Q ;allow only selected case status
65 . S PER=$$GET1^DIQ(2260,OOPSDA,2,"I")
66 . I (+PSTAT)&(PSTAT'[(PER_"^")) Q ;allow only selected per status
67 . I $$CALLER() S CNUM=$$GET1^DIQ(2260,OOPSDA,.01),ARR(CNUM)=OOPSDA
68 Q
69CALLER() ; Check to make sure case should be included
70 N EES,ESTAT,FLD,INC,SIG,SSN,VIEWC
71 S VIEWC=1
72 S INC=$$GET1^DIQ(2260,OOPSDA,52,"I")
73 ; get users SSN
74 S SSN=$$GET1^DIQ(200,DUZ,9)
75 ; make sure user cannot access claim from any menu but Employee
76 I CALL'="E",($$GET1^DIQ(2260,OOPSDA,5,"I")=SSN) S VIEWC=0 Q VIEWC
77 ; Claim already sent to DOL, can't edit, Caller / Option doesnt matter
78 ; unless the Option = "CHGCASE"
79 ; Patch 4 llh - should also be able to create amendment. NOTE: Case
80 ; status should always = open
81 ; patch 7 llh - allow access if also opt=iocome
82 I ($$GET1^DIQ(2260,OOPSDA,66)'=""),(OPT'="CHGCASE"),(OPT'="PRINTCA"),(OPT'=2162),(OPT'="CRAMEND"),(OPT'="IOCOME") S VIEWC=0 Q VIEWC
83 ; for any option from the supervisor menu
84 I CALL="S" D I 'VIEWC Q VIEWC
85 . I $$GET1^DIQ(2260,OOPSDA,53,"I")'=DUZ,($$GET1^DIQ(2260,OOPSDA,53.1,"I")'=DUZ) S VIEWC=0 Q
86 ; if opt = 2162
87 I OPT=2162 D Q VIEWC
88 . I $$GET1^DIQ(2260,OOPSDA,51,"I")=1 S VIEWC=0 ; closed, can't edit
89 . ; signed SO, coming from Supervisor menu, cant access
90 . I (CALL="S"),+$$EDSTA^OOPSUTL1(OOPSDA,"O") S VIEWC=0
91 . I CALL="H" D
92 .. I $P($$EDSTA^OOPSUTL1(OOPSDA,"S"),U,3)!(+$$EDSTA^OOPSUTL1(OOPSDA,"O")) S VIEWC=0
93 . I CALL="W" D
94 .. I +$$EDSTA^OOPSUTL1(OOPSDA,"O") S VIEWC=0 ;safety signed cant see
95 ; if opt = CA1 only return/allow CA1's, caller doesnt matter
96 I OPT="CA1",INC'=1 S VIEWC=0 Q VIEWC
97 ; if opt = CA2 only return/allow CA2's, caller doesnt matter
98 I OPT="CA2",INC'=2 S VIEWC=0 Q VIEWC
99 I CALL="E" D Q VIEWC
100 . I '$$ISEMP^OOPSUTL4(OOPSDA) S VIEWC=0 Q
101 . I '$G(SSN) S VIEWC=0 Q
102 . I $D(^OOPS(2260,"SSN",SSN))<1 S VIEWC=0 Q
103 . ; user SSN must = case IEN from Employee menu
104 . I $$GET1^DIQ(2260,OOPSDA,5,"I")'=SSN S VIEWC=0 Q
105 . S SIG=$$EDSTA^OOPSUTL1(OOPSDA,"S")
106 . I (OPT'="PRINTCA"),$P(SIG,U,INC) S VIEWC=0 Q
107 I CALL="S" D Q VIEWC
108 . ; not Super or Sec Super, can't access form, regardless of form type
109 . I $$GET1^DIQ(2260,OOPSDA,53,"I")'=DUZ&($$GET1^DIQ(2260,OOPSDA,53.1,"I")'=DUZ) S VIEWC=0 Q
110 . ; Supervisor cannot complete their own form.
111 . I $$GET1^DIQ(2260,OOPSDA,5,"I")=SSN S VIEWC=0 Q
112 . I OPT="CA1"!(OPT="CA2") D Q
113 .. ; if form CA, must be employee to complete
114 .. I '$$ISEMP^OOPSUTL4(OOPSDA) S VIEWC=0 Q
115 .. ; commented out next 2 lines, ? whether wanted by TAG 11/1/01 llh
116 .. ; Employee hasn't signed, super can't get to
117 .. ; I '$P($$EDSTA^OOPSUTL1(OOPSDA,"E"),U,INC) S VIEWC=0 Q
118 .. ; Supervisor has signed, can't re-edit
119 .. I $P($$EDSTA^OOPSUTL1(OOPSDA,"S"),U,INC) S VIEWC=0 Q
120 I CALL="O"!(CALL="W")!(CALL="H") D Q VIEWC
121 . I OPT="CA1"!(OPT="CA2") D Q
122 .. I '$$ISEMP^OOPSUTL4(OOPSDA) S VIEWC=0 Q
123 . I OPT="WCSIGN" D Q
124 .. S ESTAT=$$EDSTA^OOPSUTL1(OOPSDA,"E")
125 .. I '$$ISEMP^OOPSUTL4(OOPSDA) S VIEWC=0 Q
126 .. I CALL'="W",$P(ESTAT,U,INC) S VIEWC=0 Q
127 .. I CALL="W" D
128 ... S FLD=$S(INC=1:119,INC=2:221,1:"") I 'FLD S VIEWC=0 Q
129 ... S EES=$$GET1^DIQ(2260,OOPSDA,FLD,"I")
130 ... ; employee hasn't signed, ok for WC to sign
131 ... I 'EES Q
132 ... ; employee signed, not signed by person accessing claim, no access
133 ... I EES'=DUZ S VIEWC=0 Q
134 ... I $P($$EDSTA^OOPSUTL1(OOPSDA,"S"),U,INC) S VIEWC=0 ;Sup Sign, no acc
135 . I OPT="WCEMPSIGN" D Q
136 .. N CALLER,SVIEW
137 .. S CALLER=CALL
138 .. I $$GET1^DIQ(2260,OOPSDA,51,"I") S VIEWC=0 Q ; claim must be open
139 .. I $$GET1^DIQ(2260,OOPSDA,77)="" S VIEWC=0 Q
140 .. I $$GET1^DIQ(2260,OOPSDA,80)="" S VIEWC=0 Q
141 .. S SVIEW=$$SCR^OOPSWCSE(OOPSDA) I 'SVIEW S VIEWC=0 Q
142 I CALL="U" D Q VIEWC
143 . I '+$$EDSTA^OOPSUTL1(OOPSDA,"O") S VIEWC=0 Q
144 . I '$P($$EDSTA^OOPSUTL1(OOPSDA,"S"),U,3) S VIEWC=0 Q
145 Q VIEWC
146SORT ; put cases in reverse number order
147 N CN,CNUM,OOPSDA,SSN,DOI
148 S ^TMP("OOPSCASE",DUZ,0)="",CNUM="",CN=1
149 I '$D(ARR) S RESULTS(0)="No Cases Selectable" D
150 . S ^TMP("OOPSCASE",DUZ,1)="No Cases Selectable",VIEWSUP=0
151 . S RESULTS=$NA(^TMP("OOPSCASE",DUZ))
152 F S CNUM=$O(ARR(CNUM),-1) Q:CNUM="" D
153 . S OOPSDA=ARR(CNUM)
154 . S NM=$$GET1^DIQ(2260,OOPSDA,1)
155 . S DOI=$$GET1^DIQ(2260,OOPSDA,4)
156 . S SSN=$$GET1^DIQ(2260,OOPSDA,5)
157 . I CALL="U" S (NM,DOI,SSN)=""
158 . S ^TMP("OOPSCASE",DUZ,CN)=CNUM_U_DOI_U_NM_U_OOPSDA_U_SSN_$C(10),CN=CN+1
159 S RESULTS=$NA(^TMP("OOPSCASE",DUZ))
160 Q
Note: See TracBrowser for help on using the repository browser.