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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUFHA 4612 printed Oct 16, 2024@18:41:20 Page 2
TIUFHA ; SLC/MAM - LM Templates H, A, and C Action Detailed Display, Action Boilerplate Text ;6/5/97 22:57
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**64**;Jun 20, 1997
+2 ;
EDVIEW ; Templates H, A, C, and J Action Detailed Display if XQORNOD(0)["Detailed; Action Boilerplate Text if XQORNOD(0)["Boil".
+1 ; Requires TIUFTMPL.
+2 ; Requires TIUFWHO, set in Options TIUF/A/C/H/J EDIT/SORT/CREATE CLIN/MGR/NATL.
+3 ; For Detailed Display Sets TIUFSTMP = D
+4 ; For Boilerplate Text Sets TIUFSTMP = X.
+5 ; Sets TIUFACT where TIUFACT is a letter: C for Clinician, M for Manager, V for View.
+6 ; Sets Array TIUFINFO, Array TIUFNOD0.
+7 NEW TIUFINFO,TIUFXNOD,TIUFACT,TIUFXSTA,TIUFXBT,DTOUT,DIRUT,DIROUT,DUOUT
+8 NEW TIUFNOD0,TIUFVCN1,TIUFSTMP,QUIT,TIUFERR,OLDSNO,EXPAND,TIUFBG1
+9 NEW USROWNS,TIUFBLIN,TIUFILIN,TIUFTLIN,TIUFRLIN,TIUFULIN,TIUFPLIN,TIUFELIN
+10 NEW NOPTYPE,TIUFIXED,MISSITEM,MSG,SHARED,FILEDA
+11 ;Set by [TIUF UPLOAD FIELD EDIT]
NEW TIUPRM0,TIUPRM1,PFILEDA
+12 SET VALMBCK=""
SET TIUFXNOD=$GET(XQORNOD(0))
+13 DO EN^VALM2(TIUFXNOD,"SO")
if '$ORDER(VALMY(0))
GOTO EDVIX
SET TIUFINFO=$GET(^TMP("TIUF1IDX",$JOB,$ORDER(VALMY(0))))
IF 'TIUFINFO
WRITE !!," Missing List Manager Data; See IRM",!
DO PAUSE^TIUFXHLX
SET VALMBCK="Q"
GOTO EDVIX
+14 SET FILEDA=$PIECE(TIUFINFO,U,2)
SET MISSITEM=$$MISSITEM^TIUFLF4(FILEDA)
IF MISSITEM
WRITE !!," Sorry; File Entry "_FILEDA_" has Nonexistent Item "_MISSITEM_"; See IRM.",!
DO PAUSE^TIUFXHLX
SET VALMBCK=""
GOTO EDVIX
+15 DO PARSE^TIUFLLM(.TIUFINFO)
+16 DO NODE0ARR^TIUFLF(TIUFINFO("FILEDA"),.TIUFNOD0)
if $DATA(DTOUT)
GOTO EDVIX
+17 IF TIUFXNOD["Detailed"
SET TIUFSTMP="D"
+18 IF TIUFXNOD["Boil"
SET TIUFSTMP="X"
+19 ;P64
IF TIUFSTMP="X"
IF FILEDA=81
WRITE !!," Addendum title does not have its own Boilerplate Text",!
DO PAUSE^TIUFXHLX
SET VALMBCK=""
GOTO EDVIX
+20 IF TIUFSTMP="X"
IF TIUFNOD0("TYPE")'="TITLE"
IF TIUFNOD0("TYPE")'="COMPONENT"
WRITE !!," Only Titles and Components have Boilerplate Text",!
DO PAUSE^TIUFXHLX
SET VALMBCK=""
GOTO EDVIX
+21 SET SHARED=$PIECE(TIUFNOD0,U,10)
SET TIUFACT=TIUFWHO
+22 SET PFILEDA=""
SET NOPTYPE=0
+23 FOR
SET PFILEDA=$ORDER(^TIU(8925.1,"AD",TIUFINFO("FILEDA"),PFILEDA))
if 'PFILEDA
QUIT
Begin DoDot:1
+24 IF $PIECE(^TIU(8925.1,PFILEDA,0),U,4)=""
SET NOPTYPE=1
End DoDot:1
if NOPTYPE
QUIT
+25 if TIUFXNOD["Detailed"
Begin DoDot:1
+26 ;P64
IF FILEDA=81!(FILEDA=512)
SET TIUFACT="V"
SET MSG=" Addendum; View Only"
QUIT
+27 ;P64 set msg only for Detailed Display, not Btext
IF $PIECE(TIUFNOD0,U,13)
IF TIUFWHO'="N"
IF TIUFXNOD["Detailed"
SET MSG=" Entry is National; Limited Actions"
End DoDot:1
+28 SET USROWNS=$$PERSOWNS^TIUFLF2(TIUFINFO("FILEDA"),DUZ)
+29 IF TIUFSTMP="X"
SET TIUFXSTA=TIUFNOD0("STATUS")
SET TIUFXBT=TIUFNOD0("BOILPT")
+30 Begin DoDot:1
+31 IF TIUFWHO="C"
IF TIUFNOD0("TYPE")="OBJECT"
SET TIUFACT="V"
if TIUFTMPL'="J"
SET MSG=" Object; View Only"
QUIT
+32 IF TIUFWHO="C"
IF USROWNS=""
SET TIUFACT="V"
SET MSG=" Entry has no Owner; View Only"
QUIT
+33 IF TIUFWHO="C"
IF SHARED
SET TIUFACT="V"
SET MSG=" Entry is Shared Component; View Only"
QUIT
+34 IF TIUFWHO="C"
IF USROWNS=0
SET TIUFACT="V"
SET MSG=" Non-Owner; View Only"
QUIT
+35 IF SHARED
IF USROWNS=0
SET TIUFACT="V"
SET MSG="Shared Components can be edited only by the Owner; View Only"
QUIT
+36 IF SHARED
IF TIUFTMPL'="A"
SET TIUFACT="V"
SET MSG="Shared Components can be edited only through the SORT option; View Only"
QUIT
End DoDot:1
+37 IF $DATA(MSG)
WRITE !!,MSG,!
DO PAUSE^TIUFXHLX
if $DATA(DUOUT)!$DATA(DTOUT)
GOTO EDVIX
+38 ; If entry is expanded, collapse entry and reexpand to items only when return. Too hard to update otherwise.
+39 SET EXPAND=TIUFINFO("XPDLCNT")
+40 IF "HC"[TIUFTMPL
IF EXPAND
DO COLLAPSE^TIUFH1(.TIUFINFO)
SET VALMCNT=VALMCNT-EXPAND
+41 SET TIUFVCN1=VALMCNT
SET TIUFBG1=VALMBG
SET TIUFIXED=VALM("FIXED")
+42 NEW TIUFREDO,TIUREC
+43 SET TIUFREDO=0
+44 IF TIUFXNOD["Detailed"
Begin DoDot:1
+45 IF $PIECE(TIUFNOD0,U,4)'="O"
if (TIUFACT="C")
DO EN^VALM("TIUFD DISPLAY CLIN")
if ("NM"[TIUFACT)
DO EN^VALM("TIUFD DISPLAY MGR")
if TIUFACT="V"
DO EN^VALM("TIUFD DISPLAY VIEW")
QUIT
+46 if ("NM"[TIUFACT)
DO EN^VALM("TIUFDJ DISPLAY OBJECT MGR")
if TIUFACT="V"
DO EN^VALM("TIUFD DISPLAY VIEW")
End DoDot:1
+47 IF TIUFXNOD["Boil"
if ("NMC"[TIUFACT)
DO EN^VALM("TIUFX BOILERPLATE TEXT")
if (TIUFACT="V")
DO EN^VALM("TIUFX BOILERPLATE TEXT VIEW")
+48 SET VALMCNT=TIUFVCN1
SET VALMBG=TIUFBG1
+49 KILL ^TMP("TIUFEMBED",$JOB)
+50 IF TIUFTMPL="H"
Begin DoDot:1
+51 SET TIUREC=^TMP("TIUF1",$JOB,+TIUFINFO,0)
+52 SET TIUREC=$$PLUSUP^TIUFLLM(.TIUFINFO,TIUREC)
+53 SET ^TMP("TIUF1",$JOB,+TIUFINFO,0)=TIUREC
+54 QUIT
End DoDot:1
+55 IF "HC"[TIUFTMPL
IF EXPAND
DO EXPAND1^TIUFH1(.TIUFINFO)
SET VALMCNT=VALMCNT+$PIECE(TIUFINFO,U,3)
+56 ; Templates A,J have been updated with each change to Template D(J); just redisplay.
+57 IF TIUFTMPL="A"
Begin DoDot:1
+58 IF VALMLFT=81!(VALMLFT=113)
DO CHGCAP^VALM("NAME1","Name Type")
+59 IF VALM("FIXED")=20
DO CHGCAP^VALM("NAME1","Name Type")
End DoDot:1
+60 IF TIUFTMPL="A"!(TIUFTMPL="J")
IF TIUFREDO
DO INIT^TIUFA
+61 SET VALMBCK="R"
EDVIX IF $DATA(DTOUT)
SET VALMBCK="Q"
+1 QUIT
+2 ;
EXIT ; -- exit code for LM Template D, X
+1 KILL ^TMP("TIUF3",$JOB),^TMP("TIUFB",$JOB),^TMP("TIUF3IDX",$JOB),^TMP("TIUFBIDX",$JOB)
+2 QUIT