TIUFLD1 ; SLC/MAM - Lib; Template D Related; SETBOIL(FIELDA,LASTLIN), EDBOIL(FILEDA), DEDBOIL(FILEDA), DSETSHAR(FILEDA) ;4/6/95 11:02
;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
;
SETBOIL(FILEDA,LASTLIN) ; Sets Boilerplate Text of FILEDA into
;LM Array for Template D.
; Kills LM Array from LASTLIN+1 to the end before setting boiltxt.
; Requires FILEDA.
; Requires LASTLIN = Last array line set, if setting array; = Last
;line to keep before resetting the rest if resetting array.
; Updates LASTLIN to Last array line set by this module.
N TIUFJ,TIUFI,LINENO
F TIUFJ=LASTLIN+1:1 Q:'$D(^TMP("TIUF3",$J,TIUFJ,0)) K ^TMP("TIUF3",$J,TIUFJ,0)
S LINENO=LASTLIN,TIUFI=0
F S TIUFI=$O(^TIU(8925.1,+FILEDA,"DFLT",TIUFI)) Q:+TIUFI'>0 D
. S LINENO=LINENO+1,^TMP("TIUF3",$J,LINENO,0)=$G(^TIU(8925.1,+FILEDA,"DFLT",+TIUFI,0))
S LASTLIN=LINENO
SETBX Q
;
DSETBOIL(FILEDA,VCNT3) ; Sets boilerplate Text for descendants of FILEDA.
; Requires FILEDA, VCNT3=VALMCNT for TIUF3 when DSETBOIL is called.
; Updates VCNT3.
N TIUFITEM,TIUI,LINENO,ITENDA,TENODE0,NAME
Q:'$G(FILEDA)
Q:$G(VCNT3)=""
D ITEMS^TIUFLT(FILEDA)
S TIUI=0,LINENO=VCNT3
F S TIUI=$O(TIUFITEM(TIUI)) Q:'TIUI D
. S ITENDA=$P(TIUFITEM(TIUI),U,2)
. S TENODE0=^TIU(8925.1,FILEDA,10,ITENDA,0),NAME=$P(^TIU(8925.1,+TENODE0,0),U)
. S LINENO=LINENO+1,^TMP("TIUF3",$J,LINENO,0)=NAME_":"
. D SETBOIL(+TENODE0,.LINENO)
. D DSETBOIL(+TENODE0,.LINENO)
. Q
DSETX S VCNT3=LINENO
Q
;
EDBOIL(FILEDA,NODE0) ; Edit Boilerplate Text of FILEDA.
; Requires FILEDA, NODE0 of FILEDA
D FULL^VALM1
N DIC,DWPK,DIWESUB
S DIC="^TIU(8925.1,"_FILEDA_",""DFLT"",",DWPK=1
S DIWESUB=$P(NODE0,U)
D EN^DIWE
EDBOX Q
;
DEDBOIL(FILEDA) ; Edit Boilerplate Text for descendants of FILEDA.
N TIUI,IFILEDA,INODE0,TIUFITEM,ITENDA
G:'$O(^TIU(8925.1,FILEDA,10,0)) DEDBX
D ITEMS^TIUFLT(FILEDA)
S TIUI=0 K DUOUT
F S TIUI=$O(TIUFITEM(TIUI)) Q:'TIUI D Q:$D(DTOUT)!$D(DUOUT)
. S ITENDA=$P(TIUFITEM(TIUI),U,2)
. S IFILEDA=+^TIU(8925.1,FILEDA,10,ITENDA,0),INODE0=^TIU(8925.1,IFILEDA,0)
. I $P(INODE0,U,10),'$$PERSOWNS^TIUFLF2(IFILEDA,DUZ) W !!," ",$P(INODE0,U),!,"is a Shared Component; Only an Owner can edit its Boilerplate Text.",!! D PAUSE^TIUFXHLX Q
. I $P(INODE0,U,10),TIUFTMPL'="A" W !!," ",$P(INODE0,U),!,"is a Shared Component; it can be edited only through the SORT option",!! D PAUSE^TIUFXHLX Q
. D EDBOIL(IFILEDA,INODE0) Q:$D(DTOUT)
. D DEDBOIL(IFILEDA)
. Q
DEDBX Q
;
DSETSHAR(FILEDA) ; Sets all descendants of FILEDA to SHARED
; Requires FILEDA
N TIUI,IFILEDA,INODE0,DIE,X,Y,SHARED,DA,DR
S TIUI=0,DIE=8925.1,SHARED="YES"
F S TIUI=$O(^TIU(8925.1,FILEDA,10,TIUI)) Q:'TIUI D
. S IFILEDA=+^TIU(8925.1,FILEDA,10,TIUI,0)
. S INODE0=$G(^TIU(8925.1,IFILEDA,0))
. I INODE0="" W !!," File Entry "_FILEDA_" has Nonexistent item "_IFILEDA_"; See IRM",! D PAUSE^TIUFXHLX Q
. S DA=IFILEDA,DR=".1///^S X=SHARED" D ^DIE
. D DSETSHAR(IFILEDA)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUFLD1 2984 printed Dec 13, 2024@02:41:03 Page 2
TIUFLD1 ; SLC/MAM - Lib; Template D Related; SETBOIL(FIELDA,LASTLIN), EDBOIL(FILEDA), DEDBOIL(FILEDA), DSETSHAR(FILEDA) ;4/6/95 11:02
+1 ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
+2 ;
SETBOIL(FILEDA,LASTLIN) ; Sets Boilerplate Text of FILEDA into
+1 ;LM Array for Template D.
+2 ; Kills LM Array from LASTLIN+1 to the end before setting boiltxt.
+3 ; Requires FILEDA.
+4 ; Requires LASTLIN = Last array line set, if setting array; = Last
+5 ;line to keep before resetting the rest if resetting array.
+6 ; Updates LASTLIN to Last array line set by this module.
+7 NEW TIUFJ,TIUFI,LINENO
+8 FOR TIUFJ=LASTLIN+1:1
if '$DATA(^TMP("TIUF3",$JOB,TIUFJ,0))
QUIT
KILL ^TMP("TIUF3",$JOB,TIUFJ,0)
+9 SET LINENO=LASTLIN
SET TIUFI=0
+10 FOR
SET TIUFI=$ORDER(^TIU(8925.1,+FILEDA,"DFLT",TIUFI))
if +TIUFI'>0
QUIT
Begin DoDot:1
+11 SET LINENO=LINENO+1
SET ^TMP("TIUF3",$JOB,LINENO,0)=$GET(^TIU(8925.1,+FILEDA,"DFLT",+TIUFI,0))
End DoDot:1
+12 SET LASTLIN=LINENO
SETBX QUIT
+1 ;
DSETBOIL(FILEDA,VCNT3) ; Sets boilerplate Text for descendants of FILEDA.
+1 ; Requires FILEDA, VCNT3=VALMCNT for TIUF3 when DSETBOIL is called.
+2 ; Updates VCNT3.
+3 NEW TIUFITEM,TIUI,LINENO,ITENDA,TENODE0,NAME
+4 if '$GET(FILEDA)
QUIT
+5 if $GET(VCNT3)=""
QUIT
+6 DO ITEMS^TIUFLT(FILEDA)
+7 SET TIUI=0
SET LINENO=VCNT3
+8 FOR
SET TIUI=$ORDER(TIUFITEM(TIUI))
if 'TIUI
QUIT
Begin DoDot:1
+9 SET ITENDA=$PIECE(TIUFITEM(TIUI),U,2)
+10 SET TENODE0=^TIU(8925.1,FILEDA,10,ITENDA,0)
SET NAME=$PIECE(^TIU(8925.1,+TENODE0,0),U)
+11 SET LINENO=LINENO+1
SET ^TMP("TIUF3",$JOB,LINENO,0)=NAME_":"
+12 DO SETBOIL(+TENODE0,.LINENO)
+13 DO DSETBOIL(+TENODE0,.LINENO)
+14 QUIT
End DoDot:1
DSETX SET VCNT3=LINENO
+1 QUIT
+2 ;
EDBOIL(FILEDA,NODE0) ; Edit Boilerplate Text of FILEDA.
+1 ; Requires FILEDA, NODE0 of FILEDA
+2 DO FULL^VALM1
+3 NEW DIC,DWPK,DIWESUB
+4 SET DIC="^TIU(8925.1,"_FILEDA_",""DFLT"","
SET DWPK=1
+5 SET DIWESUB=$PIECE(NODE0,U)
+6 DO EN^DIWE
EDBOX QUIT
+1 ;
DEDBOIL(FILEDA) ; Edit Boilerplate Text for descendants of FILEDA.
+1 NEW TIUI,IFILEDA,INODE0,TIUFITEM,ITENDA
+2 if '$ORDER(^TIU(8925.1,FILEDA,10,0))
GOTO DEDBX
+3 DO ITEMS^TIUFLT(FILEDA)
+4 SET TIUI=0
KILL DUOUT
+5 FOR
SET TIUI=$ORDER(TIUFITEM(TIUI))
if 'TIUI
QUIT
Begin DoDot:1
+6 SET ITENDA=$PIECE(TIUFITEM(TIUI),U,2)
+7 SET IFILEDA=+^TIU(8925.1,FILEDA,10,ITENDA,0)
SET INODE0=^TIU(8925.1,IFILEDA,0)
+8 IF $PIECE(INODE0,U,10)
IF '$$PERSOWNS^TIUFLF2(IFILEDA,DUZ)
WRITE !!," ",$PIECE(INODE0,U),!,"is a Shared Component; Only an Owner can edit its Boilerplate Text.",!!
DO PAUSE^TIUFXHLX
QUIT
+9 IF $PIECE(INODE0,U,10)
IF TIUFTMPL'="A"
WRITE !!," ",$PIECE(INODE0,U),!,"is a Shared Component; it can be edited only through the SORT option",!!
DO PAUSE^TIUFXHLX
QUIT
+10 DO EDBOIL(IFILEDA,INODE0)
if $DATA(DTOUT)
QUIT
+11 DO DEDBOIL(IFILEDA)
+12 QUIT
End DoDot:1
if $DATA(DTOUT)!$DATA(DUOUT)
QUIT
DEDBX QUIT
+1 ;
DSETSHAR(FILEDA) ; Sets all descendants of FILEDA to SHARED
+1 ; Requires FILEDA
+2 NEW TIUI,IFILEDA,INODE0,DIE,X,Y,SHARED,DA,DR
+3 SET TIUI=0
SET DIE=8925.1
SET SHARED="YES"
+4 FOR
SET TIUI=$ORDER(^TIU(8925.1,FILEDA,10,TIUI))
if 'TIUI
QUIT
Begin DoDot:1
+5 SET IFILEDA=+^TIU(8925.1,FILEDA,10,TIUI,0)
+6 SET INODE0=$GET(^TIU(8925.1,IFILEDA,0))
+7 IF INODE0=""
WRITE !!," File Entry "_FILEDA_" has Nonexistent item "_IFILEDA_"; See IRM",!
DO PAUSE^TIUFXHLX
QUIT
+8 SET DA=IFILEDA
SET DR=".1///^S X=SHARED"
DO ^DIE
+9 DO DSETSHAR(IFILEDA)
End DoDot:1
+10 QUIT
+11 ;