MHV7B1M ;KUM - HL7 message builder ACK^P03 Patient Eligibility and Classificaiton ; 10/30/14 3:06pm
;;1.0;My HealtheVet;**11,29**;July 10, 2017;Build 73
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
ZEL(MSGROOT,DATAROOT,CNT,LEN,HL) ; Build ZEL segments for Patient Eligibility and Classificaiton data
;
; Walks data in DATAROOT to populate MSGROOT with RDT segments
; sequentially numbered starting at CNT
;
; Integration Agreements:
; 10103 : FMTHL7^XLFDT
;
; Input:
; MSGROOT - Root of array holding the message
; DATAROOT - Root of array to hold extract data
; CNT - Current message line counter
; LEN - Current message length
; HL - HL7 package array variable
;
; Output:
; - Populated message array
; - Updated LEN and CNT
;
; POPULATE SEQUENCE NUMBER
N I,APP,RDT
D LOG^MHVUL2("MHV7B1M","BEGIN ZEL","S","TRACE")
F I=1:1 Q:'$D(@DATAROOT@(I)) D
. S APP=@DATAROOT@(I)
. S ZEL(0)="ZEL"
. I I=1 D
. . S ZEL(9)=$$ESCAPE^MHV7U($P(APP,"^",1),.HL) ;Patient Status
. . S ZEL(18)=$$ESCAPE^MHV7U($P(APP,"^",2),.HL) ;Agent Orange
. . S ZEL(19)=$$ESCAPE^MHV7U($P(APP,"^",3),.HL) ;Ionizing Radiation
. . S ZEL(31)=$$ESCAPE^MHV7U($P(APP,"^",4),.HL) ;SC Condition
. . S ZEL(20)=$$ESCAPE^MHV7U($P(APP,"^",5),.HL) ;Environmental Contamination
. . S ZEL(23)=$$ESCAPE^MHV7U($P(APP,"^",6),.HL) ;Military Sexual Truama
. . S ZEL(42)=$$ESCAPE^MHV7U($P(APP,"^",7),.HL) ;Head/Neck Cancer
. . ;Jazz 329293 - SM WLC Encounter Filed Triggers CPRS Action
. . ;S ZEL(37)=$$ESCAPE^MHV7U($P(APP,"^",8),.HL) ;Combat Veteran
. . S ZEL(37)=$$ESCAPE^MHV7U($E($P($P(APP,"^",8),"~",1),1),.HL) ;Combat Veteran
. . S ZEL(44)=$$ESCAPE^MHV7U($P($P(APP,"^",9),"~",1),.HL) ;Project 112/SHAD
. I I>1 D
. . S ZEL(1)=$$ESCAPE^MHV7U($P(APP,"^",1),.HL) ;Primary/Secondary Flag
. . S ZEL(3)=$$ESCAPE^MHV7U($P(APP,"^",2),.HL) ;Eligibility Code IEN
. . S ZEL(2)=$$ESCAPE^MHV7U($P(APP,"^",3),.HL) ;Eligibility Description
. . S CNT=CNT+1
. . S @MSGROOT@(CNT)=$$BLDSEG^MHV7U(.ZEL,.HL)
. . S LEN=LEN+$L(@MSGROOT@(CNT))
. . K ZEL
. Q
D LOG^MHVUL2("MHV7B1M","END ZEL","S","TRACE")
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHV7B1M 2243 printed Oct 16, 2024@18:16:26 Page 2
MHV7B1M ;KUM - HL7 message builder ACK^P03 Patient Eligibility and Classificaiton ; 10/30/14 3:06pm
+1 ;;1.0;My HealtheVet;**11,29**;July 10, 2017;Build 73
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
ZEL(MSGROOT,DATAROOT,CNT,LEN,HL) ; Build ZEL segments for Patient Eligibility and Classificaiton data
+1 ;
+2 ; Walks data in DATAROOT to populate MSGROOT with RDT segments
+3 ; sequentially numbered starting at CNT
+4 ;
+5 ; Integration Agreements:
+6 ; 10103 : FMTHL7^XLFDT
+7 ;
+8 ; Input:
+9 ; MSGROOT - Root of array holding the message
+10 ; DATAROOT - Root of array to hold extract data
+11 ; CNT - Current message line counter
+12 ; LEN - Current message length
+13 ; HL - HL7 package array variable
+14 ;
+15 ; Output:
+16 ; - Populated message array
+17 ; - Updated LEN and CNT
+18 ;
+19 ; POPULATE SEQUENCE NUMBER
+20 NEW I,APP,RDT
+21 DO LOG^MHVUL2("MHV7B1M","BEGIN ZEL","S","TRACE")
+22 FOR I=1:1
if '$DATA(@DATAROOT@(I))
QUIT
Begin DoDot:1
+23 SET APP=@DATAROOT@(I)
+24 SET ZEL(0)="ZEL"
+25 IF I=1
Begin DoDot:2
+26 ;Patient Status
SET ZEL(9)=$$ESCAPE^MHV7U($PIECE(APP,"^",1),.HL)
+27 ;Agent Orange
SET ZEL(18)=$$ESCAPE^MHV7U($PIECE(APP,"^",2),.HL)
+28 ;Ionizing Radiation
SET ZEL(19)=$$ESCAPE^MHV7U($PIECE(APP,"^",3),.HL)
+29 ;SC Condition
SET ZEL(31)=$$ESCAPE^MHV7U($PIECE(APP,"^",4),.HL)
+30 ;Environmental Contamination
SET ZEL(20)=$$ESCAPE^MHV7U($PIECE(APP,"^",5),.HL)
+31 ;Military Sexual Truama
SET ZEL(23)=$$ESCAPE^MHV7U($PIECE(APP,"^",6),.HL)
+32 ;Head/Neck Cancer
SET ZEL(42)=$$ESCAPE^MHV7U($PIECE(APP,"^",7),.HL)
+33 ;Jazz 329293 - SM WLC Encounter Filed Triggers CPRS Action
+34 ;S ZEL(37)=$$ESCAPE^MHV7U($P(APP,"^",8),.HL) ;Combat Veteran
+35 ;Combat Veteran
SET ZEL(37)=$$ESCAPE^MHV7U($EXTRACT($PIECE($PIECE(APP,"^",8),"~",1),1),.HL)
+36 ;Project 112/SHAD
SET ZEL(44)=$$ESCAPE^MHV7U($PIECE($PIECE(APP,"^",9),"~",1),.HL)
End DoDot:2
+37 IF I>1
Begin DoDot:2
+38 ;Primary/Secondary Flag
SET ZEL(1)=$$ESCAPE^MHV7U($PIECE(APP,"^",1),.HL)
+39 ;Eligibility Code IEN
SET ZEL(3)=$$ESCAPE^MHV7U($PIECE(APP,"^",2),.HL)
+40 ;Eligibility Description
SET ZEL(2)=$$ESCAPE^MHV7U($PIECE(APP,"^",3),.HL)
+41 SET CNT=CNT+1
+42 SET @MSGROOT@(CNT)=$$BLDSEG^MHV7U(.ZEL,.HL)
+43 SET LEN=LEN+$LENGTH(@MSGROOT@(CNT))
+44 KILL ZEL
End DoDot:2
+45 QUIT
End DoDot:1
+46 DO LOG^MHVUL2("MHV7B1M","END ZEL","S","TRACE")
+47 QUIT
+48 ;