1 | VAFHLIN2 ;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 | ;
|
---|
6 | EN(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
|
---|
23 | QUITIN2 Q VAFHLREC
|
---|