source: WorldVistAEHR/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCACTM.m@ 1578

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1GMRCACTM ; SLC/DLT,DCM,JFR - Set action menus ;10/17/01 22:41
2 ;;3.0;CONSULT/REQUEST TRACKING;**1,4,11,18,15,17,22,55**;DEC 27, 1997;Build 4
3 ;
4 ; This routine invokes IA #2425
5 ;
6CPRS(GMRCPM,GUI) ;Entry point for setting menu actions for CPRS user
7 ;Input:
8 ; GMRCPM=a list of File 123 IEN's to check for menu actions.
9 ; Passed in as '300;303;295;309;313'
10 ; GUI =1 if coming from the GUI; return field name in ORFLG also
11 ;Output:
12 ; ORFLG(ien)= A^B^C^D^E^F^G^H where:
13 ; Ien = internal entry of record in file 123
14 ; A = a number representing one of the following:
15 ; 1 - user has only review capabilities
16 ; 2 - user has full update capabilities
17 ; 3 - user has administrative update capabilities
18 ; 4 - user has full update and admin user capabilities
19 ; 5 - user has full update capabilities via unrestricted access
20 ; B = field in file 123.5 (REQUEST SERVICES) that gave the user
21 ; update authority (ex. Update user w/o Notification)
22 ; C = Service in file 123.5 (REQUEST SERVICES) that gave the user
23 ; update authority (ex. CARDIOLOGY,NEUROLOGY)
24 ; D = contains a 1 if user is allowed to associate medicine results
25 ; with a consult procedure request
26 ; F = contain a 1 if user can disassociate a medicine result that was
27 ; incorrectly associated with a consult procedure request
28 ; G = contains a 1 if user is allowed to EDIT and RESUBMIT a canceled
29 ; request
30 ; H = 0-4 depending on actions allowed on a Clin. Proc. request
31 ;
32 I '$L(GMRCPM) S ORFLG=1 Q
33 K ORFLG
34 N I,GMRCSS,GMRCIEN
35 F I=1:1 S ORFLG=1,GMRCIEN=$P(GMRCPM,";",I) Q:GMRCIEN="" D
36 .S ORFLG(GMRCIEN)=1 ;set default answer to read only
37 .I $P($G(^GMR(123,GMRCIEN,12)),U,5)="P" D Q ;IFC placer so only ED/RES
38 .. ;can user edit/resubmit
39 .. I $$VALPROV^GMRCEDIT(GMRCIEN) S $P(ORFLG(GMRCIEN),U,6)=1
40 .S GMRCSS=+$P($G(^GMR(123,+GMRCIEN,0)),"^",5)
41 .Q:'+$G(GMRCSS)
42 .;when service is defined, check for service user
43 .D EN
44 .S ORFLG(GMRCIEN)=ORFLG
45 . ;what actions to allow if a Clincial Procedure
46 . S $P(ORFLG(GMRCIEN),U,7)=$$CPACTM^GMRCCP(GMRCIEN)
47 .I ORFLG>1 D
48 .. ;can DUZ associate med results? only if not a CP!
49 .. N P4
50 .. S P4=$S(+$P(ORFLG(GMRCIEN),U,7):0,1:$$CANDOMED^GMRCGUIU(GMRCIEN))
51 .. S $P(ORFLG(GMRCIEN),U,4)=P4
52 . ;can DUZ disassociate a med result?
53 . S $P(ORFLG(GMRCIEN),U,5)=+$$REMUSR^GMRCDIS(GMRCIEN)
54 . ;can user edit/resubmit
55 . I $$VALPROV^GMRCEDIT(GMRCIEN) S $P(ORFLG(GMRCIEN),U,6)=1
56 . Q
57 Q
58 ;
59EN ;Set GMRCACTM with appropriate menu of actions based on user
60 ;If ORFLG is DEFINED then GMRCACTM is returned as a set of codes:
61 ; 1 = GMRCACTM USER REVIEW SCREEN - simple actions
62 ; 2 = GMRCACTM SERVICE ACTION menu - all actions possible for
63 ; clinical user in service
64 ; 3 = administrative user
65 ; initialize GMRCACTM for read only
66 S GMRCACTM="GMRCACTM USER REVIEW SCREEN"
67 ; if service and entry aren't defined, assume read only access
68 I '$D(XQADATA),$S('+$G(GMRCSS):1,1:0) D Q
69 .I $D(ORFLG) S ORFLG(GMRCIEN)=1 K GMRCACTM
70 .Q
71 ;
72 ;Get the users service update level
73 N GMRCFLG
74 S GMRCFLG=$$VALID^GMRCAU(+GMRCSS,"",,$G(GUI))
75 S:+GMRCFLG=1 GMRCFLG=$S(($D(ORFLG)&($$PATCH^XPDUTL("OR*3.0*243"))):"5^"_$P(GMRCFLG,U,2,9999),1:"2^"_$P(GMRCFLG,U,2,9999))
76 ;
77 ;If ORFLG is all that should be returned, than set and exit
78 I $D(ORFLG) D Q
79 . K GMRCACTM
80 . I GMRCFLG=0 S ORFLG=1 Q
81 . S ORFLG=GMRCFLG Q
82 ;
83 ; If GMRCSS=and IFC sending service, only allow review screen
84 I $D(^GMR(123.5,+GMRCSS,"IFC")),$P(^("IFC"),U) S GMRCFLG=0
85 ;
86 ;Process the GMRCFLG value to get the GMRCACTM defined.
87 I GMRCFLG>0 D Q
88 . S GMRCACTM="GMRCACTM SERVICE ACTION MENU"
89 Q
Note: See TracBrowser for help on using the repository browser.