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

INHERR2.m

Go to the documentation of this file.
  1. INHERR2 ;DJL; 27 Oct 95 11:44;Interface - Error Search
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. LIST(INQUIT,IND,INSRCH,DWLRF,INRVSRCH,INL,INSRCHCT) ; Build the error array
  1. ; MODULE NAME: LIST ( Build the list of matching errors )
  1. ; DESCRIPTION:
  1. ; loop through the errors from date-start to date-end and
  1. ; give the user a progress indicator
  1. ; PARAMETERS:
  1. ; INQUIT(PBV) = 0 = The program completed properly
  1. ; 1 = No matching errors were found
  1. ; IND(PBV) = The starting time/date of the search set from information
  1. ; in INSRCH and determined by INRVSRCH flag
  1. ; INSRCH(PBR) = Array for holding search criteria information
  1. ; DWLRF(PBV) = Settings for the Display Processor
  1. ; INRVSRCH(PBV) = Flag set user indicating direction of the search
  1. ; -1 = (default)a reverse listing order. Newest to Oldest
  1. ; 0 = a forward search listing order. Oldest to Newest
  1. ; INL(PBR) = Array used to load with error items matching the criteria
  1. ; INSRCHCT(PBV) = The combined count of error items searched
  1. ; CODE BEGINS
  1. N INM,INFNDCT,INBLKCT,INNOMORE,INDSPSZ,DWLR,INETBL,INMTBL
  1. S INDSPSZ=1000 ; max. num. of msg. for disp. progress
  1. S INFNDCT=$P(@DWLRF,U,2),INBLKCT=INFNDCT+19 ; INBLKCT=num. of msg./win.
  1. ; build the set-of-code tables for MSGTEST usage
  1. D CODETBL^INHERR3("INETBL",4003,.1),CODETBL^INHERR3("INMTBL",4001,.03)
  1. S:'IND IND=$O(^INTHER("B",IND),INRVSRCH)
  1. F Q:$S('IND:1,(INRVSRCH>-1)&(IND>INSRCH("INEND")):1,(INRVSRCH=-1)&(IND<INSRCH("INSTART")):1,1:0)!(INFNDCT>(INBLKCT)) D S IND=$O(^INTHER("B",IND),INRVSRCH)
  1. . S INM="" F S INM=$O(^INTHER("B",IND,INM),INRVSRCH) Q:'INM D
  1. .. D MSGTEST(INM,.DWLRF,.INSRCH,.INSRCHCT,.INFNDCT) I '(INSRCHCT#20) D MS^DWD("SEARCHING... ERRORS SEARCHED: "_INSRCHCT_" ERRORS FOUND: "_INFNDCT)
  1. I '$O(@DWLRF@(0)) D MS^DWD("No Errors Found.") S INQUIT=$$CR^UTSRD,INQUIT=1 Q
  1. ; check for completion of search to terminate 'more' functionality
  1. S INNOMORE=0 S:$S('IND:1,(INRVSRCH>-1)&(IND>INSRCH("INEND")):1,(INRVSRCH=-1)&(IND<INSRCH("INSTART")):1,1:0) INNOMORE=1,$P(@DWLRF,U,2)=0
  1. S:'INNOMORE $P(@DWLRF,U,2)=INFNDCT
  1. S INQUIT=0
  1. Q
  1. ;
  1. MSGTEST(INEIEN,INLIST,INSRCH,INSRCHCT,INFNDCT) ; Add matching error to array
  1. ; MODULE NAME: MSGTEST ( Interface Error Match Criteria Test )
  1. ; DESCRIPTION: Tests the error for matches to values passed in third
  1. ; parameter array nodes and addes the IEN to the second
  1. ; parameter array. Updates counters accordingly.
  1. ; RETURN = none
  1. ; PARAMETERS:
  1. ; INEIEN(PBV)= IEN into ^INTHER
  1. ; INLIST(PBR) = The NAME of the array to add items found
  1. ; INSRCH(PBR) = The array of items to find
  1. ; INSRCHCT(PBR) = The count of errors searched
  1. ; INFNDCT(PBR) = The count of errors found
  1. ; CODE BEGINS
  1. N INTEMPX,INTEMPY,INMAXSZ,INMIEN
  1. S INMAXSZ=100,INTEMPX=$G(^INTHER(INEIEN,0)),INSRCHCT=INSRCHCT+1
  1. S INMIEN=$P(INTEMPX,U,4),INTEMPY=$G(^INTHU(+INMIEN,0))
  1. ; Checking the Interface Error file
  1. I INSRCH("INDEST")]"" I $P(INTEMPX,U,9)'=INSRCH("INDEST")&($P(INTEMPY,U,2)'=INSRCH("INDEST")) Q
  1. I INSRCH("INORIG")]"" I $P(INTEMPX,U,2)'=INSRCH("INORIG")&($P(INTEMPY,U,11)'=INSRCH("INORIG")) Q
  1. I $D(INSRCH("INERLOC")),INSRCH("INERLOC")]"",$P(INTEMPX,U,5)'=INSRCH("INERLOC") Q
  1. I $D(INSRCH("INERSTAT")),INSRCH("INERSTAT")]"",$P(INTEMPX,U,10)'=INSRCH("INERSTAT") Q
  1. I $D(INSRCH("INTEXT"))>9 Q:'$$INERSRCH^INHERR1(.INSRCH,INEIEN,INSRCH("INTYPE"))
  1. ; Checking the Interface Message file
  1. I $G(INSRCH("INMSGSTART")) Q:($P(INTEMPY,U)<INSRCH("INMSGSTART"))
  1. I $G(INSRCH("INMSGSTART")) Q:($P(INTEMPY,U)>INSRCH("INMSGEND"))
  1. I INSRCH("INID")]"" Q:$P(INTEMPY,U,5)'=INSRCH("INID")
  1. I INSRCH("INDIR")]"" Q:$P(INTEMPY,U,10)'=INSRCH("INDIR")
  1. I INSRCH("INSTAT")]"" Q:$P(INTEMPY,U,3)'=INSRCH("INSTAT")
  1. I INSRCH("INSOURCE")]"" Q:$E($P(INTEMPY,U,8),1,$L(INSRCH("INSOURCE")))'=INSRCH("INSOURCE")
  1. I INSRCH("INPAT")]"" Q:'INMIEN Q:'$$INMSPAT^INHMS1(INMIEN,INSRCH("INPAT"))
  1. ; move the found-items array to ^UTILITY if it's getting too large
  1. ; kill the new ^UTILITY space incase it already exists prior to merg
  1. I INFNDCT>INMAXSZ,(INLIST'[U) N INTEMPY S INTEMPY=INLIST,INLIST="^UTILITY(""INL"","_$J_"_"_DUZ_"_"_$P($H,",",2)_")" K @INLIST M @INLIST=@INTEMPY K @INTEMPY,INTEMPY
  1. S @INLIST@(INSRCHCT)=$$INMSGSTR^INHERR3(INEIEN,"",$G(INSRCH("INEXPAND"))),@INLIST@(INSRCHCT,0)=INEIEN,INFNDCT=INFNDCT+1
  1. I '$G(INSRCH("INEXPAND")) S @INLIST@((INSRCHCT+.1))=$$INMSGSTR^INHERR3(INEIEN,"",$G(INSRCH("INEXPAND")),1) K:'$L(@INLIST@((INSRCHCT+.1))) @INLIST@((INSRCHCT+.1))
  1. ; show the expanded listing date only if EXPAND and a MESSAGE exists
  1. D:$G(INSRCH("INEXPAND"))
  1. . S @INLIST@((INSRCHCT+.1))=$$INMSGSTR^INHERR3(INEIEN,"",$G(INSRCH("INEXPAND")),2) K:'$L(@INLIST@((INSRCHCT+.1))) @INLIST@((INSRCHCT+.1))
  1. D:+INMIEN&($G(INSRCH("INEXPAND")))
  1. . S @INLIST@((INSRCHCT+.2))=$$INMSGSTR^INHERR3(INEIEN,"",$G(INSRCH("INEXPAND")),3) K:'$L(@INLIST@((INSRCHCT+.2))) @INLIST@((INSRCHCT+.2))
  1. I $G(INSRCH("INEXPAND")) S @INLIST@((INSRCHCT+.3))=$$INMSGSTR^INHERR3(INEIEN,"",$G(INSRCH("INEXPAND")),1) K:'$L(@INLIST@((INSRCHCT+.3))) @INLIST@((INSRCHCT+.3))
  1. Q
  1. ;
  1. DWLTITLE(INEXPAND) ; Write the title
  1. W !," Date/Time Error Status Error Location"
  1. W:INEXPAND !," Transaction Type Destination"
  1. W:INEXPAND !," Message Date/Time Message ID Message Status"
  1. W !," Error Text"
  1. Q
  1. ;
  1. POST(INNAME,INTEMPLT,INFILE) ; Disply/Print
  1. ; MODULE NAME: POST ( Post-action logic on List Processor field )
  1. ; DESCRIPTION: Display/print using template passed on file passed
  1. ; RETURN = none
  1. ; PARAMETERS:
  1. ; INNAME(PBV) = A NAME of an Array of IEN's into the file of items
  1. ; selected for displaying/printing
  1. ; INTEMPLT(PBV) = Print template to use
  1. ; INFILE(PBV) = The file to use
  1. ;
  1. ; CODE BEGINS
  1. N X,I,DIC,DR,DHD,DW,DWCP,INIO,DIE,DA
  1. I $O(@INNAME@(0)) D
  1. . D CLEAR^DW
  1. . S %ZIS="N" D ^%ZIS Q:POP S INIO=IO,IOP=ION_";"_IOST_";"_IOM_";"_IOSL
  1. . S I=0 F S I=$O(@INNAME@(I)) Q:'I S DA(@INNAME@(I))=""
  1. . S DR=INTEMPLT,DIC=INFILE,DHD="@" D PRTLIST^DWPR
  1. . S:INIO=IO X=$$CR^UTSRD
  1. Q
  1. ;