[613] | 1 | VAFHLNK1 ;ALB/GRR - HL7 NK1 SEGMENT BUILDER ;06/08/99
|
---|
| 2 | ;;5.3;Registration;**190**;Aug 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | ;This routine will build an HL7 NK1 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 | ;VAFHSTR - Sequence numbers to be included
|
---|
| 10 | ;
|
---|
| 11 | N VAFHLREC,VAFHA,VAFHSUB,VAFHADD,VAFHLOC,VAFHREL,VAFHNAME S VAFHSUB=""
|
---|
| 12 | Q:$$GET1^DIQ(2,DFN,".211","I")="" ""
|
---|
| 13 | S $P(VAFHLREC,HL("FS"))="NK1"
|
---|
| 14 | S $P(VAFHLREC,HL("FS"),2)=1 ;THE SET ID FOR NK1
|
---|
| 15 | I VAFSTR[",2," S VAFHNAME=$$HLNAME^DGRUUTL($$GET1^DIQ(2,DFN,".211","E")),$P(VAFHLREC,HL("FS"),3)=$TR(VAFHNAME,"^",$E(HL("ECH"))) ;NEXT OF KIN NAME IN HL7 FORMAT
|
---|
| 16 | I VAFSTR[",3," S VAFHREL=$$RELATE^DGRUUTL($$GET1^DIQ(2,DFN,".212","E")),$P(VAFHLREC,HL("FS"),4)=$P(VAFHREL,"^")_$E(HL("ECH"))_$P(VAFHREL,"^",2) ;NEXT OF KIN RELATIONSHIP
|
---|
| 17 | I VAFSTR[",4," D
|
---|
| 18 | .S VAFHADD=$$GET1^DIQ(2,DFN,".213","E")_"^"_$$GET1^DIQ(2,DFN,".214","E")_"^"_$$GET1^DIQ(2,DFN,".215","E") ;NEXT OF KIN STREET ADDRESS'S
|
---|
| 19 | .S VAFHLOC=$$GET1^DIQ(2,DFN,".216","E")_"^"_$$GET1^DIQ(2,DFN,".217","I")_"^"_$$GET1^DIQ(2,DFN,".218","E") ;NEXT OF KIN CITY, STATE, AND ZIP
|
---|
| 20 | .S $P(VAFHLREC,HL("FS"),5)=$$HLADDR^HLFNC(VAFHADD,VAFHLOC) ;CONVERT TO HL7 FORMAT
|
---|
| 21 | I VAFSTR[",5," S $P(VAFHLREC,HL("FS"),6)=$$HLPHONE^HLFNC($$GET1^DIQ(2,DFN,".219","E")) ;NEXT OF KIN HOME PHONE IN HL7 FORMAT
|
---|
| 22 | QUITNK1 Q VAFHLREC
|
---|