INHERR3 ;DJL; 3 Mar 95 15:42;Interface - Error Search
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
BLDHELP(INHLP) ; Construct the array containing the HELP text
; MODULE NAME: BLDHELP ( Construct the array of text used for HELP )
; DESCRIPTION: Constructs an array on assending numeric nodes containing
; up to 78 characters per line. No realistic limit exists
; on the number of nodes.
; RETURN = none
; PARAMETERS:
; INHLP(PBR) = The array variable to load the text into.
; CODE BEGINS
; the following line can be used to limit strings to 78 characters.
; HHHHHHHHHHxxxxxxxxxXxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxx
S INHLP(1)="Displayed is a list of the Interface Errors that have matched the criteria"
S INHLP(1,0)=""
S INHLP(2)="you have selected in the previous screen. Select all errors you are"
S INHLP(2,0)=""
S INHLP(3)="interested in and hit the <RETURN> key to select the display device "
S INHLP(3,0)=""
S INHLP(4)="(re: printer/slave/etc.). To output or view an individual error"
S INHLP(4,0)=""
S INHLP(5)="use the EXPAND key. The EXPAND function will return you to the selection"
S INHLP(5,0)=""
S INHLP(6)=" list upon completion. The selection list will return you to the Search"
S INHLP(6,0)=""
S INHLP(7)="Criteria entry screen upon completion."
S INHLP(7,0)=""
S INHLP(8)="Press <RETURN> to continue:"
S INHLP(8,0)=""
Q
;
SRCHHELP(INHLPLST) ; Display List Processor style HELP
; MODULE NAME: SRCHHELP ( Display an array of text used for HELP )
; DESCRIPTION: Call the list processor to display the array passed
; if it contains a least one sub-node otherwise construct
; a node stating no help is available.
; RETURN = none
; PARAMETERS:
; INHLPLST(PBR) = The array of the text into.
; CODE BEGINS
N DWLRF,DWLMK,DWLMK1,DWLB,DWLR,DWL
S DWL="FWHTZ",DWLRF="INHLPLST",DWLB="0^7^10^78"
S:$D(INHLPLST)<10 INHLPLST(1)="No HELP is available at this time."
D ^DWL
Q
;
INHTITLE(INMSGSZ,INSRCH) ; Write the Search Status line 21 from WITHIN the list proc.
; RETURNS: none
; PARAMETERS:
; INMSGSZ(PBV) = Approximate number of items to be searched
; INSRCH(PBR) = Array for holding search criteria information
; CODE BEGINS
N INTEMPX,INTEMPY
S INTEMPX=IOX,INTEMPY=IOY,IOX=0,IOY=21 X IOXY
W "APPROXIMATE Number of Errors to Search: "_INMSGSZ
S IOX=INTEMPX,IOY=INTEMPY X IOXY
X $$INMSGSTR^INHERR3("",1,$G(INSRCH("INEXPAND")))
Q
;
INMSGSTR(INIEN,INLABEL,INEXPAND,INLEVEL) ; Build a string from msg. elements
; MODULE NAME: INMSGSTR ( Interface Error Listing String Builder )
; DESCRIPTION: Construct a string containing selected fields from
; the error. Used to construct the string which is
; displayed in the List Processor indicating errors
; found to match the search criteria. Or consruct a
; label used to identify the field to be listed.
; RETURN = The composite error string or
; a string indicating error status
; PARAMETERS:
; INIEN(PBV) = IEN into ^INTHER
; INLABEL(PBV) = Flag to return a string to be used as the title
; containing the field labels used below.
; 0/null= no label requested
; 1= return the only the label
; INEXPAND(PBV) = Flag (1/0) to build expanded listing
; INLEVEL(PBV) = Flag indicating which level of the listing is to be
; returned.
; "" = level 0 with error time/date, error status, error location
; 1 = level 1 with error text
; 2 = level 2 with transaction type, destination
; 3 = level 3 with message time/date, message ID, message status
; CODE BEGINS
N X,Y,DIC,INNODE,INTDATE,INERRID,INDEST,INERRSTR,INERRTXT,INDSTNUM,INPATNAM,INESTAT
N INEDATE,INEDEST,INELOC,INETTYPE,INMSGID,INMSTAT,INMSGTXT
S INIEN=$G(INIEN),INLABEL=$G(INLABEL),INEXPAND=$G(INEXPAND),INLEVEL=$G(INLEVEL)
; build and return a title string if the flag is set
I INLABEL S INERRSTR="D DWLTITLE^INHERR2("_+$G(INEXPAND)_")" Q INERRSTR
; acquire .01 field informationg for Errors and Messages
S INERRTXT=$G(^INTHER(INIEN,0)),INMSGTXT=$S(+$P(INERRTXT,U,4):$G(^INTHU($P(INERRTXT,U,4),0)),1:"")
Q:'$L(INERRTXT) "No Error Information Found"
; acquire information for each level of display
I '$G(INLEVEL) D Q INERRSTR
. S INEDATE=$TR($$CDATASC^%ZTFDT($P(INERRTXT,U),1,2),":")
.; use previously created TABLE of status codes(INETBL)
. S INESTAT=$S($L($P(INERRTXT,U,10)):INETBL($P(INERRTXT,U,10)),1:"none")
. S INELOC=$S(+$P(INERRTXT,U,5):+$P(INERRTXT,U,5),1:"none") S:+INELOC INELOC=$P($G(^INTHERL(INELOC,0)),U)
. S $E(INERRSTR,1,17)=$E(INEDATE,1,18),$E(INERRSTR,21,36)=$E(INESTAT,1,12),$E(INERRSTR,38,79)=$E(INELOC,1,15)
I $G(INLEVEL)=1 D Q INERRSTR
. S INERRSTR="",INNODE=$O(^INTHER(INIEN,2,0)) Q:'INNODE Q:$L($G(^INTHER(INIEN,2,INNODE,0)))=0
. S $E(INERRSTR,8,79)=$E($G(^INTHER(INIEN,2,INNODE,0)),1,65) S INNODE=$O(^INTHER(INIEN,2,INNODE))
.; Concatenate as much of the next node as possible
.; if there is room and it exists
. I $L(INERRSTR)<70,INNODE S $E(INERRSTR,($L(INERRSTR)+4),78)=$E($G(^INTHER(INIEN,2,INNODE,0)),1,(74-$L(INERRSTR)))
I $G(INLEVEL)=2 D Q INERRSTR
. S INETTYPE=$S(+$P(INERRTXT,U,2):+$P(INERRTXT,U,2),+$P(INMSGTXT,U,11):+$P(INMSGTXT,U,11),1:"none") S:+INETTYPE INETTYPE=$P($G(^INRHT(INETTYPE,0)),U)
. S INEDEST=$S(+$P(INERRTXT,U,9):+$P(INERRTXT,U,9),+$P(INMSGTXT,U,2):+$P(INMSGTXT,U,2),1:"none") S:+INEDEST INEDEST=$P($G(^INRHD(INEDEST,0)),U)
. S $E(INERRSTR,3,43)=$E(INETTYPE,1,40),$E(INERRSTR,45,79)=$E(INEDEST,1,30)
I $G(INLEVEL)=3,($L(INMSGTXT)) D Q INERRSTR
. S INTDATE=$TR($$CDATASC^%ZTFDT($P(INMSGTXT,U),1,2),":")
. S INMSGID=$S($L($P(INMSGTXT,U,5)):$P(INMSGTXT,U,5),1:"no message id")
.; use previously created TABLE of status codes(INMTBL)
. S INMSTAT=$S($L($P(INMSGTXT,U,3)):INMTBL($P(INMSGTXT,U,3)),1:"none")
. S $E(INERRSTR,3,23)=$E(INTDATE,1,18),$E(INERRSTR,25,45)=$E(INMSGID,1,20),$E(INERRSTR,47,77)=$E(INMSTAT,1,30)
Q ""
;
CODETBL(INNAME,INFILE,INFIELD) ; build an array of Set-of-codes from a DD entry
; MODULE NAME: CODETBL ( build an array of codes from the ^DD global )
; DESCRIPTION: Construct a array containing selected fields from
; the DD given the array name, file, and field.
; RETURN = none
; PARAMETERS:
; INNAME(PBV) = The name of the array to populate
; INFILE(PBV) = The file number to reference
; INFIELD(PBV) = The field within the file
; CODE BEGINS
N X,INLEN,INCNT,INPIECE,INCODE,INTXT
K @INNAME
S X=$P(^DD(INFILE,INFIELD,0),U,3)
S INLEN=$L(X,";")
F INCNT=1:1:INLEN S INPIECE=$P(X,";",INCNT),INCODE=$P(INPIECE,":",1),INTXT=$P(INPIECE,":",2) S:$L(INCODE) @INNAME@(INCODE)=INTXT
Q
;
INHERR3 ;DJL; 3 Mar 95 15:42;Interface - Error Search
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
BLDHELP(INHLP) ; Construct the array containing the HELP text
+1 ; MODULE NAME: BLDHELP ( Construct the array of text used for HELP )
+2 ; DESCRIPTION: Constructs an array on assending numeric nodes containing
+3 ; up to 78 characters per line. No realistic limit exists
+4 ; on the number of nodes.
+5 ; RETURN = none
+6 ; PARAMETERS:
+7 ; INHLP(PBR) = The array variable to load the text into.
+8 ; CODE BEGINS
+9 ; the following line can be used to limit strings to 78 characters.
+10 ; HHHHHHHHHHxxxxxxxxxXxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxxxxXxxxxxxxx
+11 SET INHLP(1)="Displayed is a list of the Interface Errors that have matched the criteria"
+12 SET INHLP(1,0)=""
+13 SET INHLP(2)="you have selected in the previous screen. Select all errors you are"
+14 SET INHLP(2,0)=""
+15 SET INHLP(3)="interested in and hit the <RETURN> key to select the display device "
+16 SET INHLP(3,0)=""
+17 SET INHLP(4)="(re: printer/slave/etc.). To output or view an individual error"
+18 SET INHLP(4,0)=""
+19 SET INHLP(5)="use the EXPAND key. The EXPAND function will return you to the selection"
+20 SET INHLP(5,0)=""
+21 SET INHLP(6)=" list upon completion. The selection list will return you to the Search"
+22 SET INHLP(6,0)=""
+23 SET INHLP(7)="Criteria entry screen upon completion."
+24 SET INHLP(7,0)=""
+25 SET INHLP(8)="Press <RETURN> to continue:"
+26 SET INHLP(8,0)=""
+27 QUIT
+28 ;
SRCHHELP(INHLPLST) ; Display List Processor style HELP
+1 ; MODULE NAME: SRCHHELP ( Display an array of text used for HELP )
+2 ; DESCRIPTION: Call the list processor to display the array passed
+3 ; if it contains a least one sub-node otherwise construct
+4 ; a node stating no help is available.
+5 ; RETURN = none
+6 ; PARAMETERS:
+7 ; INHLPLST(PBR) = The array of the text into.
+8 ; CODE BEGINS
+9 NEW DWLRF,DWLMK,DWLMK1,DWLB,DWLR,DWL
+10 SET DWL="FWHTZ"
SET DWLRF="INHLPLST"
SET DWLB="0^7^10^78"
+11 IF $DATA(INHLPLST)<10
SET INHLPLST(1)="No HELP is available at this time."
+12 DO ^DWL
+13 QUIT
+14 ;
INHTITLE(INMSGSZ,INSRCH) ; Write the Search Status line 21 from WITHIN the list proc.
+1 ; RETURNS: none
+2 ; PARAMETERS:
+3 ; INMSGSZ(PBV) = Approximate number of items to be searched
+4 ; INSRCH(PBR) = Array for holding search criteria information
+5 ; CODE BEGINS
+6 NEW INTEMPX,INTEMPY
+7 SET INTEMPX=IOX
SET INTEMPY=IOY
SET IOX=0
SET IOY=21
XECUTE IOXY
+8 WRITE "APPROXIMATE Number of Errors to Search: "_INMSGSZ
+9 SET IOX=INTEMPX
SET IOY=INTEMPY
XECUTE IOXY
+10 XECUTE $$INMSGSTR^INHERR3("",1,$GET(INSRCH("INEXPAND")))
+11 QUIT
+12 ;
INMSGSTR(INIEN,INLABEL,INEXPAND,INLEVEL) ; Build a string from msg. elements
+1 ; MODULE NAME: INMSGSTR ( Interface Error Listing String Builder )
+2 ; DESCRIPTION: Construct a string containing selected fields from
+3 ; the error. Used to construct the string which is
+4 ; displayed in the List Processor indicating errors
+5 ; found to match the search criteria. Or consruct a
+6 ; label used to identify the field to be listed.
+7 ; RETURN = The composite error string or
+8 ; a string indicating error status
+9 ; PARAMETERS:
+10 ; INIEN(PBV) = IEN into ^INTHER
+11 ; INLABEL(PBV) = Flag to return a string to be used as the title
+12 ; containing the field labels used below.
+13 ; 0/null= no label requested
+14 ; 1= return the only the label
+15 ; INEXPAND(PBV) = Flag (1/0) to build expanded listing
+16 ; INLEVEL(PBV) = Flag indicating which level of the listing is to be
+17 ; returned.
+18 ; "" = level 0 with error time/date, error status, error location
+19 ; 1 = level 1 with error text
+20 ; 2 = level 2 with transaction type, destination
+21 ; 3 = level 3 with message time/date, message ID, message status
+22 ; CODE BEGINS
+23 NEW X,Y,DIC,INNODE,INTDATE,INERRID,INDEST,INERRSTR,INERRTXT,INDSTNUM,INPATNAM,INESTAT
+24 NEW INEDATE,INEDEST,INELOC,INETTYPE,INMSGID,INMSTAT,INMSGTXT
+25 SET INIEN=$GET(INIEN)
SET INLABEL=$GET(INLABEL)
SET INEXPAND=$GET(INEXPAND)
SET INLEVEL=$GET(INLEVEL)
+26 ; build and return a title string if the flag is set
+27 IF INLABEL
SET INERRSTR="D DWLTITLE^INHERR2("_+$GET(INEXPAND)_")"
QUIT INERRSTR
+28 ; acquire .01 field informationg for Errors and Messages
+29 SET INERRTXT=$GET(^INTHER(INIEN,0))
SET INMSGTXT=$SELECT(+$PIECE(INERRTXT,U,4):$GET(^INTHU($PIECE(INERRTXT,U,4),0)),1:"")
+30 IF '$LENGTH(INERRTXT)
QUIT "No Error Information Found"
+31 ; acquire information for each level of display
+32 IF '$GET(INLEVEL)
Begin DoDot:1
+33 SET INEDATE=$TRANSLATE($$CDATASC^%ZTFDT($PIECE(INERRTXT,U),1,2),":")
+34 ; use previously created TABLE of status codes(INETBL)
+35 SET INESTAT=$SELECT($LENGTH($PIECE(INERRTXT,U,10)):INETBL($PIECE(INERRTXT,U,10)),1:"none")
+36 SET INELOC=$SELECT(+$PIECE(INERRTXT,U,5):+$PIECE(INERRTXT,U,5),1:"none")
IF +INELOC
SET INELOC=$PIECE($GET(^INTHERL(INELOC,0)),U)
+37 SET $EXTRACT(INERRSTR,1,17)=$EXTRACT(INEDATE,1,18)
SET $EXTRACT(INERRSTR,21,36)=$EXTRACT(INESTAT,1,12)
SET $EXTRACT(INERRSTR,38,79)=$EXTRACT(INELOC,1,15)
End DoDot:1
QUIT INERRSTR
+38 IF $GET(INLEVEL)=1
Begin DoDot:1
+39 SET INERRSTR=""
SET INNODE=$ORDER(^INTHER(INIEN,2,0))
IF 'INNODE
QUIT
IF $LENGTH($GET(^INTHER(INIEN,2,INNODE,0)))=0
QUIT
+40 SET $EXTRACT(INERRSTR,8,79)=$EXTRACT($GET(^INTHER(INIEN,2,INNODE,0)),1,65)
SET INNODE=$ORDER(^INTHER(INIEN,2,INNODE))
+41 ; Concatenate as much of the next node as possible
+42 ; if there is room and it exists
+43 IF $LENGTH(INERRSTR)<70
IF INNODE
SET $EXTRACT(INERRSTR,($LENGTH(INERRSTR)+4),78)=$EXTRACT($GET(^INTHER(INIEN,2,INNODE,0)),1,(74-$LENGTH(INERRSTR)))
End DoDot:1
QUIT INERRSTR
+44 IF $GET(INLEVEL)=2
Begin DoDot:1
+45 SET INETTYPE=$SELECT(+$PIECE(INERRTXT,U,2):+$PIECE(INERRTXT,U,2),+$PIECE(INMSGTXT,U,11):+$PIECE(INMSGTXT,U,11),1:"none")
IF +INETTYPE
SET INETTYPE=$PIECE($GET(^INRHT(INETTYPE,0)),U)
+46 SET INEDEST=$SELECT(+$PIECE(INERRTXT,U,9):+$PIECE(INERRTXT,U,9),+$PIECE(INMSGTXT,U,2):+$PIECE(INMSGTXT,U,2),1:"none")
IF +INEDEST
SET INEDEST=$PIECE($GET(^INRHD(INEDEST,0)),U)
+47 SET $EXTRACT(INERRSTR,3,43)=$EXTRACT(INETTYPE,1,40)
SET $EXTRACT(INERRSTR,45,79)=$EXTRACT(INEDEST,1,30)
End DoDot:1
QUIT INERRSTR
+48 IF $GET(INLEVEL)=3
IF ($LENGTH(INMSGTXT))
Begin DoDot:1
+49 SET INTDATE=$TRANSLATE($$CDATASC^%ZTFDT($PIECE(INMSGTXT,U),1,2),":")
+50 SET INMSGID=$SELECT($LENGTH($PIECE(INMSGTXT,U,5)):$PIECE(INMSGTXT,U,5),1:"no message id")
+51 ; use previously created TABLE of status codes(INMTBL)
+52 SET INMSTAT=$SELECT($LENGTH($PIECE(INMSGTXT,U,3)):INMTBL($PIECE(INMSGTXT,U,3)),1:"none")
+53 SET $EXTRACT(INERRSTR,3,23)=$EXTRACT(INTDATE,1,18)
SET $EXTRACT(INERRSTR,25,45)=$EXTRACT(INMSGID,1,20)
SET $EXTRACT(INERRSTR,47,77)=$EXTRACT(INMSTAT,1,30)
End DoDot:1
QUIT INERRSTR
+54 QUIT ""
+55 ;
CODETBL(INNAME,INFILE,INFIELD) ; build an array of Set-of-codes from a DD entry
+1 ; MODULE NAME: CODETBL ( build an array of codes from the ^DD global )
+2 ; DESCRIPTION: Construct a array containing selected fields from
+3 ; the DD given the array name, file, and field.
+4 ; RETURN = none
+5 ; PARAMETERS:
+6 ; INNAME(PBV) = The name of the array to populate
+7 ; INFILE(PBV) = The file number to reference
+8 ; INFIELD(PBV) = The field within the file
+9 ; CODE BEGINS
+10 NEW X,INLEN,INCNT,INPIECE,INCODE,INTXT
+11 KILL @INNAME
+12 SET X=$PIECE(^DD(INFILE,INFIELD,0),U,3)
+13 SET INLEN=$LENGTH(X,";")
+14 FOR INCNT=1:1:INLEN
SET INPIECE=$PIECE(X,";",INCNT)
SET INCODE=$PIECE(INPIECE,":",1)
SET INTXT=$PIECE(INPIECE,":",2)
IF $LENGTH(INCODE)
SET @INNAME@(INCODE)=INTXT
+15 QUIT
+16 ;