source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFLX.m@ 1556

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1TIUFLX ; SLC/MAM - Library; Template X (Boilerplate Text) Related: XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY), DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ;8/28/97 11:02
2 ;;1.0;TEXT INTEGRATION UTILITIES;**5**;Jun 20, 1997
3 ;
4AMBIG ; Object AS EMBEDDED is ambiguous. Sets subscript OBJ, writes msg.
5 ; Differs from object ITSELF is ambiguous, since checks only embed name.
6 ; Needs vars from XCHECK.
7 D SET("OBJ")
8 I 'SILENT D D PAUSE^TIUFXHLX
9 . W !!!,"Object |",OBJNM,"| is ambiguous.",!,"It could be any of SEVERAL objects. Please contact IRM.",!
10 Q
11 ;
12XCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks objects in FILEDA's boilerplate text.
13 ; Silent if SILENT=1. Writes problem msgs for each bad object if SILENT=0.
14 ; Called silent by CHECK^TIUFLF3. Called not silent by CHECKDEF^TIUFHA6.
15 ; Requires SILENT = 1 if silent.
16 ; Sets MSGARRAY("OBJ"),MSGARRAY("OBJINACT").
17 N TIUFJ,LINE,PIECE,OBJNM,OFILEDA,XREF,ARR,SUBS
18 S SILENT=+$G(SILENT)
19 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.
20 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
21 . S LINE=$G(^TIU(8925.1,FILEDA,"DFLT",TIUFJ,0))
22 . I LINE["|" D
23 . . 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
24 . . F PIECE=2:2:$L(LINE,"|") S OBJNM=$P(LINE,"|",PIECE) K DIRUT,ARR D Q:$D(DIRUT) I SILENT,$D(MSGARRAY("OBJ")) Q
25 . . . I OBJNM="" W:'SILENT !!!,"Brackets are there, but there's no name inside: ||",! D:'SILENT PAUSE^TIUFXHLX D SET("OBJ") Q
26 . . . K ARR
27 . . . F XREF="B","C","D" D I $O(ARR($O(ARR(0)))) D AMBIG Q
28 . . . . 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
29 . . . I $O(ARR($O(ARR(0)))) Q
30 . . . I '$D(ARR) D Q
31 . . . . 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.",!
32 . . . . D:'SILENT PAUSE^TIUFXHLX D SET("OBJ")
33 . . . S DETAILS=$S(SILENT:0,1:1),OFILEDA=$O(ARR(0)) N OBJCK D CHECK^TIUFLF3(OFILEDA,0,DETAILS,.OBJCK)
34 . . . I 'OBJCK D SET("OBJ") I 'SILENT D Q:$D(DIRUT)
35 . . . . F SUBS="F","T","O","S","J" D Q:$D(DIRUT)
36 . . . . . I $D(OBJCK(SUBS)) W !!!,"Object |",OBJNM,"| is faulty: ",!,OBJCK(SUBS),".",! D PAUSE^TIUFXHLX Q:$D(DIRUT)
37 . . . 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
38XCHEX I $D(DTOUT) S VALMQUIT=1
39 Q
40 ;
41SET(SUBS) ; Set MSGARRAY("OBJ"), MSGARRAY("OBJINACT")
42 ; Needs vars from XCHECK.
43 I SUBS="OBJ" S MSGARRAY("OBJ")="Bad Object in Boilerplate Text."
44 I SUBS="OBJINACT" S MSGARRAY("OBJINACT")="Boilerplate Text has Inactive Object."
45 I $G(MSGARRAY)="" S MSGARRAY="0^Bad/Inactive Object in Boilerplate Text"
46 Q
47 ;
48DCHECK(FILEDA,SILENT,DETAILS,MSGARRAY) ; Checks Btext for FILEDA descendants.
49 N TIUFITEM,TIUFI,MISSITEM,ITENDA,IFILEDA
50 S MISSITEM=$$MISSITEM^TIUFLF4(FILEDA),SILENT=+$G(SILENT)
51 I MISSITEM W !!,"Corrupt Database: File Entry "_FILEDA_" Has Nonexistent Item "_MISSITEM_" ; See IRM",! D PAUSE^TIUFXHLX G DCHEX
52 D ITEMS^TIUFLT(FILEDA)
53 S TIUFI=0
54 F S TIUFI=$O(TIUFITEM(TIUFI)) Q:'TIUFI D
55 . S ITENDA=$P(TIUFITEM(TIUFI),U,2)
56 . S IFILEDA=+$G(^TIU(8925.1,FILEDA,10,+ITENDA,0))
57 . K DIRUT D XCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY) Q:$D(DIRUT) D DCHECK(IFILEDA,SILENT,DETAILS,.MSGARRAY)
58DCHEX Q
59 ;
Note: See TracBrowser for help on using the repository browser.