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

PXCAERR.m

Go to the documentation of this file.
  1. PXCAERR ;ISL/dee - Sends a mail bulletin when there is an error in PXKERROR stored in file 839.01 ;12/17/96
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**5,14**;Aug 12, 1996
  1. Q
  1. ;
  1. PXKERROR(PXCAGLB) ;Take care of any error messages from PXK.
  1. ;There are error messages so store them in the error file
  1. ;and send a mail bulletin.
  1. ; Variables
  1. ; PXCAEIEN Pointer to the entry in the error file for this entry
  1. ; (839.01)
  1. ; PXCAERR Contians the variable name of either the
  1. ; error array i.e. PXKERROR( ... )
  1. ; or the PXCA array i.e. PXCA( ... )
  1. N PXCAEIEN,PXCAERR,PXCANOW,DLAYGO,%,PXCADATA
  1. D NOW^%DTC
  1. K DIC,DD,DO
  1. S (X,PXCANOW)=%
  1. S DIC="^PX(839.01,"
  1. S DIC(0)="L",DLAYGO=839.01
  1. S DIC("DR")=".02////"_PXCAPAT_$S($G(PXCAVSIT)>0:";.03////"_PXCAVSIT,1:"")
  1. D FILE^DICN
  1. I +Y>0 D
  1. . S PXCAEIEN=+Y
  1. . S ^PX(839.01,PXCAEIEN,1,0)="^839.011A^^0"
  1. . S ^PX(839.01,PXCAEIEN,2,0)="^839.012A^^0"
  1. . ;Save the PXKERROR array.
  1. . S PXCAERR="PXKERROR"
  1. . F S PXCAERR=$Q(@PXCAERR) Q:PXCAERR="" D
  1. .. K DIC,DD,DO
  1. .. S X=PXCAERR
  1. .. S DIC="^PX(839.01,"_PXCAEIEN_",1,"
  1. .. S DIC(0)="L",DLAYGO=839.01
  1. .. S PXCADATA=$TR(@PXCAERR,"^","~")
  1. .. S DIC("DR")="101////^S X=PXCADATA"
  1. .. D FILE^DICN
  1. . ;Save the PXCA array.
  1. . S PXCAERR="PXCA"
  1. . F S PXCAERR=$Q(@PXCAERR) Q:PXCAERR="" D
  1. .. K DIC,DD,DO
  1. .. S X=PXCAERR
  1. .. S DIC="^PX(839.01,"_PXCAEIEN_",2,"
  1. .. S DIC(0)="L",DLAYGO=839.01
  1. .. S PXCADATA=$TR(@PXCAERR,"^","~")
  1. .. S DIC("DR")="201////^S X=PXCADATA"
  1. .. D FILE^DICN
  1. D ERRMAIL(PXCAEIEN,PXCANOW)
  1. S PXCA("WARNING","ENCOUNTER",0,0,0)="There are ""PXKERROR""s in in the ""PCE DEVICE INTERFACE MODULE ERRORS"" file in entry number "_PXCAEIEN_"^"_PXCAEIEN
  1. I $D(PXKERROR("VISIT"))#2 S PXCASTAT=-1
  1. E S PXCASTAT=-2
  1. Q
  1. ;
  1. ERRMAIL(PXCAEIEN,PXCANOW) ;
  1. N XMDUZ,XMTEXT,XMY,XMB
  1. S XMDUZ="PCE's Data Capture Interface."
  1. S XMB="PXCA PCE ERROR BULLETIN"
  1. S XMB(1)=$P($G(^DPT($P(PXCA("ENCOUNTER"),"^",2),0)),"^",1) ;Patient
  1. S XMB(2)=$$DATE($P(PXCA("ENCOUNTER"),"^",1)) ;Appointment Date/Time
  1. S XMB(3)=PXCAEIEN ;Error number (IEN in error file)
  1. S XMB(4)=$$DATE(PXCANOW) ;Error Date/Time
  1. D ^XMB
  1. Q
  1. ;
  1. DATE(Y) ;
  1. D DD^%DT
  1. Q $P(Y,"@")_" at "_$P(Y,"@",2)