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

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

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1PXEDIELU ;ISL/PKR - Look up Device Interface errors and report them. ;9/18/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**5**;Aug 12, 1996
3 ;
4 ;=======================================================================
5EDT ;Look up by encounter date and time.
6 N IEN,EDT,VIEN
7 S EDT=BENDT-.0001
8 F S EDT=$O(^AUPNVSIT("B",EDT)) Q:(EDT>EENDT)!(EDT="") D
9 . S VIEN="",VIEN=$O(^AUPNVSIT("B",EDT,VIEN))
10 . S IEN=""
11 . F S IEN=$O(^PX(839.01,"AD",VIEN,IEN)) Q:(IEN="") D
12 .. S ^TMP("PXEDI",$J,"EDT",0,IEN)=^PX(839.01,IEN,0)
13 Q
14 ;
15 ;=======================================================================
16ERN ;Look up by error number.
17 N ERN
18 I BERN=0 Q
19 S ERN=BERN-1
20 F S ERN=$O(^PX(839.01,ERN)) Q:(ERN>EERN)!(+ERN=0) D
21 . S ^TMP("PXEDI",$J,"ERN",0,ERN)=^PX(839.01,ERN,0)
22 Q
23 ;
24 ;=======================================================================
25PAT ;Look up by patient.
26 N IC,IEN
27 F IC=1:1:NPATIENT D
28 . S IEN=""
29 . F S IEN=$O(^PX(839.01,"C",PATIENT(IC),IEN)) Q:(IEN="") D
30 .. S ^TMP("PXEDI",$J,"PAT",PATIENT(IC),IEN)=^PX(839.01,IEN,0)
31 Q
32 ;
33 ;=======================================================================
34PDT ;Look up by processing date and time.
35 N IEN,PDT
36 S PDT=BERDT-.0001
37 F S PDT=$O(^PX(839.01,"B",PDT)) Q:(PDT>EERDT)!(PDT="") D
38 . S IEN="",IEN=$O(^PX(839.01,"B",PDT,IEN))
39 . S ^TMP("PXEDI",$J,"PDT",0,IEN)=^PX(839.01,IEN,0)
40 Q
41 ;
Note: See TracBrowser for help on using the repository browser.