source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFLD1.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1TIUFLD1 ; SLC/MAM - Lib; Template D Related; SETBOIL(FIELDA,LASTLIN), EDBOIL(FILEDA), DEDBOIL(FILEDA), DSETSHAR(FILEDA) ;4/6/95 11:02
2 ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
3 ;
4SETBOIL(FILEDA,LASTLIN) ; Sets Boilerplate Text of FILEDA into
5 ;LM Array for Template D.
6 ; Kills LM Array from LASTLIN+1 to the end before setting boiltxt.
7 ; Requires FILEDA.
8 ; Requires LASTLIN = Last array line set, if setting array; = Last
9 ;line to keep before resetting the rest if resetting array.
10 ; Updates LASTLIN to Last array line set by this module.
11 N TIUFJ,TIUFI,LINENO
12 F TIUFJ=LASTLIN+1:1 Q:'$D(^TMP("TIUF3",$J,TIUFJ,0)) K ^TMP("TIUF3",$J,TIUFJ,0)
13 S LINENO=LASTLIN,TIUFI=0
14 F S TIUFI=$O(^TIU(8925.1,+FILEDA,"DFLT",TIUFI)) Q:+TIUFI'>0 D
15 . S LINENO=LINENO+1,^TMP("TIUF3",$J,LINENO,0)=$G(^TIU(8925.1,+FILEDA,"DFLT",+TIUFI,0))
16 S LASTLIN=LINENO
17SETBX Q
18 ;
19DSETBOIL(FILEDA,VCNT3) ; Sets boilerplate Text for descendants of FILEDA.
20 ; Requires FILEDA, VCNT3=VALMCNT for TIUF3 when DSETBOIL is called.
21 ; Updates VCNT3.
22 N TIUFITEM,TIUI,LINENO,ITENDA,TENODE0,NAME
23 Q:'$G(FILEDA)
24 Q:$G(VCNT3)=""
25 D ITEMS^TIUFLT(FILEDA)
26 S TIUI=0,LINENO=VCNT3
27 F S TIUI=$O(TIUFITEM(TIUI)) Q:'TIUI D
28 . S ITENDA=$P(TIUFITEM(TIUI),U,2)
29 . S TENODE0=^TIU(8925.1,FILEDA,10,ITENDA,0),NAME=$P(^TIU(8925.1,+TENODE0,0),U)
30 . S LINENO=LINENO+1,^TMP("TIUF3",$J,LINENO,0)=NAME_":"
31 . D SETBOIL(+TENODE0,.LINENO)
32 . D DSETBOIL(+TENODE0,.LINENO)
33 . Q
34DSETX S VCNT3=LINENO
35 Q
36 ;
37EDBOIL(FILEDA,NODE0) ; Edit Boilerplate Text of FILEDA.
38 ; Requires FILEDA, NODE0 of FILEDA
39 D FULL^VALM1
40 N DIC,DWPK,DIWESUB
41 S DIC="^TIU(8925.1,"_FILEDA_",""DFLT"",",DWPK=1
42 S DIWESUB=$P(NODE0,U)
43 D EN^DIWE
44EDBOX Q
45 ;
46DEDBOIL(FILEDA) ; Edit Boilerplate Text for descendants of FILEDA.
47 N TIUI,IFILEDA,INODE0,TIUFITEM,ITENDA
48 G:'$O(^TIU(8925.1,FILEDA,10,0)) DEDBX
49 D ITEMS^TIUFLT(FILEDA)
50 S TIUI=0 K DUOUT
51 F S TIUI=$O(TIUFITEM(TIUI)) Q:'TIUI D Q:$D(DTOUT)!$D(DUOUT)
52 . S ITENDA=$P(TIUFITEM(TIUI),U,2)
53 . S IFILEDA=+^TIU(8925.1,FILEDA,10,ITENDA,0),INODE0=^TIU(8925.1,IFILEDA,0)
54 . 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
55 . 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
56 . D EDBOIL(IFILEDA,INODE0) Q:$D(DTOUT)
57 . D DEDBOIL(IFILEDA)
58 . Q
59DEDBX Q
60 ;
61DSETSHAR(FILEDA) ; Sets all descendants of FILEDA to SHARED
62 ; Requires FILEDA
63 N TIUI,IFILEDA,INODE0,DIE,X,Y,SHARED,DA,DR
64 S TIUI=0,DIE=8925.1,SHARED="YES"
65 F S TIUI=$O(^TIU(8925.1,FILEDA,10,TIUI)) Q:'TIUI D
66 . S IFILEDA=+^TIU(8925.1,FILEDA,10,TIUI,0)
67 . S INODE0=$G(^TIU(8925.1,IFILEDA,0))
68 . I INODE0="" W !!," File Entry "_FILEDA_" has Nonexistent item "_IFILEDA_"; See IRM",! D PAUSE^TIUFXHLX Q
69 . S DA=IFILEDA,DR=".1///^S X=SHARED" D ^DIE
70 . D DSETSHAR(IFILEDA)
71 Q
72 ;
Note: See TracBrowser for help on using the repository browser.