source: WorldVistAEHR/trunk/r/VISTA_OFFICE_EHR-VEPE/VEPERIER.m@ 1270

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1VEPERIER ;DAOU/KFK;ERROR REPORT FOR PATIENT LOOKUP; ; 6/3/05 5:27pm
2 ;;1.0;VOEB;;Jun 12, 2005;Build 1
3 ;
4 ; This is the routine for the Patient Lookup Error Report.
5 ;
6 ; Must call at EN
7 Q
8 ;
9EN ; Main entry pt
10 ; Init vars
11 N STOP,HL7ERTN,POP,HL7ESPC
12 ;
13 S STOP=0,HL7ERTN="VEPERIER"
14 ;
15 ;Check for email
16 I $D(HL7ESPC("MM")) D G EXIT
17 . D COMPILE(HL7ERTN,.HL7ESPC)
18R5 ;
19 W @IOF
20 W !,"Error messages are generated daily. Please select a date or date"
21 W !,"range when errors were generated to view the associated error detail."
22 ;
23 ; Date Range params
24R10 D DTRANGE I STOP G:$$STOP EXIT G R5
25 ; Sort by param - Foreign ID or Patient
26R50 D SORT I STOP G:$$STOP EXIT G R10
27 ; Select output device
28R100 D DEVICE(HL7ERTN,.HL7ESPC) I STOP G:$$STOP EXIT G R50
29 G EXIT
30 ;
31EXIT ; Exit pt
32 Q
33 ;
34COMPILE(HL7ERTN,HL7ESPC) ;
35 ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
36 ; Input params:
37 ; HL7ERTN = Routine name for ^TMP($J,...
38 ; HL7ESPC = Array passed by ref of the report params
39 ;
40 ; Init scratch globals
41 K ^TMP($J,HL7ERTN)
42 ; Compile
43 D EN^VEPERPT(HL7ERTN,.HL7ESPC)
44 ; Print
45 I '$G(ZTSTOP) D
46 . D EN6^VEPERPTA(HL7ERTN)
47 ; Close device
48 D ^%ZISC
49 ; Kill scratch globals
50 K ^TMP($J,HL7ERTN)
51 ; Purge task record
52 I $D(ZTQUEUED) S ZTREQ="@"
53 ;
54COMPILX ; COMPILE exit pt
55 Q
56 ;
57STOP() ; Determine if user wants to exit out of the whole option
58 ; Init vars
59 N DIR,X,Y,DIRUT
60 ;
61 W !
62 S DIR(0)="Y"
63 S DIR("A")="Do you want to exit out of this option entirely"
64 S DIR("B")="YES"
65 S DIR("?",1)=" Enter YES to immediately exit out of this option."
66 S DIR("?")=" Enter NO to return to the previous question."
67 D ^DIR K DIR
68 I $D(DIRUT) S (STOP,Y)=1 G STOPX
69 I 'Y S STOP=0
70 ;
71STOPX ; STOP exit pt
72 Q Y
73 ;
74DTRANGE ; Determine start and end dates for date range param
75 ; Init vars
76 N X,Y,DIRUT
77 ;
78 W !
79 ;
80 S DIR(0)="D^:-NOW:EX"
81 S DIR("A")="Start DATE"
82 S DIR("?",1)=" Please enter a valid date for which an Error Message"
83 S DIR("?")=" would have been received. Future dates are not allowed."
84 D ^DIR K DIR
85 I $D(DIRUT) S STOP=1 G DTRANGX
86 S HL7ESPC("BEGDT")=Y
87 ; End date
88DTRANG1 S DIR(0)="DA^"_Y_":-NOW:EX"
89 S DIR("A")=" End DATE: "
90 S DIR("?",1)=" Please enter a valid date for which an Error Message"
91 S DIR("?",2)=" would have been received. This date must not precede"
92 S DIR("?")=" the Start Date. Future dates are not allowed."
93 D ^DIR K DIR
94 I $D(DIRUT) S STOP=1 G DTRANGX
95 S HL7ESPC("ENDDT")=Y
96 ;
97DTRANGX ; DTRANGE exit pt
98 Q
99 ;
100TYPEX ; TYPE exit pt
101 Q
102 ;
103SORT ; Prompt to allow users to sort the report by Foreign ID (default) or
104 ; Patient Name
105 ; Init vars
106 N DIR,X,Y,DIRUT
107 ;
108 S DIR(0)="S^1:Patient ID;2:Patient Name;3:Error Type"
109 S DIR("A")="Select the primary sort field"
110 S DIR("B")=1
111 S DIR("?",1)=" 1 - Patient ID is the primary sort."
112 S DIR("?",2)=" (Default)"
113 S DIR("?",3)=" 2 - Patient Name is the primary sort."
114 S DIR("?")=" 3 - Error Type is the primary sort."
115 D ^DIR K DIR
116 I $D(DIRUT) S STOP=1 G SORTX
117 S HL7ESPC("SORT")=Y
118 ;
119SORTX ; SORT exit pt
120 Q
121 ;
122DEVICE(HL7ERTN,HL7ESPC) ; Device Handler and possible TaskManager calls
123 ;
124 ; Input params:
125 ; HL7ERTN = Routine name for ^TMP($J,...
126 ; HL7ESPC = Array passed by ref of the report params
127 ;
128 ; Init vars
129 N ZTRTN,ZTDESC,ZTSAVE,POP
130 ;
131 S ZTRTN="COMPILE^VEPERIER("""_HL7ERTN_""",.HL7ESPC)"
132 S ZTDESC="HL7 Error Report sorted by "_$S(HL7ESPC("SORT")="1":"Patient ID",HL7ESPC("SORT")=2:"Patient Name",1:"Error Type")
133 S ZTSAVE("HL7ESPC(")=""
134 S ZTSAVE("HL7ERTN")=""
135 D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
136 I POP S STOP=1
137 ;
138DEVICEX ; DEVICE exit pt
139 Q
140 ;
Note: See TracBrowser for help on using the repository browser.