PXCA ;ISL/dee & LEA/Chylton - Main entry points to PCE Device Interface Module ;12/17/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**5,14**;Aug 12, 1996
Q
;
;----------------------------- FOREGROUND ---------------------------
FOREGND(PXCA,PXCASTAT,PXCAVSIT) ; Invoke the event point in the foreground
; if there are no errors
S PXCASTAT=0 ; assume that event processing did not occur
D EN^PXCA0
I '$D(PXCA("ERROR")),PXCASTAT=0 S PXCASTAT=1 ; there were no errors so report that
; event processing occurred
I PXCASTAT>0!(PXCASTAT<-1) D EVENT ; Let the rest of the world look at the array
; if there are now errors
Q
;
;----------------------------- BACKGROUND ---------------------------
BACKGND(PXCA,PXCASTAT,PXCAVSIT) ; Invoke the event point in the background
D VALIDATE(.PXCA) ; Verfify minimal data set is present and valid
S PXCASTAT=0 ; assume that event processing did not occur
Q:$D(PXCA("ERROR")) ; data did not pass validation
S ZTRTN="TASKED^PXCA",ZTDESC="PCE Device Interface Module"
S ZTDTH=$H,ZTIO=""
I $G(DUZ)'>0 S DUZ=$P(PXCA("SOURCE"),"^",2)
I $G(DUZ)'>0 S DUZ=.5
I $D(DUZ("AG"))#2'=1 S DUZ("AG")="V"
S ZTSAVE("DUZ")=DUZ,ZTSAVE("DUZ(")=""
S ZTSAVE("PXCA(")=""
D ^%ZTLOAD
K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
I $D(ZTSK) S PXCASTAT=1 ; report that event processing occurred
E S PXCASTAT=0,PXCA("ERROR","ENCOUNTER",0,0,0)="Tasking of job failed."
Q
;
;------------------------------- TASKED -----------------------------
; processing of event point was off-loaded to the host
TASKED ; called by BACKGND only
N DIC
K DTOUT,DIROUT,X
S PXCASTAT=0 ; assume that event processing did not occur (for debug)
D EN^PXCA0
K DTOUT,DIC,DIROUT,X
S:'$D(PXCA("ERROR")) PXCASTAT=1 ; there were no errors so report that
; event processing occurred (for debug)
D EVENT ; Let the rest of the world look at the array
Q
;
;----------------------------- VALIDATED ----------------------------
VALIDATE(PXCA,PXCAVSIT) ;
D PROCESS^PXCA0(.PXCA,0,0)
Q
;
;---------------------------- EVENT POINT ---------------------------
EVENT ;
S X=+$O(^ORD(101,"B","PXCA DATA EVENT",0))_";ORD(101,"
D:+X>0 EN^XQOR
Q
;
PXCA ;ISL/dee & LEA/Chylton - Main entry points to PCE Device Interface Module ;12/17/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**5,14**;Aug 12, 1996
+2 QUIT
+3 ;
+4 ;----------------------------- FOREGROUND ---------------------------
FOREGND(PXCA,PXCASTAT,PXCAVSIT) ; Invoke the event point in the foreground
+1 ; if there are no errors
+2 ; assume that event processing did not occur
SET PXCASTAT=0
+3 DO EN^PXCA0
+4 ; there were no errors so report that
IF '$DATA(PXCA("ERROR"))
IF PXCASTAT=0
SET PXCASTAT=1
+5 ; event processing occurred
+6 ; Let the rest of the world look at the array
IF PXCASTAT>0!(PXCASTAT<-1)
DO EVENT
+7 ; if there are now errors
+8 QUIT
+9 ;
+10 ;----------------------------- BACKGROUND ---------------------------
BACKGND(PXCA,PXCASTAT,PXCAVSIT) ; Invoke the event point in the background
+1 ; Verfify minimal data set is present and valid
DO VALIDATE(.PXCA)
+2 ; assume that event processing did not occur
SET PXCASTAT=0
+3 ; data did not pass validation
IF $DATA(PXCA("ERROR"))
QUIT
+4 SET ZTRTN="TASKED^PXCA"
SET ZTDESC="PCE Device Interface Module"
+5 SET ZTDTH=$HOROLOG
SET ZTIO=""
+6 IF $GET(DUZ)'>0
SET DUZ=$PIECE(PXCA("SOURCE"),"^",2)
+7 IF $GET(DUZ)'>0
SET DUZ=.5
+8 IF $DATA(DUZ("AG"))#2'=1
SET DUZ("AG")="V"
+9 SET ZTSAVE("DUZ")=DUZ
SET ZTSAVE("DUZ(")=""
+10 SET ZTSAVE("PXCA(")=""
+11 DO ^%ZTLOAD
+12 KILL ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
+13 ; report that event processing occurred
IF $DATA(ZTSK)
SET PXCASTAT=1
+14 IF '$TEST
SET PXCASTAT=0
SET PXCA("ERROR","ENCOUNTER",0,0,0)="Tasking of job failed."
+15 QUIT
+16 ;
+17 ;------------------------------- TASKED -----------------------------
+18 ; processing of event point was off-loaded to the host
TASKED ; called by BACKGND only
+1 NEW DIC
+2 KILL DTOUT,DIROUT,X
+3 ; assume that event processing did not occur (for debug)
SET PXCASTAT=0
+4 DO EN^PXCA0
+5 KILL DTOUT,DIC,DIROUT,X
+6 ; there were no errors so report that
IF '$DATA(PXCA("ERROR"))
SET PXCASTAT=1
+7 ; event processing occurred (for debug)
+8 ; Let the rest of the world look at the array
DO EVENT
+9 QUIT
+10 ;
+11 ;----------------------------- VALIDATED ----------------------------
VALIDATE(PXCA,PXCAVSIT) ;
+1 DO PROCESS^PXCA0(.PXCA,0,0)
+2 QUIT
+3 ;
+4 ;---------------------------- EVENT POINT ---------------------------
EVENT ;
+1 SET X=+$ORDER(^ORD(101,"B","PXCA DATA EVENT",0))_";ORD(101,"
+2 IF +X>0
DO EN^XQOR
+3 QUIT
+4 ;