Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGQEHL70

DGQEHL70.m

Go to the documentation of this file.
  1. DGQEHL70 ;ALB/JFP - VIC HL7 Utility Bulletins; 09/01/96
  1. ;;V5.3;REGISTRATION;**73**;DEC 11,1996
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ERRBULL(REASON) ; -- Sends error bulletin
  1. ;
  1. ;Input: REASON - Why transmission of data could not be completed
  1. ;Output: None
  1. ;
  1. ; -- Check input, reason in piece 2
  1. S REASON=$P($G(REASON),"^",2)
  1. ; -- Declare variables
  1. N MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ
  1. ; -- Send message text
  1. S MSGTXT(1)="Transmission of data to photo capture station"
  1. S MSGTXT(2)=" "
  1. S MSGTXT(3)="could not be completed for the following reason:"
  1. S MSGTXT(4)=" "
  1. S MSGTXT(5)=" "_REASON
  1. ; -- Send bulletin subject
  1. S XMB(1)="** Transmission of data to Photo station not complete **"
  1. ; -- Deliver bulletin
  1. S XMB="DGQE PHOTO CAPTURE"
  1. S XMTEXT="MSGTXT("
  1. D ^XMB
  1. Q
  1. ;
  1. CMPLBULL(SENT,ERRARY) ;Send completion bulletin
  1. ;
  1. ;Input : SENT - Number of encounters sent to NPCDB (Defaults to 0)
  1. ; ERRARRY - Array containing list of transactions that
  1. ; could not be transmitted (full global reference)
  1. ;
  1. ; ERRARY(Ptr) = Reason
  1. ; Ptr - Pointer to entry in Patient file (#2)
  1. ; Reason - Why the encounter could not be transmitted
  1. ;Output : None
  1. ;
  1. ; -- Check input
  1. S SENT=+$G(SENT)
  1. S ERRARY=$G(ERRARY)
  1. S:(ERRARY="") ERRARY="^TMP(""DGQE-XMIT-BLD"","_$J_",""ERRORS"")"
  1. ; -- Declare variables
  1. N MSGTXT,XMB,XMTEXT,XMY,XMDUZ,XMDT,XMZ,XMITPTR,LINE
  1. N NAME,TMP,SSN,PATZND,CNT
  1. S MSGTXT="^TMP(""DGQE-XMIT-BLD"","_$J_",""BULLETIN"")"
  1. K @MSGTXT
  1. ; -- Put number of transactions transmitted into message text
  1. S @MSGTXT@(1)="Transmission of data to the Photo Capture Station completed."
  1. S @MSGTXT@(2)="A total of "_SENT_" transactions were sent."
  1. S @MSGTXT@(3)=" "
  1. ; -- Put nontransmitted encounter information into message text
  1. I (+$O(@ERRARY@(0))) D
  1. .S @MSGTXT@(4)=" "
  1. .S @MSGTXT@(5)="The following transactions could not be sent:"
  1. .S @MSGTXT@(6)=" "
  1. .S LINE=7
  1. .S XMITPTR=0
  1. .S CNT=0
  1. .F S XMITPTR=+$O(@ERRARY@(XMITPTR)) Q:('XMITPTR) D
  1. ..S CNT=CNT+1
  1. ..; -- Get patient's name & SSN - truncate name to 24 characters
  1. ..S PATZND=$G(^DPT(XMITPTR,0))
  1. ..S NAME=$E($P(PATZND,"^",1),1,24)
  1. ..S:(NAME="") NAME="Unknown Patient"
  1. ..S SSN=$E($P(PATZND,"^",9),6,10)
  1. ..S:(SSN="") SSN="????"
  1. ..; -- Put info into bulletin
  1. ..S TMP=CNT_" - "
  1. ..S TMP=$$INSERT^SCDXUTL1(NAME,TMP,5)
  1. ..S TMP=$$INSERT^SCDXUTL1("("_SSN_")",TMP,29)
  1. ..S @MSGTXT@(LINE)=TMP
  1. ..; -- insert reason
  1. ..S @MSGTXT@(LINE+1)=$G(@ERRARY@(XMITPTR))
  1. ..S @MSGTXT@(LINE+2)=" "
  1. ..S LINE=LINE+3
  1. ; -- Set bulletin subject
  1. S XMB(1)="Transmission of data to Photo Capture station completed"
  1. ; -- Deliver bulletin
  1. S XMB="DGQE PHOTO CAPTURE"
  1. S XMTEXT=$P(MSGTXT,")",1)_","
  1. D ^XMB
  1. ; -- Done: (clean up and quit)
  1. K @MSGTXT
  1. Q
  1. ;
  1. END ; -- End of code
  1. Q
  1. ;