Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRCACTM

GMRCACTM.m

Go to the documentation of this file.
  1. GMRCACTM ; SLC/DLT,DCM,JFR - Set action menus ;10/17/01 22:41
  1. ;;3.0;CONSULT/REQUEST TRACKING;**1,4,11,18,15,17,22,55**;DEC 27, 1997;Build 4
  1. ;
  1. ; This routine invokes IA #2425
  1. ;
  1. CPRS(GMRCPM,GUI) ;Entry point for setting menu actions for CPRS user
  1. ;Input:
  1. ; GMRCPM=a list of File 123 IEN's to check for menu actions.
  1. ; Passed in as '300;303;295;309;313'
  1. ; GUI =1 if coming from the GUI; return field name in ORFLG also
  1. ;Output:
  1. ; ORFLG(ien)= A^B^C^D^E^F^G^H where:
  1. ; Ien = internal entry of record in file 123
  1. ; A = a number representing one of the following:
  1. ; 1 - user has only review capabilities
  1. ; 2 - user has full update capabilities
  1. ; 3 - user has administrative update capabilities
  1. ; 4 - user has full update and admin user capabilities
  1. ; 5 - user has full update capabilities via unrestricted access
  1. ; B = field in file 123.5 (REQUEST SERVICES) that gave the user
  1. ; update authority (ex. Update user w/o Notification)
  1. ; C = Service in file 123.5 (REQUEST SERVICES) that gave the user
  1. ; update authority (ex. CARDIOLOGY,NEUROLOGY)
  1. ; D = contains a 1 if user is allowed to associate medicine results
  1. ; with a consult procedure request
  1. ; F = contain a 1 if user can disassociate a medicine result that was
  1. ; incorrectly associated with a consult procedure request
  1. ; G = contains a 1 if user is allowed to EDIT and RESUBMIT a canceled
  1. ; request
  1. ; H = 0-4 depending on actions allowed on a Clin. Proc. request
  1. ;
  1. I '$L(GMRCPM) S ORFLG=1 Q
  1. K ORFLG
  1. N I,GMRCSS,GMRCIEN
  1. F I=1:1 S ORFLG=1,GMRCIEN=$P(GMRCPM,";",I) Q:GMRCIEN="" D
  1. .S ORFLG(GMRCIEN)=1 ;set default answer to read only
  1. .I $P($G(^GMR(123,GMRCIEN,12)),U,5)="P" D Q ;IFC placer so only ED/RES
  1. .. ;can user edit/resubmit
  1. .. I $$VALPROV^GMRCEDIT(GMRCIEN) S $P(ORFLG(GMRCIEN),U,6)=1
  1. .S GMRCSS=+$P($G(^GMR(123,+GMRCIEN,0)),"^",5)
  1. .Q:'+$G(GMRCSS)
  1. .;when service is defined, check for service user
  1. .D EN
  1. .S ORFLG(GMRCIEN)=ORFLG
  1. . ;what actions to allow if a Clincial Procedure
  1. . S $P(ORFLG(GMRCIEN),U,7)=$$CPACTM^GMRCCP(GMRCIEN)
  1. .I ORFLG>1 D
  1. .. ;can DUZ associate med results? only if not a CP!
  1. .. N P4
  1. .. S P4=$S(+$P(ORFLG(GMRCIEN),U,7):0,1:$$CANDOMED^GMRCGUIU(GMRCIEN))
  1. .. S $P(ORFLG(GMRCIEN),U,4)=P4
  1. . ;can DUZ disassociate a med result?
  1. . S $P(ORFLG(GMRCIEN),U,5)=+$$REMUSR^GMRCDIS(GMRCIEN)
  1. . ;can user edit/resubmit
  1. . I $$VALPROV^GMRCEDIT(GMRCIEN) S $P(ORFLG(GMRCIEN),U,6)=1
  1. . Q
  1. Q
  1. ;
  1. EN ;Set GMRCACTM with appropriate menu of actions based on user
  1. ;If ORFLG is DEFINED then GMRCACTM is returned as a set of codes:
  1. ; 1 = GMRCACTM USER REVIEW SCREEN - simple actions
  1. ; 2 = GMRCACTM SERVICE ACTION menu - all actions possible for
  1. ; clinical user in service
  1. ; 3 = administrative user
  1. ; initialize GMRCACTM for read only
  1. S GMRCACTM="GMRCACTM USER REVIEW SCREEN"
  1. ; if service and entry aren't defined, assume read only access
  1. I '$D(XQADATA),$S('+$G(GMRCSS):1,1:0) D Q
  1. .I $D(ORFLG) S ORFLG(GMRCIEN)=1 K GMRCACTM
  1. .Q
  1. ;
  1. ;Get the users service update level
  1. N GMRCFLG
  1. S GMRCFLG=$$VALID^GMRCAU(+GMRCSS,"",,$G(GUI))
  1. 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))
  1. ;
  1. ;If ORFLG is all that should be returned, than set and exit
  1. I $D(ORFLG) D Q
  1. . K GMRCACTM
  1. . I GMRCFLG=0 S ORFLG=1 Q
  1. . S ORFLG=GMRCFLG Q
  1. ;
  1. ; If GMRCSS=and IFC sending service, only allow review screen
  1. I $D(^GMR(123.5,+GMRCSS,"IFC")),$P(^("IFC"),U) S GMRCFLG=0
  1. ;
  1. ;Process the GMRCFLG value to get the GMRCACTM defined.
  1. I GMRCFLG>0 D Q
  1. . S GMRCACTM="GMRCACTM SERVICE ACTION MENU"
  1. Q