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

VAQBUL07.m

Go to the documentation of this file.
  1. VAQBUL07 ;ALB/JRP - BULLETINS;26-JUL-93
  1. ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
  1. PURGE(ERRARR) ;SEND PURGING ERROR BULLETIN
  1. ;INPUT : ERRARR - Array of errors subscripted by entry number in
  1. ; transaction file (full global ref)
  1. ;OUTPUT : 0 - Bulletin sent
  1. ; -1^ErrorText - Bulletin not sent
  1. ;NOTES : ERRARR should be in the format
  1. ; ERRARR(Transaction's IFN)=Error text
  1. ;
  1. ;CHECK INPUT
  1. Q:($G(ERRARR)="") "-1^Did not pass reference to error array"
  1. Q:('$D(@ERRARR)) 0
  1. ;DECLARE VARIABLES
  1. N SUBJ,SENTBY,FWRDBY,XMY,TMPARR,TRANPTR,X,STOPPED,LINE
  1. S TMPARR="^TMP(""VAQ-BUL"","_$J_")"
  1. K @TMPARR
  1. S LINE=1
  1. ;DETERMINE IF PURGER WAS STOPPED
  1. S STOPPED=$D(@ERRARR@("STOPPED"))
  1. I (STOPPED) D
  1. .S @TMPARR@(LINE,0)="** Purger was stopped before completion **"
  1. .S LINE=LINE+1
  1. .S @TMPARR@(LINE,0)=""
  1. .S LINE=LINE+1
  1. .S @TMPARR@(LINE,0)=""
  1. .S LINE=LINE+1
  1. ;BUILD MESSAGE
  1. S @TMPARR@(LINE,0)="The following PDX Transaction(s) could not be purged ..."
  1. S LINE=LINE+1
  1. S @TMPARR@(LINE,0)=""
  1. S LINE=LINE+1
  1. S TRANPTR=""
  1. F S TRANPTR=$O(@ERRARR@(TRANPTR)) Q:(TRANPTR="") D
  1. .Q:(TRANPTR="STOPPED")
  1. .S @TMPARR@(LINE,0)=""
  1. .S LINE=LINE+1
  1. .S X=$G(@ERRARR@(TRANPTR))
  1. .S @TMPARR@(LINE,0)="Entry #: "_TRANPTR
  1. .S LINE=LINE+1
  1. .S @TMPARR@(LINE,0)=" Global: ^VAT(394.61,"_TRANPTR_")"
  1. .S LINE=LINE+1
  1. .S @TMPARR@(LINE,0)=" Reason: "_X
  1. .S LINE=LINE+1
  1. S @TMPARR@(LINE,0)=""
  1. S LINE=LINE+1
  1. S @TMPARR@(LINE,0)=""
  1. S LINE=LINE+1
  1. S @TMPARR@(LINE,0)="** Please remember that PDX Transactions may also **"
  1. S LINE=LINE+1
  1. S @TMPARR@(LINE,0)="** have associated data stored in file number 394.62 **"
  1. S LINE=LINE+1
  1. S @TMPARR@(LINE,0)=""
  1. S LINE=LINE+1
  1. ;SET UP CALL TO SEND BULLETIN
  1. S SUBJ="PDX TRANSACTIONS COULD NOT BE PURGED"
  1. S SENTBY="PDX"
  1. S FWRDBY="Patient Data eXchange"
  1. S XMY("G.VAQ PDX ERRORS")=""
  1. ;SEND BULLETIN
  1. S X=$$SENDBULL^VAQBUL(SUBJ,SENTBY,FWRDBY,TMPARR)
  1. S:(X>0) X=0
  1. ;CLEAN UP
  1. K @TMPARR
  1. Q X