DGPFHLL ;ALB/RPM - PRF HL7 TRANSMISSION LOG API'S ; 3/6/03
;;5.3;Registration;**425,650,1015**;Aug 13, 1993;Build 21
;
Q
;
GETLOG(DGLIEN,DGPFL) ;retrieve a transmission log record
;
; Input:
; DGLIEN - IEN for PRF HL7 TRANSMISSION LOG (#26.17) file
;
; Output:
; Function value - 1 on success, 0 on failure
; DGPFL - array of transmission data fields
; Subscript Field#
; ---------- ------
; "MSGID" .01
; "ASGNHIST" .02
; "TRANSDT" .03
; "MSGSTAT" .04
; "SITE" .05
; "ACKDT" .06
; "ERROR",n .07
;
N DGIENS ;IEN string
N DGFLDS ;results array
N DGECNT ;error counter
N DGERR ;error arrary
N DGRSLT ;function value
;
S DGRSLT=0
I $G(DGLIEN)>0,$D(^DGPF(26.17,DGLIEN)) D
. S DGIENS=DGLIEN_","
. D GETS^DIQ(26.17,DGIENS,"**","IEZ","DGFLDS","DGERR")
. Q:$D(DGERR)
. S DGRSLT=1
. S DGPFL("MSGID")=$G(DGFLDS(26.17,DGIENS,.01,"I"))_U_$G(DGFLDS(26.17,DGIENS,.01,"E"))
. S DGPFL("ASGNHIST")=$G(DGFLDS(26.17,DGIENS,.02,"I"))_U_$G(DGFLDS(26.17,DGIENS,.02,"E"))
. S DGPFL("TRANSDT")=$G(DGFLDS(26.17,DGIENS,.03,"I"))_U_$G(DGFLDS(26.17,DGIENS,.03,"E"))
. S DGPFL("MSGSTAT")=$G(DGFLDS(26.17,DGIENS,.04,"I"))_U_$G(DGFLDS(26.17,DGIENS,.04,"E"))
. S DGPFL("SITE")=$G(DGFLDS(26.17,DGIENS,.05,"I"))_U_$G(DGFLDS(26.17,DGIENS,.05,"E"))
. S DGPFL("ACKDT")=$G(DGFLDS(26.17,DGIENS,.06,"I"))_U_$G(DGFLDS(26.17,DGIENS,.06,"E"))
. ;
. ;build error code array
. S DGIENS="",DGECNT=0
. F S DGIENS=$O(DGFLDS(26.1707,DGIENS)) Q:DGIENS="" D:$G(DGFLDS(26.1707,DGIENS,.01,"E"))]""
. . S DGECNT=DGECNT+1
. . S DGPFL("ERROR",DGECNT)=DGFLDS(26.1707,DGIENS,.01,"E")
;
Q DGRSLT
;
GETQLOG(DGLIEN,DGPFL) ;retrieve a query log record
;
; Input:
; DGLIEN - IEN for PRF HL7 QUERY LOG (#26.19) file
;
; Output:
; Function value - 1 on success, 0 on failure
; DGPFL - array of transmission data fields
; Subscript Field#
; --------- ------
; "MSGID" .01
; "EVNT" .02
; "TRANSDT" .03
; "MSGSTAT" .04
; "SITE" .05
; "ACKDT" .06
; "ERROR",n .07
;
N DGIENS ;IEN string
N DGFLDS ;results array
N DGECNT ;error counter
N DGERR ;error arrary
N DGRSLT ;function value
;
S DGRSLT=0
I $G(DGLIEN)>0,$D(^DGPF(26.19,DGLIEN)) D
. S DGIENS=DGLIEN_","
. D GETS^DIQ(26.19,DGIENS,"**","IEZ","DGFLDS","DGERR")
. Q:$D(DGERR)
. S DGRSLT=1
. S DGPFL("MSGID")=$G(DGFLDS(26.19,DGIENS,.01,"I"))_U_$G(DGFLDS(26.19,DGIENS,.01,"E"))
. S DGPFL("EVNT")=$G(DGFLDS(26.19,DGIENS,.02,"I"))_U_$G(DGFLDS(26.19,DGIENS,.02,"E"))
. S DGPFL("TRANSDT")=$G(DGFLDS(26.19,DGIENS,.03,"I"))_U_$G(DGFLDS(26.19,DGIENS,.03,"E"))
. S DGPFL("MSGSTAT")=$G(DGFLDS(26.19,DGIENS,.04,"I"))_U_$G(DGFLDS(26.19,DGIENS,.04,"E"))
. S DGPFL("SITE")=$G(DGFLDS(26.19,DGIENS,.05,"I"))_U_$G(DGFLDS(26.19,DGIENS,.05,"E"))
. S DGPFL("ACKDT")=$G(DGFLDS(26.19,DGIENS,.06,"I"))_U_$G(DGFLDS(26.19,DGIENS,.06,"E"))
. ;
. ;build error code array
. S DGIENS="",DGECNT=0
. F S DGIENS=$O(DGFLDS(26.1907,DGIENS)) Q:DGIENS="" D:$G(DGFLDS(26.1907,DGIENS,.01,"E"))]""
. . S DGECNT=DGECNT+1
. . S DGPFL("ERROR",DGECNT)=DGFLDS(26.1907,DGIENS,.01,"E")
;
Q DGRSLT
;
FNDLOG(DGFILE,DGMSGID) ;find and return the record number from a given HL7
; LOG file for a given HL7 Message ID
;
; Input:
; DGFILE - file number of HL7 log file
; DGMSGID - HL7 Message ID
;
; Output:
; Function value - IEN of HL7 LOG file on success, 0 on failure
;
N DGIEN ;function value
;
I +$G(DGFILE),+$G(DGMSGID) D
. S DGIEN=$O(^DGPF(DGFILE,"B",DGMSGID,0))
Q $S($G(DGIEN)>0:DGIEN,1:0)
;
STOXMIT(DGHIEN,DGMSGID,DGINST,DGERR) ;store the transmission log data
;
; Input:
; DGHIEN - pointer to PRF ASSIGNMENT HISTORY (#26.14) file
; DGMSGID - message ID from VistA HL7
; DGINST - pointer to the INSTITUTION (#4) file
;
; Output:
; DGERR - undefined on success, error message on failure
;
N DGFDA ;fda array
N DGFDAIEN ;UPDATE^DIE ien result
;
I +$G(DGHIEN),$D(^DGPF(26.14,DGHIEN)),$D(DGMSGID),+$G(DGINST),$D(^DIC(4,DGINST)) D
. Q:$$FNDLOG^DGPFHLL(26.17,DGMSGID)
. S DGFDA(26.17,"+1,",.01)=DGMSGID
. S DGFDA(26.17,"+1,",.02)=DGHIEN
. S DGFDA(26.17,"+1,",.03)=$$NOW^XLFDT()
. S DGFDA(26.17,"+1,",.04)="T"
. S DGFDA(26.17,"+1,",.05)=DGINST
. D UPDATE^DIE("","DGFDA","DGFDAIEN","DGERR")
Q
;
STOQXMIT(DGEVNT,DGMSGID,DGINST,DGERR) ;store the query log data
;
; Input:
; DGEVNT - pointer to PRF event in PRF HL7 EVENT (#26.21) file
; DGMSGID - message ID from VistA HL7
; DGINST - pointer to the INSTITUTION (#4) file
;
; Output:
; DGERR - undefined on success, error message on failure
;
N DGFDA ;fda array
N DGFDAIEN ;UPDATE^DIE ien result
;
I +$G(DGEVNT),$D(DGMSGID),+$G(DGINST),$D(^DIC(4,DGINST)) D
. Q:$$FNDLOG^DGPFHLL(26.19,DGMSGID)
. S DGFDA(26.19,"+1,",.01)=DGMSGID
. S DGFDA(26.19,"+1,",.02)=DGEVNT
. S DGFDA(26.19,"+1,",.03)=$$NOW^XLFDT()
. S DGFDA(26.19,"+1,",.04)="T"
. S DGFDA(26.19,"+1,",.05)=DGINST
. D UPDATE^DIE("","DGFDA","DGFDAIEN","DGERR")
Q
;
STOSTAT(DGFILE,DGLIEN,DGSTAT,DGEARR) ;update the HL7 transmission status
;
; Input:
; DGFILE - file number of HL7 LOG file
; DGLIEN - IEN of selected HL7 LOG file
; DGSTAT - internal Status value
; DGEARR - (optional) array of error message codes
; format: DGEARR(n)=error code
;
; Output:
; none
;
N DGERR ;filer errors
N DGFDA ;fda array
N DGI ;generic index
N DGLIENS ;iens string
;
I $G(DGFILE)]"",+$G(DGLIEN),$D(^DGPF(DGFILE,DGLIEN)),$G(DGSTAT)]"" D
. Q:'$$TESTVAL^DGPFUT(DGFILE,.04,DGSTAT)
. S DGLIENS=DGLIEN_","
. S DGFDA(DGFILE,DGLIENS,.04)=DGSTAT
. S DGFDA(DGFILE,DGLIENS,.06)=$$NOW^XLFDT()
. S DGI=0
. F S DGI=$O(DGEARR(DGI)) Q:'DGI I DGEARR(DGI)]"" D
. . S DGFDA(DGFILE_"07","+"_DGI_","_DGLIEN_",",.01)=DGEARR(DGI)
. D UPDATE^DIE("","DGFDA","","DGERR")
Q
;
GETLSQ(DGEVNT) ;get last site queried
;
; Input:
; DGEVNT - pointer to PRF HL7 EVENT (#26.21) file
;
; Output:
; Function value - last site queried as pointer to INSTITUTION (#4)
; file on success; 0 on failure
;
N DGARR ;array of query sites sorted by date
N DGLIEN ;pointer to PRF HL7 QUERY LOG (#26.19)
N DGLOG ;query log data array
;
S DGLIEN=0
S DGEVNT=+$G(DGEVNT)
F S DGLIEN=$O(^DGPF(26.19,"C",DGEVNT,DGLIEN)) Q:'DGLIEN D
. K DGLOG
. Q:'$$GETQLOG(DGLIEN,.DGLOG)
. I +$G(DGLOG("TRANSDT"))>0,+$G(DGLOG("SITE"))>0 S DGARR(+$G(DGLOG("TRANSDT")))=+$G(DGLOG("SITE"))
Q +$G(DGARR(+$O(DGARR(""),-1)))
;
PRGQLOG(DGEVNT) ;purge PRF Query Log entries
;This procedure purges non-Accepted entries in the PRF HL7 QUERY LOG
;(#26.19) file for a given PRF HL7 EVENT.
;
; Input:
; DGEVNT - pointer to PRF HL7 EVENT (#26.21) file
;
; Output: none
;
N DGERR ;FM error array
N DGFDA ;FM FDA array
N DGLIEN ;PRF HL7 QUERY LOG (#26.19) file IEN
N DGSTAT ;transmission status
;
S DGEVNT=+$G(DGEVNT)
S DGLIEN=0
;
F S DGLIEN=$O(^DGPF(26.19,"C",DGEVNT,DGLIEN)) Q:'DGLIEN D
. K DGFDA,DGERR
. S DGSTAT=$$GET1^DIQ(26.19,DGLIEN_",",.04,"I","","DGERR")
. ;
. Q:$E(DGSTAT)="A" ;don't purge "A" or "AN" status entries
. ;
. S DGFDA(26.19,DGLIEN_",",.01)="@"
. D FILE^DIE("","DGFDA","DGERR")
;
Q
DGPFHLL ;ALB/RPM - PRF HL7 TRANSMISSION LOG API'S ; 3/6/03
+1 ;;5.3;Registration;**425,650,1015**;Aug 13, 1993;Build 21
+2 ;
+3 QUIT
+4 ;
GETLOG(DGLIEN,DGPFL) ;retrieve a transmission log record
+1 ;
+2 ; Input:
+3 ; DGLIEN - IEN for PRF HL7 TRANSMISSION LOG (#26.17) file
+4 ;
+5 ; Output:
+6 ; Function value - 1 on success, 0 on failure
+7 ; DGPFL - array of transmission data fields
+8 ; Subscript Field#
+9 ; ---------- ------
+10 ; "MSGID" .01
+11 ; "ASGNHIST" .02
+12 ; "TRANSDT" .03
+13 ; "MSGSTAT" .04
+14 ; "SITE" .05
+15 ; "ACKDT" .06
+16 ; "ERROR",n .07
+17 ;
+18 ;IEN string
NEW DGIENS
+19 ;results array
NEW DGFLDS
+20 ;error counter
NEW DGECNT
+21 ;error arrary
NEW DGERR
+22 ;function value
NEW DGRSLT
+23 ;
+24 SET DGRSLT=0
+25 IF $GET(DGLIEN)>0
IF $DATA(^DGPF(26.17,DGLIEN))
Begin DoDot:1
+26 SET DGIENS=DGLIEN_","
+27 DO GETS^DIQ(26.17,DGIENS,"**","IEZ","DGFLDS","DGERR")
+28 IF $DATA(DGERR)
QUIT
+29 SET DGRSLT=1
+30 SET DGPFL("MSGID")=$GET(DGFLDS(26.17,DGIENS,.01,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.01,"E"))
+31 SET DGPFL("ASGNHIST")=$GET(DGFLDS(26.17,DGIENS,.02,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.02,"E"))
+32 SET DGPFL("TRANSDT")=$GET(DGFLDS(26.17,DGIENS,.03,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.03,"E"))
+33 SET DGPFL("MSGSTAT")=$GET(DGFLDS(26.17,DGIENS,.04,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.04,"E"))
+34 SET DGPFL("SITE")=$GET(DGFLDS(26.17,DGIENS,.05,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.05,"E"))
+35 SET DGPFL("ACKDT")=$GET(DGFLDS(26.17,DGIENS,.06,"I"))_U_$GET(DGFLDS(26.17,DGIENS,.06,"E"))
+36 ;
+37 ;build error code array
+38 SET DGIENS=""
SET DGECNT=0
+39 FOR
SET DGIENS=$ORDER(DGFLDS(26.1707,DGIENS))
IF DGIENS=""
QUIT
IF $GET(DGFLDS(26.1707,DGIENS,.01,"E"))]""
Begin DoDot:2
+40 SET DGECNT=DGECNT+1
+41 SET DGPFL("ERROR",DGECNT)=DGFLDS(26.1707,DGIENS,.01,"E")
End DoDot:2
End DoDot:1
+42 ;
+43 QUIT DGRSLT
+44 ;
GETQLOG(DGLIEN,DGPFL) ;retrieve a query log record
+1 ;
+2 ; Input:
+3 ; DGLIEN - IEN for PRF HL7 QUERY LOG (#26.19) file
+4 ;
+5 ; Output:
+6 ; Function value - 1 on success, 0 on failure
+7 ; DGPFL - array of transmission data fields
+8 ; Subscript Field#
+9 ; --------- ------
+10 ; "MSGID" .01
+11 ; "EVNT" .02
+12 ; "TRANSDT" .03
+13 ; "MSGSTAT" .04
+14 ; "SITE" .05
+15 ; "ACKDT" .06
+16 ; "ERROR",n .07
+17 ;
+18 ;IEN string
NEW DGIENS
+19 ;results array
NEW DGFLDS
+20 ;error counter
NEW DGECNT
+21 ;error arrary
NEW DGERR
+22 ;function value
NEW DGRSLT
+23 ;
+24 SET DGRSLT=0
+25 IF $GET(DGLIEN)>0
IF $DATA(^DGPF(26.19,DGLIEN))
Begin DoDot:1
+26 SET DGIENS=DGLIEN_","
+27 DO GETS^DIQ(26.19,DGIENS,"**","IEZ","DGFLDS","DGERR")
+28 IF $DATA(DGERR)
QUIT
+29 SET DGRSLT=1
+30 SET DGPFL("MSGID")=$GET(DGFLDS(26.19,DGIENS,.01,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.01,"E"))
+31 SET DGPFL("EVNT")=$GET(DGFLDS(26.19,DGIENS,.02,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.02,"E"))
+32 SET DGPFL("TRANSDT")=$GET(DGFLDS(26.19,DGIENS,.03,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.03,"E"))
+33 SET DGPFL("MSGSTAT")=$GET(DGFLDS(26.19,DGIENS,.04,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.04,"E"))
+34 SET DGPFL("SITE")=$GET(DGFLDS(26.19,DGIENS,.05,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.05,"E"))
+35 SET DGPFL("ACKDT")=$GET(DGFLDS(26.19,DGIENS,.06,"I"))_U_$GET(DGFLDS(26.19,DGIENS,.06,"E"))
+36 ;
+37 ;build error code array
+38 SET DGIENS=""
SET DGECNT=0
+39 FOR
SET DGIENS=$ORDER(DGFLDS(26.1907,DGIENS))
IF DGIENS=""
QUIT
IF $GET(DGFLDS(26.1907,DGIENS,.01,"E"))]""
Begin DoDot:2
+40 SET DGECNT=DGECNT+1
+41 SET DGPFL("ERROR",DGECNT)=DGFLDS(26.1907,DGIENS,.01,"E")
End DoDot:2
End DoDot:1
+42 ;
+43 QUIT DGRSLT
+44 ;
FNDLOG(DGFILE,DGMSGID) ;find and return the record number from a given HL7
+1 ; LOG file for a given HL7 Message ID
+2 ;
+3 ; Input:
+4 ; DGFILE - file number of HL7 log file
+5 ; DGMSGID - HL7 Message ID
+6 ;
+7 ; Output:
+8 ; Function value - IEN of HL7 LOG file on success, 0 on failure
+9 ;
+10 ;function value
NEW DGIEN
+11 ;
+12 IF +$GET(DGFILE)
IF +$GET(DGMSGID)
Begin DoDot:1
+13 SET DGIEN=$ORDER(^DGPF(DGFILE,"B",DGMSGID,0))
End DoDot:1
+14 QUIT $SELECT($GET(DGIEN)>0:DGIEN,1:0)
+15 ;
STOXMIT(DGHIEN,DGMSGID,DGINST,DGERR) ;store the transmission log data
+1 ;
+2 ; Input:
+3 ; DGHIEN - pointer to PRF ASSIGNMENT HISTORY (#26.14) file
+4 ; DGMSGID - message ID from VistA HL7
+5 ; DGINST - pointer to the INSTITUTION (#4) file
+6 ;
+7 ; Output:
+8 ; DGERR - undefined on success, error message on failure
+9 ;
+10 ;fda array
NEW DGFDA
+11 ;UPDATE^DIE ien result
NEW DGFDAIEN
+12 ;
+13 IF +$GET(DGHIEN)
IF $DATA(^DGPF(26.14,DGHIEN))
IF $DATA(DGMSGID)
IF +$GET(DGINST)
IF $DATA(^DIC(4,DGINST))
Begin DoDot:1
+14 IF $$FNDLOG^DGPFHLL(26.17,DGMSGID)
QUIT
+15 SET DGFDA(26.17,"+1,",.01)=DGMSGID
+16 SET DGFDA(26.17,"+1,",.02)=DGHIEN
+17 SET DGFDA(26.17,"+1,",.03)=$$NOW^XLFDT()
+18 SET DGFDA(26.17,"+1,",.04)="T"
+19 SET DGFDA(26.17,"+1,",.05)=DGINST
+20 DO UPDATE^DIE("","DGFDA","DGFDAIEN","DGERR")
End DoDot:1
+21 QUIT
+22 ;
STOQXMIT(DGEVNT,DGMSGID,DGINST,DGERR) ;store the query log data
+1 ;
+2 ; Input:
+3 ; DGEVNT - pointer to PRF event in PRF HL7 EVENT (#26.21) file
+4 ; DGMSGID - message ID from VistA HL7
+5 ; DGINST - pointer to the INSTITUTION (#4) file
+6 ;
+7 ; Output:
+8 ; DGERR - undefined on success, error message on failure
+9 ;
+10 ;fda array
NEW DGFDA
+11 ;UPDATE^DIE ien result
NEW DGFDAIEN
+12 ;
+13 IF +$GET(DGEVNT)
IF $DATA(DGMSGID)
IF +$GET(DGINST)
IF $DATA(^DIC(4,DGINST))
Begin DoDot:1
+14 IF $$FNDLOG^DGPFHLL(26.19,DGMSGID)
QUIT
+15 SET DGFDA(26.19,"+1,",.01)=DGMSGID
+16 SET DGFDA(26.19,"+1,",.02)=DGEVNT
+17 SET DGFDA(26.19,"+1,",.03)=$$NOW^XLFDT()
+18 SET DGFDA(26.19,"+1,",.04)="T"
+19 SET DGFDA(26.19,"+1,",.05)=DGINST
+20 DO UPDATE^DIE("","DGFDA","DGFDAIEN","DGERR")
End DoDot:1
+21 QUIT
+22 ;
STOSTAT(DGFILE,DGLIEN,DGSTAT,DGEARR) ;update the HL7 transmission status
+1 ;
+2 ; Input:
+3 ; DGFILE - file number of HL7 LOG file
+4 ; DGLIEN - IEN of selected HL7 LOG file
+5 ; DGSTAT - internal Status value
+6 ; DGEARR - (optional) array of error message codes
+7 ; format: DGEARR(n)=error code
+8 ;
+9 ; Output:
+10 ; none
+11 ;
+12 ;filer errors
NEW DGERR
+13 ;fda array
NEW DGFDA
+14 ;generic index
NEW DGI
+15 ;iens string
NEW DGLIENS
+16 ;
+17 IF $GET(DGFILE)]""
IF +$GET(DGLIEN)
IF $DATA(^DGPF(DGFILE,DGLIEN))
IF $GET(DGSTAT)]""
Begin DoDot:1
+18 IF '$$TESTVAL^DGPFUT(DGFILE,.04,DGSTAT)
QUIT
+19 SET DGLIENS=DGLIEN_","
+20 SET DGFDA(DGFILE,DGLIENS,.04)=DGSTAT
+21 SET DGFDA(DGFILE,DGLIENS,.06)=$$NOW^XLFDT()
+22 SET DGI=0
+23 FOR
SET DGI=$ORDER(DGEARR(DGI))
IF 'DGI
QUIT
IF DGEARR(DGI)]""
Begin DoDot:2
+24 SET DGFDA(DGFILE_"07","+"_DGI_","_DGLIEN_",",.01)=DGEARR(DGI)
End DoDot:2
+25 DO UPDATE^DIE("","DGFDA","","DGERR")
End DoDot:1
+26 QUIT
+27 ;
GETLSQ(DGEVNT) ;get last site queried
+1 ;
+2 ; Input:
+3 ; DGEVNT - pointer to PRF HL7 EVENT (#26.21) file
+4 ;
+5 ; Output:
+6 ; Function value - last site queried as pointer to INSTITUTION (#4)
+7 ; file on success; 0 on failure
+8 ;
+9 ;array of query sites sorted by date
NEW DGARR
+10 ;pointer to PRF HL7 QUERY LOG (#26.19)
NEW DGLIEN
+11 ;query log data array
NEW DGLOG
+12 ;
+13 SET DGLIEN=0
+14 SET DGEVNT=+$GET(DGEVNT)
+15 FOR
SET DGLIEN=$ORDER(^DGPF(26.19,"C",DGEVNT,DGLIEN))
IF 'DGLIEN
QUIT
Begin DoDot:1
+16 KILL DGLOG
+17 IF '$$GETQLOG(DGLIEN,.DGLOG)
QUIT
+18 IF +$GET(DGLOG("TRANSDT"))>0
IF +$GET(DGLOG("SITE"))>0
SET DGARR(+$GET(DGLOG("TRANSDT")))=+$GET(DGLOG("SITE"))
End DoDot:1
+19 QUIT +$GET(DGARR(+$ORDER(DGARR(""),-1)))
+20 ;
PRGQLOG(DGEVNT) ;purge PRF Query Log entries
+1 ;This procedure purges non-Accepted entries in the PRF HL7 QUERY LOG
+2 ;(#26.19) file for a given PRF HL7 EVENT.
+3 ;
+4 ; Input:
+5 ; DGEVNT - pointer to PRF HL7 EVENT (#26.21) file
+6 ;
+7 ; Output: none
+8 ;
+9 ;FM error array
NEW DGERR
+10 ;FM FDA array
NEW DGFDA
+11 ;PRF HL7 QUERY LOG (#26.19) file IEN
NEW DGLIEN
+12 ;transmission status
NEW DGSTAT
+13 ;
+14 SET DGEVNT=+$GET(DGEVNT)
+15 SET DGLIEN=0
+16 ;
+17 FOR
SET DGLIEN=$ORDER(^DGPF(26.19,"C",DGEVNT,DGLIEN))
IF 'DGLIEN
QUIT
Begin DoDot:1
+18 KILL DGFDA,DGERR
+19 SET DGSTAT=$$GET1^DIQ(26.19,DGLIEN_",",.04,"I","","DGERR")
+20 ;
+21 ;don't purge "A" or "AN" status entries
IF $EXTRACT(DGSTAT)="A"
QUIT
+22 ;
+23 SET DGFDA(26.19,DGLIEN_",",.01)="@"
+24 DO FILE^DIE("","DGFDA","DGERR")
End DoDot:1
+25 ;
+26 QUIT