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

TIUFHA.m

Go to the documentation of this file.
TIUFHA ; SLC/MAM - LM Templates H, A, and C Action Detailed Display, Action Boilerplate Text ;6/5/97 22:57
 ;;1.0;TEXT INTEGRATION UTILITIES;**64**;Jun 20, 1997
 ;
EDVIEW ; Templates H, A, C, and J Action Detailed Display if XQORNOD(0)["Detailed; Action Boilerplate Text if XQORNOD(0)["Boil".
 ; Requires TIUFTMPL.
 ; Requires TIUFWHO, set in Options TIUF/A/C/H/J EDIT/SORT/CREATE CLIN/MGR/NATL.
 ; For Detailed Display Sets TIUFSTMP = D 
 ; For Boilerplate Text Sets TIUFSTMP = X.
 ; Sets TIUFACT where TIUFACT is a letter: C for Clinician, M for Manager, V for View.
 ; Sets Array TIUFINFO, Array TIUFNOD0.
 N TIUFINFO,TIUFXNOD,TIUFACT,TIUFXSTA,TIUFXBT,DTOUT,DIRUT,DIROUT,DUOUT
 N TIUFNOD0,TIUFVCN1,TIUFSTMP,QUIT,TIUFERR,OLDSNO,EXPAND,TIUFBG1
 N USROWNS,TIUFBLIN,TIUFILIN,TIUFTLIN,TIUFRLIN,TIUFULIN,TIUFPLIN,TIUFELIN
 N NOPTYPE,TIUFIXED,MISSITEM,MSG,SHARED,FILEDA
 N TIUPRM0,TIUPRM1,PFILEDA ;Set by [TIUF UPLOAD FIELD EDIT]
 S VALMBCK="",TIUFXNOD=$G(XQORNOD(0))
 D EN^VALM2(TIUFXNOD,"SO") G:'$O(VALMY(0)) EDVIX  S TIUFINFO=$G(^TMP("TIUF1IDX",$J,$O(VALMY(0)))) I 'TIUFINFO W !!," Missing List Manager Data; See IRM",! D PAUSE^TIUFXHLX S VALMBCK="Q" G EDVIX
 S FILEDA=$P(TIUFINFO,U,2),MISSITEM=$$MISSITEM^TIUFLF4(FILEDA) I MISSITEM W !!," Sorry; File Entry "_FILEDA_" has Nonexistent Item "_MISSITEM_"; See IRM.",! D PAUSE^TIUFXHLX S VALMBCK="" G EDVIX
 D PARSE^TIUFLLM(.TIUFINFO)
 D NODE0ARR^TIUFLF(TIUFINFO("FILEDA"),.TIUFNOD0) G:$D(DTOUT) EDVIX
 I TIUFXNOD["Detailed" S TIUFSTMP="D"
 I TIUFXNOD["Boil" S TIUFSTMP="X"
 I TIUFSTMP="X",FILEDA=81 W !!," Addendum title does not have its own Boilerplate Text",! D PAUSE^TIUFXHLX S VALMBCK="" G EDVIX ;P64
 I TIUFSTMP="X",TIUFNOD0("TYPE")'="TITLE",TIUFNOD0("TYPE")'="COMPONENT" W !!," Only Titles and Components have Boilerplate Text",! D PAUSE^TIUFXHLX S VALMBCK="" G EDVIX
 S SHARED=$P(TIUFNOD0,U,10),TIUFACT=TIUFWHO
 S PFILEDA="",NOPTYPE=0
 F  S PFILEDA=$O(^TIU(8925.1,"AD",TIUFINFO("FILEDA"),PFILEDA)) Q:'PFILEDA  D  Q:NOPTYPE
 . I $P(^TIU(8925.1,PFILEDA,0),U,4)="" S NOPTYPE=1
 D:TIUFXNOD["Detailed"
 . I FILEDA=81!(FILEDA=512) S TIUFACT="V",MSG=" Addendum; View Only" Q  ;P64
 . I $P(TIUFNOD0,U,13),TIUFWHO'="N",TIUFXNOD["Detailed" S MSG=" Entry is National; Limited Actions" ;P64 set msg only for Detailed Display, not Btext
 S USROWNS=$$PERSOWNS^TIUFLF2(TIUFINFO("FILEDA"),DUZ)
 I TIUFSTMP="X" S TIUFXSTA=TIUFNOD0("STATUS"),TIUFXBT=TIUFNOD0("BOILPT")
 D
 . I TIUFWHO="C",TIUFNOD0("TYPE")="OBJECT" S TIUFACT="V" S:TIUFTMPL'="J" MSG=" Object; View Only" Q
 . I TIUFWHO="C",USROWNS="" S TIUFACT="V",MSG=" Entry has no Owner; View Only" Q
 . I TIUFWHO="C",SHARED S TIUFACT="V",MSG=" Entry is Shared Component; View Only" Q
 . I TIUFWHO="C",USROWNS=0 S TIUFACT="V",MSG=" Non-Owner; View Only" Q
 . I SHARED,USROWNS=0 S TIUFACT="V",MSG="Shared Components can be edited only by the Owner; View Only" Q
 . I SHARED,TIUFTMPL'="A" S TIUFACT="V",MSG="Shared Components can be edited only through the SORT option; View Only" Q
 I $D(MSG) W !!,MSG,! D PAUSE^TIUFXHLX G:$D(DUOUT)!$D(DTOUT) EDVIX
 ; If entry is expanded, collapse entry and reexpand to items only when return.  Too hard to update otherwise.
 S EXPAND=TIUFINFO("XPDLCNT")
 I "HC"[TIUFTMPL,EXPAND D COLLAPSE^TIUFH1(.TIUFINFO) S VALMCNT=VALMCNT-EXPAND
 S TIUFVCN1=VALMCNT,TIUFBG1=VALMBG,TIUFIXED=VALM("FIXED")
 N TIUFREDO,TIUREC
 S TIUFREDO=0
 I TIUFXNOD["Detailed" D
 . I $P(TIUFNOD0,U,4)'="O" D EN^VALM("TIUFD DISPLAY CLIN"):(TIUFACT="C"),EN^VALM("TIUFD DISPLAY MGR"):("NM"[TIUFACT),EN^VALM("TIUFD DISPLAY VIEW"):TIUFACT="V" Q
 . D EN^VALM("TIUFDJ DISPLAY OBJECT MGR"):("NM"[TIUFACT),EN^VALM("TIUFD DISPLAY VIEW"):TIUFACT="V"
 I TIUFXNOD["Boil" D EN^VALM("TIUFX BOILERPLATE TEXT"):("NMC"[TIUFACT),EN^VALM("TIUFX BOILERPLATE TEXT VIEW"):(TIUFACT="V")
 S VALMCNT=TIUFVCN1,VALMBG=TIUFBG1
 K ^TMP("TIUFEMBED",$J)
 I TIUFTMPL="H" D
 . S TIUREC=^TMP("TIUF1",$J,+TIUFINFO,0)
 . S TIUREC=$$PLUSUP^TIUFLLM(.TIUFINFO,TIUREC)
 . S ^TMP("TIUF1",$J,+TIUFINFO,0)=TIUREC
 . Q
 I "HC"[TIUFTMPL,EXPAND D EXPAND1^TIUFH1(.TIUFINFO) S VALMCNT=VALMCNT+$P(TIUFINFO,U,3)
 ; Templates A,J have been updated with each change to Template D(J); just redisplay.
 I TIUFTMPL="A" D
 . I VALMLFT=81!(VALMLFT=113) D CHGCAP^VALM("NAME1","Name                                Type")
 . I VALM("FIXED")=20 D CHGCAP^VALM("NAME1","Name    Type")
 I TIUFTMPL="A"!(TIUFTMPL="J"),TIUFREDO D INIT^TIUFA
 S VALMBCK="R"
EDVIX I $D(DTOUT) S VALMBCK="Q"
 Q
 ;
EXIT ; -- exit code for LM Template D, X
 K ^TMP("TIUF3",$J),^TMP("TIUFB",$J),^TMP("TIUF3IDX",$J),^TMP("TIUFBIDX",$J)
 Q