Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BTIUFD

BTIUFD.m

Go to the documentation of this file.
BTIUFD ;IHS/CIA/MGH - LM Routine to display and edit description field ;26-Jan-2006 12:40;MGH
 ;;1.0;TEXT INTEGRATION UTILITIES;**1003**;NOV 04,2004
DESC(LASTLIN) ; EP Set Display Array TIUF3 starting with Description.
 ; Used by subtemplates D and X AND T
 ; See DSBASICS for required variables, etc.
 N LINENO,CNT,TIUI,FILEDA,NAME,TIUFBLIN
 S (TIUFBLIN,LINENO)=LASTLIN
 G:TIUFNOD0("DESC")="" DSBOX ; NA
 ;If called to redisplay edited screen rather than by Init, kill array starting with Desc tx before resetting array.
 S CNT=$O(^TMP("TIUF3",$J,1000000),-1)
 F TIUI=LASTLIN+1:1:CNT K ^TMP("TIUF3",$J,TIUI),^TMP("TIUF3IDX",$J,TIUI)
 S FILEDA=TIUFINFO("FILEDA")
 I TIUFSTMP'="X" D
 .S LINENO=LINENO+1
 .S ^TMP("TIUF3",$J,LINENO,0)=""
 .S LINENO=LINENO+1
 .S ^TMP("TIUF3",$J,LINENO,0)="  Description"
 I TIUFNOD0("TYPE")="COMPONENT" S NAME=$P(TIUFNOD0,U),LINENO=LINENO+1,^TMP("TIUF3",$J,LINENO,0)=NAME_":"
 D SETDESC(FILEDA,.LINENO)
DSBOX K TIUFQ S LASTLIN=LINENO Q:$D(DTOUT)
 Q
 ;
SETDESC(FILEDA,LASTLIN) ;Set description
 N TIUFJ,TIUFI,LINE2
 F TIUFJ=LASTLIN+1:1 Q:'$D(^TMP("TIUF3",$J,TIUFJ,0))  K ^TMP("TIUF3",$J,TIUFJ,0)
 S LINE2=LASTLIN,TIUFI=0
 F  S TIUFI=$O(^TIU(8925.1,+FILEDA,9003130.1,TIUFI)) Q:+TIUFI'>0  D
 .S LINE2=LINE2+1
 .S ^TMP("TIUF3",$J,LINE2,0)=$G(^TIU(8925.1,+FILEDA,9003130.1,+TIUFI,0))
 S LASTLIN=LINE2
SETBX Q
HASDESC(FILDEDA,NODEO) ; EP  Function returns no or yes if description field exists
 N ANS
 S ANS=0
 S ANS=$D(^TIU(8925.1,FILEDA,9003130.1,0))
 I ANS>0 S ANS="1"
 Q ANS
EDDES ; EP  Entry point to edit the description field
 ; Requires CURRENT arrays TIUFINFO, TIUFNOD0.
 N FILEDA,LINENO,CNTCHNG,TIUFXNOD,MSG,STATUS,DTOUT,DIRUT,DIROUT
 S FILEDA=TIUFINFO("FILEDA")
 S VALMBCK="R",TIUFXNOD=$G(XQORNOD(0))
 S STATUS=$$STATWORD^TIUFLF5($P(^TIU(8925.1,FILEDA,0),U,7))
 I STATUS'="INACTIVE" W !!,"Entry is not Inactive: Can't edit Description" D PAUSE^TIUFXHLX S VALMBCK="" G EDBOX
 I TIUFSTMP="X" L +^TIU(8925.1,FILEDA):1 I '$T W !!," Another user is editing this entry.",! H 2 G EDBOX
 D EDDESC(FILEDA,TIUFNOD0) G:$D(DTOUT) EDBOX
 D NODE0ARR^TIUFLF(FILEDA,.TIUFNOD0) G:$D(DTOUT) EDBOX
 ; Update template D or X:
 S LINENO=TIUFBLIN D DESC(.LINENO) G:$D(DTOUT) EDBOX S VALMCNT=LINENO
 I TIUFTMPL="A" D AUPDATE^TIUFLA1(TIUFNOD0,FILEDA,.CNTCHNG) S:CNTCHNG TIUFVCN1=TIUFVCN1-1 ;doesn't match.
 I "HC"[TIUFTMPL D LINEUP^TIUFLLM1(.TIUFINFO,TIUFTMPL)
EDBOX ;
 I TIUFSTMP="X" L -^TIU(8925.1,+$G(FILEDA))
 I $D(DTOUT) S VALMBCK="Q"
 Q
EDDESC(FILEDA,NODE0) ; Edit Description of FILEDA.
 ; Requires FILEDA, NODE0 of FILEDA
 D FULL^VALM1
 N DIC,DWPK,DIWESUB
 S DIC="^TIU(8925.1,"_FILEDA_",9003130.1,",DWPK=1
 S DIWESUB=$P(NODE0,U)
 D EN^DIWE
 Q