TIUFLX ; SLC/MAM - Library; Template X (Boilerplate Text) Related: XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY), DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ;8/28/97 11:02
;;1.0;TEXT INTEGRATION UTILITIES;**5**;Jun 20, 1997
;
AMBIG ; Object AS EMBEDDED is ambiguous. Sets subscript OBJ, writes msg.
; Differs from object ITSELF is ambiguous, since checks only embed name.
; Needs vars from XCHECK.
D SET("OBJ")
I 'SILENT D D PAUSE^TIUFXHLX
. W !!!,"Object |",OBJNM,"| is ambiguous.",!,"It could be any of SEVERAL objects. Please contact IRM.",!
Q
;
XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks objects in FILEDA's boilerplate text.
; Silent if SILENT=1. Writes problem msgs for each bad object if SILENT=0.
; Called silent by CHECK^TIUFLF3. Called not silent by CHECKDEF^TIUFHA6.
; Requires SILENT = 1 if silent.
; Sets MSGARRAY("OBJ"),MSGARRAY("OBJINACT").
N TIUFJ,LINE,PIECE,OBJNM,OFILEDA,XREF,ARR,SUBS
S SILENT=+$G(SILENT)
I 'SILENT,$G(TIUFSTMP)="D",FILEDA=$P(TIUFINFO,U,2) W !!!,"Faulty Entry: Bad/Inactive Object in Boilerplate Text:",! D PAUSE^TIUFXHLX G:$D(DIRUT) XCHEX ; TIUFINFO: Don't rewrite msg for descendants.
S TIUFJ=0 F S TIUFJ=$O(^TIU(8925.1,FILEDA,"DFLT",TIUFJ)) Q:'TIUFJ K DIRUT D G:$D(DIRUT) XCHEX I SILENT,$D(MSGARRAY("OBJ")) G XCHEX
. S LINE=$G(^TIU(8925.1,FILEDA,"DFLT",TIUFJ,0))
. I LINE["|" D
. . I ($L(LINE,"|")+1)#2 W:'SILENT !!!,"Object split between lines, rest of line not checked:",!,LINE,! D:'SILENT PAUSE^TIUFXHLX D SET("OBJ") Q
. . F PIECE=2:2:$L(LINE,"|") S OBJNM=$P(LINE,"|",PIECE) K DIRUT,ARR D Q:$D(DIRUT) I SILENT,$D(MSGARRAY("OBJ")) Q
. . . I OBJNM="" W:'SILENT !!!,"Brackets are there, but there's no name inside: ||",! D:'SILENT PAUSE^TIUFXHLX D SET("OBJ") Q
. . . K ARR
. . . F XREF="B","C","D" D I $O(ARR($O(ARR(0)))) D AMBIG Q
. . . . S OFILEDA=0 F S OFILEDA=$O(^TIU(8925.1,XREF,OBJNM,OFILEDA)) Q:'OFILEDA S:$D(^TIU(8925.1,"AT","O",OFILEDA)) ARR(OFILEDA)="" I $O(ARR($O(ARR(0)))) Q
. . . I $O(ARR($O(ARR(0)))) Q
. . . I '$D(ARR) D Q
. . . . W:'SILENT !!!,"Object |",OBJNM,"| cannot be found in the file.",!,"Use uppercase and use object's exact name, print name, or abbreviation.",!,"Object's name/print name/abbreviation may have changed since this was embedded.",!
. . . . D:'SILENT PAUSE^TIUFXHLX D SET("OBJ")
. . . S DETAILS=$S(SILENT:0,1:1),OFILEDA=$O(ARR(0)) N OBJCK D CHECK^TIUFLF3(OFILEDA,0,DETAILS,.OBJCK)
. . . I 'OBJCK D SET("OBJ") I 'SILENT D Q:$D(DIRUT)
. . . . F SUBS="F","T","O","S","J" D Q:$D(DIRUT)
. . . . . I $D(OBJCK(SUBS)) W !!!,"Object |",OBJNM,"| is faulty: ",!,OBJCK(SUBS),".",! D PAUSE^TIUFXHLX Q:$D(DIRUT)
. . . I '$D(^TIU(8925.1,"AS",+^TMP("TIUF",$J,"STATA"),OFILEDA)) D SET("OBJINACT") I 'SILENT W !!!,"Object |",OBJNM,"| is not active.",! D PAUSE^TIUFXHLX
XCHEX I $D(DTOUT) S VALMQUIT=1
Q
;
SET(SUBS) ; Set MSGARRAY("OBJ"), MSGARRAY("OBJINACT")
; Needs vars from XCHECK.
I SUBS="OBJ" S MSGARRAY("OBJ")="Bad Object in Boilerplate Text."
I SUBS="OBJINACT" S MSGARRAY("OBJINACT")="Boilerplate Text has Inactive Object."
I $G(MSGARRAY)="" S MSGARRAY="0^Bad/Inactive Object in Boilerplate Text"
Q
;
DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks Btext for FILEDA descendants.
N TIUFITEM,TIUFI,MISSITEM,ITENDA,IFILEDA
S MISSITEM=$$MISSITEM^TIUFLF4(FILEDA),SILENT=+$G(SILENT)
I MISSITEM W !!,"Corrupt Database: File Entry "_FILEDA_" Has Nonexistent Item "_MISSITEM_" ; See IRM",! D PAUSE^TIUFXHLX G DCHEX
D ITEMS^TIUFLT(FILEDA)
S TIUFI=0
F S TIUFI=$O(TIUFITEM(TIUFI)) Q:'TIUFI D
. S ITENDA=$P(TIUFITEM(TIUFI),U,2)
. S IFILEDA=+$G(^TIU(8925.1,FILEDA,10,+ITENDA,0))
. K DIRUT D XCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY) Q:$D(DIRUT) D DCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY)
DCHEX Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUFLX 3772 printed Nov 22, 2024@17:51:18 Page 2
TIUFLX ; SLC/MAM - Library; Template X (Boilerplate Text) Related: XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY), DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ;8/28/97 11:02
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**5**;Jun 20, 1997
+2 ;
AMBIG ; Object AS EMBEDDED is ambiguous. Sets subscript OBJ, writes msg.
+1 ; Differs from object ITSELF is ambiguous, since checks only embed name.
+2 ; Needs vars from XCHECK.
+3 DO SET("OBJ")
+4 IF 'SILENT
Begin DoDot:1
+5 WRITE !!!,"Object |",OBJNM,"| is ambiguous.",!,"It could be any of SEVERAL objects. Please contact IRM.",!
End DoDot:1
DO PAUSE^TIUFXHLX
+6 QUIT
+7 ;
XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks objects in FILEDA's boilerplate text.
+1 ; Silent if SILENT=1. Writes problem msgs for each bad object if SILENT=0.
+2 ; Called silent by CHECK^TIUFLF3. Called not silent by CHECKDEF^TIUFHA6.
+3 ; Requires SILENT = 1 if silent.
+4 ; Sets MSGARRAY("OBJ"),MSGARRAY("OBJINACT").
+5 NEW TIUFJ,LINE,PIECE,OBJNM,OFILEDA,XREF,ARR,SUBS
+6 SET SILENT=+$GET(SILENT)
+7 ; TIUFINFO: Don't rewrite msg for descendants.
IF 'SILENT
IF $GET(TIUFSTMP)="D"
IF FILEDA=$PIECE(TIUFINFO,U,2)
WRITE !!!,"Faulty Entry: Bad/Inactive Object in Boilerplate Text:",!
DO PAUSE^TIUFXHLX
if $DATA(DIRUT)
GOTO XCHEX
+8 SET TIUFJ=0
FOR
SET TIUFJ=$ORDER(^TIU(8925.1,FILEDA,"DFLT",TIUFJ))
if 'TIUFJ
QUIT
KILL DIRUT
Begin DoDot:1
+9 SET LINE=$GET(^TIU(8925.1,FILEDA,"DFLT",TIUFJ,0))
+10 IF LINE["|"
Begin DoDot:2
+11 IF ($LENGTH(LINE,"|")+1)#2
if 'SILENT
WRITE !!!,"Object split between lines, rest of line not checked:",!,LINE,!
if 'SILENT
DO PAUSE^TIUFXHLX
DO SET("OBJ")
QUIT
+12 FOR PIECE=2:2:$LENGTH(LINE,"|")
SET OBJNM=$PIECE(LINE,"|",PIECE)
KILL DIRUT,ARR
Begin DoDot:3
+13 IF OBJNM=""
if 'SILENT
WRITE !!!,"Brackets are there, but there's no name inside: ||",!
if 'SILENT
DO PAUSE^TIUFXHLX
DO SET("OBJ")
QUIT
+14 KILL ARR
+15 FOR XREF="B","C","D"
Begin DoDot:4
+16 SET OFILEDA=0
FOR
SET OFILEDA=$ORDER(^TIU(8925.1,XREF,OBJNM,OFILEDA))
if 'OFILEDA
QUIT
if $DATA(^TIU(8925.1,"AT","O",OFILEDA))
SET ARR(OFILEDA)=""
IF $ORDER(ARR($ORDER(ARR(0))))
QUIT
End DoDot:4
IF $ORDER(ARR($ORDER(ARR(0))))
DO AMBIG
QUIT
+17 IF $ORDER(ARR($ORDER(ARR(0))))
QUIT
+18 IF '$DATA(ARR)
Begin DoDot:4
+19 if 'SILENT
WRITE !!!,"Object |",OBJNM,"| cannot be found in the file.",!,"Use uppercase and use object's exact name, print name, or abbreviation.",!,"Object's name/print name/abbreviation may have changed since this was
embedded.",!
+20 if 'SILENT
DO PAUSE^TIUFXHLX
DO SET("OBJ")
End DoDot:4
QUIT
+21 SET DETAILS=$SELECT(SILENT:0,1:1)
SET OFILEDA=$ORDER(ARR(0))
NEW OBJCK
DO CHECK^TIUFLF3(OFILEDA,0,DETAILS,.OBJCK)
+22 IF 'OBJCK
DO SET("OBJ")
IF 'SILENT
Begin DoDot:4
+23 FOR SUBS="F","T","O","S","J"
Begin DoDot:5
+24 IF $DATA(OBJCK(SUBS))
WRITE !!!,"Object |",OBJNM,"| is faulty: ",!,OBJCK(SUBS),".",!
DO PAUSE^TIUFXHLX
if $DATA(DIRUT)
QUIT
End DoDot:5
if $DATA(DIRUT)
QUIT
End DoDot:4
if $DATA(DIRUT)
QUIT
+25 IF '$DATA(^TIU(8925.1,"AS",+^TMP("TIUF",$JOB,"STATA"),OFILEDA))
DO SET("OBJINACT")
IF 'SILENT
WRITE !!!,"Object |",OBJNM,"| is not active.",!
DO PAUSE^TIUFXHLX
End DoDot:3
if $DATA(DIRUT)
QUIT
IF SILENT
IF $DATA(MSGARRAY("OBJ"))
QUIT
End DoDot:2
End DoDot:1
if $DATA(DIRUT)
GOTO XCHEX
IF SILENT
IF $DATA(MSGARRAY("OBJ"))
GOTO XCHEX
XCHEX IF $DATA(DTOUT)
SET VALMQUIT=1
+1 QUIT
+2 ;
SET(SUBS) ; Set MSGARRAY("OBJ"), MSGARRAY("OBJINACT")
+1 ; Needs vars from XCHECK.
+2 IF SUBS="OBJ"
SET MSGARRAY("OBJ")="Bad Object in Boilerplate Text."
+3 IF SUBS="OBJINACT"
SET MSGARRAY("OBJINACT")="Boilerplate Text has Inactive Object."
+4 IF $GET(MSGARRAY)=""
SET MSGARRAY="0^Bad/Inactive Object in Boilerplate Text"
+5 QUIT
+6 ;
DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks Btext for FILEDA descendants.
+1 NEW TIUFITEM,TIUFI,MISSITEM,ITENDA,IFILEDA
+2 SET MISSITEM=$$MISSITEM^TIUFLF4(FILEDA)
SET SILENT=+$GET(SILENT)
+3 IF MISSITEM
WRITE !!,"Corrupt Database: File Entry "_FILEDA_" Has Nonexistent Item "_MISSITEM_" ; See IRM",!
DO PAUSE^TIUFXHLX
GOTO DCHEX
+4 DO ITEMS^TIUFLT(FILEDA)
+5 SET TIUFI=0
+6 FOR
SET TIUFI=$ORDER(TIUFITEM(TIUFI))
if 'TIUFI
QUIT
Begin DoDot:1
+7 SET ITENDA=$PIECE(TIUFITEM(TIUFI),U,2)
+8 SET IFILEDA=+$GET(^TIU(8925.1,FILEDA,10,+ITENDA,0))
+9 KILL DIRUT
DO XCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY)
if $DATA(DIRUT)
QUIT
DO DCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY)
End DoDot:1
DCHEX QUIT
+1 ;