EASEZT2 ;ALB/jap - Data Transformation Logic for 1010EZ Processing ;10/12/00 13:08
;;1.0;ENROLLMENT APPLICATION SYSTEM;**51,57,66**;Mar 15, 2001
;
WORKPH(EASAPP,TYPE) ;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT",
;output PHONE = formatted work phone or null;
; example: (432)987-1234 X123
;
N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
S PHONE="",MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE EXTENSION") I KEY D
.S EXT=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I EXT'="" S EXT=" X"_EXT
I NUM="" Q PHONE
S PHONE=AC_NUM_EXT
Q PHONE
;
HOMEPH(EASAPP,TYPE) ;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT"
;output PHONE = formatted home phone;
; example: (432)987-1234
;
N PHONE,MULTIPLE,AC,NUM,KEY,T
S PHONE="",MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I NUM="" Q PHONE
S PHONE=AC_NUM
Q PHONE
;
INSPH(EASAPP,TYPE,MULTIPLE) ;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT", "OTHER(N)"
; MULTIPLE = EASMULT Value def=1
;output PHONE = formatted home phone;
; example: (432)987-1234
;
N PHONE,AC,NUM,KEY,T
S PHONE="",MULTIPLE=+$G(MULTIPLE) I MULTIPLE<2 S MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I NUM="" Q PHONE
S PHONE=AC_NUM
Q PHONE
;
EMPLPH(EASAPP,TYPE) ;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT", "SPOUSE"
;output PHONE = formatted employer phone or null;
; example: (432)987-1234 X123
;
N PHONE,MULTIPLE,AC,NUM,EXT,KET,T
S PHONE="",MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE EXTENSION") I KEY D
.S EXT=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I EXT'="" S EXT=" X"_EXT
I NUM="" Q PHONE
S PHONE=AC_NUM_EXT
Q PHONE
;
CELLPH(EASAPP,TYPE) ;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT"
;output PHONE = formatted cell phone or null;
; example: (432)987-1234
;
N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
S PHONE="",MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I NUM="" Q PHONE
S PHONE=AC_NUM
Q PHONE
;
;input EASAPP = application ien in file #712
; TYPE = "APPLICANT"
;output PHONE = formatted pager phone or null;
; example: (432)987-1234
;
N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
S PHONE="",MULTIPLE=1
S KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE AREA CODE") I KEY D
.S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
S KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE NUMBER") I KEY D
.S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
.F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
I AC'="" S AC="("_AC_")"
I NUM="-" S NUM=""
I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
I NUM="" Q PHONE
S PHONE=AC_NUM
Q PHONE
;
ZIP(XDATA) ;
N X
I XDATA="-" S XDATA=""
I XDATA["-",($L(XDATA)'=10) Q $E(XDATA,1,5)
I $L(XDATA)<5 S XDATA=""
Q XDATA
;
EMPLOY(XDATA) ;
N X
I XDATA="" Q "UNKNOWN"
I XDATA="EMPLOYED" Q "EMPLOYED FULL TIME"
Q XDATA
;
MARR(XDATA) ;
N X
I XDATA="" Q "UNKNOWN"
I XDATA["WIDOW" S XDATA="WIDOW/WIDOWER"
S X=$O(^DIC(11,"B",XDATA,0))
I X="" Q "UNKNOWN"
Q XDATA
;
RELIGION(XDATA) ;
N X
I XDATA="" Q "UNKNOWN/NO PREFERENCE"
S X=$O(^DIC(13,"B",XDATA,0))
I X="" Q "UNKNOWN/NO PREFERENCE"
Q XDATA
;
SVCBRCH(XDATA) ;
N X
I XDATA="" Q "OTHER"
S X=$O(^DIC(23,"B",XDATA,0))
I X="" Q "OTHER"
Q XDATA
;
SUMSSI(XDATA,IEN) ; glomb income fields for print
N NODE,CIVIL,RAIL,MILIT,UNEMP,OTHER,INTER,COMP,OUT
S NODE=$G(^DGMT(408.21,IEN,0))
S CIVIL=$P(NODE,U,9)
S RAIL=$P(NODE,U,10)
S MILIT=$P(NODE,U,11)
S UNEMP=$P(NODE,U,12)
S OTHER=$P(NODE,U,13)
S INTER=$P(NODE,U,15)
S COMP=$P(NODE,U,16)
I (XDATA=""),(CIVIL=""),(RAIL=""),(MILIT=""),(UNEMP=""),(OTHER=""),(INTER=""),(COMP="") Q "" ;EAS*66 - IF ALL NULL, PRINT NULL
S OUT=XDATA+CIVIL+RAIL+MILIT+UNEMP+OTHER+INTER+COMP
Q OUT
;
SUMCASH(XDATA,IEN) ; glomb net worth fields for print
N NODE,STOCKS,OUT
S NODE=$G(^DGMT(408.21,IEN,2))
S STOCKS=$P(NODE,U,2)
I (XDATA=""),(STOCKS="") Q "" ;EAS*66 - IF ALL NULL, PRINT NULL
S OUT=XDATA+STOCKS
Q OUT
;
SUMPROP(XDATA,IEN) ; glomb net worth fields for print
N NODE,DEBT,OUT
S NODE=$G(^DGMT(408.21,IEN,2))
S DEBT=$P(NODE,U,5)
I (XDATA=""),(DEBT="") Q "" ;EAS*66 - IF ALL NULL, PRINT NULL
S OUT=XDATA-DEBT
Q OUT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASEZT2 6527 printed Oct 16, 2024@17:55:59 Page 2
EASEZT2 ;ALB/jap - Data Transformation Logic for 1010EZ Processing ;10/12/00 13:08
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**51,57,66**;Mar 15, 2001
+2 ;
WORKPH(EASAPP,TYPE) ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT",
+3 ;output PHONE = formatted work phone or null;
+4 ; example: (432)987-1234 X123
+5 ;
+6 NEW PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
+7 SET PHONE=""
SET MULTIPLE=1
+8 SET KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE AREA CODE")
IF KEY
Begin DoDot:1
+9 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+10 SET KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE NUMBER")
IF KEY
Begin DoDot:1
+11 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+12 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+13 SET KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE EXTENSION")
IF KEY
Begin DoDot:1
+14 SET EXT=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+15 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+16 IF AC'=""
SET AC="("_AC_")"
+17 IF NUM="-"
SET NUM=""
+18 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+19 IF EXT'=""
SET EXT=" X"_EXT
+20 IF NUM=""
QUIT PHONE
+21 SET PHONE=AC_NUM_EXT
+22 QUIT PHONE
+23 ;
HOMEPH(EASAPP,TYPE) ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT"
+3 ;output PHONE = formatted home phone;
+4 ; example: (432)987-1234
+5 ;
+6 NEW PHONE,MULTIPLE,AC,NUM,KEY,T
+7 SET PHONE=""
SET MULTIPLE=1
+8 SET KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE AREA CODE")
IF KEY
Begin DoDot:1
+9 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+10 SET KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE NUMBER")
IF KEY
Begin DoDot:1
+11 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+12 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+13 IF AC'=""
SET AC="("_AC_")"
+14 IF NUM="-"
SET NUM=""
+15 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+16 IF NUM=""
QUIT PHONE
+17 SET PHONE=AC_NUM
+18 QUIT PHONE
+19 ;
INSPH(EASAPP,TYPE,MULTIPLE) ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT", "OTHER(N)"
+3 ; MULTIPLE = EASMULT Value def=1
+4 ;output PHONE = formatted home phone;
+5 ; example: (432)987-1234
+6 ;
+7 NEW PHONE,AC,NUM,KEY,T
+8 SET PHONE=""
SET MULTIPLE=+$GET(MULTIPLE)
IF MULTIPLE<2
SET MULTIPLE=1
+9 SET KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE AREA CODE")
IF KEY
Begin DoDot:1
+10 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+11 SET KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE NUMBER")
IF KEY
Begin DoDot:1
+12 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+13 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+14 IF AC'=""
SET AC="("_AC_")"
+15 IF NUM="-"
SET NUM=""
+16 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+17 IF NUM=""
QUIT PHONE
+18 SET PHONE=AC_NUM
+19 QUIT PHONE
+20 ;
EMPLPH(EASAPP,TYPE) ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT", "SPOUSE"
+3 ;output PHONE = formatted employer phone or null;
+4 ; example: (432)987-1234 X123
+5 ;
+6 NEW PHONE,MULTIPLE,AC,NUM,EXT,KET,T
+7 SET PHONE=""
SET MULTIPLE=1
+8 SET KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE AREA CODE")
IF KEY
Begin DoDot:1
+9 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+10 SET KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE NUMBER")
IF KEY
Begin DoDot:1
+11 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+12 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+13 SET KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE EXTENSION")
IF KEY
Begin DoDot:1
+14 SET EXT=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+15 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+16 IF AC'=""
SET AC="("_AC_")"
+17 IF NUM="-"
SET NUM=""
+18 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+19 IF EXT'=""
SET EXT=" X"_EXT
+20 IF NUM=""
QUIT PHONE
+21 SET PHONE=AC_NUM_EXT
+22 QUIT PHONE
+23 ;
CELLPH(EASAPP,TYPE) ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT"
+3 ;output PHONE = formatted cell phone or null;
+4 ; example: (432)987-1234
+5 ;
+6 NEW PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
+7 SET PHONE=""
SET MULTIPLE=1
+8 SET KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE AREA CODE")
IF KEY
Begin DoDot:1
+9 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+10 SET KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE NUMBER")
IF KEY
Begin DoDot:1
+11 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+12 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+13 IF AC'=""
SET AC="("_AC_")"
+14 IF NUM="-"
SET NUM=""
+15 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+16 IF NUM=""
QUIT PHONE
+17 SET PHONE=AC_NUM
+18 QUIT PHONE
+19 ;
+1 ;input EASAPP = application ien in file #712
+2 ; TYPE = "APPLICANT"
+3 ;output PHONE = formatted pager phone or null;
+4 ; example: (432)987-1234
+5 ;
+6 NEW PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
+7 SET PHONE=""
SET MULTIPLE=1
+8 SET KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE AREA CODE")
IF KEY
Begin DoDot:1
+9 SET AC=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
End DoDot:1
+10 SET KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE NUMBER")
IF KEY
Begin DoDot:1
+11 SET NUM=$PIECE($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
+12 FOR T=1,2
SET ^TMP("EZDATA",$JOB,KEY,MULTIPLE,T)=""
End DoDot:1
+13 IF AC'=""
SET AC="("_AC_")"
+14 IF NUM="-"
SET NUM=""
+15 IF NUM'=""
if NUM'["-"
SET NUM=$EXTRACT(NUM,1,3)_"-"_$EXTRACT(NUM,4,7)
+16 IF NUM=""
QUIT PHONE
+17 SET PHONE=AC_NUM
+18 QUIT PHONE
+19 ;
ZIP(XDATA) ;
+1 NEW X
+2 IF XDATA="-"
SET XDATA=""
+3 IF XDATA["-"
IF ($LENGTH(XDATA)'=10)
QUIT $EXTRACT(XDATA,1,5)
+4 IF $LENGTH(XDATA)<5
SET XDATA=""
+5 QUIT XDATA
+6 ;
EMPLOY(XDATA) ;
+1 NEW X
+2 IF XDATA=""
QUIT "UNKNOWN"
+3 IF XDATA="EMPLOYED"
QUIT "EMPLOYED FULL TIME"
+4 QUIT XDATA
+5 ;
MARR(XDATA) ;
+1 NEW X
+2 IF XDATA=""
QUIT "UNKNOWN"
+3 IF XDATA["WIDOW"
SET XDATA="WIDOW/WIDOWER"
+4 SET X=$ORDER(^DIC(11,"B",XDATA,0))
+5 IF X=""
QUIT "UNKNOWN"
+6 QUIT XDATA
+7 ;
RELIGION(XDATA) ;
+1 NEW X
+2 IF XDATA=""
QUIT "UNKNOWN/NO PREFERENCE"
+3 SET X=$ORDER(^DIC(13,"B",XDATA,0))
+4 IF X=""
QUIT "UNKNOWN/NO PREFERENCE"
+5 QUIT XDATA
+6 ;
SVCBRCH(XDATA) ;
+1 NEW X
+2 IF XDATA=""
QUIT "OTHER"
+3 SET X=$ORDER(^DIC(23,"B",XDATA,0))
+4 IF X=""
QUIT "OTHER"
+5 QUIT XDATA
+6 ;
SUMSSI(XDATA,IEN) ; glomb income fields for print
+1 NEW NODE,CIVIL,RAIL,MILIT,UNEMP,OTHER,INTER,COMP,OUT
+2 SET NODE=$GET(^DGMT(408.21,IEN,0))
+3 SET CIVIL=$PIECE(NODE,U,9)
+4 SET RAIL=$PIECE(NODE,U,10)
+5 SET MILIT=$PIECE(NODE,U,11)
+6 SET UNEMP=$PIECE(NODE,U,12)
+7 SET OTHER=$PIECE(NODE,U,13)
+8 SET INTER=$PIECE(NODE,U,15)
+9 SET COMP=$PIECE(NODE,U,16)
+10 ;EAS*66 - IF ALL NULL, PRINT NULL
IF (XDATA="")
IF (CIVIL="")
IF (RAIL="")
IF (MILIT="")
IF (UNEMP="")
IF (OTHER="")
IF (INTER="")
IF (COMP="")
QUIT ""
+11 SET OUT=XDATA+CIVIL+RAIL+MILIT+UNEMP+OTHER+INTER+COMP
+12 QUIT OUT
+13 ;
SUMCASH(XDATA,IEN) ; glomb net worth fields for print
+1 NEW NODE,STOCKS,OUT
+2 SET NODE=$GET(^DGMT(408.21,IEN,2))
+3 SET STOCKS=$PIECE(NODE,U,2)
+4 ;EAS*66 - IF ALL NULL, PRINT NULL
IF (XDATA="")
IF (STOCKS="")
QUIT ""
+5 SET OUT=XDATA+STOCKS
+6 QUIT OUT
+7 ;
SUMPROP(XDATA,IEN) ; glomb net worth fields for print
+1 NEW NODE,DEBT,OUT
+2 SET NODE=$GET(^DGMT(408.21,IEN,2))
+3 SET DEBT=$PIECE(NODE,U,5)
+4 ;EAS*66 - IF ALL NULL, PRINT NULL
IF (XDATA="")
IF (DEBT="")
QUIT ""
+5 SET OUT=XDATA-DEBT
+6 QUIT OUT
+7 ;