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

DIO3.m

Go to the documentation of this file.
DIO3 ;SFISC/GFT-TTLS, SUBTTLS ;09:49 AM  27 Aug 1999 [ 04/02/2003   8:25 AM ]
 ;;22.0;VA FileMan;**1001**;APR 1, 2003
 ;;22.0;VA FileMan;**2**;Mar 30, 1999
 ;Per VHA Directive 10-93-142, this routine should not be modified.
SUB ;
 N TYPE,V
 W:'$D(DNP)&$X ! K X I $D(^UTILITY($J,"SV",A+1)) F Y="S","N","Q","H","L" S C=Y_"(V)" F V=0:0 S V=$O(@C) Q:V=""  I $D(^UTILITY($J,"SV",A+1,V,Y)) S @C=^(Y),^(Y)=$S(Y="H":-99999999,Y="L":99999999,1:0)
 S %X="" F  S %X=$O(^UTILITY($J,"T",%X)) Q:%X=""  D
 .S Z=^(%X),V=$P(Z,U,2) Q:$D(V(V))
 .S V(V)="",TYPE=$P(Z,U,4)
U .F I=1:1:6 S DE=$P($T(@I),";",4),Y=DE_"(V)" I $D(@Y)#2 S Y=@Y,C=$P(Z,U,5) D @I
 .I '$D(DNP),$D(X)>9 W ?%X F I=1:1:Z W "-"
 S Z=A I $D(A(A)) F DE="S","N" S I=DE_"(V)" F V=0:0 S V=$O(@I) Q:V=""  S Y=@I I '$D(DNP)!Y S:'$D(V(V)) ^(DE)=$G(^UTILITY($J,"SV",A,V,DE))+Y S @I=0,Z=0 X A(A)
 S X=-1 G K:$D(X)<9!Z F I=0:0 S I=$O(X(I)),X=X+1 Q:I=""
 I X+$Y>IOSL X ^UTILITY($J,1)
 F I=0:0 S I=$O(X(I)),X=-1 Q:I=""  W:$X ! W $P("SUB",U,A>0),$P($T(@I),";",3)," " F %=0:0 S X=$O(X(I,X)) Q:X=""  W ?X,X(I,X)
 W !
K K Z,X,V,C Q
 ;
1 ;;TOTAL;S
 I $P(Z,U,6)]"" X $P(Z,U,6,99) S S(V)=Y
 S ^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