TIUFLJ1 ;SLC/MAM - DOCUMENTATION, LOCKEMB(FILEDA,NAP,LUNLOCK), STATEMB(FILEDA,STATFLG,NAP), EDBTEXT(FILEDA,NAPNAME) ;;7/1/97
;;1.0;TEXT INTEGRATION UTILITIES;**2**;Jun 20, 1997
;
; ** Documentation on Array ^TMP("TIUFEMBED") **
;
; Array looks like
; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) if FILEDA
; is a title, or
; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFCO",NAP,FILEDA) if FILEDA
; is a component DESCENDING FROM A TITLE, or
; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFORPHAN",NAP,FILEDA) if
; FILEDA is a COMPONENT NOT DESCENDING FROM A TITLE.
;
; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) = original status
;(status when array was set) of FILEDA: ACTIVE, TEST, INACTIVE, or "".
;
; NAP is N, A, P, or ANY.
;NAP="N": Array is set if FILEDA'S boilerplate text has NAME of object
; OBJECTDA embedded in it.
;NAP="A": Array is set if FILEDA'S boilerplate text has ABBREVIATION
; of object OBJECTDA embedded in it.
;NAP="P": Array is set if FILEDA'S boilerplate text has PRINT NAME
; of object OBJECTDA embedded in it.
;NAP="ANY": Array is set if FILEDA'S boilerplate text has ANY of the
; above attributes of object OBJECTDA embedded in it.
;Name, Abbreviation, and Print Name are the values that existed when
;array was SET.
;
; **********
;
LOCKEMB(FILEDA,NAP,LUNLOCK) ; Function returns 1 if has successfully locked or unlocked all Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP)
; NAP See top of rtn TIUFLJ
; LUNLOCK = + or -
N TITLEDA,NAME,ABBREV,PNAME,ONODE0,LOCKANS,CONT
S LOCKANS=1
S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D G:'LOCKANS LOCKX
. I LUNLOCK="-" L -^TIU(8925.1,TITLEDA,0) Q
. L +^TIU(8925.1,TITLEDA,0):1 I '$T W !!," Another user is editing one of the Titles you need to edit. Please try later.",! S LOCKANS=0
LOCKX Q LOCKANS
;
STATEMB(FILEDA,STATFLG,NAP) ; Inactivate/reactivate titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
; Edit Status to original status if STATFLG="O", to inactive if STATFLG="I".
; If restoring to Active, checks for problems, does not reactivate if problems are found.
N TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0,LIST,MSG,PTITLEDA
S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D
. S TNODE0=^TIU(8925.1,TITLEDA,0),TSTATUS=^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA) ;may be ""
. I STATFLG="O",TSTATUS="ACTIVE" D
. . S PTITLEDA=+$O(^TIU(8925.1,"AD",TITLEDA,0))
. . D STATLIST^TIUFLF5(TITLEDA,PTITLEDA,"A",.MSG,.LIST) Q:$D(DTOUT)
. . I STATFLG="O" W !!,"Restoring IFN ",TITLEDA,"..."
. . I LIST'["A" W !,MSG,! D PAUSE^TIUFXHLX Q
. . D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS) W " ."
. I STATFLG="O",TSTATUS="TEST" D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS) W " ."
. I STATFLG="I",TSTATUS'="INACTIVE" D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,"INACTIVE") W " ."
I STATFLG="O",$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,0)) W !!,"Finished Restoring Titles to original Status.",!
Q
;
EDBTEXT(FILEDA,NAP) ; Edit boilerplate text of the Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
N TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0
S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D Q:$D(DTOUT)
. D EDBOIL^TIUFLD1(TITLEDA,^TIU(8925.1,TITLEDA,0)) Q:$D(DTOUT)
. D DEDBOIL^TIUFLD1(TITLEDA)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUFLJ1 3541 printed Dec 13, 2024@02:41:13 Page 2
TIUFLJ1 ;SLC/MAM - DOCUMENTATION, LOCKEMB(FILEDA,NAP,LUNLOCK), STATEMB(FILEDA,STATFLG,NAP), EDBTEXT(FILEDA,NAPNAME) ;;7/1/97
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**2**;Jun 20, 1997
+2 ;
+3 ; ** Documentation on Array ^TMP("TIUFEMBED") **
+4 ;
+5 ; Array looks like
+6 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) if FILEDA
+7 ; is a title, or
+8 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFCO",NAP,FILEDA) if FILEDA
+9 ; is a component DESCENDING FROM A TITLE, or
+10 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFORPHAN",NAP,FILEDA) if
+11 ; FILEDA is a COMPONENT NOT DESCENDING FROM A TITLE.
+12 ;
+13 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) = original status
+14 ;(status when array was set) of FILEDA: ACTIVE, TEST, INACTIVE, or "".
+15 ;
+16 ; NAP is N, A, P, or ANY.
+17 ;NAP="N": Array is set if FILEDA'S boilerplate text has NAME of object
+18 ; OBJECTDA embedded in it.
+19 ;NAP="A": Array is set if FILEDA'S boilerplate text has ABBREVIATION
+20 ; of object OBJECTDA embedded in it.
+21 ;NAP="P": Array is set if FILEDA'S boilerplate text has PRINT NAME
+22 ; of object OBJECTDA embedded in it.
+23 ;NAP="ANY": Array is set if FILEDA'S boilerplate text has ANY of the
+24 ; above attributes of object OBJECTDA embedded in it.
+25 ;Name, Abbreviation, and Print Name are the values that existed when
+26 ;array was SET.
+27 ;
+28 ; **********
+29 ;
LOCKEMB(FILEDA,NAP,LUNLOCK) ; Function returns 1 if has successfully locked or unlocked all Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP)
+1 ; NAP See top of rtn TIUFLJ
+2 ; LUNLOCK = + or -
+3 NEW TITLEDA,NAME,ABBREV,PNAME,ONODE0,LOCKANS,CONT
+4 SET LOCKANS=1
+5 SET TITLEDA=0
FOR
SET TITLEDA=$ORDER(^TMP("TIUFEMBED",$JOB,FILEDA,"TIUFTL",NAP,TITLEDA))
if 'TITLEDA
QUIT
Begin DoDot:1
+6 IF LUNLOCK="-"
LOCK -^TIU(8925.1,TITLEDA,0)
QUIT
+7 LOCK +^TIU(8925.1,TITLEDA,0):1
IF '$TEST
WRITE !!," Another user is editing one of the Titles you need to edit. Please try later.",!
SET LOCKANS=0
End DoDot:1
if 'LOCKANS
GOTO LOCKX
LOCKX QUIT LOCKANS
+1 ;
STATEMB(FILEDA,STATFLG,NAP) ; Inactivate/reactivate titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
+1 ; Edit Status to original status if STATFLG="O", to inactive if STATFLG="I".
+2 ; If restoring to Active, checks for problems, does not reactivate if problems are found.
+3 NEW TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0,LIST,MSG,PTITLEDA
+4 SET TITLEDA=0
FOR
SET TITLEDA=$ORDER(^TMP("TIUFEMBED",$JOB,FILEDA,"TIUFTL",NAP,TITLEDA))
if 'TITLEDA
QUIT
Begin DoDot:1
+5 ;may be ""
SET TNODE0=^TIU(8925.1,TITLEDA,0)
SET TSTATUS=^TMP("TIUFEMBED",$JOB,FILEDA,"TIUFTL",NAP,TITLEDA)
+6 IF STATFLG="O"
IF TSTATUS="ACTIVE"
Begin DoDot:2
+7 SET PTITLEDA=+$ORDER(^TIU(8925.1,"AD",TITLEDA,0))
+8 DO STATLIST^TIUFLF5(TITLEDA,PTITLEDA,"A",.MSG,.LIST)
if $DATA(DTOUT)
QUIT
+9 IF STATFLG="O"
WRITE !!,"Restoring IFN ",TITLEDA,"..."
+10 IF LIST'["A"
WRITE !,MSG,!
DO PAUSE^TIUFXHLX
QUIT
+11 DO AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS)
WRITE " ."
End DoDot:2
+12 IF STATFLG="O"
IF TSTATUS="TEST"
DO AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS)
WRITE " ."
+13 IF STATFLG="I"
IF TSTATUS'="INACTIVE"
DO AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,"INACTIVE")
WRITE " ."
End DoDot:1
+14 IF STATFLG="O"
IF $ORDER(^TMP("TIUFEMBED",$JOB,FILEDA,"TIUFTL",NAP,0))
WRITE !!,"Finished Restoring Titles to original Status.",!
+15 QUIT
+16 ;
EDBTEXT(FILEDA,NAP) ; Edit boilerplate text of the Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
+1 NEW TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0
+2 SET TITLEDA=0
FOR
SET TITLEDA=$ORDER(^TMP("TIUFEMBED",$JOB,FILEDA,"TIUFTL",NAP,TITLEDA))
if 'TITLEDA
QUIT
Begin DoDot:1
+3 DO EDBOIL^TIUFLD1(TITLEDA,^TIU(8925.1,TITLEDA,0))
if $DATA(DTOUT)
QUIT
+4 DO DEDBOIL^TIUFLD1(TITLEDA)
End DoDot:1
if $DATA(DTOUT)
QUIT
+5 QUIT
+6 ;