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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.1 KB
Line 
1VAFHLIN2 ;ALB/GRR/SCK - HL7 IN2 SEGMENT BUILDER ;06/08/99~4-MAR-05
2 ;;5.3;Registration;**190,421,670**;Aug 13, 1993
3 ;
4 ;This routine will build an HL7 IN2 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 be included
10 ;
11 ; Patch 670
12 ; The Insurance Encapsulation API does not return the Insured's
13 ; Employer Name and ID (IN2-3) at this time. This field will not
14 ; be populated.
15 ;
16 N VAFINS,VAFHLREC,VAFHA,VAFHSUB,VAFHADD,VAFHLOC,VAFHNAME,VAFX,VAFTMP S VAFHSUB=""
17 S VAFX=$$INSUR^IBBAPI(DFN,,"R",.VAFTMP,"*")
18 S $P(VAFHLREC,HL("FS"))="IN2" ;Set segment type to IN2
19 I VAFSTR[",2," S $P(VAFHLREC,HL("FS"),3)=$$GET1^DIQ(2,DFN,".09","I") ;Patient SSN
20 I VAFSTR[",3," S $P(VAFHLREC,HL("FS"),4)=$E(HL("ECH")) ; VAFHNAME=$P($G(VAFINS(2,2)),"^",9),$P(VAFHLREC,HL("FS"),4)=$E(HL("ECH"))_VAFHNAME
21 I VAFSTR[",6," S $P(VAFHLREC,HL("FS"),7)=$$MEDICARE^DGRUUTL(DFN) ;Set to Medicare Number or null
22 I VAFSTR[",8," S $P(VAFHLREC,HL("FS"),9)=$$MEDICAID^DGRUUTL(DFN) ;Set to Medicaid Number or null; p-421
23QUITIN2 Q VAFHLREC
Note: See TracBrowser for help on using the repository browser.