VistA-WorldVistAEHR/r/AUTOMATED_INFO_COLLECTION_S.../IBDF5.m

76 lines
3.2 KiB
Mathematica

IBDF5 ;ALB/CJM - ENCOUNTER FORM (edit a form);NOV 16,1992
;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
;displays the form for editing using the list processor
;
;these variables should always be defined while editing a form
;IBFORM - contains the form description
INIT ;
;
Q:'$$FORMDSCR^IBDFU1C(.IBFORM)
D IDXFORM^IBDF5A()
Q
EXIT ;
K @VALMAR
Q
HDR ;the screen header, a ruler
S VALMHDR(1)=$$PADRIGHT^IBDFU("",4) ;VALMHDR(2)=VALMHDR(2)_0
F I=1:1:16 S VALMHDR(1)=VALMHDR(1)_$J(I,10)
Q
DELETE ;allows user to select a block for deletion
N IBBLK,IBVALMBG,TOP,BOT
S VALMBCK="R",IBVALMBG=$G(VALMBG)
S VALMBG=IBVALMBG
D FULL^VALM1
S IBBLK=$$SLCTBLK^IBDFU8(IBFORM,IOSL)
Q:'IBBLK
Q:'$$RUSURE^IBDFU5($P($G(^IBE(357.1,IBBLK,0)),"^"))
D TOPNBOT^IBDFU5(IBBLK,.TOP,.BOT)
D DLTBLK^IBDFU3(IBBLK,IBFORM,357.1)
S VALMBCK="R"
D IDXFORM^IBDF5A(TOP,BOT)
Q
;
MOVE ;allows the user to select a block and move it
N IBBLK,NODE0,BLKWIDTH,BLKHT,STARTCOL,STARTROW,TOP1,BOT1,TOP2,BOT2
S VALMBCK="R"
;D FULL^VALM1
S IBBLK=$$SLCTBLK^IBDFU8(IBFORM,5)
I IBBLK D
.S NODE0=$G(^IBE(357.1,IBBLK,0))
.S BLKWIDTH=+$P(NODE0,"^",6),BLKHT=+$P(NODE0,"^",7),STARTCOL=+$P(NODE0,"^",5),STARTROW=+$P(NODE0,"^",4)
.S TOP1=STARTROW,BOT1=(TOP1+BLKHT)-1
.I STARTROW!(IBFORM("HT")>BLKHT) K DIR S DIR(0)="NA^1:"_(IBFORM("HT")-BLKHT+1)_":0",DIR("A")="Move the TOP MARGIN of the block to which row?: ",DIR("B")=STARTROW+1 D ^DIR K DIR Q:$D(DIRUT) S STARTROW=X-1
.I STARTCOL!(IBFORM("WIDTH")>BLKWIDTH) K DIR S DIR(0)="NA^1:"_(IBFORM("WIDTH")-BLKWIDTH+1)_":0",DIR("A")="Move the LEFT MARGIN of the block to which column?: ",DIR("B")=STARTCOL+1 D ^DIR K DIR Q:$D(DIRUT) S STARTCOL=X-1
.K DIE,DA S DIE=357.1,DA=IBBLK,DR=".04////^S X=STARTROW;.05////^S X=STARTCOL" D ^DIE K DIE,DA,DR
.S VALMBCK="R"
.D TOPNBOT^IBDFU5(IBBLK,.TOP2,.BOT2) S TOP1=$S(TOP1<TOP2:TOP1,1:TOP2) S BOT1=$S(BOT1>BOT2:BOT1,1:BOT2)
.D IDXFORM^IBDF5A(TOP1,BOT1)
.S VALMBG=STARTROW-7 S:VALMBG<1 VALMBG=1
Q
RESIZE ;allows user to select a block & re-size it
N IBBLK,BLKWIDTH,BLKHT,STARTCOL,STARTROW,TOP1,TOP2,BOT1,BOT2
S IBBLK=$$SLCTBLK^IBDFU8(IBFORM,5)
I IBBLK D
.D NOWSIZE S TOP1=STARTROW,BOT1=(TOP1+BLKHT)-1
.D NEWSIZE
.D TOPNBOT^IBDFU5(IBBLK,.TOP2,.BOT2) S TOP1=$S(TOP1<TOP2:TOP1,1:TOP2) S BOT1=$S(BOT1>BOT2:BOT1,1:BOT2)
.D IDXFORM^IBDF5A(TOP1,BOT1)
S VALMBCK="R"
Q
NOWSIZE ;what size is the block, and where does it start? returns BLKWIDTH,BLKHT,STARTROW,STARTCOL
N NODE0
S NODE0=$G(^IBE(357.1,IBBLK,0))
S BLKWIDTH=+$P(NODE0,"^",6),BLKHT=+$P(NODE0,"^",7),STARTCOL=+$P(NODE0,"^",5),STARTROW=+$P(NODE0,"^",4)
Q
NEWSIZE ;allows user to change the size of a block
K DIR S DIR(0)="NA^"_(STARTROW+1)_":"_(IBFORM("HT"))_":0",DIR("A")="Move the BOTTOM MARGIN of the block to which row?: ",DIR("B")=(STARTROW+BLKHT) D ^DIR K DIR Q:$D(DIRUT) S BLKHT=(X-STARTROW)
K DIR S DIR(0)="NA^"_(STARTCOL+1)_":"_IBFORM("WIDTH")_":0",DIR("A")="Move the RIGHT MARGIN of the block to which column?: ",DIR("B")=(STARTCOL+BLKWIDTH) D ^DIR K DIR Q:$D(DIRUT) S BLKWIDTH=(X-STARTCOL)
K DIE,DA S DIE=357.1,DA=IBBLK,DR=".06////^S X=BLKWIDTH;.07////^S X=BLKHT" D ^DIE K DIE,DA,DR
D UNCMPBLK^IBDF19(IBBLK)
Q
SHIFT ;allows the user to shift a group of blocks within a rectangular region on the form
D SHIFT^IBDF10("B")
D IDXFORM^IBDF5A()
S VALMBCK="R"
Q