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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1DIVRE ;SFISC/MWE-REQ FLD(S) CHK ;2:52 PM 10 Jun 1997
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4B K ^UTILITY($J),DIBT S (DK,DIC)=DI,DIC(0)="EQM",DIK=0
5 W !,"CHECK WHICH ENTRY: " R X:DTIME G QQ:U[X!'$T
6 I X="ALL" D ALL G QQ:$D(DIRUT) I Y S DIROOT=DIU G D
7 D ^DIC I Y<0 W:X?1."?" !?3,"You may type 'ALL' to select every entry in the file.",! G B
8R S DIK=DIK+1,^UTILITY($J,"DIN",+Y)=""
9 S DIC(0)="AEQM",DIC("A")="ANOTHER ONE: " D ^DIC I Y>0 G R
10 Q:'DIK!(X=U)
11D ;
12 D S2^DIBT1 K DIRUT,DIROUT G QQ:$D(DTOUT)!($D(DUOUT))
13 I X]"" G D:Y<0 S:Y>0 DIBT=+Y
14 S DIC=DI
15 S:$D(^%ZTSK) %ZIS="Q" D ^%ZIS G:POP QQ
16 I $G(IO("Q"))=1 G TSK
17L I $E(IOST)="C" S DIFF=1
18 S (DC,DA,N)=0 S:'$D(DIROOT) DIROOT="^UTILITY($J,""DIN""," F I=0:0 S DA=$O(@(DIROOT_DA_")")) Q:'DA W:IOST?1"C".E "." D START
19 I N U IO S DC=0 D PH F N=1:1 Q:'$D(^UTILITY($J,"DIVRE",N)) S X=^(N) D P I IOST?1"C".E,$Y>(IOSL-4) W $C(7) R X:DTIME Q:X=U!'$T
20 I 'N U IO D PH W !!,"NO REQUIRED FIELD IS MISSING"
21Q W:$E(IOST)'="C"&($Y) @IOF X $G(^%ZIS("C"))
22QQ K DIRUT,DTOUT,DUOUT,DIROUT,DK,C,D,I,J,N,F,S,G,P,L,X,Y,DI,DIK,DIC,DISD,DIREF,DIFLD,DC,DIROOT,DIFF,^UTILITY($J)
23 Q
24P ;
25 D:$Y>(IOSL-3) PH
26 S %=$P(X,U),Y=$P(@(^DIC($P(%,";",2),0,"GL")_+%_",0)"),U,1),C=$P(^DD($P(%,";",2),.01,0),U,2) D Y^DIQ
27 W !,+$P(X,U),?10,$E(Y,1,20),?35,$P(X,U,2),?50,$P(^DD($P(X,U,2),$P(X,U,3),0),U)
28 Q:DUZ(0)'="@"
29 I IOM>80 W ?85,$P(X,U,4) Q
30 W !?35,$P(X,U,4) Q
31PH ;
32 S DC=DC+1 W:$D(DIFF)&($Y) @IOF S DIFF=1 W "Required-Field-Check File: ",DIC_" "_$O(^DD(DIC,0,"NM","")),?(IOM-25) S Y=DT D DD^%DT W ?(IOM-10),"PAGE ",DC
33 W !,"Entry",?35,"DD-Number",$S((DUZ(0)="@")+(IOM'>80)=2:"/Path",1:""),?50,"Field" I DUZ(0)="@",IOM>80 W ?85,"Path"
34 W ! F L=1:1:(IOM-2) W "-"
35 Q
36CHECK ;
37 I $P(^DD(DIC,DIFLD,0),U,2)'["R",'$D(DIKEYCHK) Q
38 S G=$P(^(0),U,4),P=$P(G,";",2),G=$P(G,";") S:'P P=1
39 I $D(@(DIREF_","""_G_""")")),$P(^(G),U,P)]"" Q
40 N % S %=0 S N=N+1,^UTILITY($J,"DIVRE",N)=D(1)_";"_I(1)_U_DIC_U_DIFLD_DIREF S:$D(DIBT) %=%+1,^DIBT(DIBT,1,D(1))=""
41 I %,$G(DIBT) S ^DIBT(DIBT,"QR")=DT_U_%
42 Q
43START ;
44 S L=1,DIC=$S('DIC:+$P(@(DIC_"0)"),U,2),1:DIC),DIREF=^DIC(DIC,0,"GL"),X="",U="^",DIREF=DIREF_DA
45M S J(L)=DIREF,I(L)=DIC,D(L)=DA K DIFLIST,DIKEYCHK
46 S DIFLD=0 F I=0:0 S DIFLD=$O(^DD(DIC,"RQ",DIFLD)) Q:'DIFLD S F(L)=DIFLD,DIFLIST(DIFLD)="" D CHECK
47 S DIKEYCHK=1,DIFLD=0 F S DIFLD=$O(^DD("KEY","F",DIC,DIFLD)) Q:'DIFLD I '$D(DIFLIST(DIFLD)) S F(L)=DIFLD D CHECK
48 K DIFLIST,DIKEYCHK S F(L)=""
49 S DISD=0 F I=0:0 S DISD=$O(^DD(DIC,"SB",DISD)) Q:'DISD S S(L)=DISD D NEW
50 Q
51NEW ;
52 S L=L+1
53 S DINODE=$P($P(^DD(I(L-1),$O(^DD(I(L-1),"SB",DISD,"")),0),U,4),";")
54 I DINODE="" S DINODE=0
55 E I DINODE'=+$P(DINODE,"E") S DINODE=""""_DINODE_""""
56 S DIC=DISD,DIREF=DIREF_","_DINODE_"," K DINODE
57 S DA=0 F I=0:0 S DA=$O(@(DIREF_DA_")")) Q:'DA S DIREF(L)=DIREF,DIREF=DIREF_DA D M S DIREF=DIREF(L)
58 S L=L-1,DIC=I(L),DIREF=J(L),DA=D(L),DIFLD=F(L),DISD=S(L)
59 Q
60TSK ;
61 S ZTRTN="L^DIVRE",ZTDESC="REQUIRED FIELD CHECK",ZTIO=ION_";"_IOST_";"_IOM
62 F N="DIC","^UTILITY($J,","DIROOT" S ZTSAVE(N)=""
63 D ^%ZTLOAD X $G(^%ZIS("C")) G QQ
64 ;
65ALL S DIR(0)="Y",DIR("??")="^D H^DIVRE1"
66 S DIR("A")="DO YOU MEAN ALL THE ENTRIES IN THE FILE"
67 D ^DIR K DIR S X="ALL"
68 Q
Note: See TracBrowser for help on using the repository browser.