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