source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXCAERR.m@ 1704

Last change on this file since 1704 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1PXCAERR ;ISL/dee - Sends a mail bulletin when there is an error in PXKERROR stored in file 839.01 ;12/17/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**5,14**;Aug 12, 1996
3 Q
4 ;
5PXKERROR(PXCAGLB) ;Take care of any error messages from PXK.
6 ;There are error messages so store them in the error file
7 ;and send a mail bulletin.
8 ; Variables
9 ; PXCAEIEN Pointer to the entry in the error file for this entry
10 ; (839.01)
11 ; PXCAERR Contians the variable name of either the
12 ; error array i.e. PXKERROR( ... )
13 ; or the PXCA array i.e. PXCA( ... )
14 N PXCAEIEN,PXCAERR,PXCANOW,DLAYGO,%,PXCADATA
15 D NOW^%DTC
16 K DIC,DD,DO
17 S (X,PXCANOW)=%
18 S DIC="^PX(839.01,"
19 S DIC(0)="L",DLAYGO=839.01
20 S DIC("DR")=".02////"_PXCAPAT_$S($G(PXCAVSIT)>0:";.03////"_PXCAVSIT,1:"")
21 D FILE^DICN
22 I +Y>0 D
23 . S PXCAEIEN=+Y
24 . S ^PX(839.01,PXCAEIEN,1,0)="^839.011A^^0"
25 . S ^PX(839.01,PXCAEIEN,2,0)="^839.012A^^0"
26 . ;Save the PXKERROR array.
27 . S PXCAERR="PXKERROR"
28 . F S PXCAERR=$Q(@PXCAERR) Q:PXCAERR="" D
29 .. K DIC,DD,DO
30 .. S X=PXCAERR
31 .. S DIC="^PX(839.01,"_PXCAEIEN_",1,"
32 .. S DIC(0)="L",DLAYGO=839.01
33 .. S PXCADATA=$TR(@PXCAERR,"^","~")
34 .. S DIC("DR")="101////^S X=PXCADATA"
35 .. D FILE^DICN
36 . ;Save the PXCA array.
37 . S PXCAERR="PXCA"
38 . F S PXCAERR=$Q(@PXCAERR) Q:PXCAERR="" D
39 .. K DIC,DD,DO
40 .. S X=PXCAERR
41 .. S DIC="^PX(839.01,"_PXCAEIEN_",2,"
42 .. S DIC(0)="L",DLAYGO=839.01
43 .. S PXCADATA=$TR(@PXCAERR,"^","~")
44 .. S DIC("DR")="201////^S X=PXCADATA"
45 .. D FILE^DICN
46 D ERRMAIL(PXCAEIEN,PXCANOW)
47 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
48 I $D(PXKERROR("VISIT"))#2 S PXCASTAT=-1
49 E S PXCASTAT=-2
50 Q
51 ;
52ERRMAIL(PXCAEIEN,PXCANOW) ;
53 N XMDUZ,XMTEXT,XMY,XMB
54 S XMDUZ="PCE's Data Capture Interface."
55 S XMB="PXCA PCE ERROR BULLETIN"
56 S XMB(1)=$P($G(^DPT($P(PXCA("ENCOUNTER"),"^",2),0)),"^",1) ;Patient
57 S XMB(2)=$$DATE($P(PXCA("ENCOUNTER"),"^",1)) ;Appointment Date/Time
58 S XMB(3)=PXCAEIEN ;Error number (IEN in error file)
59 S XMB(4)=$$DATE(PXCANOW) ;Error Date/Time
60 D ^XMB
61 Q
62 ;
63DATE(Y) ;
64 D DD^%DT
65 Q $P(Y,"@")_" at "_$P(Y,"@",2)
Note: See TracBrowser for help on using the repository browser.