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

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

revised back to 6/30/08 version

File size: 3.4 KB
Line 
1DICOMP0 ;SFISC/GFT-EVALUATE COMPUTED FLD EXPR ;2DEC2006
2 ;;22.0;VA FileMan;**6,76,114,144**;;Build 5
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 N DICOMPI
5SETFUNC I DPS,$D(DPS(DPS,"SET")),'$D(W(DPS)) S T="""",D=$P(X,T)_$P(X,T,2) G BAD:$L(D)+2\5-1!(D'?.UN)!(D?1"D".E)!(DUZ(0)'="@") S X=T_D_T,DICOMPX(D)=D,Y=0 Q
6LIT I X?1"""".E1"""" S Y=0,%=$E(X,2,$L(X)-1) K:%[""" X "!(%[""" D @") Y S X=""""_$$CONVQQ^DILIBF(%)_"""" Q
7L S T=DLV,DICN=X
8TRY G M:'$D(J(T))!'$D(I(T)),M:+J(T)'=J(T),M:$D(^DD(J(T)))<9 S DIC="^DD("_J(T)_",",DG=$O(^DD(J(T),0,"NM",0))_" "
9 S DIC("S")=$S(W="["!($E(I,M,M+1)="'[")!$D(DICMX):"I ",1:"S %=$P(^(0),U,2) I '%,%'[""m"",")_"$$SCREEN^DICOMP0"
10 D DICS^DICOMPY:DUZ(0)'="@"
11R I X?1"#"1.NP S X=$E(X,2,99) D ^DIC G:Y>0 A:DLV,X S X="#"_X
12 D ^DIC G A:Y>0
13N I $P(X,DG)="",X=DICN S X=$P(X,DG,2,9) G R
14NUMBER I X="NUMBER" S Y=.001,Y(0)=0 G D
15 S T=T-1,X=DICN G M:T<0,TRY:$D(J(T)) F T=T-99:1 G TRY:'$D(J(T+1))
16 ;
17A F D=M:1:$L(I)+1 Q:$F(X,$E(I,1,D))-1-D S W=$E(I,D+1)
18 I DICOMP["?",DICN'="#.01",$P(Y,U,2)'=DICN,DG_$P(Y,U,2)'=DICN D G BAD:%<0,N:%-1
19 .W !?3,"By '"_DICN_"', do you mean "_DG_"'"_$P(Y,U,2)_"'" S %=1 D YN^DICN
20 E S DICO("BACK",T)=+Y
21 S M=D
22X I $D(DICOMPX)#2 S %Y=J(T)_U_+Y_$E(";",1,$L(DICOMPX)) S:";"_DICOMPX_";"'[(";"_%Y) DICOMPX=%Y_DICOMPX
23D S D=$P(Y(0),"^",2),%=T\100*100,DICN=+Y,DICOMPI=W=")"&$D(DPS($$NEST^DICOMP,"INTERNAL")) D DATE:D["D"&'DICOMPI
24 I D["m"!D D MUL^DICOMPZ(D) Q
25 I $D(DICOMPX(1,J(T),+Y)) S X=DICOMPX(1,J(T),+Y) G O
26 I D["C" S:'$D(DG(%,T,+Y)) DG(%)=DG(%)+1,DG(%,T,+Y)=DG(%) S X=DQI_DG(%,T,+Y)_")" Q:D'["p"!DICOMPI S DICN=+$P(D,"p",2),%Y=$G(^DIC(DICN,0,"GL")) Q:%Y="" G POINT
27GET I DICOMP["G",T#100=0 S X="$$GET^DDSVAL("_J(T)_",D0,"_+Y_",,"""_$E("E",'DICOMPI)_""")" G O
28 D G^DICOMPY
29O Q:DICOMPI
30 S T=J(T)
31S ;
32 S %=DLV0,DG=W=":"&'$D(DPS(DPS,"$S"))
33 I D["O"&(D'["P"!'DG)!(D["V"&'$D(DPS(DPS,"FILE"))) D DIMP^DICOMPZ("N C S Y="_X_",C="""_D_""" D:$D(^DD("_T_","_DICN_",0)) Y^DIQ") S X=X_" S X=Y" Q
34SET I D["S" S DG(%)=DG(%)+1,DG(%,DG(%))="$C(59)_$P($G(^DD("_T_","_DICN_",0)),U,3)",X="$P($P("_DQI_DG(%)_"),$C(59)_"_X_"_"":"",2),$C(59))"
35 Q:D'["P" S %Y=U_$P(Y(0),U,3),DICN=+$P(@(%Y_"0)"),U,2)
36POINT I W=":" G MR:'$$OKFILE^DICOMPX(DICN,DICOMP)
37 I W'=":" S D=$P($G(^DD(DICN,.01,0)),U,2) I D'["V",D'["S",D'["P" D DATE:D["D" S X="$P($G("_%Y_"+"_X_",0)),U)" Q
38P G P^DICOMPX
39 ;
40M S T=$F(X," IN ") I T S X=$E(X,1,T-5),W=":",M=T-4,I=X_W_$E(I,T,999),T=$F(I," FILE",M) S:T&$F(DPUNC,$E(I,T)) I=$E(I,1,T-6)_$E(I,T,999) G DICOMP0
41 G MR:$L(X)>30 S DICF=X,T=$O(^DD("FUNC","B",X,0))
42 G LITDATE:'$D(^DD("FUNC",+T,3)),LITDATE:^(3)
43 I $G(^(1))'="" D 2^DICOMP S Y(0)=0,K=K+1,K(K)=X D DATE:$G(^(2))?1"D".E,DPS^DICOMPW Q
44 G MR:X'?1"PRIOR"4.U S Y=X,X="$P($$LAST^DIAUTL("_J(DLV0)_",D0,""*""),U)" I Y["USER",$D(^VA(200)) S $E(X,$L(X))=",2)",DICN=200,%Y="^VA(200," G POINT
45 G DATE
46 ;
47LITDATE S %DT="T" I $L(X)>2 D ^%DT I Y>0 S X=Y,Y(0)=0 D DATE Q ;may be a literal date
48BACKPNT S T=$O(^DIC("B",X)) I T]"",$P(T,X)=""!$D(^(X)),$D(J(0)) S T=DLV0 D ^DICOMPV I D>0 Q ;try backwards-pointer TOOK OFF CHECK FOR DICOMPW VARIABLE 3/28/2000
49MR I M'>$L(I),+X'=X D MR^DICOMP G L:X]""
50BAD K Y Q
51 ;
52DATE ;
53 S DATE(K+1)=1 Q
54 ;
55SCREEN() ;Screen out certain fields as we process an atom
56 I $D(DICO("BACK"))=11,$G(DICO("BACK",T))=Y Q 0
57 I Y=DA,DICO(1)=T Q 0 ;Computed field cannot refer to itself!
58 I $P(^(0),U,2) Q '$G(DBOOL) ;A multiple cannot be manipulated as a Boolean!
59 I $P(^(0),U,2)'["P" Q 1
60 N P S P=$P(^(0),U,3) I P]"",$D(@(U_P_"0)")) Q 1 ;Only allow a pointer that points to an existing file!
61 Q 0
Note: See TracBrowser for help on using the repository browser.