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

INHES.m

Go to the documentation of this file.
  1. INHES ;KN; 6 Mar 96 14:10; Interface Error Summary
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. ; MODULE NAME: INTERFACE ERROR SUMMARY (INHES)
  1. ;
  1. ; PURPOSE:
  1. ; The purpose of the Interface Error Summary is to get user/programmer
  1. ; a summary report of the interface error in a given period of time.
  1. ; Based on user's select criteria, the report will search the Interfa-
  1. ; ce Error File, collect all the messages matching the given criteria.
  1. ; The report will group the error messages according to user's input
  1. ; text length. The error count, total and also the first and last
  1. ; of the error occurs are included in the summary report.
  1. ;
  1. ; DESCRIPTION:
  1. ; The processing of this routine will ask user for start date, optional
  1. ; end date, and a summary or detail report. A summary report will also
  1. ; require text length input ( the default length is set at 30 charactor)
  1. ; Programmer call is invoke by calling PGUSE^INHES. (ARNAME) where
  1. ; ARNAME is the name of array that will contains the error text, the
  1. ; count, as well as the IEN of the first and last of the error occurs
  1. ; are included in the summary report.
  1. ;
  1. ;
  1. ; Return: None
  1. ; Parameters:
  1. ;
  1. ; Code begins:
  1. ENUSE ; User's entry point for the Interface Error Summary
  1. ;
  1. ; Description: The ENUSE entry point is used for accepting
  1. ; user's input message. The user is presented with
  1. ; a criteria selection screen. User can select a
  1. ; summary report of various error text lenght, or a
  1. ; detail listing of all the error messages in a given
  1. ; period of time.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code begins:
  1. ;
  1. N %ZIS,A,EXIT,HDR,INPAGE,X,ZTDESC,ZTIO,ZTRTN,ZTSAVE
  1. D SEARCH^INHES2
  1. G QUIT
  1. ;
  1. PGUSE(INKA) ; Programmer input
  1. ;
  1. ; Description: The PGUSE entry point is used for accepting
  1. ; programmer's call to interface error summary report.
  1. ;
  1. ; Return: None
  1. ;
  1. ; Parameters:
  1. ; INKA: array contains the results, which are the error text,
  1. ; count, first and last occurence IEN.
  1. ;
  1. ; Code begins:
  1. ;
  1. N INQUIT,PROG
  1. ; set programmer input flag PROG, and display criteria select sreen
  1. S PROG=1,INQUIT=$$BGNSRCH^INHERR(.INSRCH,0,"","",1)
  1. G QUIT
  1. ;
  1. QUEUE(INSRCH) ;Device handling & Tasking logic
  1. ; return array INKA for programmer use
  1. I $D(PROG) D Q
  1. . S INKL="INARIEN"
  1. .; get IEN for array of errors matching selected criteria
  1. . K @INKL D LIST^INHES1(.INSRCH,.INKL,.INARIEN)
  1. .; return array INKA which contains error text, count, first and last
  1. .; occurence IEN
  1. . D INSUMP^INHES2(.INSRCH,.INKL,.INKA)
  1. ; display/print summary report for user
  1. N INSRSZ S INSRSZ=$$SRCHSIZE^INHERR4(.INSRCH,"^INTHER(""B"")")
  1. Q:INSRSZ<0
  1. W !,INSRSZ," MESSAGES TO SEARCH.",!
  1. S INSRCH("TOTAL")=INSRSZ
  1. ;
  1. K IOP S %ZIS("A")="DEVICE: ",%ZIS("B")="",%ZIS="NQ" D ^%ZIS G:POP QUIT
  1. S IOP=ION_";"_IOST_";"_IOM_";"_IOSL
  1. I IO=IO(0) S %ZIS="" D ^%ZIS I POP W *7,!,"Sorry, unable to find device..." G QUIT
  1. I IO'=IO(0) S ZTDESC="Description of job",ZTIO=IOP,ZTRTN="ENQUE^INHES" D G QUIT
  1. .F X="U","IO*","D*","HDR(","INPAGE","INSRCH(" S ZTSAVE(X)=""
  1. .D ^%ZTLOAD
  1. ;
  1. ENQUE ; Taskman entry point
  1. ;
  1. ; Description: ENQUE is the entry point for Taskman. It will call
  1. ; module INSUM for the interface summary report
  1. ;
  1. ; Return: None
  1. ; Parameter: None
  1. ;
  1. ; Code begins:
  1. ;
  1. S INPAGE=0,EXIT=0
  1. N INQUIT,INKL
  1. S INQUIT=0,INKL="INARIEN"
  1. ; INKL is the array that contains the IEN of all the error messages
  1. ; which match the user select criteria.
  1. K @INKL D LIST^INHES1(.INSRCH,.INKL,.INARIEN)
  1. ; at this point all found IEN are in INARIEN array
  1. D INSUM^INHES2(.INSRCH,.INKL) K @INKL,INKL
  1. G QUIT
  1. ;
  1. ;
  1. ; Description: The function HEADER is used to display header when
  1. ; reaching the end of page/screen, and give user the
  1. ; option to continue or to abort.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code begins:
  1. N INA
  1. ; Check for end of page/screen and give option to continue or quit
  1. I ($P(IOST,"-")["C")&('$D(IO("Q")))&(IO=IO(0))&(INPAGE>0) Q:$G(DUOUT) D
  1. .W ! D ^UTSRD("Press <RETURN> to continue or ^ to quit;;;;;;;0;;;;DTIME;;X","","",1) S:(X=1)!(X=2) DUOUT=1
  1. Q:$G(DUOUT)
  1. ; Display new page and header
  1. S INPAGE=INPAGE+1 I (INPAGE>1)!($P(IOST,"-")["C") W @IOF
  1. F INA=1:1:3 W @HDR(INA)
  1. ; Display criteria header on page 1
  1. I INPAGE=1 D CRIHDR^INHES1(.INSRCH)
  1. S INA=3 F S INA=$O(HDR(INA)) Q:'INA U IO W !,@HDR(INA)
  1. Q
  1. ;
  1. HSET ; set up header
  1. ;
  1. ; Description: The function HSET is used to set up the header with
  1. ; the current page and current date/time.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code Begins:
  1. ;
  1. ; Initialize site name and today date
  1. S INSITE=$S($D(^DIC(4,^DD("SITE",1),0)):^(0),1:^DD("SITE")),INSITE=$S($P(INSITE,"^",4)]"":$P(INSITE,"^",4),1:$P(INSITE,"^",1))
  1. I '$D(INDT) D NOW^%DTC S Y=$J(%,12,4) D DD^%DT S INDT=Y
  1. ; calculate start and stop date for header
  1. S Y=$G(INSRCH("INSTART"))+.000001,INTY=Y\1
  1. I Y-INTY>.0001 S Y=$J(Y,12,4)
  1. E S Y=Y\1
  1. D DD^%DT S INSD=$G(Y)
  1. S Y=$G(INSRCH("INEND")),INTY=Y\1
  1. ; delete the seconds resolution
  1. I Y-INTY>.00009 S Y=Y-.000099
  1. ; no hhmm for end date
  1. I Y-INTY>.99 S Y=Y-.9999
  1. D DD^%DT S INED=$G(Y)
  1. ; format the header
  1. S HDR(1)="INSITE,?(IOM-30),INDT,?(IOM-10),""Page: "",INPAGE"
  1. S HDR(2)="!!?(IOM-36)/2,""INTERFACE ERROR SUMMARY REPORT"""
  1. S HDR(3)="!?(IOM-48)/2,""From : "",INSD,"" To : "",INED,!"
  1. S HDR(4)="",$P(HDR(4),"-",IOM-1)="",HDR(4)=""""_HDR(4)_""""
  1. S HDR(5)="""Count Error Text"""
  1. S HDR(6)="?5,"" Occurence"",?45,""Message ID"""
  1. S HDR(7)="?5,""Tran. Type"",?45,""Error Loc"",!?5,""Destination"",?45,""Backgrnd Proc"""
  1. S HDR(8)="",$P(HDR(8),"-",IOM-1)="",HDR(8)=""""_HDR(8)_""""
  1. Q
  1. ;
  1. QUIT ;exit module
  1. ;
  1. ; Description: The function QUIT is used to close the ouput
  1. ; device, reset IO variables back to the home
  1. ; device and exit the module.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code Begins:
  1. ;
  1. D ^%ZISC K IO("Q"),IOP,POP
  1. Q