source: WorldVistAEHR/trunk/r/VISTA_OFFICE_EHR-VEPE/VEPERMM.m@ 1286

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

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1VEPERMM ;DAOU/KFK; HL7 ERROR REPORT MAIL MESSAGE GENERATION; ; 6/3/05 4:16pm
2 ;;1.0;;;;Build 1
3 ; This routine will determine if there is a mailgroup that is to
4 ; receive the HL7 Error Report for Patient Lookup.
5 ;
6 ; Need to enter routine at a TAG.
7 Q
8 ;
9MMEN ; Tag to be called by TaskMan to generate report with default values
10 ; and send as MailMan message
11 ;
12 ; Initialize variables
13 N BDT,EDT,HL7ERTN,HL7ESPC,TM
14 ;
15 ; Default report parameters
16 ; Start Date/Time - End Date/Time range
17 ; Determine start time based on site parameter
18 ;
19 S TM=$$GET1^DIQ(350.9,"1,",51.03,"E")
20 I TM=""!(TM=0) S TM="2400"
21 S EDT=$$DT^XLFDT
22 S BDT=$$FMADD^XLFDT(EDT,-1)
23 S HL7ESPC("BEGDTM")=+(BDT_"."_TM)
24 S HL7ESPC("ENDDTM")=+(EDT_"."_TM)
25 ; Sort by Patient
26 S HL7ESPC("SORT")=2
27 ; Set MailMan flag to site parameter email address
28 S HL7ESPC("MM")=$$MGRP^IBCNEUT5
29 ; If there is no email address to send message - do not continue
30 I HL7ESPC("MM")="" Q
31 ; If the send email message parameter is turned off, stop the process
32 I '$P($G(^IBE(350.9,1,51)),U,2) Q
33 ;
34 ; Set routine parameter
35 S HL7ERTN="VEPERIER"
36 ;
37 ; Initialize scratch global
38 K ^TMP($J,HL7ERTN)
39 ;
40 ; Compile the report data
41 I '$G(ZSTOP) D EN^VEPERIER(HL7ERTN,HL7ESPC)
42 ;
43 ; Kill scratch global
44 K ^TMP($J,HL7ERTN)
45 ;
46 ; Purge the task record
47 I $D(ZTQUEUED) S ZTREQ="@"
48 ;
49 ; MAILMSG exit
50 Q
Note: See TracBrowser for help on using the repository browser.