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

A1VSLPER.m

Go to the documentation of this file.
A1VSLPER ;Albany FO/GTS - VistA Package Sizing Manager; 7-JUL-2016
 ;;1.0;VistA Package Sizing;;Oct 10, 2016;Build 25
EN ; -- main entry point for A1VS PKG MGR PARAM ERROR DISP
 D EN^VALM("A1VS PKG MGR PARAM ERROR DISP")
 Q
 ;
HDR ; -- header code
 NEW DEFDIR,SPCPAD,DIRHEAD
 SET SPCPAD=""
 SET DEFDIR=$$GET^XPAR("SYS","A1VS PACKAGE MGR DEFAULT DIR",1,"I")
 SET VALMHDR(1)="           VistA Package Size Analysis Manager - Prefix/File Overlap"
 SET VALMHDR(2)="                         Version: "_$$VERNUM^A1VSLM()_"     Build: "_$$BLDNUM^A1VSLM()
 SET DIRHEAD="Default Directory: "_DEFDIR
 SET $P(SPCPAD," ",(80-$L(DIRHEAD))/2)=""
 SET VALMHDR(3)=SPCPAD_DIRHEAD
 SET SPCPAD=""
 SET DIRHEAD="Parameter file: "_A1VPSPRM
 SET $P(SPCPAD," ",(80-$L(DIRHEAD))/2)=""
 SET VALMHDR(4)=SPCPAD_DIRHEAD
 QUIT
 ;
INIT ; -- init variables and list array
 DO KILL
 DO INCONSCK ; Check for package Prefix/File Range Overlaps
 ;
 NEW CMBLP
 SET CMBLP=""
 SET VALMCNT=0
 FOR  SET CMBLP=$O(^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBLP)) Q:CMBLP=""  DO ADD^A1VSLAPI(.VALMCNT,^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBLP))
 QUIT
 ;
HELP ; -- help code
 S X="?" D DISP^XQORM1 W !!
 Q
 ;
EXIT ; -- exit code
 DO KILL
 Q
 ;
EXPND ; -- expand code
 Q
 ;
KILL ; - Clean up local and global display arrays
 DO CLEAN^VALM10 ;Kill data and video control arrays
 DO KILL^VALM10() ;Kill Video attributes
 KILL ^TMP("A1VS PKG MGR PARAM ERROR DISP",$JOB),^TMP("A1VS-ERROR",$J)
 QUIT
 ;
 ;APIs
INCONSCK ;Check for overlaps in Forum Package file data
 NEW TMPROOT,PKGNME,PREFIX,ADPFXIND,OLDPKG
 SET TMPROOT="^TMP(""A1VS-PKGEDIT"","_$J_")"
 SET OLDPKG=$QSUBSCRIPT($QUERY(@TMPROOT),3)
 SET ADPFXIND=0
 FOR  SET TMPROOT=$QUERY(@TMPROOT) QUIT:TMPROOT=""  Q:$QSUBSCRIPT(TMPROOT,1)'="A1VS-PKGEDIT"  Q:$QSUBSCRIPT(TMPROOT,2)'=$JOB  DO
 . SET PKGNME=$QSUBSCRIPT(TMPROOT,3)
 . SET PREFIX=$QSUBSCRIPT(TMPROOT,4)
 . ; Execute "If" code when a new package is encountered
 . IF (OLDPKG'=PKGNME) DO
 .. ;1st loop on pkg, check primary prefix
 .. IF ('ADPFXIND) DO CHKPFX(PKGNME,PREFIX,"^TMP(""A1VS-PKGEDIT"","_$J_","""_PKGNME_""","""_PREFIX_""")",PREFIX)
 .. SET ADPFXIND=0 ;Reset the Add Prefix list found indicator after the first pass on the latest package
 . SET OLDPKG=PKGNME
 . DO FLDDATLP(TMPROOT,PKGNME,PREFIX,.ADPFXIND) ; Loop fields and data to check Prefix and File ranges
 KILL ^TMP("A1VS-PKGRPT-PFX-IDX",$J),^TMP("A1VS-PKGRPT-FRNG-IDX",$J),^TMP("A1VS-PKGRPT-CMB-IDX",$J)
 QUIT
 ;
FLDDATLP(TMPROOT,PKGNME,PREFIX,ADPFXIND) ;Check Fields and Data for 'ADDPFX' and 'FLERNG'
 ; Input: TMPROOT  - Package "A1VS-PKGEDIT" array root [^TMP("A1VS-PKGEDIT",$J,PKGNME,PREFIX)]
 ;        PKGNME   - Package Name using Prefix
 ;        PREFIX   - Additional Prefix used by Package
 ;        ADPFXIND - Indicates that prefix has been checked
 ;
 NEW FLDSUB,DATASUB
 SET FLDSUB=""
 FOR  SET FLDSUB=$O(@TMPROOT@(FLDSUB)) Q:FLDSUB=""  DO
 . SET DATASUB=""
 . FOR  SET DATASUB=$O(@TMPROOT@(FLDSUB,DATASUB)) Q:DATASUB=""  DO
 .. IF FLDSUB="ADDPFX" DO CHKPFX(PKGNME,DATASUB,TMPROOT,PREFIX) SET ADPFXIND=1
 .. IF FLDSUB="FLERNG" DO CHKFILE(PKGNME,DATASUB,TMPROOT,PREFIX)
 QUIT
 ;
CHKPFX(PKGNME,PREFIX,TMPROOT,PKGPFX) ; Check Prefix for multiple use
 ; Input: PKGNME  - Package Name using Prefix
 ;        PREFIX  - Additional Prefix used by Package
 ;        TMPROOT - Package "A1VS-PKGEDIT" array root [^TMP("A1VS-PKGEDIT",J,PKGNME,PREFIX)]
 ;        PKGPFX  - Package Prefix
 ;
 ; Output: ^TMP("A1VS-ERROR",$J,"PREFIX") array
 ;
 NEW IDXROOT,PKGSUB,ERRARYCT,FILERPRT,ADDREMPX
 SET FILERPRT=0
 SET IDXROOT="^TMP(""A1VS-PFXIDX"","_$J_","""_PREFIX_""")"  ;Use "PFXIDX" index
 SET ADDREMPX=@IDXROOT@(PKGNME)
 SET ERRARYCT=+$O(^TMP("A1VS-ERROR",$J,"PREFIX",""),-1)
 FOR  SET IDXROOT=$QUERY(@IDXROOT) Q:IDXROOT=""  Q:$QSUBSCRIPT(IDXROOT,1)'="A1VS-PFXIDX"  Q:$QSUBSCRIPT(IDXROOT,3)'[PREFIX  Q:$QSUBSCRIPT(IDXROOT,2)'=$JOB  DO
 . SET PKGSUB=$QSUBSCRIPT(IDXROOT,4)
 . IF PKGSUB'=PKGNME DO
 .. NEW IDXRT3
 .. SET IDXRT3=$QSUBSCRIPT(IDXROOT,3)
 .. IF IDXRT3=PREFIX DO MLTPFX(TMPROOT,PKGSUB,PKGNME,IDXRT3,.ERRARYCT,.FILERPRT)
 .. IF (IDXRT3'=PREFIX),(ADDREMPX'[IDXRT3) DO MLTPFX(TMPROOT,PKGSUB,PKGNME,IDXRT3,.ERRARYCT,.FILERPRT)
 ;
 QUIT
 ;
CHKFILE(PKGNME,FLERNG,TMPROOT,PKGPFX) ; Check File range for multiple use
 ; Input: PKGNME  - Package Name using Prefix
 ;        FILRNG  - File Range used by Package Name
 ;        TMPROOT - Package "A1VS-PKGEDIT" array root
 ;        PKGPFX  - Package Prefix
 ;
 ; Output: ^TMP("A1VS-ERROR",$J,"FILERNG") array
 ;
 NEW IDXROOT,STARTSUB,ENDSUB,PKGSUB,ERRARYCT,RNGBEG,RNGEND,PKGRPRT,RNGIND,PARENT,PREFIX,NODETXT,CMBARCT,NDTXTCMB
 SET PKGRPRT=0
 SET RNGBEG=$P(FLERNG,"-")
 SET RNGEND=$P(FLERNG,"-",2)
 SET ERRARYCT=+$O(^TMP("A1VS-ERROR",$J,"FILERNG",""),-1)
 SET IDXROOT="^TMP(""A1VS-FRIDX"","_$J_")"  ;;Use "FRIDX" index
 FOR  SET IDXROOT=$QUERY(@IDXROOT) Q:IDXROOT=""  Q:$QSUBSCRIPT(IDXROOT,1)'="A1VS-FRIDX"  Q:$QSUBSCRIPT(IDXROOT,2)'=$JOB  DO
 . SET STARTSUB=$QSUBSCRIPT(IDXROOT,3)
 . SET ENDSUB=$QSUBSCRIPT(IDXROOT,4)
 . SET PKGSUB=$QSUBSCRIPT(IDXROOT,5)
 . IF PKGSUB'=PKGNME DO
 .. SET RNGIND=$$RNGCHK(RNGBEG,RNGEND,STARTSUB,ENDSUB)
 .. IF RNGIND DO
 ... SET ERRARYCT=ERRARYCT+1
 ... IF ERRARYCT=1 DO SETFLHDR("FILERNG",.ERRARYCT)
 ... ;
 ... SET CMBARCT=+$O(^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",""),-1)
 ... IF +CMBARCT=0 DO CMBARST(.CMBARCT)
 ... ;
 ... IF 'PKGRPRT DO NOPKGRT(PKGNME,PKGPFX,.ERRARYCT,.CMBARCT,.PKGRPRT) ;Output Package being reported
 ... SET PREFIX=$O(^TMP("A1VS-PKGEDIT",$J,PKGSUB,""))
 ... SET PARENT=^TMP("A1VS-PKGEDIT",$J,PKGSUB,PREFIX,"PARENT")
 ... SET NODETXT="    . "_PKGSUB_" ["_STARTSUB_"-"_ENDSUB_"]"_$S(PARENT]"":" (Parent: "_PARENT_")",1:"")
 ... SET NDTXTCMB=NODETXT
 ... IF ($L(NODETXT)>79),(NODETXT["(Parent") SET NODETXT=$$SPLITNDE(NODETXT,"FILERNG",.ERRARYCT)
 ... SET ^TMP("A1VS-ERROR",$J,"FILERNG",ERRARYCT)=NODETXT
 ... SET CMBARCT=CMBARCT+1
 ... IF ($L(NDTXTCMB)>79),(NDTXTCMB["(Parent") SET NODETXT=$$SPLITNDE(NDTXTCMB,"COMB-PFX-FLRNG",.CMBARCT)
 ... SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=NODETXT
 QUIT
 ;
MLTPFX(TMPROOT,PKGSUB,PKGNME,SUBPFX,ERRARYCT,FILERPRT) ; Report multiple use of prefix
 NEW PARENT,CMBARCT,NODETXT,CMBHDR
 SET (CMBHDR,PKGHDOUT)=0
 SET PARENT=""
 SET ERRARYCT=ERRARYCT+1
 IF ERRARYCT=1 DO
 . SET ^TMP("A1VS-ERROR",$J,"PREFIX",1)="The following Prefixes are multiply used by the indicated packages:"
 . SET ERRARYCT=2
 ;
 SET CMBARCT=+$O(^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",""),-1)
 IF +CMBARCT=0 DO CMBARST(.CMBARCT)
 ;
 SET PKGPFX=$O(^TMP("A1VS-PKGEDIT",$J,PKGSUB,""))
 ;
 ; IF not printed package header, print header
 IF 'FILERPRT DO
 . SET ^TMP("A1VS-ERROR",$J,"PREFIX",ERRARYCT)=" "
 . SET CMBARCT=CMBARCT+1
 . SET ^TMP("A1VS-ERROR",$J,"A1VS-PKGRPT-CMB-IDX",ERRARYCT)=" "
 . SET ERRARYCT=ERRARYCT+1
 . IF '$D(^TMP("A1VS-PKGRPT-PFX-IDX",$J,PKGNME)) DO PKGERHDR(TMPROOT,"^TMP(""A1VS-ERROR"","_$J_",""PREFIX"")",PKGNME,.ERRARYCT)
 . IF '$D(^TMP("A1VS-PKGRPT-CMB-IDX",$J,PKGNME)) DO
 .. SET CMBARCT=CMBARCT+1
 .. SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=" "
 .. SET CMBARCT=CMBARCT+1
 .. DO PKGERHDR(TMPROOT,"^TMP(""A1VS-ERROR"","_$J_",""COMB-PFX-FLRNG"")",PKGNME,.CMBARCT)
 .. SET CMBHDR=1
 . ; 
 . IF 'CMBHDR DO
 .. SET CMBARCT=CMBARCT+1
 .. SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=" "
 . ;
 . SET NODETXT="   Prefix: "_PREFIX_" ; intersects the following packages..."
 . SET ^TMP("A1VS-ERROR",$J,"PREFIX",ERRARYCT)=NODETXT
 . SET ERRARYCT=ERRARYCT+1
 . SET CMBARCT=CMBARCT+1
 . SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=NODETXT
 . SET FILERPRT=1
 SET PARENT=^TMP("A1VS-PKGEDIT",$J,PKGSUB,PKGPFX,"PARENT")
 ;
 SET NODETXT="        .  "_PKGSUB_" ["_SUBPFX_"] "_$S(PARENT]"":" (Parent: "_PARENT_")",1:"")
 SET CMBARCT=CMBARCT+1
 IF ($L(NODETXT)>79),(NODETXT["(Parent") DO
 . NEW NDTXTCMB
 . SET NDTXTCMB=NODETXT
 . SET NODETXT=$$SPLITNDE(NODETXT,"PREFIX",.ERRARYCT)
 . SET NODETXT=$$SPLITNDE(NDTXTCMB,"COMB-PFX-FLRNG",.CMBARCT)
 SET ^TMP("A1VS-ERROR",$J,"PREFIX",ERRARYCT)=NODETXT
 SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=NODETXT
 QUIT
 ;
 ;
PKGERHDR(TMPROOT,ERRAYRT,PKGNME,ERRARYCT) ; Output Header info for PREFIX and FILE RANGE overlap arrays
 NEW PKGPFX
 SET:$QSUBSCRIPT(ERRAYRT,3)="PREFIX" ^TMP("A1VS-PKGRPT-PFX-IDX",$J,PKGNME)="" ;Temporary index of Prefix overlap packages reported
 SET:$QSUBSCRIPT(ERRAYRT,3)="FILERNG" ^TMP("A1VS-PKGRPT-FRNG-IDX",$J,PKGNME)="" ;Temporary index of File overlap packages reported
 SET:$QSUBSCRIPT(ERRAYRT,3)="COMB-PFX-FLRNG" ^TMP("A1VS-PKGRPT-CMB-IDX",$J,PKGNME)="" ;Temporary index of File overlap packages reported
 ;
 SET PKGPFX=$QSUBSCRIPT(TMPROOT,4)
 SET @ERRAYRT@(ERRARYCT)=" "
 SET ERRARYCT=ERRARYCT+1
 SET @ERRAYRT@(ERRARYCT)=" "_PKGNME_" [Primary Prefix: "_PKGPFX_"]"
 SET PARENT=@TMPROOT@("PARENT")
 SET ERRARYCT=ERRARYCT+1
 SET @ERRAYRT@(ERRARYCT)="   Parent: "_$S(PARENT]"":PARENT,1:"None indicated")
 SET ERRARYCT=ERRARYCT+1
 QUIT
 ;
CMBARST(CMBARCT) ;Add Header to Combined Prefix and File Range overlap error array
 SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",1)="The following Prefixes are multiply used by the indicated packages."
 SET CMBARCT=2
 DO SETFLHDR("COMB-PFX-FLRNG",.CMBARCT)
 QUIT
 ;
SETFLHDR(NODETYPE,ERRARYCT) ;Set File Header
 SET ^TMP("A1VS-ERROR",$J,NODETYPE,ERRARYCT)="The Primary Package file ranges are used by the listed packages."
 SET ERRARYCT=ERRARYCT+1
 SET ^TMP("A1VS-ERROR",$J,NODETYPE,ERRARYCT)="NOTE: The Primary Package defines Ranges from the Forum LOW-HIGH RANGE'"
 SET ERRARYCT=ERRARYCT+1
 SET ^TMP("A1VS-ERROR",$J,NODETYPE,ERRARYCT)=" Multiple or included in the FILE multiple.  *LOWEST & *HIGHEST FILE NUMBER"
 SET ERRARYCT=ERRARYCT+1
 SET ^TMP("A1VS-ERROR",$J,NODETYPE,ERRARYCT)=" data is included with LOW-HIGH Range and FILE multiple data in the list"
 SET ERRARYCT=ERRARYCT+1
 SET ^TMP("A1VS-ERROR",$J,NODETYPE,ERRARYCT)=" of packages overlapping LOW-HIGH Range and FILE multiple data."
 SET ERRARYCT=ERRARYCT+1
 QUIT
 ;
SPLITNDE(TEXT,NODESUB,ERRARYCT) ;Split Error Node
 NEW PARNTPLC,TXTSLICE,NODETXT
 SET PARNTPLC=$FIND(TEXT,"(Parent")-7
 SET TXTSLICE=$E(TEXT,1,PARNTPLC-1)
 SET ^TMP("A1VS-ERROR",$J,NODESUB,ERRARYCT)=TXTSLICE
 SET ERRARYCT=ERRARYCT+1
 SET NODETXT="              "_$E(TEXT,PARNTPLC,$L(TEXT))
 QUIT NODETXT
 ;
NOPKGRT(PKGNME,PKGPFX,ERRARYCT,CMBARCT,PKGRPRT) ;Report Package for File section
 NEW NODETXT,FLEHDR
 SET FLEHDR=0
 SET ^TMP("A1VS-ERROR",$J,"FILERNG",ERRARYCT)=" "
 SET ERRARYCT=ERRARYCT+1
 SET CMBARCT=CMBARCT+1
 IF ('$D(^TMP("A1VS-PKGRPT-FRNG-IDX",$J,PKGNME))) DO PKGERHDR(TMPROOT,"^TMP(""A1VS-ERROR"","_$J_",""FILERNG"")",PKGNME,.ERRARYCT)
 IF ('$D(^TMP("A1VS-PKGRPT-CMB-IDX",$J,PKGNME))) DO 
 . SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=" "
 . SET CMBARCT=CMBARCT+1
 . DO PKGERHDR(TMPROOT,"^TMP(""A1VS-ERROR"","_$J_",""COMB-PFX-FLRNG"")",PKGNME,.CMBARCT)
 . SET FLEHDR=1
 ; 
 IF 'FLEHDR DO
 . SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=" "
 . SET CMBARCT=CMBARCT+1
 ;
 SET NODETXT="   File range, "_FLERNG_", overlaps with the following packages..."
 SET ^TMP("A1VS-ERROR",$J,"FILERNG",ERRARYCT)=NODETXT
 SET ERRARYCT=ERRARYCT+1
 SET ^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBARCT)=NODETXT
 SET CMBARCT=CMBARCT+1
 SET PKGRPRT=1
 QUIT
 ;
 ;TO DO: GTS - Code here as follows:
 ;  Create ^TMP("A1VS-ERROR",$J,"COMBINE",<pkgnme>) array in the form:
 ; <pkgname> <prefix>
 ;    Parent: <pkgname> or "none indicated"
 ;       [If Prefix overlap exists]
 ;    Prefix: <prefix> used by
 ;         . <pkgname> (Parent: <pkgname>)
 ;         . <pkgname> (Parent: <pkgname>)
 ;       [If File Range overlap exists]
 ;    File Range:
 ;         . <pkgname> [has range {begin num - end num}]
 ;         . <pkgname> [has range {begin num - end num}]
 ;
 ;
RNGCHK(RNGBEG,RNGEND,STARTSUB,ENDSUB) ;Check Package file ranges against Range index
 ;Input:
 ;  RNGBEG   - Package File begin range to check
 ;  RNGEND   - Package File end range to check
 ;  STARTSUB - Range Index - Start file Subscript
 ;  ENDSUB   - Range Index - End file Subscript
 ;
 ;Output:
 ;  1: Package file number OVERLAPS range
 ;  0: Package file number out of range
 ;
 NEW INRNG
 SET INRNG=0
 IF RNGBEG'<STARTSUB,RNGBEG'>ENDSUB SET INRNG=1
 IF RNGEND'<STARTSUB,RNGEND'>ENDSUB SET INRNG=1
 IF RNGBEG<STARTSUB,RNGEND>ENDSUB SET INRNG=1
 IF RNGBEG=STARTSUB,RNGEND=ENDSUB SET INRNG=1
 QUIT INRNG
 ;
 ;Action Protocol APIs
DPFXERR ; Display prefix overlap list
 ; -- Protocol: A1VS PKG MGR PREFIX OVERLAP ACTION
 ;
 NEW LPITEM
 SET VALMHDR(1)="           VistA Package Size Analysis Manager - Prefix Overlap"
 KILL ^TMP("A1VS PKG MGR PARAM ERROR DISP",$JOB)
 SET VALMCNT=0
 NEW LPITEM
 SET LPITEM=""
 FOR  SET LPITEM=$O(^TMP("A1VS-ERROR",$J,"PREFIX",LPITEM)) Q:LPITEM=""  DO ADD^A1VSLAPI(.VALMCNT,^TMP("A1VS-ERROR",$J,"PREFIX",LPITEM))
 SET VALMBG=1
 SET VALMBCK="R"
 QUIT
 ;
DRNGERR ; Display File range errors
 ; -- Protocol: A1VS PKG MGR FILE OVERLAP ACTION
 ;
 NEW LPITEM
 SET VALMHDR(1)="           VistA Package Size Analysis Manager - File Overlap"
 KILL ^TMP("A1VS PKG MGR PARAM ERROR DISP",$JOB)
 SET VALMCNT=0
 SET LPITEM=""
 FOR  SET LPITEM=$O(^TMP("A1VS-ERROR",$J,"FILERNG",LPITEM)) Q:LPITEM=""  DO ADD^A1VSLAPI(.VALMCNT,^TMP("A1VS-ERROR",$J,"FILERNG",LPITEM))
 SET VALMBG=1
 SET VALMBCK="R"
 QUIT
 ;
CMBERR ; Redisplay Prefix/File Range overlaps
 ; -- Protocol: A1VS PKG MGR PARAM OVRLP REDISP ACTION
 ;
 NEW CMBLP ;NEW CODE
 ;
 SET VALMHDR(1)="           VistA Package Size Analysis Manager - Prefix/File Overlap"
 KILL ^TMP("A1VS PKG MGR PARAM ERROR DISP",$JOB)
 SET VALMCNT=0
 SET CMBLP=0
 FOR  SET CMBLP=$O(^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBLP)) Q:CMBLP=""  DO ADD^A1VSLAPI(.VALMCNT,^TMP("A1VS-ERROR",$J,"COMB-PFX-FLRNG",CMBLP))
 SET VALMBG=1
 SET VALMBCK="R"
 QUIT
 ;
ERPT ; Email ^TMP("A1VS PKG MGR PARAM ERROR DISP") displayed report
 ; -- Protocol: A1VS PKG MGR EMAIL OVRLAP RPT ACTION
 ;
 NEW A1INSTMM,A1TOMM,XMERR,XMZ,A1TYPE
 DO FULL^VALM1
 KILL XMERR
 SET A1INSTMM("ADDR FLAGS")="R"  ;Do not Restrict addressing
 SET A1TYPE="S"
 DO TOWHOM^XMXAPIU(DUZ,,A1TYPE,.A1INSTMM)
 IF +$G(XMERR)'>0 DO
 . NEW XMY,XMTEXT,XMDUZ,XMSUB,A1LPCNT
 . SET A1LPCNT=""
 . FOR  SET A1LPCNT=$O(^TMP("XMY",$J,A1LPCNT)) QUIT:A1LPCNT=""  SET XMY(A1LPCNT)=""
 . SET XMDUZ=DUZ
 . SET XMSUB=$P(VALMHDR(4),":",2)_" ("_$P(VALMHDR(1)," - ",2)_")"
 . SET XMTEXT="^TMP(""A1VS PKG MGR PARAM ERROR DISP"","_$JOB_","
 . DO ^XMD
 . IF +XMZ>0 DO JUSTPAWS^A1VSLAPI($P(VALMHDR(1)," - ",2)_" E-Mailed.  [MSG #:"_XMZ_"]")
 . IF +XMZ'>0  DO JUSTPAWS^A1VSLAPI("Error: ^TMP(""A1VS PKG MGR PARAM ERROR DISP"","_$JOB_") not E-Mailed! ["_XMZ_"]")
 ;
 SET VALMBCK="R"
 QUIT