source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFLJ1.m@ 1489

Last change on this file since 1489 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1TIUFLJ1 ;SLC/MAM - DOCUMENTATION, LOCKEMB(FILEDA,NAP,LUNLOCK), STATEMB(FILEDA,STATFLG,NAP), EDBTEXT(FILEDA,NAPNAME) ;;7/1/97
2 ;;1.0;TEXT INTEGRATION UTILITIES;**2**;Jun 20, 1997
3 ;
4 ; ** Documentation on Array ^TMP("TIUFEMBED") **
5 ;
6 ; Array looks like
7 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) if FILEDA
8 ; is a title, or
9 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFCO",NAP,FILEDA) if FILEDA
10 ; is a component DESCENDING FROM A TITLE, or
11 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFORPHAN",NAP,FILEDA) if
12 ; FILEDA is a COMPONENT NOT DESCENDING FROM A TITLE.
13 ;
14 ; ^TMP("TIUFEMBED",$J,OBJECTDA,"TIUFTL",NAP,FILEDA) = original status
15 ;(status when array was set) of FILEDA: ACTIVE, TEST, INACTIVE, or "".
16 ;
17 ; NAP is N, A, P, or ANY.
18 ;NAP="N": Array is set if FILEDA'S boilerplate text has NAME of object
19 ; OBJECTDA embedded in it.
20 ;NAP="A": Array is set if FILEDA'S boilerplate text has ABBREVIATION
21 ; of object OBJECTDA embedded in it.
22 ;NAP="P": Array is set if FILEDA'S boilerplate text has PRINT NAME
23 ; of object OBJECTDA embedded in it.
24 ;NAP="ANY": Array is set if FILEDA'S boilerplate text has ANY of the
25 ; above attributes of object OBJECTDA embedded in it.
26 ;Name, Abbreviation, and Print Name are the values that existed when
27 ;array was SET.
28 ;
29 ; **********
30 ;
31LOCKEMB(FILEDA,NAP,LUNLOCK) ; Function returns 1 if has successfully locked or unlocked all Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP)
32 ; NAP See top of rtn TIUFLJ
33 ; LUNLOCK = + or -
34 N TITLEDA,NAME,ABBREV,PNAME,ONODE0,LOCKANS,CONT
35 S LOCKANS=1
36 S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D G:'LOCKANS LOCKX
37 . I LUNLOCK="-" L -^TIU(8925.1,TITLEDA,0) Q
38 . 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
39LOCKX Q LOCKANS
40 ;
41STATEMB(FILEDA,STATFLG,NAP) ; Inactivate/reactivate titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
42 ; Edit Status to original status if STATFLG="O", to inactive if STATFLG="I".
43 ; If restoring to Active, checks for problems, does not reactivate if problems are found.
44 N TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0,LIST,MSG,PTITLEDA
45 S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D
46 . S TNODE0=^TIU(8925.1,TITLEDA,0),TSTATUS=^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA) ;may be ""
47 . I STATFLG="O",TSTATUS="ACTIVE" D
48 . . S PTITLEDA=+$O(^TIU(8925.1,"AD",TITLEDA,0))
49 . . D STATLIST^TIUFLF5(TITLEDA,PTITLEDA,"A",.MSG,.LIST) Q:$D(DTOUT)
50 . . I STATFLG="O" W !!,"Restoring IFN ",TITLEDA,"..."
51 . . I LIST'["A" W !,MSG,! D PAUSE^TIUFXHLX Q
52 . . D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS) W " ."
53 . I STATFLG="O",TSTATUS="TEST" D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,TSTATUS) W " ."
54 . I STATFLG="I",TSTATUS'="INACTIVE" D AUTOSTAT^TIUFLF6(TITLEDA,TNODE0,"INACTIVE") W " ."
55 I STATFLG="O",$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,0)) W !!,"Finished Restoring Titles to original Status.",!
56 Q
57 ;
58EDBTEXT(FILEDA,NAP) ; Edit boilerplate text of the Titles in ^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP).
59 N TITLEDA,TNODE0,TSTATUS,NAME,ABBREV,PNAME,ONODE0
60 S TITLEDA=0 F S TITLEDA=$O(^TMP("TIUFEMBED",$J,FILEDA,"TIUFTL",NAP,TITLEDA)) Q:'TITLEDA D Q:$D(DTOUT)
61 . D EDBOIL^TIUFLD1(TITLEDA,^TIU(8925.1,TITLEDA,0)) Q:$D(DTOUT)
62 . D DEDBOIL^TIUFLD1(TITLEDA)
63 Q
64 ;
Note: See TracBrowser for help on using the repository browser.