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

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1PXEDIEL ;ISL/PKR - PCE device interface error listing utilities. ;6/7/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
3 ;
4 ;=======================================================================
5ARRAY(PXCAEIEN) ;Restores the local array PXCA from the error file.
6 ;;This comes from pcazfix.
7 K PXCA
8 N PXCAINDX,PXCAVAR
9 S PXCAINDX=0
10 F S PXCAINDX=$O(^PX(839.01,PXCAEIEN,2,PXCAINDX)) Q:PXCAINDX'>0 D
11 . S PXCAVAR=^PX(839.01,PXCAEIEN,2,PXCAINDX,0)
12 . S @PXCAVAR=$TR(^PX(839.01,PXCAEIEN,2,PXCAINDX,2),"~","^")
13 Q
14 ;
15 ;=======================================================================
16ENC(ERRNUM) ;Try to return the encounter information for the error array.
17 N IND,DONE,ENCNTER,TEMP
18 S ENCNTER=""
19 S (DONE,IND)=0
20 F S IND=$O(^PX(839.01,ERRNUM,2,IND)) Q:('IND)!(DONE) D
21 . I ^PX(839.01,ERRNUM,2,IND,0)="PXCA(""ENCOUNTER"")" D
22 .. S ENCNTER=^PX(839.01,ERRNUM,2,IND,2)
23 .. S DONE=1
24 ;
25 Q ENCNTER
26 ;
27 ;=======================================================================
28ERRLST ;Write out the error list.
29 N AFTER,BEFORE,C1S,DFN,EM,ENCDATE,ENCNTER,ENTRY,ENUM,ERRMSG,EVAR
30 N IEN,FIELD,FIELDNAM,FILE,FILENAM,FILENUM,HLOCIEN,HLOCNAM,INDENT,NODE
31 N PATIENT,PXERR,TEMP,TEXT
32 ;
33 S INDENT=3
34 S C1S=INDENT+3
35 ;
36 ;Setup the correspondence between abbreviations and file numbers.
37 S FILENUM("CPT")=9000010.18,FILENUM("HF")=9000010.23
38 S FILENUM("IMM")=9000010.11,FILENUM("PED")=9000010.16
39 S FILENUM("POV")=9000010.07,FILENUM("PRV")=9000010.06
40 S FILENUM("SK")=9000010.12,FILENUM("TRT")=9000010.15
41 S FILENUM("XAM")=9000010.13,FILENUM("VST")=9000010
42 ;
43 S ENUM=0
44 ;Build the error array.
45 F S ENUM=$O(^TMP("PXEDI",$J,TYPE,PATDFN,ENUM)) Q:(ENUM="")!(DONE) D
46 .;Check for a user request to stop the task.
47 . I $$S^%ZTLOAD S ZTSTOP=1,DONE=1 Q
48 .;
49 . S EM=^TMP("PXEDI",$J,TYPE,PATDFN,ENUM)
50 . S ENCNTER=$$ENC(ENUM)
51 . I ENCNTER>0 S ENCDATE=$P(ENCNTER,"~",1)
52 . E S ENCDATE=""
53 . S HLOCIEN=$P(ENCNTER,"~",3)
54 .;This is the same usage as in PXRRECSE. It should fall under the same
55 .;DBIA.
56 . I HLOCIEN>0 S HLOCNAM=$P(^SC(HLOCIEN,0),U,1)
57 . E S HLOCNAM="Missing"
58 . S DFN=$P(EM,U,2)
59 . D DEM^VADPT
60 . I $D(VADM(1)) S PATIENT=VADM(1)_" "_$P(VADM(2),U,2)
61 . E S PATIENT="Missing"
62 . D ARRAY(ENUM)
63 . I $Y>(IOSL-8) D PAGE^PXEDIP
64 . I DONE Q
65 . W !,"------------------------------------------------------------------------"
66 . W !,"Error Number: ",ENUM
67 . W !,?INDENT,"Patient: ",PATIENT
68 . W !,?INDENT,"Hospital Location: ",HLOCNAM
69 . W !,?INDENT,"Encounter date: "
70 . I +ENCDATE>0 W $$FMTE^XLFDT(ENCDATE)
71 . E W "Missing"
72 . W !,?INDENT,"Processing date: ",$$FMTE^XLFDT($P(EM,U,1))
73 .;
74 . S EVAR=0
75 . F S EVAR=$O(^PX(839.01,ENUM,1,EVAR)) Q:(EVAR="")!(DONE) D
76 .. S PXERR=$P($G(^PX(839.01,ENUM,1,1,0)),"(",2)
77 .. S TEXT=$G(^PX(839.01,ENUM,1,1,1))
78 .. S FILE=$P(PXERR,",",1),FILE=$TR(FILE,"""","")
79 .. S ENTRY=$P(PXERR,",",2)
80 .. S IEN=$P(PXERR,",",3)
81 .. I $L(IEN)=0 S IEN="Missing"
82 .. S FIELD=$P(PXERR,",",4),FIELD=$TR(FIELD,")","")
83 .. S FILENO=$G(FILENUM(FILE))
84 .. S NODE=""
85 .. I ($L(FILE)>0)&($L(ENTRY)>0) D
86 ... S NODE=$O(^TMP("PXCA",$J,FILE,ENTRY,NODE))
87 .. I $L(NODE)>0 D
88 ... S AFTER=$G(^TMP("PXCA",$J,FILE,ENTRY,NODE,"AFTER"))
89 ... S BEFORE=$G(^TMP("PXCA",$J,FILE,ENTRY,NODE,"BEFORE"))
90 .. E S (AFTER,BEFORE,NODE)="Missing"
91 .. I FILENO>0 S FILENAM=$$GET1^DID(FILENO,"","","NAME","TEMP","ERRMSG")
92 .. E S FILENAM="Missing"
93 .. I $Y>(IOSL-8) D PAGE^PXEDIP
94 .. I DONE Q
95 .. W !!,?INDENT,"File: ",FILENO," (",FILENAM,")"
96 .. W " IEN: ",IEN
97 ..;If FIELD=0 then the error applies to the entire entry, not just a
98 ..;field.
99 .. I FIELD>0 D
100 ... S FIELDNAM=$$GET1^DID(FILENO,FIELD,"","LABEL","TEMP","ERRMSG")
101 ... W " Field ",FIELD," (",FIELDNAM,")"
102 .. W !,?INDENT,"Error message: ",TEXT
103 .. W !,?INDENT,"Node: ",NODE
104 .. W !,?C1S,"Original: ",BEFORE
105 .. W !,?C1S," Updated: ",AFTER
106 D KVA^VADPT
107 K PXCA
108 K ^TMP("PXCA",$J)
109 Q
110 ;
Note: See TracBrowser for help on using the repository browser.