DGQEHL70 ;ALB/JFP - VIC HL7 Utility Bulletins; 09/01/96
;;5.3;Registration;**73,1015**;DEC 11,1996;Build 21
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
ERRBULL(REASON) ; -- Sends error bulletin
;
;Input: REASON - Why transmission of data could not be completed
;Output: None
;
; -- Check input, reason in piece 2
S REASON=$P($G(REASON),"^",2)
; -- Declare variables
N MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ
; -- Send message text
S MSGTXT(1)="Transmission of data to photo capture station"
S MSGTXT(2)=" "
S MSGTXT(3)="could not be completed for the following reason:"
S MSGTXT(4)=" "
S MSGTXT(5)=" "_REASON
; -- Send bulletin subject
S XMB(1)="** Transmission of data to Photo station not complete **"
; -- Deliver bulletin
S XMB="DGQE PHOTO CAPTURE"
S XMTEXT="MSGTXT("
D ^XMB
Q
;
CMPLBULL(SENT,ERRARY) ;Send completion bulletin
;
;Input : SENT - Number of encounters sent to NPCDB (Defaults to 0)
; ERRARRY - Array containing list of transactions that
; could not be transmitted (full global reference)
;
; ERRARY(Ptr) = Reason
; Ptr - Pointer to entry in Patient file (#2)
; Reason - Why the encounter could not be transmitted
;Output : None
;
; -- Check input
S SENT=+$G(SENT)
S ERRARY=$G(ERRARY)
S:(ERRARY="") ERRARY="^TMP(""DGQE-XMIT-BLD"","_$J_",""ERRORS"")"
; -- Declare variables
N MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ,XMITPTR,LINE
N NAME,TMP,SSN,PATZND,CNT
S MSGTXT="^TMP(""DGQE-XMIT-BLD"","_$J_",""BULLETIN"")"
K @MSGTXT
; -- Put number of transactions transmitted into message text
S @MSGTXT@(1)="Transmission of data to the Photo Capture Station completed."
S @MSGTXT@(2)="A total of "_SENT_" transactions were sent."
S @MSGTXT@(3)=" "
; -- Put nontransmitted encounter information into message text
I (+$O(@ERRARY@(0))) D
.S @MSGTXT@(4)=" "
.S @MSGTXT@(5)="The following transactions could not be sent:"
.S @MSGTXT@(6)=" "
.S LINE=7
.S XMITPTR=0
.S CNT=0
.F S XMITPTR=+$O(@ERRARY@(XMITPTR)) Q:('XMITPTR) D
..S CNT=CNT+1
..; -- Get patient's name & SSN - truncate name to 24 characters
..S PATZND=$G(^DPT(XMITPTR,0))
..S NAME=$E($P(PATZND,"^",1),1,24)
..S:(NAME="") NAME="Unknown Patient"
..S SSN=$E($P(PATZND,"^",9),6,10)
..S:(SSN="") SSN="????"
..; -- Put info into bulletin
..S TMP=CNT_" - "
..S TMP=$$INSERT^SCDXUTL1(NAME,TMP,5)
..S TMP=$$INSERT^SCDXUTL1("("_SSN_")",TMP,29)
..S @MSGTXT@(LINE)=TMP
..; -- insert reason
..S @MSGTXT@(LINE+1)=$G(@ERRARY@(XMITPTR))
..S @MSGTXT@(LINE+2)=" "
..S LINE=LINE+3
; -- Set bulletin subject
S XMB(1)="Transmission of data to Photo Capture station completed"
; -- Deliver bulletin
S XMB="DGQE PHOTO CAPTURE"
S XMTEXT=$P(MSGTXT,")",1)_","
D ^XMB
; -- Done: (clean up and quit)
K @MSGTXT
Q
;
END ; -- End of code
Q
;
DGQEHL70 ;ALB/JFP - VIC HL7 Utility Bulletins; 09/01/96
+1 ;;5.3;Registration;**73,1015**;DEC 11,1996;Build 21
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
ERRBULL(REASON) ; -- Sends error bulletin
+1 ;
+2 ;Input: REASON - Why transmission of data could not be completed
+3 ;Output: None
+4 ;
+5 ; -- Check input, reason in piece 2
+6 SET REASON=$PIECE($GET(REASON),"^",2)
+7 ; -- Declare variables
+8 NEW MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ
+9 ; -- Send message text
+10 SET MSGTXT(1)="Transmission of data to photo capture station"
+11 SET MSGTXT(2)=" "
+12 SET MSGTXT(3)="could not be completed for the following reason:"
+13 SET MSGTXT(4)=" "
+14 SET MSGTXT(5)=" "_REASON
+15 ; -- Send bulletin subject
+16 SET XMB(1)="** Transmission of data to Photo station not complete **"
+17 ; -- Deliver bulletin
+18 SET XMB="DGQE PHOTO CAPTURE"
+19 SET XMTEXT="MSGTXT("
+20 DO ^XMB
+21 QUIT
+22 ;
CMPLBULL(SENT,ERRARY) ;Send completion bulletin
+1 ;
+2 ;Input : SENT - Number of encounters sent to NPCDB (Defaults to 0)
+3 ; ERRARRY - Array containing list of transactions that
+4 ; could not be transmitted (full global reference)
+5 ;
+6 ; ERRARY(Ptr) = Reason
+7 ; Ptr - Pointer to entry in Patient file (#2)
+8 ; Reason - Why the encounter could not be transmitted
+9 ;Output : None
+10 ;
+11 ; -- Check input
+12 SET SENT=+$GET(SENT)
+13 SET ERRARY=$GET(ERRARY)
+14 IF (ERRARY="")
SET ERRARY="^TMP(""DGQE-XMIT-BLD"","_$JOB_",""ERRORS"")"
+15 ; -- Declare variables
+16 NEW MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ,XMITPTR,LINE
+17 NEW NAME,TMP,SSN,PATZND,CNT
+18 SET MSGTXT="^TMP(""DGQE-XMIT-BLD"","_$JOB_",""BULLETIN"")"
+19 KILL @MSGTXT
+20 ; -- Put number of transactions transmitted into message text
+21 SET @MSGTXT@(1)="Transmission of data to the Photo Capture Station completed."
+22 SET @MSGTXT@(2)="A total of "_SENT_" transactions were sent."
+23 SET @MSGTXT@(3)=" "
+24 ; -- Put nontransmitted encounter information into message text
+25 IF (+$ORDER(@ERRARY@(0)))
Begin DoDot:1
+26 SET @MSGTXT@(4)=" "
+27 SET @MSGTXT@(5)="The following transactions could not be sent:"
+28 SET @MSGTXT@(6)=" "
+29 SET LINE=7
+30 SET XMITPTR=0
+31 SET CNT=0
+32 FOR
SET XMITPTR=+$ORDER(@ERRARY@(XMITPTR))
IF ('XMITPTR)
QUIT
Begin DoDot:2
+33 SET CNT=CNT+1
+34 ; -- Get patient's name & SSN - truncate name to 24 characters
+35 SET PATZND=$GET(^DPT(XMITPTR,0))
+36 SET NAME=$EXTRACT($PIECE(PATZND,"^",1),1,24)
+37 IF (NAME="")
SET NAME="Unknown Patient"
+38 SET SSN=$EXTRACT($PIECE(PATZND,"^",9),6,10)
+39 IF (SSN="")
SET SSN="????"
+40 ; -- Put info into bulletin
+41 SET TMP=CNT_" - "
+42 SET TMP=$$INSERT^SCDXUTL1(NAME,TMP,5)
+43 SET TMP=$$INSERT^SCDXUTL1("("_SSN_")",TMP,29)
+44 SET @MSGTXT@(LINE)=TMP
+45 ; -- insert reason
+46 SET @MSGTXT@(LINE+1)=$GET(@ERRARY@(XMITPTR))
+47 SET @MSGTXT@(LINE+2)=" "
+48 SET LINE=LINE+3
End DoDot:2
End DoDot:1
+49 ; -- Set bulletin subject
+50 SET XMB(1)="Transmission of data to Photo Capture station completed"
+51 ; -- Deliver bulletin
+52 SET XMB="DGQE PHOTO CAPTURE"
+53 SET XMTEXT=$PIECE(MSGTXT,")",1)_","
+54 DO ^XMB
+55 ; -- Done: (clean up and quit)
+56 KILL @MSGTXT
+57 QUIT
+58 ;
END ; -- End of code
+1 QUIT
+2 ;