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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1VAFHLPV2 ;ALB/GRR - HL7 PV2 SEGMENT BUILDER ; 3/6/06 8:25am
2 ;;5.3;Registration;**190,692**;Aug 13, 1993
3 ;
4 ;This routine will build an HL7 PV2 segment for an inpatient.
5 ;
6EN(DFN,VAFHMIEN,VAFSTR) ;Entry point of routine
7 ;DFN - Patient Internal Entry Number
8 ;VAFHMIEN - Patient Movement Internal Entry Number
9 ;VAFSTR - Sequence numbers to include in message
10 ;
11 N VAFHLREC,VAFHA,VAFHSUB S VAFHSUB="" ;Initialize variables
12 S $P(VAFHLREC,HL("FS"))="PV2" ;Set segment type to PV2
13 S VAFHMIEN=$$GETAMOV^DGRUUTL(DFN) I VAFHMIEN="" G QUITPV2 ;If movement ien not passed, get admission movement and quit if none
14 I VAFSTR[",3," D
15 .S VAFHA=$$GET1^DIQ(405,VAFHMIEN,".11","I") ;retrieve 'Admitted for SC Condition' field
16 .I VAFHA=1 D ;If admitted for SC condition do following
17 ..S $P(VAFHSUB,$E(HL("ECH")),4)="SC"
18 ..S $P(VAFHSUB,$E(HL("ECH")),5)="ADMITTED FOR SC CONDITION"
19 ..S $P(VAFHSUB,$E(HL("ECH")),6)="VA0039"
20 .I VAFHA'=1 D ;If not admitted for SC condition do following
21 ..S $P(VAFHSUB,$E(HL("ECH")),4)="NSC"
22 ..S $P(VAFHSUB,$E(HL("ECH")),5)="NOT ADMITTED FOR SC CONDITION"
23 ..S $P(VAFHSUB,$E(HL("ECH")),6)="VA0039"
24 .S $P(VAFHLREC,HL("FS"),4)=VAFHSUB
25 ;If call center param is on add privacy indicator
26 I VAFSTR[",22," D
27 .S VAIP("D")=$G(VAFHDT) D IN5^VADPT
28 .S $P(VAFHLREC,HL("FS"),23)=$S(+VAIP(19,1)=1:"Y",+VAIP(19,1)=0:"N",1:"")
29 .D KVAR^VADPT
30QUITPV2 Q VAFHLREC
Note: See TracBrowser for help on using the repository browser.