source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DIC5.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1DIC5 ;SFISC/XAK,TKW,SEA/TOAD-VA FileMan: Lookup, Part 1 (utilities) ;1:56 PM 19 Sep 2002
2 ;;22.0;VA FileMan;**4,20,31,70**;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4NODE75 ; Do after executing 7.5 node on DD, called from ^DIC
5 I $D(X)#2 S (DIVAL,DIVAL(1))=X Q
6 S Y=-1 Q:DIC(0)'["Q"!(DIC(0)'["E")
7 W $C(7) Q:$D(DDS)
8 W !,$$EZBLD^DIALOG(120,$$EZBLD^DIALOG(8090)) Q
9 ;
10BYIEN1 ; Lookup record by IEN when user enters `n for a number 'n', called from ^DIC
11 S Y=$E(X,2,30) I Y="" S Y=-1 Q
12 N % S %=DINDEX("START") N DINDEX S DINDEX="",DINDEX("#")=1,DINDEX("START")=%
13 D S^DIC3 I '$T S Y=-1 Q
14 N DD,DS,DZ S DS=1,DD=Y,DIX=X D ADDKEY^DIC3,GOT^DIC2
15 Q
16 ;
17BYIEN2 ; Lookup record by IEN when user enters a numeric lookup value, called from ^DIC
18 Q:DO(2)<0!($D(DF))
19 N T S T=DINDEX(1,"TYPE")
20 I $D(@(DIC_"X,0)")) D Q:Y>0
21 . N DD S DD=$D(^DD(DIFILEI,.001))
22 . I 'DD Q:T["N" I '$O(@(DIC_"""A["")")),$O(^("A["))]"" Q
23 . N % S %=DINDEX("START") N DINDEX S DINDEX="",DINDEX("#")=1,DINDEX("START")=%
24 . S Y=X D S^DIC3 I '$T S Y=-1 Q
25 . N DZ,DS,DIX S DS=1,DIX=X D ADDKEY^DIC3,GOT^DIC2 Q
26 I T["P"!(T["V"),DIC(0)'["U" S DISKIPIX=D
27 Q
28 ;
29SPACEBAR ; Lookup last record selected by this user when user enters space bar return. Called from ^DIC
30 N % S %=DINDEX("START") N DINDEX S DINDEX="",DINDEX("#")=1,DINDEX("START")=%
31 D S^DIC3 I '$T S Y=-1 Q
32 N DZ,DS,DIX S DS=1,DIX=X D ADDKEY^DIC3,GOT^DIC2 Q
33 ;
34KEEPON ; If DIC(0)["T", display entries found so far, then check for internal value if index is date, set, pointer, VP. Called from ^DIC3.
35 I DS D Q:Y>0!($G(DTOUT))!($G(DIROUT))
36 . N I M I=X N X M X=I S I=D N D S D=I K I
37 . I DS=1 D
38 . . S DS("DD")=1 D G^DIC2 Q
39 . E I $G(DS("DD"))'=DS D Y^DIC1 I '$D(DIROUT),$D(DUOUT) K DUOUT ;22*70
40 . K DD,DS,DIX,DIYX S (DD,DS,DS("DD"))=0
41 . S:DIC(0)["E" DS(0,"HDRDSP",DIFILEI)=1
42 . S DS(0)=$S(Y>0:"1^"_+Y,$G(DTOUT):"1^T",$G(DIROUT):"1^U",1:0)
43 . Q
44 Q:DIC(0)["U" I DINDEX=DINDEX("START"),$G(DINDEX("#"))>1 Q
45 N I M I=X N X M X=I S I=D N D S D=I K I
46 D 1^DICM
47 K DD,DS,DIX,DIYX S (DD,DS,DS("DD"))=0
48 S DS(0)=$S(Y>0:"1^"_+Y,$G(DTOUT):"1^T",$G(DIROUT):"1^U",1:0)
49 Q
50 ;
51PTRID(DO,DIC) ; Build code in DIC("W") to display Identifiers on pointed-to files
52 N DIFILEI,DIGBL,DIOGBL S DIFILEI=+DO(2),DIOGBL=DIC
53 F S DIFILEI=+$P($P($G(^DD(DIFILEI,.01,0)),U,2),"P",2) Q:'DIFILEI S DIGBL=$G(^DIC(DIFILEI,0,"GL")) Q:DIGBL="" D Q
54 Q
55Q ; Build Identifier code for a single pointed-to file
56 N DIGBL1 S DIGBL1=DIGBL
57 I DIGBL[$C(34) S DIGBL1=$$CONVQQ^DILIBF(DIGBL)
58 N N,O,% S N=$O(DIC("W",999999),-1)
59 S O=$S(N:DIC("W",N),1:DIC("W"))
60 N % S %="I '$G(DICR) S DIEN=+"_DIOGBL_"DIEN,0) I $D("_DIGBL_"DIEN,0)) S DIFILEI="_DIFILEI_",DIGBL="""_DIGBL1_""" D WOV^DICQ1"
61 S DIOGBL=DIGBL
62 I ($L(O)+$L(%))<230 D Q
63 . I 'N S DIC("W")=DIC("W")_" "_% Q
64 . S DIC("W",N)=DIC("W",N)_" "_% Q
65 S N=N+1,DIC("W",N)=%
66 I N=1 S DIC("W")=DIC("W")_" X DIC(""W"",1)" Q
67 S DIC("W",N-1)=DIC("W",N-1)_" X DIC(""W"","_N_")"
68 Q
69 ;
Note: See TracBrowser for help on using the repository browser.