IVMCZMT ;ALB/MLI/LD/CKN,TDM,EG,TDM,TGH,HM - Creation of HL7 ZMT (means test) segment ;7/19/06 4:41pm
;;2.0;INCOME VERIFICATION MATCH;**17,53,49,58,81,89,104,105,160,193**;21-OCT-94;Build 37
;
; This routine returns the ZMT segment which contains means test
; data for a selected patient. It differs from the standard segment
; builder in that it will add default values where needed for
; fields added by means test sharing - these fields may not have
; values for old tests, though for new tests the values should be there.
;
;
;
EN(DFN,VAFSTR,VAFMTDT,VAFTYPE,SETID,DELETE,LIMIT) ; Entry point to get ZMT segment
;
; Input:
; DFN - as the IEN or corresponding patient in the PATIENT file
; VAFSTR - as string of segment fields needed separated by commas
; VAFMTDT - (optional) as date of desired means test (defaults to latest MT)
; VAFTYPE - (optional) as type of test: 1 - Means Test (default=1)
; 2 - Copay Test
; 4 - LTC Copay Exemption Test
; SETID - (optional) value to use for SEQ 1, the set id field (1 used
; as default if not passed.)
; DELETE - (optional, pass by reference) This array is used to
; indicate whether the segment is being used to notify of the
; the deletion of a means test, pharmacy copay test, or a
; hardship determinatin. If a means test or hardship is being
; deleted, then VAFTYPE must equal 1. If an Rx copay test is
; being deleted, then VAFTYPE must equal 2. The subscripts
; are as follows:
; DELETE("DATE OF TEST")=<date of test> - indicates
; the income year of the test that the deletion flags
; refer to
; DELETE("HARDSHIP") - if $G(DELETE("HARDSHIP"))=1 then the
; segment will be created to delete the hardship.
; DELETE("MT") - if $G(DELETE("MT"))=1 then
; the segment will be created to delete a means test.
; DELETE("RX")= if $G(DELETE("RX"))=1 then
; the segment will be created to delete a pharmacy
; copay test.
; DELETE("LTC")= if $G(DELETE("LTC"))=1 then
; the segment will be created to delete a Long term
; care copay exemption test.
; LIMIT - (optional) if $G(LIMIT)=1 then this indicates that a test in
; an income year other than indicated in the IVM Patient File
; should NOT be returned in the ZMT segment
;
; ****Also assumes all HL7 variables are defined as returned ****
; by the INIT^HLTRANS call
;
; Output - string in the form of the DHCP HL7 ZMT segment
;
;
N NODE,PRIM,X,Y,VAFY,NODE2,MTIEN
;
I '$G(DFN)!($G(VAFSTR)']"") G QUIT
S $P(VAFY,HLFS,22)="",VAFSTR=","_VAFSTR_","
S VAFTYPE=$S($G(VAFTYPE):VAFTYPE,1:1)
S VAFMTDT=$S($G(VAFMTDT):VAFMTDT,1:DT)
S $P(VAFY,HLFS,1)=$S($G(SETID):SETID,1:1)
S (NODE,NODE2,PRIM)=""
;
;handle deletions of a test
I ($G(DELETE("MT"))=1),VAFTYPE=1 D G QUIT
.S $P(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST")) ; MT Date
.S $P(VAFY,HLFS,3)=HLQ
.I ($G(DELETE("HARDSHIP"))=1) S $P(VAFY,HLFS,24)=HLQ
.S $P(VAFY,HLFS,17)=VAFTYPE ; Type Of Test
;
I ($G(DELETE("RX"))=1),VAFTYPE=2 D G QUIT
.S $P(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST")) ; MT Date
.S $P(VAFY,HLFS,3)=HLQ
.S $P(VAFY,HLFS,17)=VAFTYPE ; Type Of Test
;
I ($G(DELETE("LTC"))=1),VAFTYPE=4 D G QUIT
.S $P(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST")) ; MT Date
.S $P(VAFY,HLFS,3)=HLQ
.S $P(VAFY,HLFS,17)=VAFTYPE ; Type Of Test
;
; Income Year requiring transmission from IVM Patient File (301.5)
S IVMIY=$S($D(IVMIY):IVMIY,1:(VAFMTDT-10000))
;
; Check for a future dated Income Test
S MTIEN=""
N EC S EC=0
I VAFTYPE'=4 D
. S MTIEN=+$$FUT^DGMTU(DFN,"",$S($G(VAFTYPE):VAFTYPE,1:1))
. I MTIEN D
. . S NODE=$G(^DGMT(408.31,MTIEN,0)),PRIM=$G(^("PRIM")),NODE2=$G(^DGMT(408.31,MTIEN,2))
. . ;the FUT API works off the a XREF that is not deleted if the test
. . ;is no longer future. As a result, you may pick up the wrong income
. . ;year as a return. The check $E(IVMIY,1,3)+1'=$E(+NODE,1,3) must be
. . ;performed here and after the current Primary icnome test section below
. . I ($G(LIMIT)=1),($E(IVMIY,1,3)+1)'=$E(+NODE,1,3) S EC=1
. . Q
. Q
I VAFTYPE'=4,EC S (NODE,NODE2,MTIEN,PRIM)="" ;Q "ZMT"_HLFS_$G(VAFY)
;
; Check for a current Primary Income Test
I 'MTIEN S MTIEN=+$$LST^DGMTU(DFN,VAFMTDT,$S($G(VAFTYPE):VAFTYPE,1:1))
S:(NODE="") NODE=$G(^DGMT(408.31,MTIEN,0)),PRIM=$G(^("PRIM")),NODE2=$G(^DGMT(408.31,MTIEN,2))
;
;if the wrong income yr, and told to ignore it ($G(LIMIT)=1,
;send blank means test
I ($G(LIMIT)=1),($E(IVMIY,1,3)+1)'=$E(+NODE,1,3) S (NODE,NODE2,MTIEN,PRIM)="" Q "ZMT"_HLFS_$G(VAFY)
;
;
I NODE'="" D
.;add default values to new means test sharing fields
.N STATUS,CODE,TDSTATUS,TDCODE,HARDSHIP,DATA,SOURCE,TIME
.S TDSTATUS=$P(NODE2,"^",3)
.S HARDSHIP=$P(NODE,"^",20)
.I TDSTATUS="" D
..S STATUS=$P(NODE,"^",3)
..Q:'STATUS
..S CODE=$$GETCODE^DGMTH(STATUS)
..I CODE'="","ABCEGMP"[CODE D
...I VAFTYPE=1,HARDSHIP D
....I "AG"[CODE D Q
.....I CODE="A",($P(NODE,"^",4)'>$P(NODE,"^",27)) S TDSTATUS=$$GETSTAT^DGMTH("G",1) Q ;Income <= GMT Threshold
.....S TDSTATUS=$$GETSTAT^DGMTH("C",1)
....S TDSTATUS=STATUS
...S DATA(2.03)=TDSTATUS,$P(NODE2,"^",3)=TDSTATUS
.S SOURCE=$P(NODE,"^",23)
.I SOURCE=1 D
..S TIME=$P(NODE2,"^",2)
..I TIME="" S TIME=$$NOW^XLFDT,$P(NODE2,"^",2)=TIME,DATA(2.02)=TIME
..I $P(NODE2,"^",5)="",$P(NODE,"^",6) S $P(NODE2,"^",5)=$$GETSITE^DGMTU4($P(NODE,"^",6)),DATA(2.05)=$P(NODE2,"^",5)
.I HARDSHIP,$P(NODE2,"^",4)="",$P(NODE,"^",22) S $P(NODE2,"^",4)=$$GETSITE^DGMTU4($P(NODE,"^",22)),DATA(2.04)=$P(NODE2,"^",4)
.I $D(DATA),$$UPD^DGENDBS(408.31,MTIEN,.DATA)
.;
I VAFSTR[",2," S $P(VAFY,HLFS,2)=$S(+NODE:$$HLDATE^HLFNC(+NODE),1:HLQ) ; MT Date
I VAFSTR[",3," S X=$P($G(^DG(408.32,+$P(NODE,"^",3),0)),"^",2),$P(VAFY,HLFS,3)=$S(X]"":X,1:"") ; MT Status
I VAFSTR[",4," S $P(VAFY,HLFS,4)=$S($P(NODE,"^",4)]"":$P(NODE,"^",4),1:HLQ) ; Income
I VAFSTR[",5," S $P(VAFY,HLFS,5)=$S($P(NODE,"^",5)]"":$P(NODE,"^",5),1:HLQ) ; Net Worth
I VAFSTR[",6," S $P(VAFY,HLFS,6)=$S($P(NODE,"^",10):$$HLDATE^HLFNC($P(NODE,"^",10)),1:HLQ) ; Adjudication Date/Time
I VAFSTR[",7," S $P(VAFY,HLFS,7)=$$YN^VAFHLFNC($P(NODE,"^",11)) ;Agreed To Pay
I VAFSTR[",8," S $P(VAFY,HLFS,8)=$S($P(NODE,"^",12):$P(NODE,"^",12),1:HLQ) ; Threshold A
I VAFSTR[",9," S $P(VAFY,HLFS,9)=$S($P(NODE,"^",15)]"":$P(NODE,"^",15),1:HLQ) ; Deductible Expenses
I VAFSTR[",10," S $P(VAFY,HLFS,10)=$S($P(NODE,"^",7):$$HLDATE^HLFNC($P(NODE,"^",7)),1:HLQ) ; Date/Time Completed
I VAFSTR[",11," S $P(VAFY,HLFS,11)=$$YN^VAFHLFNC($P(NODE,"^",16)) ;Previous Year Means Test Threshold Flag
I VAFSTR[",12," S $P(VAFY,HLFS,12)=$S($P(NODE,"^",18)]"":$P(NODE,"^",18),1:HLQ) ; Total Dependents
I VAFSTR[",13," S $P(VAFY,HLFS,13)=$$YN^VAFHLFNC($P(NODE,"^",20)) ;Hardship
I VAFSTR[",14," S $P(VAFY,HLFS,14)=$S($P(NODE,"^",21):$$HLDATE^HLFNC($P(NODE,"^",21)),1:HLQ) ; Hardship Review Date
I VAFSTR[",15," S $P(VAFY,HLFS,15)=$S($P(NODE,"^",24):$$HLDATE^HLFNC($P(NODE,"^",24)),1:HLQ) ; Date Vet Signed Test
I VAFSTR[",16," S $P(VAFY,HLFS,16)=$$YN^VAFHLFNC($P(NODE,"^",14)) ;Declines To Give Income Info
I VAFSTR[",17," S $P(VAFY,HLFS,17)=$S($P(NODE,"^",19):$P(NODE,"^",19),1:VAFTYPE) ; Type Of Test
I VAFSTR[",18," S $P(VAFY,HLFS,18)=$S($P(NODE,"^",23)]"":$P(NODE,"^",23),1:HLQ) ; Source Of Test
I VAFSTR[",19," S $P(VAFY,HLFS,19)=$$YN^VAFHLFNC(PRIM) ; Primary Test?
I VAFSTR[",20," S $P(VAFY,HLFS,20)=$S($P(NODE,"^",25):$$HLDATE^HLFNC($P(NODE,"^",25)),1:HLQ) ; Date IVM Verified MT Completed
I VAFSTR[",21," S $P(VAFY,HLFS,21)=$$YN^VAFHLFNC($P(NODE,"^",26)) ;Refused To Sign
;
;
I VAFSTR[",22," S $P(VAFY,HLFS,22)=$P(NODE2,"^",5) ;Site Conducting Test
I VAFSTR[",23," S $P(VAFY,HLFS,23)=$P(NODE2,"^",4) ;Site Granting Hardship
I VAFSTR[",24," S $P(VAFY,HLFS,24)=$S($P(NODE2,"^"):$$HLDATE^HLFNC($P(NODE2,"^")),1:"") ;Hardship Effective Date
I VAFSTR[",25," S $P(VAFY,HLFS,25)=$S($P(NODE2,"^",2):$$HLDATE^HLFNC($P(NODE2,"^",2)),1:"") ;Dt/Tm Test Last Edited
I VAFSTR[",26," S $P(VAFY,HLFS,26)=$S($P(NODE2,"^",3):$$GETCODE^DGMTH($P(NODE2,"^",3)),1:"") ; Test Determined Status
I VAFSTR[",28," S $P(VAFY,HLFS,28)=$P(NODE,"^",27) ;GMT Threshold
I VAFSTR[",29," S $P(VAFY,HLFS,29)=$P(NODE2,"^",9) ;Hardship Reason
I VAFSTR[",30," S $P(VAFY,HLFS,30)=+$P(NODE2,"^",11) ; Test Version
I VAFSTR[",31," S $P(VAFY,HLFS,31)=$G(^DGMT(408.31,MTIEN,4)) ;Beneficiary Travel Financial Indicator - IVM*2.0*160
I VAFSTR[",32," S $P(VAFY,HLFS,32)=$S($P(NODE2,"^",13):$$HLDATE^HLFNC($P(NODE2,"^",13)),1:"") ;Hardship Expiration Date IVM*2.0*193
;
;can only transmit the deletion of a hardship if the segment is for a means test - and the income years must match if there is a means test
;
I VAFTYPE=1,($G(DELETE("HARDSHIP"))=1),('(+NODE)!($E(DELETE("DATE OF TEST"),1,3)=$E((+NODE),1,3))) S $P(VAFY,HLFS,24)=HLQ
;
QUIT Q "ZMT"_HLFS_$G(VAFY)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMCZMT 9007 printed Oct 16, 2024@18:02:24 Page 2
IVMCZMT ;ALB/MLI/LD/CKN,TDM,EG,TDM,TGH,HM - Creation of HL7 ZMT (means test) segment ;7/19/06 4:41pm
+1 ;;2.0;INCOME VERIFICATION MATCH;**17,53,49,58,81,89,104,105,160,193**;21-OCT-94;Build 37
+2 ;
+3 ; This routine returns the ZMT segment which contains means test
+4 ; data for a selected patient. It differs from the standard segment
+5 ; builder in that it will add default values where needed for
+6 ; fields added by means test sharing - these fields may not have
+7 ; values for old tests, though for new tests the values should be there.
+8 ;
+9 ;
+10 ;
EN(DFN,VAFSTR,VAFMTDT,VAFTYPE,SETID,DELETE,LIMIT) ; Entry point to get ZMT segment
+1 ;
+2 ; Input:
+3 ; DFN - as the IEN or corresponding patient in the PATIENT file
+4 ; VAFSTR - as string of segment fields needed separated by commas
+5 ; VAFMTDT - (optional) as date of desired means test (defaults to latest MT)
+6 ; VAFTYPE - (optional) as type of test: 1 - Means Test (default=1)
+7 ; 2 - Copay Test
+8 ; 4 - LTC Copay Exemption Test
+9 ; SETID - (optional) value to use for SEQ 1, the set id field (1 used
+10 ; as default if not passed.)
+11 ; DELETE - (optional, pass by reference) This array is used to
+12 ; indicate whether the segment is being used to notify of the
+13 ; the deletion of a means test, pharmacy copay test, or a
+14 ; hardship determinatin. If a means test or hardship is being
+15 ; deleted, then VAFTYPE must equal 1. If an Rx copay test is
+16 ; being deleted, then VAFTYPE must equal 2. The subscripts
+17 ; are as follows:
+18 ; DELETE("DATE OF TEST")=<date of test> - indicates
+19 ; the income year of the test that the deletion flags
+20 ; refer to
+21 ; DELETE("HARDSHIP") - if $G(DELETE("HARDSHIP"))=1 then the
+22 ; segment will be created to delete the hardship.
+23 ; DELETE("MT") - if $G(DELETE("MT"))=1 then
+24 ; the segment will be created to delete a means test.
+25 ; DELETE("RX")= if $G(DELETE("RX"))=1 then
+26 ; the segment will be created to delete a pharmacy
+27 ; copay test.
+28 ; DELETE("LTC")= if $G(DELETE("LTC"))=1 then
+29 ; the segment will be created to delete a Long term
+30 ; care copay exemption test.
+31 ; LIMIT - (optional) if $G(LIMIT)=1 then this indicates that a test in
+32 ; an income year other than indicated in the IVM Patient File
+33 ; should NOT be returned in the ZMT segment
+34 ;
+35 ; ****Also assumes all HL7 variables are defined as returned ****
+36 ; by the INIT^HLTRANS call
+37 ;
+38 ; Output - string in the form of the DHCP HL7 ZMT segment
+39 ;
+40 ;
+41 NEW NODE,PRIM,X,Y,VAFY,NODE2,MTIEN
+42 ;
+43 IF '$GET(DFN)!($GET(VAFSTR)']"")
GOTO QUIT
+44 SET $PIECE(VAFY,HLFS,22)=""
SET VAFSTR=","_VAFSTR_","
+45 SET VAFTYPE=$SELECT($GET(VAFTYPE):VAFTYPE,1:1)
+46 SET VAFMTDT=$SELECT($GET(VAFMTDT):VAFMTDT,1:DT)
+47 SET $PIECE(VAFY,HLFS,1)=$SELECT($GET(SETID):SETID,1:1)
+48 SET (NODE,NODE2,PRIM)=""
+49 ;
+50 ;handle deletions of a test
+51 IF ($GET(DELETE("MT"))=1)
IF VAFTYPE=1
Begin DoDot:1
+52 ; MT Date
SET $PIECE(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST"))
+53 SET $PIECE(VAFY,HLFS,3)=HLQ
+54 IF ($GET(DELETE("HARDSHIP"))=1)
SET $PIECE(VAFY,HLFS,24)=HLQ
+55 ; Type Of Test
SET $PIECE(VAFY,HLFS,17)=VAFTYPE
End DoDot:1
GOTO QUIT
+56 ;
+57 IF ($GET(DELETE("RX"))=1)
IF VAFTYPE=2
Begin DoDot:1
+58 ; MT Date
SET $PIECE(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST"))
+59 SET $PIECE(VAFY,HLFS,3)=HLQ
+60 ; Type Of Test
SET $PIECE(VAFY,HLFS,17)=VAFTYPE
End DoDot:1
GOTO QUIT
+61 ;
+62 IF ($GET(DELETE("LTC"))=1)
IF VAFTYPE=4
Begin DoDot:1
+63 ; MT Date
SET $PIECE(VAFY,HLFS,2)=$$HLDATE^HLFNC(DELETE("DATE OF TEST"))
+64 SET $PIECE(VAFY,HLFS,3)=HLQ
+65 ; Type Of Test
SET $PIECE(VAFY,HLFS,17)=VAFTYPE
End DoDot:1
GOTO QUIT
+66 ;
+67 ; Income Year requiring transmission from IVM Patient File (301.5)
+68 SET IVMIY=$SELECT($DATA(IVMIY):IVMIY,1:(VAFMTDT-10000))
+69 ;
+70 ; Check for a future dated Income Test
+71 SET MTIEN=""
+72 NEW EC
SET EC=0
+73 IF VAFTYPE'=4
Begin DoDot:1
+74 SET MTIEN=+$$FUT^DGMTU(DFN,"",$SELECT($GET(VAFTYPE):VAFTYPE,1:1))
+75 IF MTIEN
Begin DoDot:2
+76 SET NODE=$GET(^DGMT(408.31,MTIEN,0))
SET PRIM=$GET(^("PRIM"))
SET NODE2=$GET(^DGMT(408.31,MTIEN,2))
+77 ;the FUT API works off the a XREF that is not deleted if the test
+78 ;is no longer future. As a result, you may pick up the wrong income
+79 ;year as a return. The check $E(IVMIY,1,3)+1'=$E(+NODE,1,3) must be
+80 ;performed here and after the current Primary icnome test section below
+81 IF ($GET(LIMIT)=1)
IF ($EXTRACT(IVMIY,1,3)+1)'=$EXTRACT(+NODE,1,3)
SET EC=1
+82 QUIT
End DoDot:2
+83 QUIT
End DoDot:1
+84 ;Q "ZMT"_HLFS_$G(VAFY)
IF VAFTYPE'=4
IF EC
SET (NODE,NODE2,MTIEN,PRIM)=""
+85 ;
+86 ; Check for a current Primary Income Test
+87 IF 'MTIEN
SET MTIEN=+$$LST^DGMTU(DFN,VAFMTDT,$SELECT($GET(VAFTYPE):VAFTYPE,1:1))
+88 if (NODE="")
SET NODE=$GET(^DGMT(408.31,MTIEN,0))
SET PRIM=$GET(^("PRIM"))
SET NODE2=$GET(^DGMT(408.31,MTIEN,2))
+89 ;
+90 ;if the wrong income yr, and told to ignore it ($G(LIMIT)=1,
+91 ;send blank means test
+92 IF ($GET(LIMIT)=1)
IF ($EXTRACT(IVMIY,1,3)+1)'=$EXTRACT(+NODE,1,3)
SET (NODE,NODE2,MTIEN,PRIM)=""
QUIT "ZMT"_HLFS_$GET(VAFY)
+93 ;
+94 ;
+95 IF NODE'=""
Begin DoDot:1
+96 ;add default values to new means test sharing fields
+97 NEW STATUS,CODE,TDSTATUS,TDCODE,HARDSHIP,DATA,SOURCE,TIME
+98 SET TDSTATUS=$PIECE(NODE2,"^",3)
+99 SET HARDSHIP=$PIECE(NODE,"^",20)
+100 IF TDSTATUS=""
Begin DoDot:2
+101 SET STATUS=$PIECE(NODE,"^",3)
+102 if 'STATUS
QUIT
+103 SET CODE=$$GETCODE^DGMTH(STATUS)
+104 IF CODE'=""
IF "ABCEGMP"[CODE
Begin DoDot:3
+105 IF VAFTYPE=1
IF HARDSHIP
Begin DoDot:4
+106 IF "AG"[CODE
Begin DoDot:5
+107 ;Income <= GMT Threshold
IF CODE="A"
IF ($PIECE(NODE,"^",4)'>$PIECE(NODE,"^",27))
SET TDSTATUS=$$GETSTAT^DGMTH("G",1)
QUIT
+108 SET TDSTATUS=$$GETSTAT^DGMTH("C",1)
End DoDot:5
QUIT
+109 SET TDSTATUS=STATUS
End DoDot:4
+110 SET DATA(2.03)=TDSTATUS
SET $PIECE(NODE2,"^",3)=TDSTATUS
End DoDot:3
End DoDot:2
+111 SET SOURCE=$PIECE(NODE,"^",23)
+112 IF SOURCE=1
Begin DoDot:2
+113 SET TIME=$PIECE(NODE2,"^",2)
+114 IF TIME=""
SET TIME=$$NOW^XLFDT
SET $PIECE(NODE2,"^",2)=TIME
SET DATA(2.02)=TIME
+115 IF $PIECE(NODE2,"^",5)=""
IF $PIECE(NODE,"^",6)
SET $PIECE(NODE2,"^",5)=$$GETSITE^DGMTU4($PIECE(NODE,"^",6))
SET DATA(2.05)=$PIECE(NODE2,"^",5)
End DoDot:2
+116 IF HARDSHIP
IF $PIECE(NODE2,"^",4)=""
IF $PIECE(NODE,"^",22)
SET $PIECE(NODE2,"^",4)=$$GETSITE^DGMTU4($PIECE(NODE,"^",22))
SET DATA(2.04)=$PIECE(NODE2,"^",4)
+117 IF $DATA(DATA)
IF $$UPD^DGENDBS(408.31,MTIEN,.DATA)
+118 ;
End DoDot:1
+119 ; MT Date
IF VAFSTR[",2,"
SET $PIECE(VAFY,HLFS,2)=$SELECT(+NODE:$$HLDATE^HLFNC(+NODE),1:HLQ)
+120 ; MT Status
IF VAFSTR[",3,"
SET X=$PIECE($GET(^DG(408.32,+$PIECE(NODE,"^",3),0)),"^",2)
SET $PIECE(VAFY,HLFS,3)=$SELECT(X]"":X,1:"")
+121 ; Income
IF VAFSTR[",4,"
SET $PIECE(VAFY,HLFS,4)=$SELECT($PIECE(NODE,"^",4)]"":$PIECE(NODE,"^",4),1:HLQ)
+122 ; Net Worth
IF VAFSTR[",5,"
SET $PIECE(VAFY,HLFS,5)=$SELECT($PIECE(NODE,"^",5)]"":$PIECE(NODE,"^",5),1:HLQ)
+123 ; Adjudication Date/Time
IF VAFSTR[",6,"
SET $PIECE(VAFY,HLFS,6)=$SELECT($PIECE(NODE,"^",10):$$HLDATE^HLFNC($PIECE(NODE,"^",10)),1:HLQ)
+124 ;Agreed To Pay
IF VAFSTR[",7,"
SET $PIECE(VAFY,HLFS,7)=$$YN^VAFHLFNC($PIECE(NODE,"^",11))
+125 ; Threshold A
IF VAFSTR[",8,"
SET $PIECE(VAFY,HLFS,8)=$SELECT($PIECE(NODE,"^",12):$PIECE(NODE,"^",12),1:HLQ)
+126 ; Deductible Expenses
IF VAFSTR[",9,"
SET $PIECE(VAFY,HLFS,9)=$SELECT($PIECE(NODE,"^",15)]"":$PIECE(NODE,"^",15),1:HLQ)
+127 ; Date/Time Completed
IF VAFSTR[",10,"
SET $PIECE(VAFY,HLFS,10)=$SELECT($PIECE(NODE,"^",7):$$HLDATE^HLFNC($PIECE(NODE,"^",7)),1:HLQ)
+128 ;Previous Year Means Test Threshold Flag
IF VAFSTR[",11,"
SET $PIECE(VAFY,HLFS,11)=$$YN^VAFHLFNC($PIECE(NODE,"^",16))
+129 ; Total Dependents
IF VAFSTR[",12,"
SET $PIECE(VAFY,HLFS,12)=$SELECT($PIECE(NODE,"^",18)]"":$PIECE(NODE,"^",18),1:HLQ)
+130 ;Hardship
IF VAFSTR[",13,"
SET $PIECE(VAFY,HLFS,13)=$$YN^VAFHLFNC($PIECE(NODE,"^",20))
+131 ; Hardship Review Date
IF VAFSTR[",14,"
SET $PIECE(VAFY,HLFS,14)=$SELECT($PIECE(NODE,"^",21):$$HLDATE^HLFNC($PIECE(NODE,"^",21)),1:HLQ)
+132 ; Date Vet Signed Test
IF VAFSTR[",15,"
SET $PIECE(VAFY,HLFS,15)=$SELECT($PIECE(NODE,"^",24):$$HLDATE^HLFNC($PIECE(NODE,"^",24)),1:HLQ)
+133 ;Declines To Give Income Info
IF VAFSTR[",16,"
SET $PIECE(VAFY,HLFS,16)=$$YN^VAFHLFNC($PIECE(NODE,"^",14))
+134 ; Type Of Test
IF VAFSTR[",17,"
SET $PIECE(VAFY,HLFS,17)=$SELECT($PIECE(NODE,"^",19):$PIECE(NODE,"^",19),1:VAFTYPE)
+135 ; Source Of Test
IF VAFSTR[",18,"
SET $PIECE(VAFY,HLFS,18)=$SELECT($PIECE(NODE,"^",23)]"":$PIECE(NODE,"^",23),1:HLQ)
+136 ; Primary Test?
IF VAFSTR[",19,"
SET $PIECE(VAFY,HLFS,19)=$$YN^VAFHLFNC(PRIM)
+137 ; Date IVM Verified MT Completed
IF VAFSTR[",20,"
SET $PIECE(VAFY,HLFS,20)=$SELECT($PIECE(NODE,"^",25):$$HLDATE^HLFNC($PIECE(NODE,"^",25)),1:HLQ)
+138 ;Refused To Sign
IF VAFSTR[",21,"
SET $PIECE(VAFY,HLFS,21)=$$YN^VAFHLFNC($PIECE(NODE,"^",26))
+139 ;
+140 ;
+141 ;Site Conducting Test
IF VAFSTR[",22,"
SET $PIECE(VAFY,HLFS,22)=$PIECE(NODE2,"^",5)
+142 ;Site Granting Hardship
IF VAFSTR[",23,"
SET $PIECE(VAFY,HLFS,23)=$PIECE(NODE2,"^",4)
+143 ;Hardship Effective Date
IF VAFSTR[",24,"
SET $PIECE(VAFY,HLFS,24)=$SELECT($PIECE(NODE2,"^"):$$HLDATE^HLFNC($PIECE(NODE2,"^")),1:"")
+144 ;Dt/Tm Test Last Edited
IF VAFSTR[",25,"
SET $PIECE(VAFY,HLFS,25)=$SELECT($PIECE(NODE2,"^",2):$$HLDATE^HLFNC($PIECE(NODE2,"^",2)),1:"")
+145 ; Test Determined Status
IF VAFSTR[",26,"
SET $PIECE(VAFY,HLFS,26)=$SELECT($PIECE(NODE2,"^",3):$$GETCODE^DGMTH($PIECE(NODE2,"^",3)),1:"")
+146 ;GMT Threshold
IF VAFSTR[",28,"
SET $PIECE(VAFY,HLFS,28)=$PIECE(NODE,"^",27)
+147 ;Hardship Reason
IF VAFSTR[",29,"
SET $PIECE(VAFY,HLFS,29)=$PIECE(NODE2,"^",9)
+148 ; Test Version
IF VAFSTR[",30,"
SET $PIECE(VAFY,HLFS,30)=+$PIECE(NODE2,"^",11)
+149 ;Beneficiary Travel Financial Indicator - IVM*2.0*160
IF VAFSTR[",31,"
SET $PIECE(VAFY,HLFS,31)=$GET(^DGMT(408.31,MTIEN,4))
+150 ;Hardship Expiration Date IVM*2.0*193
IF VAFSTR[",32,"
SET $PIECE(VAFY,HLFS,32)=$SELECT($PIECE(NODE2,"^",13):$$HLDATE^HLFNC($PIECE(NODE2,"^",13)),1:"")
+151 ;
+152 ;can only transmit the deletion of a hardship if the segment is for a means test - and the income years must match if there is a means test
+153 ;
+154 IF VAFTYPE=1
IF ($GET(DELETE("HARDSHIP"))=1)
IF ('(+NODE)!($EXTRACT(DELETE("DATE OF TEST"),1,3)=$EXTRACT((+NODE),1,3)))
SET $PIECE(VAFY,HLFS,24)=HLQ
+155 ;
QUIT QUIT "ZMT"_HLFS_$GET(VAFY)