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

DDGFUPDB.m

Go to the documentation of this file.
  1. DDGFUPDB ;SFISC/MKO-UPDATE BLOCK COORDINATES ;03:28 PM 17 Aug 1993
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. BLK(DDGFORIG) ;
  1. ;Update image with adjusted block coordinates
  1. ; DDGFORIG(B) : defined for all blocks that changed coordinates
  1. ; = original $Y^original $X
  1. N P,P1,P2,B,B1,B2,F,C1,C2,C3,C,D1,D2,D3,L,X1,Y1,N,I
  1. ;
  1. ;Get page coordinates
  1. S P=DDGFPG
  1. S P1=$P(@DDGFREF@("F",P),U),P2=$P(@DDGFREF@("F",P),U,2)
  1. ;
  1. ;Loop through all blocks on page
  1. S B="" F S B=$O(@DDGFREF@("F",P,B)) Q:B="" D BK
  1. Q
  1. ;
  1. BK ;Get block coordinates
  1. S B2=@DDGFREF@("F",P,B)
  1. S B1=$P(B2,U),B2=$P(B2,U,2)
  1. ;
  1. ;Get Y1=delta $Y, X1=delta $X
  1. I $D(DDGFORIG(B)) S Y1=B1-$P(DDGFORIG(B),U),X1=B2-$P(DDGFORIG(B),U,2)
  1. E S (Y1,X1)=0
  1. I 'Y1,'X1 K DDGFORIG(B)
  1. ;
  1. ;Loop through all fields on block
  1. S F="" F S F=$O(@DDGFREF@("F",P,B,F)) Q:F="" D FD
  1. Q
  1. ;
  1. FD ;
  1. ;Get field data
  1. S N=@DDGFREF@("F",P,B,F)
  1. S C1=$P(N,U),C2=$P(N,U,2),C3=$P(N,U,3),C=$P(N,U,4)
  1. S D1=$P(N,U,5),D2=$P(N,U,6),D3=$P(N,U,7),L=$P(N,U,8)
  1. ;
  1. I $D(DDGFORIG(B)) D
  1. . I Y1 S:C1]"" $P(N,U)=C1+Y1 S:L $P(N,U,5)=D1+Y1
  1. . I X1 D
  1. .. I C]"" F I=2,3 S $P(N,U,I)=$P(N,U,I)+X1
  1. .. I L F I=6,7 S $P(N,U,I)=$P(N,U,I)+X1
  1. . S @DDGFREF@("F",P,B,F)=N
  1. . ;
  1. . I C]"" D
  1. .. K @DDGFREF@("RC",DDGFWID,C1,C2,C3,B,F,"C")
  1. .. S @DDGFREF@("RC",DDGFWID,$P(N,U),$P(N,U,2),$P(N,U,3),B,F,"C")=""
  1. . I L D
  1. .. K @DDGFREF@("RC",DDGFWID,D1,D2,D3,B,F,"D")
  1. .. S @DDGFREF@("RC",DDGFWID,$P(N,U,5),$P(N,U,6),$P(N,U,7),B,F,"D")=""
  1. ;
  1. I C]"" D WRITE^DDGLIBW(DDGFWID,C,$P(N,U)-P1,$P(N,U,2)-P2)
  1. I L D WRITE^DDGLIBW(DDGFWID,$TR($J("",L)," ","_"),$P(N,U,5)-P1,$P(N,U,6)-P2)
  1. Q