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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1XQ83D ;ISC-SF..SEA/JLI - MICRO SURGERY ON MENU TREES FOR ITEM DELETED FROM MENU ;04/16/2002 13:58
2 ;;8.0;KERNEL;**157**;Jul 10, 1995
3 I $D(^DIC(19,+XQOPM,0)),$D(^(10,"B",+XQOPI)) S XQB=$O(^(+XQOPI,0)) I $D(^DIC(19,+XQOPM,10,XQB,0)),+^(0)=+XQOPI Q ; item hasn't been removed, or was put back on
4 D TABLE^XQ83A
5 S A="P" F XQI=0:0 S A=$O(^XUTL("XQO",A)) Q:A'["P" I $D(^(A,U,XQOPI)),$D(^(XQOPM)) S XQAKEY=$S(+$E(A,2,99)=+XQOPM:1,1:0) D A
6 Q
7XPAND ;
8 F L=0:0 S L=$O(^DIC(19,XQNEW,10,L)) Q:L'>0 S T=+^(L,0) I $P(^DIC(19,T,0),U,3)="",'$D(^TMP($J,"ACT",T)) S K=K+1,^(T)="",^TMP($J,"NEW",K)=T
9 Q
10 ;
11A ;
12 S PATH=""
13 F XQ83DI=0:0 S PATH=$O(^TMP($J,"PATH",PATH)) Q:PATH="" S XQ83DN=$L(PATH,","),XQJ=$P(PATH,",",XQ83DN-1),XQVAL=^(PATH),XQSYN=^(PATH,"SYN"),XQUC=^("U") I $D(^XUTL("XQO",A,U,XQJ)) S XQPATH=","_$S(XQAKEY:"",1:XQOPM_",")_PATH D DA
14 K XQB,XQFND,XQJ,XQSYN,XQPATH,XQ83DI,XQ83DN,PATH
15 Q
16 ;
17DA ;
18 F XQK=0:0 S XQK=$O(^XUTL("XQO",A,U,XQJ,0,XQK)) Q:XQK'>0 S XQB=$P(^(XQK),U) I ","_XQB[XQPATH S ^(0)=^XUTL("XQO",A,U,XQJ,0)-1 K:^(0)'>0 ^(0) K ^(0,XQK) I XQSYN'="" S XQ2=XQSYN,XQ1=XQJ_U_"0" D DELNAM
19 S XQB=$P(^XUTL("XQO",A,U,XQJ),U,6) I ","_XQB[XQPATH D DA1 I XQSYN'="" S XQ2=XQSYN,XQ1=XQJ_U_"0" D DELNAM
20 I '$D(^XUTL("XQO",A,U,XQJ)) S XQ2=$E(XQUC,1,27),XQ1=XQJ_U_"1" D DELNAM
21 Q
22 ;
23DA1 ;
24 I $D(^XUTL("XQO",A,U,XQJ))'>9 K ^(XQJ) Q
25 S XQ2=^XUTL("XQO",A,U,XQJ)
26 ;
27 S XQ1=0 F XQJJ=0:0 S XQJJ=$O(^XUTL("XQO",A,U,XQJ,0,XQJJ)) Q:XQJJ'>0 S XQ1=XQJJ
28 S XQA=^XUTL("XQO",A,U,XQJ,0,XQ1),^(XQJ)=$P(^XUTL("XQO",A,U,XQJ),U,1,5)_U_$P(XQA,U,1,2)_U_$P(^(XQJ),U,8,9)_U_$P(XQA,U,3,4)_U_$P(^(XQJ),U,12,16)_U_$P(XQA,U,5)_U_$P(^(XQJ),U,18,99),^(0)=^(XQJ,0)-1 K:^(0)=0 ^(0) K ^(0,XQ1),XQA,XQ1,XQ2
29 Q
30 ;
31DELNAM ;
32 S XQ3=XQ2 F XQK=0:0 S XQ3=$O(^XUTL("XQO",A,XQ3)) Q:$E(XQ3,1,$L(XQ2))'=XQ2 I ^(XQ3)=XQ1 K ^(XQ3) Q
33 K XQ1,XQ2,XQ3
34 Q
35 ;
Note: See TracBrowser for help on using the repository browser.