HLCSRPT4 ;OIFO-O/LJA - Error Listing code ;3/18/02 10:19
;;1.6;HEALTH LEVEL SEVEN;**85**;Oct 13, 1995
;
; Patch HL*1.6*85 created a significant amount of code; enough
; that this routine had to be created to hold it.
;
LOADERR ; Find latest NUMERR statuses in ERRDTB->ERRDTE date range. ;HL*1.6*85
;ERRDTB,ERRDTE,HLCSER,HLCSTER1,NUMERR -- req
;
N CT,ERR,ERR4,IEN,TIME
;
KILL ^TMP("HLERR",$J),^TMP("ERRLST",$J)
;
S HLERR=3.9,CT=0
F S HLERR=$O(^HLMA("AG",HLERR)) QUIT:HLERR'>0!(HLERR>7) D
. S IEN773=0
. F S IEN773=$O(^HLMA("AG",HLERR,IEN773)) Q:IEN773'>0 D
. . S ERR4=$P($G(^HLMA(+IEN773,"P")),U,4) QUIT:ERR4'>0 ;->
. . D CHKERR(ERR4,IEN773,ERRDTB,ERRDTE)
. . S CT=CT+1 W:'(CT#1000) "."
;
S ERR=0
F S ERR=$O(^TMP("HLERR",$J,ERR)) Q:ERR'>0 D
. S TIME=0
. F S TIME=$O(^TMP("HLERR",$J,ERR,TIME)) Q:TIME'>0 D
. . S IEN=0
. . F S IEN=$O(^TMP("HLERR",$J,ERR,TIME,IEN)) Q:IEN'>0 D
. . . S ^TMP("ERRLST",$J,+ERR,+IEN)=""
;
KILL ^TMP("HLERR",$J)
;
QUIT
;
CHKERR(ERR4,IEN773,DTB,DTE) ; Should this entry be included? ;HL*1.6*85
;NUMERR -- req
;
N ERRNO,OLD773,OLDPDT,PROCDT
;
; Processing date/time check...
S PROCDT=$$PROCDT(IEN773) QUIT:PROCDT'>0 ;->
I PROCDT<DTB!(PROCDT>DTE) QUIT ;->
; OK. Date check passes. But, is it among NUMERR latest?
;
; How many errors recorded for error status?
S ERRNO=$G(^TMP("HLERR",$J,ERR4))
;
; Number of errors recorded less than # maximum per status...
I ERRNO<NUMERR D RECERR(ERR4,IEN773) QUIT ;->
;
; Find oldest entry's process date/time & last 773 IEN...
S OLDPDT=$O(^TMP("HLERR",$J,ERR4,0)) QUIT:OLDPDT'>0 ;->
S OLD773=$O(^TMP("HLERR",$J,ERR4,+OLDPDT,0)) QUIT:OLD773'>0 ;->
;
; Now see if "this" error is newer...
QUIT:PROCDT<OLDPDT ;->
I PROCDT=OLDPDT,IEN773<OLD773 QUIT ;->
;
; Max number errors reached, but this error is newer than newest...
;
; Zilch oldest entry, then record "this" error...
D KILLERR(ERR4,OLDPDT,OLD773)
D RECERR(ERR4,IEN773)
;
QUIT
;
KILLERR(ERR4,OLDPDT,OLD773) ; Remove entry and adjust counts... ;HL*1.6*85
N NUM
;
KILL ^TMP("HLERR",$J,ERR4,OLDPDT,OLD773)
;
I $O(^TMP("HLERR",$J,ERR4,OLDPDT,0))'>0 D
. KILL ^TMP("HLERR",$J,ERR4,OLDPDT)
I $O(^TMP("HLERR",$J,ERR4,OLDPDT,0))>0 D
. S NUM=$G(^TMP("HLERR",$J,ERR4,OLDPDT))-1,NUM=$S(NUM'<0:+NUM,1:0)
. S ^TMP("HLERR",$J,ERR4,OLDPDT)=NUM
;
I $O(^TMP("HLERR",$J,ERR4,0))'>0 D
. KILL ^TMP("HLERR",$J,ERR4)
I $O(^TMP("HLERR",$J,ERR4,0))>0 D
. S NUM=$G(^TMP("HLERR",$J,ERR4))-1,NUM=$S(NUM'<0:+NUM,1:0)
. S ^TMP("HLERR",$J,ERR4)=NUM
;
I $O(^TMP("HLERR",$J,0))'>0 D
. KILL ^TMP("HLERR",$J)
I $O(^TMP("HLERR",$J,0))>0 D
. S NUM=$G(^TMP("HLERR",$J))-1,NUM=$S(NUM'<0:+NUM,1:0)
. S ^TMP("HLERR",$J)=NUM
;
QUIT
;
RECERR(ERR4,IEN773) ; Store error in ^TMP("HLERR",$J,STATUS,IEN773) ;HL*1.6*85
S ^TMP("HLERR",$J,ERR4)=$G(^TMP("HLERR",$J,ERR4))+1
S ^TMP("HLERR",$J,ERR4,PROCDT)=$G(^TMP("HLERR",$J,ERR4,PROCDT))+1
S ^TMP("HLERR",$J,ERR4,PROCDT,IEN773)=""
QUIT
;
SETUP() ; Setup "limit" variables... ;HL*1.6*85
S TYPEINFO=$$TYPEINFO QUIT:TYPEINFO']"" "" ;->
;
S (ERRDTB,ERRDTE,NUMERR)=""
W !!," If you answer NO below, you will be allowed to specify the number of"
W !," errors to be included in the report."
W !
S NUMERR=$$YN("Print all errors","No") QUIT:NUMERR']"" "" ;->
S NUMERR=$S(NUMERR=1:9999999,1:$$NUMERR) QUIT:NUMERR'>0 "" ;->
I NUMERR=9999999 D
. W !!," All errors in the date range you specify next will be included"
. W !," in the report."
I NUMERR'=9999999 D
. W !!," The newest ",NUMERR," errors, for every error status, in the date range you"
. W !," specify next will be included in the report."
W !!,"The first entry at your site is from ",$$FMTE^XLFDT($O(^HL(772,"B",2840000))),"."
W !
S1 S ERRDTB=$$DATE("Enter START DATE/TIME",,$$FMADD^XLFDT($$DT^XLFDT,-90)) QUIT:ERRDTB'>0 "" ;->
W !
S ERRDTE=$$DATE("Enter END DATE/TIME",ERRDTB,"NOW") QUIT:ERRDTE'>0 "" ;->
I ERRDTB=ERRDTE D G S1 ;->
. W !!,"You cannot enter the same values for the beginning and ending times!"
. W !
QUIT 1
;
NUMERR() ; How many errors, maximum, does user want to see ;HL*1.6*85
; HLCSER -- req
N DIR,DIRUT,DTOUT,DUOUT,X,Y
W !!,"Enter the maximum number errors to report for every error status."
W !
S DIR(0)="N",DIR("A")="Enter maximum number errors/status"
S DIR("B")=999
S DIR("?",1)="If you enter '1000' for the maximum number errors/status..."
S DIR("?",2)=""
I HLCSER="ALL" D
. S DIR("?",3)="... The most recent 1000 errors for every error type will be included in the"
. S DIR("?",4)="... report. If two different error types exist, and each error type has"
. S DIR("?",5)="... more than 1000 entries, then 2000 errors will be reported."
. S DIR("?")="... (I.e., 1000 errors per error type.)"
I HLCSER'="ALL" D
. S DIR("?",3)="... The most recent 1000 errors for the error type you just selected"
. S DIR("?")="... will be included in the report."
D ^DIR
QUIT $S(Y>0:+Y,1:"")
;
DATE(PMT,BDT,PDT) ; Entry of date for looping ;HL*1.6*85
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S BDT=$S($G(BDT)?7N.E:BDT,1:"")
S DIR(0)="DA^"_$G(BDT)_"::ET"
I $G(BDT)>0 D
. N TXT
. S TXT="Enter a date/time after "_$$FMTE^XLFDT(BDT)_"..."
. S DIR("?")=TXT
S DIR("A")=PMT_": "
I $G(PDT)?7N.E S DIR("B")=$P($$FMTE^XLFDT(PDT),":",1,2)
I $G(PDT)="NOW" S DIR("B")="NOW"
D ^DIR
I Y?7N.E,$G(PMT)="NOW",$G(PDT)="NOW" QUIT 9999999.24 ;->
QUIT $S(Y>0:+Y,1:"")
;
YN(PMT,DEF,FF) ; Generic YES/NO DIR call... ;HL*1.6*85
N DIR,DIRUT,DTOUT,DUOUT,X,Y
F X=1:1:$G(FF) W !
S DIR(0)="Y",DIR("A")=PMT
S:$G(DEF)]"" DIR("B")=DEF
D ^DIR
QUIT:$D(DIRUT)!($D(DTOUT))!($D(DUOUT)) "" ;->
QUIT $S(Y=1:1,1:0)
;
TMPLOG ; Reset ^TMP("TMPLOG") data created in ERRRPT to ^TMP("TLOG") format
; expected by the browser. (See DISPLAY^HLCSRPT)
; [This subroutine created by HL*1.6*85.]
N HLCSLN,PROCDT,IEN773
S HLCSLN=0,PROCDT="zzzzz"
F S PROCDT=$O(^TMP("TMPLOG",$J,PROCDT),-1) Q:PROCDT']"" D
. S IEN773=":"
. F S IEN773=$O(^TMP("TMPLOG",$J,PROCDT,IEN773),-1) Q:IEN773'>0 D
. . S HLCSLN=HLCSLN+1
. . S ^TMP("TLOG",$J,+HLCSLN)=$G(^TMP("TMPLOG",$J,PROCDT,IEN773))
KILL ^TMP("TMPLOG",$J)
QUIT
;
OKDATE(IEN773,DTBEG,DTEND) ; Does 773 processing time fall in date range? ;HL*1.6*85
N PROCDT
;
; Check what's passed in...
QUIT:'$D(^HLMA(+IEN773,0)) "" ;->
QUIT:$G(DTBEG)'?7N.E "" ;->
QUIT:$G(DTEND)'?7N.E "" ;->
;
; Get processing date/time...
S PROCDT=$$PROCDT(IEN773) QUIT:PROCDT'?7N.E "" ;->
;
; Compare dates...
I PROCDT=DTBEG!(PROCDT=DTEND) QUIT 1 ;->
QUIT:PROCDT<DTBEG "" ;->
QUIT:PROCDT>DTEND "" ;->
;
QUIT 1
;
PROCDT(IEN773) ; Return 773'S processing date (1st), or if not available
; return the 772 creation date/time. ;HL*1.6*85
N PROCDT
S PROCDT=$P($G(^HLMA(+IEN773,"S")),U) QUIT:PROCDT?7N.E PROCDT ;->
QUIT $P($G(^HL(772,+$G(^HLMA(+IEN773,0)),0)),U)
;
DTORTM(DTB,DTE,PDT) ; Show date or time?
QUIT $S($E(DTB,1,7)=$E(DTE,1,7):$$TM(PDT),1:$$DT(PDT))
;
TM(PDT) ; Show the 5 character hh:mm time
QUIT $E($P($$FMTE^XLFDT(+PDT),"@",2),1,5)
;
DT(PDT) ; Show the 8 character mm/dd/yy date
QUIT $E(PDT,4,5)_"/"_$E(PDT,6,7)_"/"_$E(PDT,2,3)
;
TYPEINFO() ; Display error type or application information?
N DIR,DIRUT,DTOUT,DUOUT,X,Y
W !!,"Select the report view now. There are two report views. Both list the "
W !,"internal entry number from the HL7 Message Administration file (#773) entry,"
W !,"message ID, processing date or time, and logical link. The two report views"
W !,"differ in the remainder of the information displayed on the report. "
S DIR(0)="S^1:Display message, event, & application data;2:Display error type"
S DIR("A")="Select data to display",DIR("B")=1
S DIR("?",1)="Select the data to be displayed in the last few columns of the report after"
S DIR("?")="the IEN, message ID, processing date or time, and logical link."
D ^DIR
QUIT $S(Y>0:+Y,1:"")
;
EOR ;HLCSRPT4 - Error Listing code ;3/18/02 10:19
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLCSRPT4 8153 printed Oct 16, 2024@17:57:48 Page 2
HLCSRPT4 ;OIFO-O/LJA - Error Listing code ;3/18/02 10:19
+1 ;;1.6;HEALTH LEVEL SEVEN;**85**;Oct 13, 1995
+2 ;
+3 ; Patch HL*1.6*85 created a significant amount of code; enough
+4 ; that this routine had to be created to hold it.
+5 ;
LOADERR ; Find latest NUMERR statuses in ERRDTB->ERRDTE date range. ;HL*1.6*85
+1 ;ERRDTB,ERRDTE,HLCSER,HLCSTER1,NUMERR -- req
+2 ;
+3 NEW CT,ERR,ERR4,IEN,TIME
+4 ;
+5 KILL ^TMP("HLERR",$JOB),^TMP("ERRLST",$JOB)
+6 ;
+7 SET HLERR=3.9
SET CT=0
+8 FOR
SET HLERR=$ORDER(^HLMA("AG",HLERR))
if HLERR'>0!(HLERR>7)
QUIT
Begin DoDot:1
+9 SET IEN773=0
+10 FOR
SET IEN773=$ORDER(^HLMA("AG",HLERR,IEN773))
if IEN773'>0
QUIT
Begin DoDot:2
+11 ;->
SET ERR4=$PIECE($GET(^HLMA(+IEN773,"P")),U,4)
if ERR4'>0
QUIT
+12 DO CHKERR(ERR4,IEN773,ERRDTB,ERRDTE)
+13 SET CT=CT+1
if '(CT#1000)
WRITE "."
End DoDot:2
End DoDot:1
+14 ;
+15 SET ERR=0
+16 FOR
SET ERR=$ORDER(^TMP("HLERR",$JOB,ERR))
if ERR'>0
QUIT
Begin DoDot:1
+17 SET TIME=0
+18 FOR
SET TIME=$ORDER(^TMP("HLERR",$JOB,ERR,TIME))
if TIME'>0
QUIT
Begin DoDot:2
+19 SET IEN=0
+20 FOR
SET IEN=$ORDER(^TMP("HLERR",$JOB,ERR,TIME,IEN))
if IEN'>0
QUIT
Begin DoDot:3
+21 SET ^TMP("ERRLST",$JOB,+ERR,+IEN)=""
End DoDot:3
End DoDot:2
End DoDot:1
+22 ;
+23 KILL ^TMP("HLERR",$JOB)
+24 ;
+25 QUIT
+26 ;
CHKERR(ERR4,IEN773,DTB,DTE) ; Should this entry be included? ;HL*1.6*85
+1 ;NUMERR -- req
+2 ;
+3 NEW ERRNO,OLD773,OLDPDT,PROCDT
+4 ;
+5 ; Processing date/time check...
+6 ;->
SET PROCDT=$$PROCDT(IEN773)
if PROCDT'>0
QUIT
+7 ;->
IF PROCDT<DTB!(PROCDT>DTE)
QUIT
+8 ; OK. Date check passes. But, is it among NUMERR latest?
+9 ;
+10 ; How many errors recorded for error status?
+11 SET ERRNO=$GET(^TMP("HLERR",$JOB,ERR4))
+12 ;
+13 ; Number of errors recorded less than # maximum per status...
+14 ;->
IF ERRNO<NUMERR
DO RECERR(ERR4,IEN773)
QUIT
+15 ;
+16 ; Find oldest entry's process date/time & last 773 IEN...
+17 ;->
SET OLDPDT=$ORDER(^TMP("HLERR",$JOB,ERR4,0))
if OLDPDT'>0
QUIT
+18 ;->
SET OLD773=$ORDER(^TMP("HLERR",$JOB,ERR4,+OLDPDT,0))
if OLD773'>0
QUIT
+19 ;
+20 ; Now see if "this" error is newer...
+21 ;->
if PROCDT<OLDPDT
QUIT
+22 ;->
IF PROCDT=OLDPDT
IF IEN773<OLD773
QUIT
+23 ;
+24 ; Max number errors reached, but this error is newer than newest...
+25 ;
+26 ; Zilch oldest entry, then record "this" error...
+27 DO KILLERR(ERR4,OLDPDT,OLD773)
+28 DO RECERR(ERR4,IEN773)
+29 ;
+30 QUIT
+31 ;
KILLERR(ERR4,OLDPDT,OLD773) ; Remove entry and adjust counts... ;HL*1.6*85
+1 NEW NUM
+2 ;
+3 KILL ^TMP("HLERR",$JOB,ERR4,OLDPDT,OLD773)
+4 ;
+5 IF $ORDER(^TMP("HLERR",$JOB,ERR4,OLDPDT,0))'>0
Begin DoDot:1
+6 KILL ^TMP("HLERR",$JOB,ERR4,OLDPDT)
End DoDot:1
+7 IF $ORDER(^TMP("HLERR",$JOB,ERR4,OLDPDT,0))>0
Begin DoDot:1
+8 SET NUM=$GET(^TMP("HLERR",$JOB,ERR4,OLDPDT))-1
SET NUM=$SELECT(NUM'<0:+NUM,1:0)
+9 SET ^TMP("HLERR",$JOB,ERR4,OLDPDT)=NUM
End DoDot:1
+10 ;
+11 IF $ORDER(^TMP("HLERR",$JOB,ERR4,0))'>0
Begin DoDot:1
+12 KILL ^TMP("HLERR",$JOB,ERR4)
End DoDot:1
+13 IF $ORDER(^TMP("HLERR",$JOB,ERR4,0))>0
Begin DoDot:1
+14 SET NUM=$GET(^TMP("HLERR",$JOB,ERR4))-1
SET NUM=$SELECT(NUM'<0:+NUM,1:0)
+15 SET ^TMP("HLERR",$JOB,ERR4)=NUM
End DoDot:1
+16 ;
+17 IF $ORDER(^TMP("HLERR",$JOB,0))'>0
Begin DoDot:1
+18 KILL ^TMP("HLERR",$JOB)
End DoDot:1
+19 IF $ORDER(^TMP("HLERR",$JOB,0))>0
Begin DoDot:1
+20 SET NUM=$GET(^TMP("HLERR",$JOB))-1
SET NUM=$SELECT(NUM'<0:+NUM,1:0)
+21 SET ^TMP("HLERR",$JOB)=NUM
End DoDot:1
+22 ;
+23 QUIT
+24 ;
RECERR(ERR4,IEN773) ; Store error in ^TMP("HLERR",$J,STATUS,IEN773) ;HL*1.6*85
+1 SET ^TMP("HLERR",$JOB,ERR4)=$GET(^TMP("HLERR",$JOB,ERR4))+1
+2 SET ^TMP("HLERR",$JOB,ERR4,PROCDT)=$GET(^TMP("HLERR",$JOB,ERR4,PROCDT))+1
+3 SET ^TMP("HLERR",$JOB,ERR4,PROCDT,IEN773)=""
+4 QUIT
+5 ;
SETUP() ; Setup "limit" variables... ;HL*1.6*85
+1 ;->
SET TYPEINFO=$$TYPEINFO
if TYPEINFO']""
QUIT ""
+2 ;
+3 SET (ERRDTB,ERRDTE,NUMERR)=""
+4 WRITE !!," If you answer NO below, you will be allowed to specify the number of"
+5 WRITE !," errors to be included in the report."
+6 WRITE !
+7 ;->
SET NUMERR=$$YN("Print all errors","No")
if NUMERR']""
QUIT ""
+8 ;->
SET NUMERR=$SELECT(NUMERR=1:9999999,1:$$NUMERR)
if NUMERR'>0
QUIT ""
+9 IF NUMERR=9999999
Begin DoDot:1
+10 WRITE !!," All errors in the date range you specify next will be included"
+11 WRITE !," in the report."
End DoDot:1
+12 IF NUMERR'=9999999
Begin DoDot:1
+13 WRITE !!," The newest ",NUMERR," errors, for every error status, in the date range you"
+14 WRITE !," specify next will be included in the report."
End DoDot:1
+15 WRITE !!,"The first entry at your site is from ",$$FMTE^XLFDT($ORDER(^HL(772,"B",2840000))),"."
+16 WRITE !
S1 ;->
SET ERRDTB=$$DATE("Enter START DATE/TIME",,$$FMADD^XLFDT($$DT^XLFDT,-90))
if ERRDTB'>0
QUIT ""
+1 WRITE !
+2 ;->
SET ERRDTE=$$DATE("Enter END DATE/TIME",ERRDTB,"NOW")
if ERRDTE'>0
QUIT ""
+3 ;->
IF ERRDTB=ERRDTE
Begin DoDot:1
+4 WRITE !!,"You cannot enter the same values for the beginning and ending times!"
+5 WRITE !
End DoDot:1
GOTO S1
+6 QUIT 1
+7 ;
NUMERR() ; How many errors, maximum, does user want to see ;HL*1.6*85
+1 ; HLCSER -- req
+2 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+3 WRITE !!,"Enter the maximum number errors to report for every error status."
+4 WRITE !
+5 SET DIR(0)="N"
SET DIR("A")="Enter maximum number errors/status"
+6 SET DIR("B")=999
+7 SET DIR("?",1)="If you enter '1000' for the maximum number errors/status..."
+8 SET DIR("?",2)=""
+9 IF HLCSER="ALL"
Begin DoDot:1
+10 SET DIR("?",3)="... The most recent 1000 errors for every error type will be included in the"
+11 SET DIR("?",4)="... report. If two different error types exist, and each error type has"
+12 SET DIR("?",5)="... more than 1000 entries, then 2000 errors will be reported."
+13 SET DIR("?")="... (I.e., 1000 errors per error type.)"
End DoDot:1
+14 IF HLCSER'="ALL"
Begin DoDot:1
+15 SET DIR("?",3)="... The most recent 1000 errors for the error type you just selected"
+16 SET DIR("?")="... will be included in the report."
End DoDot:1
+17 DO ^DIR
+18 QUIT $SELECT(Y>0:+Y,1:"")
+19 ;
DATE(PMT,BDT,PDT) ; Entry of date for looping ;HL*1.6*85
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 SET BDT=$SELECT($GET(BDT)?7N.E:BDT,1:"")
+3 SET DIR(0)="DA^"_$GET(BDT)_"::ET"
+4 IF $GET(BDT)>0
Begin DoDot:1
+5 NEW TXT
+6 SET TXT="Enter a date/time after "_$$FMTE^XLFDT(BDT)_"..."
+7 SET DIR("?")=TXT
End DoDot:1
+8 SET DIR("A")=PMT_": "
+9 IF $GET(PDT)?7N.E
SET DIR("B")=$PIECE($$FMTE^XLFDT(PDT),":",1,2)
+10 IF $GET(PDT)="NOW"
SET DIR("B")="NOW"
+11 DO ^DIR
+12 ;->
IF Y?7N.E
IF $GET(PMT)="NOW"
IF $GET(PDT)="NOW"
QUIT 9999999.24
+13 QUIT $SELECT(Y>0:+Y,1:"")
+14 ;
YN(PMT,DEF,FF) ; Generic YES/NO DIR call... ;HL*1.6*85
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 FOR X=1:1:$GET(FF)
WRITE !
+3 SET DIR(0)="Y"
SET DIR("A")=PMT
+4 if $GET(DEF)]""
SET DIR("B")=DEF
+5 DO ^DIR
+6 ;->
if $DATA(DIRUT)!($DATA(DTOUT))!($DATA(DUOUT))
QUIT ""
+7 QUIT $SELECT(Y=1:1,1:0)
+8 ;
TMPLOG ; Reset ^TMP("TMPLOG") data created in ERRRPT to ^TMP("TLOG") format
+1 ; expected by the browser. (See DISPLAY^HLCSRPT)
+2 ; [This subroutine created by HL*1.6*85.]
+3 NEW HLCSLN,PROCDT,IEN773
+4 SET HLCSLN=0
SET PROCDT="zzzzz"
+5 FOR
SET PROCDT=$ORDER(^TMP("TMPLOG",$JOB,PROCDT),-1)
if PROCDT']""
QUIT
Begin DoDot:1
+6 SET IEN773=":"
+7 FOR
SET IEN773=$ORDER(^TMP("TMPLOG",$JOB,PROCDT,IEN773),-1)
if IEN773'>0
QUIT
Begin DoDot:2
+8 SET HLCSLN=HLCSLN+1
+9 SET ^TMP("TLOG",$JOB,+HLCSLN)=$GET(^TMP("TMPLOG",$JOB,PROCDT,IEN773))
End DoDot:2
End DoDot:1
+10 KILL ^TMP("TMPLOG",$JOB)
+11 QUIT
+12 ;
OKDATE(IEN773,DTBEG,DTEND) ; Does 773 processing time fall in date range? ;HL*1.6*85
+1 NEW PROCDT
+2 ;
+3 ; Check what's passed in...
+4 ;->
if '$DATA(^HLMA(+IEN773,0))
QUIT ""
+5 ;->
if $GET(DTBEG)'?7N.E
QUIT ""
+6 ;->
if $GET(DTEND)'?7N.E
QUIT ""
+7 ;
+8 ; Get processing date/time...
+9 ;->
SET PROCDT=$$PROCDT(IEN773)
if PROCDT'?7N.E
QUIT ""
+10 ;
+11 ; Compare dates...
+12 ;->
IF PROCDT=DTBEG!(PROCDT=DTEND)
QUIT 1
+13 ;->
if PROCDT<DTBEG
QUIT ""
+14 ;->
if PROCDT>DTEND
QUIT ""
+15 ;
+16 QUIT 1
+17 ;
PROCDT(IEN773) ; Return 773'S processing date (1st), or if not available
+1 ; return the 772 creation date/time. ;HL*1.6*85
+2 NEW PROCDT
+3 ;->
SET PROCDT=$PIECE($GET(^HLMA(+IEN773,"S")),U)
if PROCDT?7N.E
QUIT PROCDT
+4 QUIT $PIECE($GET(^HL(772,+$GET(^HLMA(+IEN773,0)),0)),U)
+5 ;
DTORTM(DTB,DTE,PDT) ; Show date or time?
+1 QUIT $SELECT($EXTRACT(DTB,1,7)=$EXTRACT(DTE,1,7):$$TM(PDT),1:$$DT(PDT))
+2 ;
TM(PDT) ; Show the 5 character hh:mm time
+1 QUIT $EXTRACT($PIECE($$FMTE^XLFDT(+PDT),"@",2),1,5)
+2 ;
DT(PDT) ; Show the 8 character mm/dd/yy date
+1 QUIT $EXTRACT(PDT,4,5)_"/"_$EXTRACT(PDT,6,7)_"/"_$EXTRACT(PDT,2,3)
+2 ;
TYPEINFO() ; Display error type or application information?
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 WRITE !!,"Select the report view now. There are two report views. Both list the "
+3 WRITE !,"internal entry number from the HL7 Message Administration file (#773) entry,"
+4 WRITE !,"message ID, processing date or time, and logical link. The two report views"
+5 WRITE !,"differ in the remainder of the information displayed on the report. "
+6 SET DIR(0)="S^1:Display message, event, & application data;2:Display error type"
+7 SET DIR("A")="Select data to display"
SET DIR("B")=1
+8 SET DIR("?",1)="Select the data to be displayed in the last few columns of the report after"
+9 SET DIR("?")="the IEN, message ID, processing date or time, and logical link."
+10 DO ^DIR
+11 QUIT $SELECT(Y>0:+Y,1:"")
+12 ;
EOR ;HLCSRPT4 - Error Listing code ;3/18/02 10:19