INHMGD9 ;CAR; 15 May 97 14:57;HL7 MESSAGING - PRINT LOOKUP ERRORS
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
; MODULE NAME:
; HL7 Messaging - Print Lookup Errors (INHMGD9).
;
; PURPOSE:
; Module INHMGD9 is used to print a listing of the lookup errors
; encountered while building the ^UTILITY("INHMGD",$J,"A") table
; for Sensitivity Analysis
;
INPERR ;Print the Lookup Errors
;Print list of lookup errors from ^UTILITY("INHMGD",$J,"E")
;Inputs:
; INPERR takes no inputs. When started, it goes to
; ^UTILITY("INHMGD",$J,"E") and lists all of the errors found.
;
S INPAGE="" K INHDR
;quit if no errors
I '$D(^UTILITY("INHMGD",$J,"E")) Q
;
N IN7F,IN7FT,IN7FET,IN7M,IN7MT,IN7S,IN7ST,IN7SET
N INAM,IND,INF,INFIL,INFLD,INHP,INT,INT0,INTEXT,INX
;
;begin printing Lookup Error Report
;All of the errors which are logged, are handled in roughly the same
;way. An entry is made under ^UTILITY("INHMGD",$J,"E",I1,I2,I3)=data
;where I1=Message IEN, I2=Segment IEN and I3 (if available)=Field IEN.
;Where I3 is not available, an incrementing counter is used.
;"data" is composed of File#_^_Field#_error_message.
;
S INHP=0 ;flag: page header not setup
S INT=$S(IOM>80:48,1:40)
S INQ="^UTILITY(""INHMGD"","_$J_",""E"")"
F S INQ=$Q(@INQ) Q:$QS(INQ,3)'["E"!$G(DUOUT) D
.I 'INHP D
..D SETHDR(.INHDR) S INHP=1 ;setup header
..D PHEADER^INHMGD8(4,.INHDR) ;print a header (full header if page="")
.;now, handle errors
.;extract Message, Segment and Field numbers.
.S IN7M=$QS(INQ,4),IN7S=$QS(INQ,5),IN7F=$QS(INQ,6)
.;get data: Root File# | Field "C" data.
.S IN7FET=@INQ,INAM=+IN7FET,INFC=$P(IN7FET,U,2)
.;message name
.S IN7MT=""
.I IN7M,$D(^INTHL7M(IN7M,0)) D Q:$E(IN7MT,1,2)'="HL"
..S IN7MT=$P($G(^INTHL7M(IN7M,0)),U)
.;segment name
.S IN7ST=""
.I IN7S,$D(^INTHL7S(IN7S,0)) S IN7ST=$P($G(^INTHL7S(IN7S,0)),U)
.;field name
.S IN7FT="",INT0=INT
.I IN7F<1 S IN7F="Field N/A",INT0=15
.I IN7F,$D(^INTHL7F(IN7F,0)) S IN7FT=$P($G(^INTHL7F(IN7F,0)),U)
.;
.S INDATA="IN7M_"" ""_IN7MT,?INT,IN7S_"" "",?INT,IN7ST"
.D INW^INHMGD8(1)
.S INDATA="?3,IN7F_"" "",IN7FT,?INT0,INAM_"" ""_INFC,!"
.D INW^INHMGD8(0)
;
;print *****End of Report*****, and pause to read.
S INHDR(4)="$C(32)" F INJ=1:1:3 D INW^INHMGD8(INJ=2)
S INDATA="$$DASH^INHMGD1(IOM-$L(INEOR)\2,"" "")_INEOR" D INW^INHMGD8(0)
I $E(IOST)="C",'$D(IO("Q")),IO=IO(0) S DUOUT=$$CR^UTSRD
Q
;
SETHDR(INHDR) ;Setup header lines
; Input & Output:
; INHDR =header text array
;
S INHDR(99)="HL7 Messaging Data Sources - Lookup Errors"
S INHDR(1)="INHDR(99),?(IOM-30),INDT,?(IOM-10),""PAGE: "",INPAGE"
S INHDR(4)="""IEN/Message Name"",?INT,""IEN/Segment Name"""
S INHDR(5)=""" IEN/Field Name"",?INT,""Root/DATA LOCATION or Error"""
S INHDR(10)="$$DASH^INHMGD1(IOM-3)"
Q
;
INHMGD9 ;CAR; 15 May 97 14:57;HL7 MESSAGING - PRINT LOOKUP ERRORS
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
+4 ; MODULE NAME:
+5 ; HL7 Messaging - Print Lookup Errors (INHMGD9).
+6 ;
+7 ; PURPOSE:
+8 ; Module INHMGD9 is used to print a listing of the lookup errors
+9 ; encountered while building the ^UTILITY("INHMGD",$J,"A") table
+10 ; for Sensitivity Analysis
+11 ;
INPERR ;Print the Lookup Errors
+1 ;Print list of lookup errors from ^UTILITY("INHMGD",$J,"E")
+2 ;Inputs:
+3 ; INPERR takes no inputs. When started, it goes to
+4 ; ^UTILITY("INHMGD",$J,"E") and lists all of the errors found.
+5 ;
+6 SET INPAGE=""
KILL INHDR
+7 ;quit if no errors
+8 IF '$DATA(^UTILITY("INHMGD",$JOB,"E"))
QUIT
+9 ;
+10 NEW IN7F,IN7FT,IN7FET,IN7M,IN7MT,IN7S,IN7ST,IN7SET
+11 NEW INAM,IND,INF,INFIL,INFLD,INHP,INT,INT0,INTEXT,INX
+12 ;
+13 ;begin printing Lookup Error Report
+14 ;All of the errors which are logged, are handled in roughly the same
+15 ;way. An entry is made under ^UTILITY("INHMGD",$J,"E",I1,I2,I3)=data
+16 ;where I1=Message IEN, I2=Segment IEN and I3 (if available)=Field IEN.
+17 ;Where I3 is not available, an incrementing counter is used.
+18 ;"data" is composed of File#_^_Field#_error_message.
+19 ;
+20 ;flag: page header not setup
SET INHP=0
+21 SET INT=$SELECT(IOM>80:48,1:40)
+22 SET INQ="^UTILITY(""INHMGD"","_$JOB_",""E"")"
+23 FOR
SET INQ=$QUERY(@INQ)
IF $QSUBSCRIPT(INQ,3)'["E"!$GET(DUOUT)
QUIT
Begin DoDot:1
+24 IF 'INHP
Begin DoDot:2
+25 ;setup header
DO SETHDR(.INHDR)
SET INHP=1
+26 ;print a header (full header if page="")
DO PHEADER^INHMGD8(4,.INHDR)
End DoDot:2
+27 ;now, handle errors
+28 ;extract Message, Segment and Field numbers.
+29 SET IN7M=$QSUBSCRIPT(INQ,4)
SET IN7S=$QSUBSCRIPT(INQ,5)
SET IN7F=$QSUBSCRIPT(INQ,6)
+30 ;get data: Root File# | Field "C" data.
+31 SET IN7FET=@INQ
SET INAM=+IN7FET
SET INFC=$PIECE(IN7FET,U,2)
+32 ;message name
+33 SET IN7MT=""
+34 IF IN7M
IF $DATA(^INTHL7M(IN7M,0))
Begin DoDot:2
+35 SET IN7MT=$PIECE($GET(^INTHL7M(IN7M,0)),U)
End DoDot:2
IF $EXTRACT(IN7MT,1,2)'="HL"
QUIT
+36 ;segment name
+37 SET IN7ST=""
+38 IF IN7S
IF $DATA(^INTHL7S(IN7S,0))
SET IN7ST=$PIECE($GET(^INTHL7S(IN7S,0)),U)
+39 ;field name
+40 SET IN7FT=""
SET INT0=INT
+41 IF IN7F<1
SET IN7F="Field N/A"
SET INT0=15
+42 IF IN7F
IF $DATA(^INTHL7F(IN7F,0))
SET IN7FT=$PIECE($GET(^INTHL7F(IN7F,0)),U)
+43 ;
+44 SET INDATA="IN7M_"" ""_IN7MT,?INT,IN7S_"" "",?INT,IN7ST"
+45 DO INW^INHMGD8(1)
+46 SET INDATA="?3,IN7F_"" "",IN7FT,?INT0,INAM_"" ""_INFC,!"
+47 DO INW^INHMGD8(0)
End DoDot:1
+48 ;
+49 ;print *****End of Report*****, and pause to read.
+50 SET INHDR(4)="$C(32)"
FOR INJ=1:1:3
DO INW^INHMGD8(INJ=2)
+51 SET INDATA="$$DASH^INHMGD1(IOM-$L(INEOR)\2,"" "")_INEOR"
DO INW^INHMGD8(0)
+52 IF $EXTRACT(IOST)="C"
IF '$DATA(IO("Q"))
IF IO=IO(0)
SET DUOUT=$$CR^UTSRD
+53 QUIT
+54 ;
SETHDR(INHDR) ;Setup header lines
+1 ; Input & Output:
+2 ; INHDR =header text array
+3 ;
+4 SET INHDR(99)="HL7 Messaging Data Sources - Lookup Errors"
+5 SET INHDR(1)="INHDR(99),?(IOM-30),INDT,?(IOM-10),""PAGE: "",INPAGE"
+6 SET INHDR(4)="""IEN/Message Name"",?INT,""IEN/Segment Name"""
+7 SET INHDR(5)=""" IEN/Field Name"",?INT,""Root/DATA LOCATION or Error"""
+8 SET INHDR(10)="$$DASH^INHMGD1(IOM-3)"
+9 QUIT
+10 ;