VAFHLZIE ;ALB/KCL - Create generic HL7 Ineligible (ZIE) segment ; 12-SEPTEMBER-1997
;;5.3;Registration;**122**;Aug 13, 1993
;
;
; This generic extrinsic function is designed to return the
; HL7 Ineligible (ZIE) segment. This segment contains VA-specific
; ineligible information from the Patient (#2) file for a patient.
;
EN(DFN,VAFSTR,VAFNUM,VAFHLQ,VAFHLFS) ; --
; Entry point for creating HL7 Ineligible (ZIE) segment.
;
; Input(s):
; DFN - internal entry number of Patient (#2) file
; VAFSTR - (optional) string of fields requested, separated by
; commas. If not passed, return all data fields.
; VAFNUM - (optional) sequential number for SET ID (default=1)
; VAFHLQ - (optional) HL7 null variable.
; VAFHLFS - (optional) HL7 field separator.
;
; Output(s):
; String containing the desired components of the HL7 ZIE segment
;
N VAFY,VAF15,VAF3,VAFINE
;
; if VAFHLQ or VAFHLFS not passed, use default HL7 variables
S VAFHLQ=$S($D(VAFHLQ):VAFHLQ,1:$G(HLQ)),VAFHLFS=$S($D(VAFHLFS):VAFHLFS,1:$G(HLFS))
;
; if set id not passed, use default
S VAFNUM=$S($G(VAFNUM):VAFNUM,1:1)
;
; if DFN not passed, exit
I '$G(DFN) S VAFY=1 G ENQ
;
; if VAFSTR not passed, return all data fields
I $G(VAFSTR)']"" S VAFSTR="1,2,3,4"
;
; initialize output string and requested data fields
S $P(VAFY,VAFHLFS,5)="",VAFSTR=","_VAFSTR_","
;
; get ineligible data nodes of Patient (#2) file
S VAF15=$G(^DPT(DFN,.15)),VAF3=$G(^(.3)),VAFINE=$G(^("INE"))
;
S $P(VAFY,VAFHLFS,1)=$S($G(VAFNUM):VAFNUM,1:1) ; Set ID
I VAFSTR[",2," S $P(VAFY,VAFHLFS,2)=$S($P(VAF15,"^",2)]"":$$HLDATE^HLFNC($P(VAF15,"^",2)),1:VAFHLQ) ; Ineligible Date
I VAFSTR[",3," S $P(VAFY,VAFHLFS,3)=$S($P(VAF3,"^",7)]"":$P(VAF3,"^",7),1:VAFHLQ) ; Ineligible Reason
I VAFSTR[",4," S $P(VAFY,VAFHLFS,4)=$S($P(VAFINE,"^",6)]"":$P(VAFINE,"^",6),1:VAFHLQ) ; Ineligible VARO Decision
;
ENQ Q "ZIE"_VAFHLFS_$G(VAFY)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAFHLZIE 1992 printed Dec 13, 2024@03:03:30 Page 2
VAFHLZIE ;ALB/KCL - Create generic HL7 Ineligible (ZIE) segment ; 12-SEPTEMBER-1997
+1 ;;5.3;Registration;**122**;Aug 13, 1993
+2 ;
+3 ;
+4 ; This generic extrinsic function is designed to return the
+5 ; HL7 Ineligible (ZIE) segment. This segment contains VA-specific
+6 ; ineligible information from the Patient (#2) file for a patient.
+7 ;
EN(DFN,VAFSTR,VAFNUM,VAFHLQ,VAFHLFS) ; --
+1 ; Entry point for creating HL7 Ineligible (ZIE) segment.
+2 ;
+3 ; Input(s):
+4 ; DFN - internal entry number of Patient (#2) file
+5 ; VAFSTR - (optional) string of fields requested, separated by
+6 ; commas. If not passed, return all data fields.
+7 ; VAFNUM - (optional) sequential number for SET ID (default=1)
+8 ; VAFHLQ - (optional) HL7 null variable.
+9 ; VAFHLFS - (optional) HL7 field separator.
+10 ;
+11 ; Output(s):
+12 ; String containing the desired components of the HL7 ZIE segment
+13 ;
+14 NEW VAFY,VAF15,VAF3,VAFINE
+15 ;
+16 ; if VAFHLQ or VAFHLFS not passed, use default HL7 variables
+17 SET VAFHLQ=$SELECT($DATA(VAFHLQ):VAFHLQ,1:$GET(HLQ))
SET VAFHLFS=$SELECT($DATA(VAFHLFS):VAFHLFS,1:$GET(HLFS))
+18 ;
+19 ; if set id not passed, use default
+20 SET VAFNUM=$SELECT($GET(VAFNUM):VAFNUM,1:1)
+21 ;
+22 ; if DFN not passed, exit
+23 IF '$GET(DFN)
SET VAFY=1
GOTO ENQ
+24 ;
+25 ; if VAFSTR not passed, return all data fields
+26 IF $GET(VAFSTR)']""
SET VAFSTR="1,2,3,4"
+27 ;
+28 ; initialize output string and requested data fields
+29 SET $PIECE(VAFY,VAFHLFS,5)=""
SET VAFSTR=","_VAFSTR_","
+30 ;
+31 ; get ineligible data nodes of Patient (#2) file
+32 SET VAF15=$GET(^DPT(DFN,.15))
SET VAF3=$GET(^(.3))
SET VAFINE=$GET(^("INE"))
+33 ;
+34 ; Set ID
SET $PIECE(VAFY,VAFHLFS,1)=$SELECT($GET(VAFNUM):VAFNUM,1:1)
+35 ; Ineligible Date
IF VAFSTR[",2,"
SET $PIECE(VAFY,VAFHLFS,2)=$SELECT($PIECE(VAF15,"^",2)]"":$$HLDATE^HLFNC($PIECE(VAF15,"^",2)),1:VAFHLQ)
+36 ; Ineligible Reason
IF VAFSTR[",3,"
SET $PIECE(VAFY,VAFHLFS,3)=$SELECT($PIECE(VAF3,"^",7)]"":$PIECE(VAF3,"^",7),1:VAFHLQ)
+37 ; Ineligible VARO Decision
IF VAFSTR[",4,"
SET $PIECE(VAFY,VAFHLFS,4)=$SELECT($PIECE(VAFINE,"^",6)]"":$PIECE(VAFINE,"^",6),1:VAFHLQ)
+38 ;
ENQ QUIT "ZIE"_VAFHLFS_$GET(VAFY)