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

INHERR1.m

Go to the documentation of this file.
  1. INHERR1 ;DJL; 28 Feb 95 10:40;Interface - Error Search
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. EXPAND(INTEMPLT,INFILE) ;Expand-action logic on List Processor field
  1. ; MODULE NAME: EXPAND (Expand-action logic for ^DWL )
  1. ; DESCRIPTION: Expand using print template name passed and
  1. ; on the file passed.
  1. ; RETURN = none
  1. ; PARAMETERS
  1. ; INTEMPLT = The print template to use
  1. ; INFILE = The file to use
  1. ; CODE BEGINS
  1. N I,X,DIC,DR,DHD,DW,DWCP,INIO,DIE,DA
  1. Q:'$D(@DWLRF@($P(@DWLRF,U,4),0))
  1. D CLEAR^DW
  1. S %ZIS="N" D ^%ZIS Q:POP S INIO=IO,IOP=ION_";"_IOST_";"_IOM_";"_IOSL
  1. S DA(@DWLRF@($P(@DWLRF,U,4),0))=""
  1. S DR=INTEMPLT,DIC=INFILE,DHD="@" D PRTLIST^DWPR
  1. S:INIO=IO X=$$CR^UTSRD
  1. Q
  1. ;
  1. INERSRCH(INETEXT,INEIEN,INELOGIC) ; Test error for text-string match(multi)
  1. ; MODULE NAME: INERSRCH (Interface Error MESSAGE Search)
  1. ; DESCRIPTION: Search ^INTHER( INEIEN ) error for matching values to
  1. ; the search string array: INETEXT.
  1. ; RETURN= PASS/FAIL (1/0)
  1. ; PARAMETERS:
  1. ; INETEXT= search string array with base node("INTEXT") set to
  1. ; subscript count value and subscript nodes containing
  1. ; the strings
  1. ; INEIEN= The IEN of the error in the ^INTHER error file
  1. ; INELOGIC= The matching logic switch set to 1 or 0
  1. ; 1= ANDing functionality RE:all strings must be found
  1. ; in the error
  1. ; 0= ORing functionality RE:only one string need match
  1. ; CODE BEGINS
  1. N X,INEFOUND,INELINE,INENODE
  1. S (INEFOUND,INENODE)=0 F S INENODE=$O(^INTHER(INEIEN,2,INENODE)) Q:'INENODE!INEFOUND D
  1. . S INELINE=^INTHER(INEIEN,2,INENODE,0)
  1. . I '$D(INELINE) Q
  1. .; loop through the strings for the current error
  1. .; For enhances text searching use MSGPACK^INHMS1
  1. . S INEFOUND=$$INLSRCH(.INETEXT,.INELINE,.INEFOUND,INELOGIC)
  1. .; no items were found or AND functionality is used.
  1. .; test if any of INEFOUND(n) are not TRUE quit with 0 returned
  1. . I INELOGIC S INEFOUND=1,X="" F S X=$O(INETEXT("INTEXT",X)) Q:'X I '$D(INEFOUND(X)) S INEFOUND=0 Q
  1. Q INEFOUND
  1. ;
  1. INLSRCH(SRCHTEXT,MSGTEXT,INFOUND,INLOGIC) ; Test error for text-string
  1. ; match(one line)
  1. ; MODULE NAME: INLSRCH (Interface Error LINE Search)
  1. ; DESCRIPTION: To find a search string in a error which may be a
  1. ; continuation line or not. The search line MAY be
  1. ; split across multiple lines.
  1. ; RETURN= PASS/FAIL (1/0)
  1. ; PARAMETERS:
  1. ; SRCHTEXT(PBR)= The array of search string containing less than a 70 char.
  1. ; count value and subscript nodes containing the strings
  1. ; MSGTEXT(PBR)= error text/array
  1. ; INFOUND(PBR)= The array used to indicate strings matches found.
  1. ; INLOGIC(PBV)= The flag indicating the type(OR/AND) of logic used with
  1. ; matching error data and the search strings.
  1. ; CODE BEGINS
  1. N BUF,INQUIT,INNODE
  1. ; pack the error into 250 char./node error
  1. ; *** COMMENTED-OUT(following line) FOR ERROR SEARCH ONLY ***
  1. ;D MSGPACK(.MSGTEXT)
  1. S BUF=MSGTEXT,(INFOUND,INQUIT)=0
  1. F Q:INFOUND!INQUIT D
  1. .; loop thru the strings(SRCHTEXT("INTEXT")) to match
  1. .; setting a corresponding node(INFOUND(n))=TRUE if a match is
  1. .; found. quit on a single 'find' for OR functionality
  1. . S INNODE="" F S INNODE=$O(SRCHTEXT("INTEXT",INNODE)) Q:'INNODE I BUF[SRCHTEXT("INTEXT",INNODE) S INFOUND(INNODE)=1 I 'INLOGIC S INFOUND=1 Q
  1. .; if OR functionity and a error was found then quit looping thru
  1. .; this error
  1. . I 'INLOGIC,INFOUND Q
  1. .; quit if there are no more lines to test
  1. . I '$O(MSGTEXT("")) S INQUIT=1 Q
  1. .; move the last 69 char to the front of buffer and repack the array
  1. .; *** COMMENTED-OUT(following line) FOR ERROR SEARCH ONLY ***
  1. .; S MSGTEXT=$E(BUF,181,999) D MSGPACK(.MSGTEXT) S BUF=MSGTEXT
  1. . Q
  1. Q INFOUND
  1. ;