source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGRUGA11.m@ 1432

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1DGRUGA11 ;ALB/GRR - HL7 ADT A11 MESSAGE BUILDER ;8/5/99 15:33
2 ;;5.3;Registration;**190**;Aug 13, 1993
3 ;
4 ;This routine will build a ADT A11 (Cancel Admit) HL7 message for an inpatient.
5 ;
6EN(DFN,DGMIEN,DGARRAY,DGWARD,DGDT) ;Entry point of routine
7 ;DFN - Patient Internal Entry Number
8 ;DGMIEN - Patient Movement Internal Entry Number
9 ;DGARRAY - Name of output array by reference where built message will be contained.
10 ;DGWARD - IEN of Ward Location (OPTIONAL)
11 ;
12 ;The HL7 variables must be initialized before calling this routine!
13 ;HL("FS"),HL("ECH"),HLFS,HLECH, and HLQ are used by segment builders called by this routine
14 ;
15 N DGCNT,DGMDT,DGCDT,DGOADT,DGPV1,DGICD,DGICDCNT,DGIN,DGINCNT,DGWARDNM,DGCTRAN,DGHMDT S DGCNT=0,DGWARDNM=""
16 Q:DGARRAY="" ;Required output variable name was not passed
17 K @DGARRAY ;Kill output array to insure erronuous data does not exist
18 S DGMDT=$S($G(DGCTRAN)=1:+DGPMP,1:$$GET1^DIQ(405,DGMIEN,.01,"I")),DGHMDT=$$HLDATE^HLFNC(DGMDT)
19 D NOW^%DTC S DGCDT=$$HLDATE^HLFNC(%) ;Get current date/time and convert to HL7 format
20 S DGCNT=DGCNT+1 ;Increment node counter by one for first segment
21 S @DGARRAY@(DGCNT)=$$EVN^VAFHLEVN("A11","05",DGMDT) ;Create Event segment and store in output array (Use current date/time for cancel)
22 S DGCNT=DGCNT+1 ;Increment node counter by one for next segment
23 S @DGARRAY@(DGCNT)=$$EN^VAFCPID(DFN,",2,5,7,8,10,11,13,16,17,19,23,29",1) ;Create PID segment using segment sequence numbers passed and store in output array
24 I DGWARD]"" S DGWARDNM=$$GET1^DIQ(42,+DGWARD,.01)
25 S DGCNT=DGCNT+1 ;Increment node counter by one to store next segment
26 S DGPV1="PV1"_HL("FS")_1_HL("FS")_"I" ;Create the PV1 segment with no visit data and store in output array
27 S $P(DGPV1,HL("FS"),45)=$$HLDATE^HLFNC(DGDT) ;GRR 1/26/00
28 S DGOADT=$$CKADMIT^DGRUUTL1(DFN) ;check if integrated site get original admit date/time
29 I DGOADT]"" S $P(DGPV1,HL("FS"),45)=$$HLDATE^HLFNC(DGOADT)
30 S DGPV1=$$DOCID^DGRUUTL(DGPV1)
31 I DGWARDNM]"" S $P(DGPV1,HL("FS"),7)=DGWARDNM
32 S @DGARRAY@(DGCNT)=DGPV1
33 S DGCNT=DGCNT+1
34 S @DGARRAY@(DGCNT)="PV2"
35 Q
Note: See TracBrowser for help on using the repository browser.