source: WorldVistAEHR/trunk/r/VDEF-VDEF/VDEFREQ1.m@ 1036

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1VDEFREQ1 ;INTEGIC/AM & BPOIFO/JG - VDEF Request Processor 2; 21 Dec 2004 11:24 AM
2 ;;1.00;VDEF;;Dec 17, 2004
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ; IA's: #4316 - Lookup to file #869.3
6 ;
7 Q ; No bozos
8 ;
9 ; Generate HL7 message
10GENERATE(NVPIEN,HLA,HLCS,IEN577,SUBT,DSTPROT,DSTTYP,ZTSTOP,VDEFHL,DYNAMIC) ;
11 N CNT,ARYTYP,HLL,II,VDEFOPT,VDEFRES,EXTPRG
12 ;
13 ; Build the HLL("LINKS") array for VistA HL7 Dynamic Addressing from
14 ; the DYNAMIC array
15 F II=0:0 S II=$O(DYNAMIC(II)) Q:'II D
16 . N SUB S SUB=$G(DYNAMIC(II,0)) I SUB="" Q
17 . S HLL("LINKS",SUB)=$G(DYNAMIC(II,1))
18 ;
19 ; Set up control part of MSH for VistA HL7
20 S VDEFOPT("CONTPTR")=HLCS_HLCS_HLCS_SUBT
21 ;
22 ; Check to see if message extraction is active for this event
23 S EXTPRG=$$GET1^DIQ(577,IEN577_",",.3) S:EXTPRG="" EXTPRG="INACTIVE"
24 I EXTPRG="INACTIVE" D ERR^VDEFREQ("VDEF Event is not active") S ZTSTOP=1 Q
25 ;
26 ; Call the extraction program as a function and quit if error returned (ZTSTOP)
27 S ZTSTOP=0,@("ARYTYP=$$EN^"_EXTPRG_"(IEN577,NVPIEN,DSTTYP,.HLA,VDEFOPT(""CONTPTR""))")
28 K OUT Q:ZTSTOP'=0
29 ;
30 ; Send to VistA HL7, stop processing if error from HL7
31 D GENERATE^HLMA(DSTPROT,$P(ARYTYP,U,1),1,.VDEFRES)
32 I $P($G(VDEFRES),U,2) D ERR^VDEFREQ("VistA HL7 Error: "_$P(VDEFRES,U,3)) S ZTSTOP=2 Q
33 ;
34 ; Update date/time message created
35 D NOW^%DTC S FDA(1,579.31,IENS,.1)=% D FILE^DIE("","FDA(1)","ERR(1)") K FDA
36 I 'ZTSTOP,'$$S^%ZTLOAD(),$$GET1^DIQ(579.3,QIEN_",",.09,"I")'="S" Q
37 S ZTSTOP=1
38 Q
39 ;
40 ; Update statue of request
41STATUS(IENS,STATUS) ;
42 ; If the status is to be changed to "P"rocessed, update related DTS
43 N FDA I STATUS="P" D NOW^%DTC S FDA(1,579.31,IENS,.13)=%
44 S FDA(1,579.31,IENS,.02)=STATUS D FILE^DIE("","FDA(1)","ERR(1)")
45 Q
Note: See TracBrowser for help on using the repository browser.