Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DICM3

DICM3.m

Go to the documentation of this file.
  1. DICM3 ;SFISC/XAK,TKW-PROCESS INDIVIDUAL FILE FOR VAR PTR ;12/7/99 14:59 [ 04/02/2003 8:25 AM ]
  1. ;;22.0;VA FileMan;**1001**;APR 1, 2003
  1. ;;22.0;VA FileMan;**16,4,20**;Mar 30, 1999
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. DIC ; Does recursive ^DIC call to single pointed-to file.
  1. Q:$D(DIVP(+DIVPDIC))
  1. I $D(DIV("V")) N % D X % I '$T K Y S Y=-1 D DQ Q
  1. . S Y=DIVP,Y(0)=DIVPDIC
  1. . S %=$S($G(DIV("V"))]"":DIV("V"),1:$G(DIV("V",1))) Q
  1. I '$D(^DIC(+DIVPDIC,0,"GL")) S Y=-1 D DQ Q
  1. S (Y,DIC)=^("GL"),%="DIC"_DICR
  1. N:'$D(DIVPSEL) DIVPSEL S DIVPSEL(DICR)=0
  1. S D=$G(DICR(DICR,4)) S:D="" D="B"
  1. I DIC["""" S Y="" F A1=1:1:$L(DIC,",")-1 S A0=$P(DIC,",",A1) S:A0["""" A0=$P(A0,"""")_""""""_$P(A0,"""",2)_""""""_$P(A0,"""",3) S Y=Y_A0_","
  1. ;
  1. ; Build screen to select only pointed-to entries.
  1. K DIC("S") N DICODE S DICODE=""
  1. I DIC(0)'["L"!'$D(DICR(DICR,"V")) D
  1. . N DIX S DIX=""""_D_"""" D
  1. . . I $G(DINDEX("#"))>1 D BLDC^DICM0("("_DIVDIC,DIX,DINDEX("#"),DIFILEI,Y,.DICODE,.DICR) Q
  1. . . S DICODE="X ""I 0"" N "_%_$S($D(DICR(DICR,"S")):",%Y"_DICR,1:"")_" "
  1. . . S DICODE=DICODE_"F "_%_"=0:0 S "_%_"=$O("_DIVDIC_DIX_",(+Y_"";"_$E(Y,2,99)_"""),"_%_")) Q:"_%_"'>0 I $D("_DIVDIC_%_",0))"
  1. . . I DIC(0)["T",DICR=1 S DICODE=DICODE_$$CHKTMP^DICM0(.DIC,DICR,DIFILEI,%)
  1. . . I $D(DICR(DICR,"S")) S DICODE=DICODE_" S %Y"_DICR_"=Y,Y="_%_" X DICR("_DICR_",""S"") S Y=%Y"_DICR_" I "
  1. . . S DICODE=DICODE_" Q" Q
  1. . S:DICODE]"" DIC("S")=DICODE Q
  1. ;
  1. ; Set DIC(0)
  1. S %=DIC(0),DIC(0)="D"_$E("M",%'["B") D
  1. . N I F I="E","O","B","T","V" I %[I S DIC(0)=DIC(0)_I
  1. . Q
  1. I %["L",$D(DICR(DICR,"V")),$$OKTOADD^DICM0(DIVDO,.DINDEX,.DIFINDER) D
  1. . I $P(DIVPDIC,U,6)="y" S DIC(0)=DIC(0)_"L"
  1. . ; Execute screen code for screened pointer (should set DIC("S")).
  1. . K D Q:$P(DIVPDIC,U,5)'="y"
  1. . N DICODE S DICODE=$G(^DD(DIVDO,DIVY,"V",DIVP,1)) Q:DICODE=""
  1. . N DICSSAV S DICSSAV=$G(DIC("S"))
  1. . X DICODE
  1. . S DIC("S")=$G(DIC("S"))_$S(DICSSAV]"":" "_DICSSAV,1:"")
  1. . Q
  1. E K D
  1. ; If user passed list of indexes to use on pointed-to file, setup.
  1. S %=$G(DIC("PTRIX",DIFILEI,DINDEX(1,"FIELD"),+DIVPDIC))
  1. I %]"" N DF,DID S D=% D SETIX^DICM0(.D,.DIC,.DID,.DF)
  1. S:$G(D)="" D="B" N DISAVED S DISAVED=D
  1. ;
  1. ; Write prompt
  1. I DIC(0)["E" D
  1. . I $G(DICODE)="" D H1^DIE3 W:'$D(DDS) ! Q
  1. . D H1 Q
  1. ;
  1. ; Set up rest of variables needed for DQ^DICQ or ^DIC call.
  1. D DO^DIC1
  1. N DS,DINDEX,DIFILEI
  1. S D=DISAVED K DISAVED
  1. ; Handle ? help
  1. I X?."?" D D DQ Q
  1. . S DZ=X_$E("?",'$D(DICR(DICR,"V")))
  1. . D DQ^DICQ S X=$S($D(DZ):DZ,1:"?"),Y=-1 Q
  1. ; Do ^DIC call.
  1. D X^DIC I $D(DUOUT) D DQ Q
  1. ;
  1. ; Process output from ^DIC call.
  1. S X=+Y_";"_$E(DIC,2,99),%=1 K:Y<0 X
  1. I Y<0,DIC(0)["E",$D(DIVP1),$D(DICR(DICR,"V")) W !
  1. I '$D(DICR(DICR,"V"))!(DICR>1) K DICR("^",+DIVPDIC) S DIVP(+DIVPDIC)=0
  1. I Y>0,'DIVPSEL(DICR),DIC(0)["E",'$P(Y,U,3),$P(@(DIC_"0)"),U,2)'["O" D
  1. . N I F I=(DICR-1):-1 Q:'$D(DIVPSEL(I)) S DIVPSEL(I)=1
  1. . D S1^DIE3 I $G(%Y)?1"^^".E S (DIROUT,DUOUT)=1
  1. . Q
  1. DQ I $D(DIC("PTRIX")) M DIV("PTRIX")=DIC("PTRIX")
  1. K A0,A1,DIC,DO S DIC=DIVDIC,D=$S($D(DICR(DICR,4)):DICR(DICR,4),1:"B")
  1. S DIC(0)=DICR(DICR,0)
  1. F %="V","PTRIX" I $D(DIV(%)) M DIC(%)=DIV(%)
  1. Q
  1. ;
  1. H1 W:'$D(DDS) !
  1. N A1,DST,DIPAR S A1="T"
  1. S DIPAR(1)=$P(DIVPDIC,U,2),DIPAR(2)=$P($G(^DD(DIVDO,DIVY,0)),U)
  1. S DST=$$EZBLD^DIALOG(8097,.DIPAR)
  1. D S^DIE3 W:'$D(DDS) ! Q
  1. ;
  1. ;8070 Searching for a |1|
  1. ;8097 Searching for a |1|, (pointed-to by |2|)
  1. ;