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

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1DIC5 ;SFISC/XAK,TKW,SEA/TOAD-VA FileMan: Lookup, Part 1 (utilities) ;05/28/2008
2 ;;22.0;VA FileMan;**4,20,31,70,159**;Mar 30, 1999;Build 8
3 ;Per VHA Directive 2004-038, 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,DIC5D S DIC5D=D,DS=1,DIX=X D ADDKEY^DIC3,GOT^DIC2 Q:Y>0
26 . D DO^DIC1 S D=DIC5D
27 I T["P"!(T["V"),DIC(0)'["U" S DISKIPIX=D
28 Q
29 ;
30SPACEBAR ; Lookup last record selected by this user when user enters space bar return. Called from ^DIC
31 N % S %=DINDEX("START") N DINDEX S DINDEX="",DINDEX("#")=1,DINDEX("START")=%
32 D S^DIC3 I '$T S Y=-1 Q
33 N DZ,DS,DIX S DS=1,DIX=X D ADDKEY^DIC3,GOT^DIC2 Q
34 ;
35KEEPON ; If DIC(0)["T", display entries found so far, then check for internal value if index is date, set, pointer, VP. Called from ^DIC3.
36 I DS D Q:Y>0!($G(DTOUT))!($G(DIROUT))
37 . N I M I=X N X M X=I S I=D N D S D=I K I
38 . I DS=1 D
39 . . S DS("DD")=1 D G^DIC2 Q
40 . E I $G(DS("DD"))'=DS D Y^DIC1 I '$D(DIROUT),$D(DUOUT) K DUOUT ;22*70
41 . K DD,DS,DIX,DIYX S (DD,DS,DS("DD"))=0
42 . S:DIC(0)["E" DS(0,"HDRDSP",DIFILEI)=1
43 . S DS(0)=$S(Y>0:"1^"_+Y,$G(DTOUT):"1^T",$G(DIROUT):"1^U",1:0)
44 . Q
45 Q:DIC(0)["U" I DINDEX=DINDEX("START"),$G(DINDEX("#"))>1 Q
46 N I M I=X N X M X=I S I=D N D S D=I K I
47 D 1^DICM
48 K DD,DS,DIX,DIYX S (DD,DS,DS("DD"))=0
49 S DS(0)=$S(Y>0:"1^"_+Y,$G(DTOUT):"1^T",$G(DIROUT):"1^U",1:0)
50 Q
51 ;
52PTRID(DO,DIC) ; Build code in DIC("W") to display Identifiers on pointed-to files
53 N DIFILEI,DIGBL,DIOGBL S DIFILEI=+DO(2),DIOGBL=DIC
54 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
55 Q
56Q ; Build Identifier code for a single pointed-to file
57 N DIGBL1 S DIGBL1=DIGBL
58 I DIGBL[$C(34) S DIGBL1=$$CONVQQ^DILIBF(DIGBL)
59 N N,O,% S N=$O(DIC("W",999999),-1)
60 S O=$S(N:DIC("W",N),1:DIC("W"))
61 N % S %="I '$G(DICR) S DIEN=+"_DIOGBL_"DIEN,0) I $D("_DIGBL_"DIEN,0)) S DIFILEI="_DIFILEI_",DIGBL="""_DIGBL1_""" D WOV^DICQ1"
62 S DIOGBL=DIGBL
63 I ($L(O)+$L(%))<230 D Q
64 . I 'N S DIC("W")=DIC("W")_" "_% Q
65 . S DIC("W",N)=DIC("W",N)_" "_% Q
66 S N=N+1,DIC("W",N)=%
67 I N=1 S DIC("W")=DIC("W")_" X DIC(""W"",1)" Q
68 S DIC("W",N-1)=DIC("W",N-1)_" X DIC(""W"","_N_")"
69 Q
70 ;
Note: See TracBrowser for help on using the repository browser.