DDSZ3 ;SFISC/MKO-FORM COMPILER ;02:49 PM 30 Dec 1993
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
;
ASUB(DDSPG,DDSFRM) ;
;Set @DDSREFS@("ASUB",pg,bk,ddo)=subpage for parent field
N MF,MB,MP
S MF=$P(^DIST(.403,+DDSFRM,40,DDSPG,1),U,2) Q:MF=""
S MP=$P(MF,",",3),MB=$P(MF,",",2),MF=$P(MF,",")
;
S MF=$$GETFLD^DDSLIB(MF,MB,MP,DDSFRM)
I $G(DIERR) K DIERR,^TMP("DIERR",$J) Q
S @DDSREFS@("ASUB",$P(MF,",",3),$P(MF,",",2),$P(MF,","))=DDSPG
Q
;
PGRP(FRM,G) ;Find page groups
;In: FRM = Form number
;Out: G = Array of page groups
;
N B,I,NP,P,PP,PG
S G=0
S P=0 F S P=$O(^DIST(.403,FRM,40,P)) Q:'P D
. Q:'$D(^DIST(.403,FRM,40,P,0)) S NP=$P(^(0),U,4),PP=$P(^(0),U,5)
. F PG="NP","PP" I @PG D
.. S @PG=$O(^DIST(.403,FRM,40,"B",@PG,"")) Q:'@PG
.. S:$D(^DIST(.403,FRM,40,@PG,0))[0 @PG=""
. S:NP=P NP=0 S:PP=NP!(PP=P) PP=0
. S I=0 F S I=$O(G(I)) Q:'I Q:U_G(I)_U[(U_P_U)
. I 'I S G=G+1,G(G)=P_$S(NP:U_NP,1:"")_$S(PP:U_PP,1:"") Q
. F PG="NP","PP" I @PG,U_G(I)_U'[(U_@PG_U) S G(I)=G(I)_U_@PG
Q
DDSZ3 ;SFISC/MKO-FORM COMPILER ;02:49 PM 30 Dec 1993
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
ASUB(DDSPG,DDSFRM) ;
+1 ;Set @DDSREFS@("ASUB",pg,bk,ddo)=subpage for parent field
+2 NEW MF,MB,MP
+3 SET MF=$PIECE(^DIST(.403,+DDSFRM,40,DDSPG,1),U,2)
IF MF=""
QUIT
+4 SET MP=$PIECE(MF,",",3)
SET MB=$PIECE(MF,",",2)
SET MF=$PIECE(MF,",")
+5 ;
+6 SET MF=$$GETFLD^DDSLIB(MF,MB,MP,DDSFRM)
+7 IF $GET(DIERR)
KILL DIERR,^TMP("DIERR",$JOB)
QUIT
+8 SET @DDSREFS@("ASUB",$PIECE(MF,",",3),$PIECE(MF,",",2),$PIECE(MF,","))=DDSPG
+9 QUIT
+10 ;
PGRP(FRM,G) ;Find page groups
+1 ;In: FRM = Form number
+2 ;Out: G = Array of page groups
+3 ;
+4 NEW B,I,NP,P,PP,PG
+5 SET G=0
+6 SET P=0
FOR
SET P=$ORDER(^DIST(.403,FRM,40,P))
IF 'P
QUIT
Begin DoDot:1
+7 IF '$DATA(^DIST(.403,FRM,40,P,0))
QUIT
SET NP=$PIECE(^(0),U,4)
SET PP=$PIECE(^(0),U,5)
+8 FOR PG="NP","PP"
IF @PG
Begin DoDot:2
+9 SET @PG=$ORDER(^DIST(.403,FRM,40,"B",@PG,""))
IF '@PG
QUIT
+10 IF $DATA(^DIST(.403,FRM,40,@PG,0))[0
SET @PG=""
End DoDot:2
+11 IF NP=P
SET NP=0
IF PP=NP!(PP=P)
SET PP=0
+12 SET I=0
FOR
SET I=$ORDER(G(I))
IF 'I
QUIT
IF U_G(I)_U[(U_P_U)
QUIT
+13 IF 'I
SET G=G+1
SET G(G)=P_$SELECT(NP:U_NP,1:"")_$SELECT(PP:U_PP,1:"")
QUIT
+14 FOR PG="NP","PP"
IF @PG
IF U_G(I)_U'[(U_@PG_U)
SET G(I)=G(I)_U_@PG
End DoDot:1
+15 QUIT