source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFHA4.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1TIUFHA4 ; SLC/MAM - LM Templates H and A action Edit Name/Owner/PrintName ;4/17/97 11:02
2 ;;1.0;TEXT INTEGRATION UTILITIES;**13**;Jun 20, 1997
3EDATTR ; Actions Edit Name/Owner/PrintName.
4 N FIELDS,ATTR,OLDLNO,TIUFDA,NEWLNO,TIUFXNOD,TIUFFULL,EDIT
5 N DTOUT,DIRUT,DIROUT
6 S VALMBCK="",TIUFXNOD=$G(XQORNOD(0))
7 S EDIT=$S(TIUFXNOD["Print":"PRINT NAME",TIUFXNOD["Owner":"OWNER",1:"NAME")
8 W !!,"Selecting entries for "_EDIT_" Edit"
9 D EN^VALM2(XQORNOD,"O") I '$O(VALMY(0)) G EDATX
10 S OLDLNO=0 F S OLDLNO=$O(VALMY(OLDLNO)) Q:'OLDLNO S TIUFDA(OLDLNO)=$P(^TMP("TIUF1IDX",$J,OLDLNO),U,2)
11 I TIUFTMPL="A"!(TIUFTMPL="J") D ;if Temp=A,J delete selected entries:
12 . S OLDLNO=0 F S OLDLNO=$O(VALMY(OLDLNO)) Q:'OLDLNO D
13 . . S NEWLNO=$O(^TMP("TIUF1IDX",$J,"DAF",TIUFDA(OLDLNO),0)) D UPDATE^TIUFLLM1("A",-1,NEWLNO-1) S VALMCNT=VALMCNT-1
14 S FIELDS=$S(EDIT="NAME":";.01;",EDIT="OWNER":";.05;.06;",1:";.03;")
15 D BASIC(EDIT)
16EDATX I $D(DTOUT) S VALMBCK="Q" Q
17 I $G(TIUFFULL) S VALMBCK="R" D RESET^TIUFXHLX
18 Q
19 ;
20BASIC(EDIT) ; Edit one basic field.
21 N LINENO,FILEDA,NODE0,CNTCHNG,NOMATCH,STATUS,EXITFLG,MSG
22 N SHARED,NATL,TYPE,PFILEDA,PLINENO,BYPASS
23 S LINENO=0 K DUOUT
24 F S LINENO=$O(VALMY(LINENO)) Q:'LINENO!$D(DTOUT)!$D(DUOUT) D
25 . S FILEDA=TIUFDA(LINENO),NODE0=^TIU(8925.1,FILEDA,0),NATL=+$P(NODE0,U,13),TYPE=$P(NODE0,U,4),STATUS=$$STATWORD^TIUFLF5($P(NODE0,U,7)),SHARED=$P(NODE0,U,10)
26 . S NOMATCH=0,MSG=" Editing Entry "_LINENO W !!,MSG
27 . I TIUFWHO'="N",NATL,EDIT'="OWNER" S MSG=" Entry "_LINENO_" is National; Can't Edit" W !!,MSG,! D PAUSE^TIUFXHLX G AUPDATE
28 . ; W Msg, G AUPDATE if editing field other than Owner and active and not Shared component or Object, and not Natl User.
29 . ; G AUPDATE if editing field other than Owner and active and Natl user and user chooses NO.
30 . I SHARED,TIUFTMPL'="A" W !,"Shared Components can be edited only through the SORT Option",! D PAUSE^TIUFXHLX G AUPDATE
31 . I EDIT'="OWNER",SHARED,'$$PERSOWNS^TIUFLF2(FILEDA,DUZ) W !,"Only the Owner can edit Shared Components",! D PAUSE^TIUFXHLX G AUPDATE
32 . I EDIT'="OWNER",TYPE="O" W !,"To Edit Name or Print Name of an Object, please select Detailed Display and then",!,"select Basics.",! D PAUSE^TIUFXHLX G AUPDATE
33 . I EDIT'="OWNER",SHARED,'$$CANEDIT^TIUFLF6(FILEDA) W !,"Shared Component has parent that isn't Inactive: Can't Edit",! D PAUSE^TIUFXHLX G AUPDATE
34 . I 'SHARED,STATUS="NO/BAD",TYPE'="O" W !!," Entry has No Status/Bad Status; Can't Edit",! D PAUSE^TIUFXHLX G AUPDATE
35 . I 'SHARED,EDIT'="OWNER",STATUS'="INACTIVE" K DIRUT D Q:$D(DTOUT) G:TIUFWHO'="N" AUPDATE G:$D(DIRUT)!(BYPASS'=1) AUPDATE
36 . . I TIUFWHO'="N" W !!," Entry "_LINENO_" is not Inactive; Can't Edit",! D PAUSE^TIUFXHLX Q
37 . . N DIR,X,Y D ; Let Natl Developer choose to bypass safety:
38 . . . S DIR(0)="Y",(DIR("A",1),DIR("A",2),DIR("A",3))=" "
39 . . . S DIR("A",4)=" Entry "_LINENO_" is Active. Do you want to bypass safety measures and edit"
40 . . . S DIR("A",5)="even though this may cause errors if e.g. a document is being entered"
41 . . . S DIR("A")="on this entry.",DIR("B")="NO" D ^DIR S BYPASS=Y K DIR,X,Y
42 . L +^TIU(8925.1,FILEDA):1 I '$T W !!,"Another user is editing this entry; please try later.",! H 2 G LOOPX
43 . S EXITFLG=0 D ASKFLDS^TIUFLF1(FILEDA,FIELDS,0,0,.EXITFLG) G:$D(DTOUT) LOOPX
44 . G:EXITFLG AUPDATE
45 . S NODE0=^TIU(8925.1,FILEDA,0),VALMBCK="R"
46 . I TIUFTMPL="H" N INFO S INFO=^TMP("TIUF1IDX",$J,LINENO) D LINEUP^TIUFLLM1(.INFO,"H") G LOOPX
47AUPDATE . I TIUFTMPL="A"!(TIUFTMPL="J") D
48 . . S NODE0=^TIU(8925.1,FILEDA,0)
49 . . D AUPDATE^TIUFLA1(NODE0,FILEDA,.CNTCHNG) S:CNTCHNG=1 VALMCNT=VALMCNT+1 I 'CNTCHNG S NOMATCH=1
50 . . I NOMATCH S MSG=" Edited Entry Not in current View" W !!,MSG,! K MSG D PAUSE^TIUFXHLX
51LOOPX . L -^TIU(8925.1,FILEDA)
52 Q
53 ;
Note: See TracBrowser for help on using the repository browser.