PXEDIELU ;ISL/PKR - Look up Device Interface errors and report them. ;9/18/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**5**;Aug 12, 1996
;
;=======================================================================
EDT ;Look up by encounter date and time.
N IEN,EDT,VIEN
S EDT=BENDT-.0001
F S EDT=$O(^AUPNVSIT("B",EDT)) Q:(EDT>EENDT)!(EDT="") D
. S VIEN="",VIEN=$O(^AUPNVSIT("B",EDT,VIEN))
. S IEN=""
. F S IEN=$O(^PX(839.01,"AD",VIEN,IEN)) Q:(IEN="") D
.. S ^TMP("PXEDI",$J,"EDT",0,IEN)=^PX(839.01,IEN,0)
Q
;
;=======================================================================
ERN ;Look up by error number.
N ERN
I BERN=0 Q
S ERN=BERN-1
F S ERN=$O(^PX(839.01,ERN)) Q:(ERN>EERN)!(+ERN=0) D
. S ^TMP("PXEDI",$J,"ERN",0,ERN)=^PX(839.01,ERN,0)
Q
;
;=======================================================================
PAT ;Look up by patient.
N IC,IEN
F IC=1:1:NPATIENT D
. S IEN=""
. F S IEN=$O(^PX(839.01,"C",PATIENT(IC),IEN)) Q:(IEN="") D
.. S ^TMP("PXEDI",$J,"PAT",PATIENT(IC),IEN)=^PX(839.01,IEN,0)
Q
;
;=======================================================================
PDT ;Look up by processing date and time.
N IEN,PDT
S PDT=BERDT-.0001
F S PDT=$O(^PX(839.01,"B",PDT)) Q:(PDT>EERDT)!(PDT="") D
. S IEN="",IEN=$O(^PX(839.01,"B",PDT,IEN))
. S ^TMP("PXEDI",$J,"PDT",0,IEN)=^PX(839.01,IEN,0)
Q
;
PXEDIELU ;ISL/PKR - Look up Device Interface errors and report them. ;9/18/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**5**;Aug 12, 1996
+2 ;
+3 ;=======================================================================
EDT ;Look up by encounter date and time.
+1 NEW IEN,EDT,VIEN
+2 SET EDT=BENDT-.0001
+3 FOR
SET EDT=$ORDER(^AUPNVSIT("B",EDT))
IF (EDT>EENDT)!(EDT="")
QUIT
Begin DoDot:1
+4 SET VIEN=""
SET VIEN=$ORDER(^AUPNVSIT("B",EDT,VIEN))
+5 SET IEN=""
+6 FOR
SET IEN=$ORDER(^PX(839.01,"AD",VIEN,IEN))
IF (IEN="")
QUIT
Begin DoDot:2
+7 SET ^TMP("PXEDI",$JOB,"EDT",0,IEN)=^PX(839.01,IEN,0)
End DoDot:2
End DoDot:1
+8 QUIT
+9 ;
+10 ;=======================================================================
ERN ;Look up by error number.
+1 NEW ERN
+2 IF BERN=0
QUIT
+3 SET ERN=BERN-1
+4 FOR
SET ERN=$ORDER(^PX(839.01,ERN))
IF (ERN>EERN)!(+ERN=0)
QUIT
Begin DoDot:1
+5 SET ^TMP("PXEDI",$JOB,"ERN",0,ERN)=^PX(839.01,ERN,0)
End DoDot:1
+6 QUIT
+7 ;
+8 ;=======================================================================
PAT ;Look up by patient.
+1 NEW IC,IEN
+2 FOR IC=1:1:NPATIENT
Begin DoDot:1
+3 SET IEN=""
+4 FOR
SET IEN=$ORDER(^PX(839.01,"C",PATIENT(IC),IEN))
IF (IEN="")
QUIT
Begin DoDot:2
+5 SET ^TMP("PXEDI",$JOB,"PAT",PATIENT(IC),IEN)=^PX(839.01,IEN,0)
End DoDot:2
End DoDot:1
+6 QUIT
+7 ;
+8 ;=======================================================================
PDT ;Look up by processing date and time.
+1 NEW IEN,PDT
+2 SET PDT=BERDT-.0001
+3 FOR
SET PDT=$ORDER(^PX(839.01,"B",PDT))
IF (PDT>EERDT)!(PDT="")
QUIT
Begin DoDot:1
+4 SET IEN=""
SET IEN=$ORDER(^PX(839.01,"B",PDT,IEN))
+5 SET ^TMP("PXEDI",$JOB,"PDT",0,IEN)=^PX(839.01,IEN,0)
End DoDot:1
+6 QUIT
+7 ;