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

XQCHK2.m

Go to the documentation of this file.
  1. XQCHK2 ; OAK-BP/BDT - Internal APIs to check Keys for options; 4/28/11
  1. ;;8.0;KERNEL;**427,503,570**;Jul 10, 1995;Build 3
  1. ;;"Per VHA Directive 2004-038, this routine should not be modified".
  1. Q
  1. ;; These Internal Kernel APIs are using in the routine XQCHK
  1. ;; to check Keys for options
  1. ;;
  1. CHCKL(XQCY0,XQDUZ) ;Entry point for checking all Locks for an option
  1. ;; XQCY0 is $P(^XUTL("XQO",XQDIC,"^",%XQOP),"^",2,99)
  1. ;; XQDUZ is IEN of user
  1. ;; Return XQRT: Zero or 1^Key found that user needed for the option
  1. S XQCY0=$G(XQCY0)
  1. N XQI,XQY,XQX,XQRT,XQK S (XQRT,XQX)=0
  1. ;check Key for the option; p457
  1. S XQY=$P(XQCY0,"^"),XQX=$$GETIEN(XQY)
  1. I +XQX S XQK=$$GET1^DIQ(19,XQX,3)
  1. I $G(XQK)'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q XQRT
  1. ;loop through higher menu options.
  1. S XQY=$P(XQCY0,"^",5)
  1. F XQI=1:1 S XQX=$P(XQY,",",XQI) Q:'XQX D
  1. . I +XQX S XQK=$$GET1^DIQ(19,XQX,3) I XQK'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q
  1. Q XQRT
  1. ;
  1. CHCKRL(XQCY0,XQDUZ) ;Entry point for checking all Reversed Locks for an option
  1. ;; XQCY0 is $P(^XUTL("XQO",XQDIC,"^",%XQOP),"^",2,99)
  1. ;; XQDUZ is IEN of user
  1. ;; Return XQRT: Zero or 1^Reversed Key found that user has
  1. S XQCY0=$G(XQCY0)
  1. N XQI,XQY,XQX,XQRT,XQK S (XQRT,XQX)=0
  1. ;check Reversed Key for the option; p457
  1. S XQY=$P(XQCY0,"^"),XQX=$$GETIEN(XQY)
  1. I +XQX S XQK=$$GET1^DIQ(19,XQX,3.01)
  1. I $G(XQK)'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q XQRT
  1. ;loop through higher menu options.
  1. S XQY=$P(XQCY0,"^",5)
  1. F XQI=1:1 S XQX=$P(XQY,",",XQI) Q:'XQX D
  1. . I +XQX S XQK=$$GET1^DIQ(19,XQX,3.01) I XQK'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q
  1. Q XQRT
  1. ;
  1. GETIEN(XQNAME) ;get IEN for an option; 457
  1. ;; XQNAME is name of an option
  1. ;; Retrun XQIEN: Null or IEN if existed
  1. N XQIEN S XQIEN=""
  1. I $G(XQNAME)="" Q XQIEN
  1. I '$D(^DIC(19,"B",XQNAME)) Q XQIEN
  1. S XQIEN=$O(^DIC(19,"B",XQNAME,XQIEN))
  1. Q XQIEN
  1. ;
  1. CHKTOPL(XQIEN,XQDUZ) ;Check Lock for the top level of the secondary options
  1. ;this need to be called to check the top level first when check the
  1. ;Locks for lower menu option because the 6th piece of ^XUTL does not
  1. ;contain the IEN of the top menu option.
  1. N XQRT,XQK S XQRT=0
  1. I XQIEN'=+$G(XQIEN) Q XQRT
  1. S XQK=$$GET1^DIQ(19,XQIEN,3)
  1. I $G(XQK)'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK
  1. Q XQRT
  1. ;
  1. CHKTOPRL(XQIEN,XQDUZ) ;Check Reversed Lock the top level of the secondary options
  1. ;this need to be called to check the top level first when check the
  1. ;Reversed Locks for lower menu option because the 6th piece of ^XUTL does not
  1. ;contain the IEN of the top menu option.
  1. N XQRT,XQK S XQRT=0
  1. I XQIEN'=+$G(XQIEN) Q XQRT
  1. S XQK=$$GET1^DIQ(19,XQIEN,3.01)
  1. I $G(XQK)'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK
  1. Q XQRT
  1. ;
  1. CHKOOO(XQCY0) ; Check OOO option
  1. ;; XQCY0 is $P(^XUTL("XQO",XQDIC,"^",%XQOP),"^",2,99)
  1. ;; Return XQRT: Zero or 1^Out Of Order message
  1. S XQCY0=$G(XQCY0)
  1. N XQI,XQY,XQX,XQRT,XQK S (XQRT,XQX)=0
  1. ;check Out Of Order
  1. S XQY=$P(XQCY0,"^"),XQX=$$GETIEN(XQY)
  1. I +XQX S XQK=$$GET1^DIQ(19,XQX,2)
  1. I $G(XQK)'="" Q "1^"_$G(XQK)
  1. ;loop through higher menu options.
  1. S XQY=$P(XQCY0,"^",5)
  1. F XQI=1:1 S XQX=$P(XQY,",",XQI) Q:'XQX D
  1. . I +XQX S XQK=$$GET1^DIQ(19,XQX,2) I XQK'="" S XQRT="1^"_XQK Q
  1. Q XQRT
  1. ;