source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XQCHK2.m@ 1527

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1XQCHK2 ; OAK-BP/BDT - Internal APIs to check Keys for options; 5/20/08
2 ;;8.0;KERNEL;**427,503**;Jul 10, 1995;Build 2
3 ;;"Per VHA Directive 2004-038, this routine should not be modified".
4 Q
5 ;; These Internal Kernel APIs are using in the routine XQCHK
6 ;; to check Keys for options
7 ;;
8CHCKL(XQCY0,XQDUZ) ;Entry point for checking all Locks for an option
9 ;; XQCY0 is $P(^XUTL("XQO",XQDIC,"^",%XQOP),"^",2,99)
10 ;; XQDUZ is IEN of user
11 ;; Return XQRT: Zero or 1^Key found that user needed for the option
12 S XQCY0=$G(XQCY0)
13 N XQI,XQY,XQX,XQRT,XQK S (XQRT,XQX)=0
14 ;check Key for the option; p457
15 S XQY=$P(XQCY0,"^"),XQX=$$GETIEN(XQY)
16 I +XQX S XQK=$$GET1^DIQ(19,XQX,3)
17 I $G(XQK)'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q XQRT
18 ;loop through higher menu options.
19 S XQY=$P(XQCY0,"^",5)
20 F XQI=1:1 S XQX=$P(XQY,",",XQI) Q:'XQX D
21 . I +XQX S XQK=$$GET1^DIQ(19,XQX,3) I XQK'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q
22 Q XQRT
23 ;
24CHCKRL(XQCY0,XQDUZ) ;Entry point for checking all Reversed Locks for an option
25 ;; XQCY0 is $P(^XUTL("XQO",XQDIC,"^",%XQOP),"^",2,99)
26 ;; XQDUZ is IEN of user
27 ;; Return XQRT: Zero or 1^Reversed Key found that user has
28 S XQCY0=$G(XQCY0)
29 N XQI,XQY,XQX,XQRT,XQK S (XQRT,XQX)=0
30 ;check Reversed Key for the option; p457
31 S XQY=$P(XQCY0,"^"),XQX=$$GETIEN(XQY)
32 I +XQX S XQK=$$GET1^DIQ(19,XQX,3.01)
33 I $G(XQK)'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q XQRT
34 ;loop through higher menu options.
35 S XQY=$P(XQCY0,"^",5)
36 F XQI=1:1 S XQX=$P(XQY,",",XQI) Q:'XQX D
37 . I +XQX S XQK=$$GET1^DIQ(19,XQX,3.01) I XQK'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK Q
38 Q XQRT
39 ;
40GETIEN(XQNAME) ;get IEN for an option; 457
41 ;; XQNAME is name of an option
42 ;; Retrun XQIEN: Null or IEN if existed
43 N XQIEN S XQIEN=""
44 I $G(XQNAME)="" Q XQIEN
45 I '$D(^DIC(19,"B",XQNAME)) Q XQIEN
46 S XQIEN=$O(^DIC(19,"B",XQNAME,XQIEN))
47 Q XQIEN
48 ;
49CHKTOPL(XQIEN,XQDUZ) ;Check Lock for the top level of the secondary options
50 ;this need to be called to check the top level first when check the
51 ;Locks for lower menu option because the 6th piece of ^XUTL does not
52 ;contain the IEN of the top menu option.
53 N XQRT,XQK S XQRT=0
54 I XQIEN'=+$G(XQIEN) Q XQRT
55 S XQK=$$GET1^DIQ(19,XQIEN,3)
56 I $G(XQK)'="",'$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK
57 Q XQRT
58 ;
59CHKTOPRL(XQIEN,XQDUZ) ;Check Reversed Lock the top level of the secondary options
60 ;this need to be called to check the top level first when check the
61 ;Reversed Locks for lower menu option because the 6th piece of ^XUTL does not
62 ;contain the IEN of the top menu option.
63 N XQRT,XQK S XQRT=0
64 I XQIEN'=+$G(XQIEN) Q XQRT
65 S XQK=$$GET1^DIQ(19,XQIEN,3.01)
66 I $G(XQK)'="",$D(^XUSEC(XQK,XQDUZ)) S XQRT=1_"^"_XQK
67 Q XQRT
Note: See TracBrowser for help on using the repository browser.